Refactor tests using Page Object Model and remove original example test.

This commit is contained in:
Sebastien Castiel
2025-08-02 10:07:06 -04:00
parent 378a369c8f
commit 05a25f7e4f
3 changed files with 54 additions and 6 deletions

View File

@@ -0,0 +1,21 @@
import { expect, test } from '@playwright/test'
import { CreateGroupPage } from './create-group-page'
test('Create a new group', async ({ page }) => {
const createGroupPage = new CreateGroupPage(page)
await createGroupPage.navigate()
await createGroupPage.fillGroupName('New Test Group')
await createGroupPage.fillCurrency('USD')
await createGroupPage.fillAdditionalInfo('This is a test group.')
await createGroupPage.addParticipant('John', 0)
await createGroupPage.addParticipant('Jane', 1)
await createGroupPage.submit()
await page.waitForURL(/.*\/groups\/.*\/expenses/)
await expect(
page.getByRole('heading', { name: 'New Test Group' }),
).toBeVisible()
})