Files
spliit/tests/pom/create-group-page.ts
2025-08-02 10:36:42 -04:00

34 lines
859 B
TypeScript

import { Page } from '@playwright/test'
export class CreateGroupPage {
constructor(private page: Page) {}
async navigate() {
await this.page.goto('http://localhost:3002/groups/create')
}
async fillGroupName(name: string) {
await this.page.getByRole('textbox', { name: 'Group name' }).fill(name)
}
async fillCurrency(currency: string) {
await this.page.getByRole('textbox', { name: 'Currency' }).fill(currency)
}
async fillAdditionalInfo(info: string) {
await this.page
.getByRole('textbox', { name: 'Group Information' })
.fill(info)
}
async addParticipant(participantName: string, index: number) {
await this.page
.locator(`input[name="participants.${index}.name"]`)
.fill(participantName)
}
async submit() {
await this.page.getByRole('button', { name: 'Create' }).click()
}
}