Skip to content

Commit

Permalink
test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanvanherwijnen committed Dec 16, 2024
1 parent 95737eb commit 0b2064b
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
},
"devDependencies": {
"@faker-js/faker": "^9.2.0",
"@playwright/test": "1.49.0",
"@playwright/test": "1.49.1",
"@types/bcrypt": "^5.0.2",
"@types/pg": "^8.11.10",
"@vitejs/plugin-vue": "5.2.1",
Expand Down
14 changes: 7 additions & 7 deletions packages/api/tests/e2e/account.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ test.describe('Account', async () => {
test('Add customer details', async () => {
await page.goto('/account/customer')

await page.locator('button >> text=Add').click()
await page.getByRole('button', { name: 'Add' }).click()

await page.getByLabel('Gender').click()
await page.getByRole('option', { name: 'Male', exact: true }).click()
Expand All @@ -163,7 +163,7 @@ test.describe('Account', async () => {

expect(page.locator(`text=${customer.firstName}`)).toBeVisible()

await page.locator('button >> text=edit').click()
await page.getByRole('button', { name: 'Edit' }).click()
const dialog = page.locator('.q-dialog')
await dialog.isVisible()
await page.getByLabel('First name*').fill('NewFirstName')
Expand All @@ -175,7 +175,7 @@ test.describe('Account', async () => {
test('Add contact person', async () => {
await page.goto('/account/contactpeople')

await page.locator('button >> text=Add').click()
await page.getByRole('button', { name: 'Add' }).click()
await page.getByLabel('First name').fill(contactPerson.firstName)
await page.getByLabel('Last name').fill(contactPerson.lastName)
await page
Expand All @@ -186,7 +186,7 @@ test.describe('Account', async () => {

await expect(page.locator(`text=${contactPerson.firstName}`)).toBeVisible()

await page.locator('button >> text=edit').click()
await page.locator('button').filter({ hasText: 'edit' }).click()
const dialog = page.locator('.q-dialog')
await dialog.isVisible()
await page.getByLabel('First name*').fill('NewContactPersonFirstName')
Expand All @@ -198,7 +198,7 @@ test.describe('Account', async () => {
test('Add pet', async () => {
await page.goto('/account/pets')

await page.locator('button >> text=Add').click()
await page.getByRole('button', { name: 'Add' }).click()
await page.getByLabel('Name').fill(pet.name)
await page.getByLabel('Breed').fill(pet.breed)
// await page.getByLabel('Birth date').fill(pet.birthDate)
Expand All @@ -215,7 +215,7 @@ test.describe('Account', async () => {

await expect(page.locator(`text=${pet.name}`)).toBeVisible()

await page.locator('button >> text=edit').click()
await page.locator('button').filter({ hasText: 'edit' }).click()
const dialog = page.locator('.q-dialog')
await dialog.isVisible()
await page.getByLabel('Name*').fill(newPetName)
Expand All @@ -227,7 +227,7 @@ test.describe('Account', async () => {
test('Add booking', async () => {
await page.goto('/account/bookings')

await page.locator('button >> text=Add').click()
await page.getByRole('button', { name: 'Add' }).click()

await page.locator('.q-date__calendar-item--in').first().click()
await page
Expand Down
2 changes: 1 addition & 1 deletion packages/api/tests/e2e/administrator/announcements.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ test.describe('Announcements', async () => {
await page.goto('/admin/announcements')
await page.waitForLoadState('networkidle')

await page.locator('button >> text=Add').click()
await page.getByRole('button', { name: 'Add' }).click()
await page.getByLabel('Title').fill(announcement.title)
await page.getByLabel('Message').fill(announcement.message)
// await page.getByLabel('Expiration date').fill('2040/01/01')
Expand Down
2 changes: 1 addition & 1 deletion packages/api/tests/e2e/administrator/categories.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ test.beforeAll(async ({ browser }) => {

test.describe('Categories', async () => {
test('Create category', async () => {
await page.locator('button >> text=Add').click()
await page.getByRole('button', { name: 'Add' }).click()
await page.getByLabel('Name').fill(category.name)
// await page.getByLabel('Price').fill(`${category.price}`)

Expand Down
2 changes: 1 addition & 1 deletion packages/api/tests/e2e/administrator/openingtimes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ test.describe('Opening times', async () => {
await page.goto('/admin/configuration/openingtimes')
await page.waitForLoadState('networkidle')

await page.locator('button >> text=Add').click()
await page.getByRole('button', { name: 'Add' }).click()
await page.getByLabel('Name').fill(openingTime.name)
await page.getByLabel('Start time').fill(openingTime.startTime)
await page.getByLabel('End time').fill(openingTime.endTime)
Expand Down
2 changes: 1 addition & 1 deletion packages/api/tests/e2e/administrator/periods.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ test.describe('Periods', async () => {
await page.goto('/admin/periods')
await page.waitForLoadState('networkidle')

await page.locator('button >> text=Add').click()
await page.getByRole('button', { name: 'Add' }).click()
// await page.getByLabel('Start date').fill(period.startDate)
// await page.getByLabel('End date').fill(`${period.endDate}`)
await page.locator('.q-date__calendar-item--in').first().click()
Expand Down
2 changes: 1 addition & 1 deletion packages/api/tests/e2e/administrator/services.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ test.describe('Services', async () => {
await page.goto('/admin/configuration/services')
await page.waitForLoadState('networkidle')

await page.locator('button >> text=Add').click()
await page.getByRole('button', { name: 'Add' }).click()
await page.getByLabel('Name').fill(service.name)
await page.getByLabel('Description').fill(`${service.description}`)

Expand Down
26 changes: 13 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0b2064b

Please sign in to comment.