mirror of
https://github.com/spliit-app/spliit.git
synced 2026-02-22 15:36:12 +01:00
34 lines
859 B
TypeScript
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()
|
|
}
|
|
}
|