rallly/apps/web/tests/invite-page.ts
Luke Vella c22b3abc4d
⬆️ v3.0.0 (#704)
2023-06-19 17:17:00 +01:00

20 lines
592 B
TypeScript

import { Page } from "@playwright/test";
export class InvitePage {
constructor(public readonly page: Page) {}
async addParticipant(name: string, email?: string) {
const page = this.page;
await page.locator("data-testid=vote-selector >> nth=0").click();
await page.locator("data-testid=vote-selector >> nth=2").click();
await page.click("button >> text='Continue'");
await page.type('[placeholder="Jessie Smith"]', name);
if (email) {
await page.type('[placeholder="jessie.smith@example.com"]', email);
}
await page.click("text='Submit'");
}
}