From c2b9cc3f48f5d5b2f08d2f43b028de4650517e8c Mon Sep 17 00:00:00 2001 From: mattk70 Date: Wed, 27 Nov 2024 23:31:02 +0000 Subject: [PATCH] {page} passed to tests --- playwright.config.ts | 2 +- test/menu.spec.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index da7048a..2093e96 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -5,7 +5,7 @@ export default defineConfig({ testDir: './test', maxFailures: 2, timeout: 60 * 1000, - //workers: 4, + workers: 4, use: { // Maximum time each action such as `click()` can take. Defaults to 0 (no limit). actionTimeout: 0, diff --git a/test/menu.spec.ts b/test/menu.spec.ts index caf1966..1fe3fbd 100644 --- a/test/menu.spec.ts +++ b/test/menu.spec.ts @@ -101,7 +101,7 @@ REMEMBER TO REBUILD THE APP IF THE *APPLICATION CODE* NEEDS TO BE CHANGED // }) -test('Page title is correct', async () => { +test('Page title is correct', async ({page}) => { const title = await page.title() console.log('title: ', title) console.log('url: ', page.url()) @@ -110,7 +110,7 @@ test('Page title is correct', async () => { }) -test(`Nocmig analyse works and second result is 61%`, async () => { +test(`Nocmig analyse works and second result is 61%`, async ({page}) => { await runExampleAnalysis(page,'chirpity'); const callID = page.locator('#speciesFilter').getByText('Redwing (call)'); expect(callID).not.toBe(undefined) @@ -119,7 +119,7 @@ test(`Nocmig analyse works and second result is 61%`, async () => { expect(secondResult).toBe('61%'); }) -test(`BirdNET analyse works and second result is 34%`, async () => { +test(`BirdNET analyse works and second result is 34%`, async ({page}) => { await runExampleAnalysis(page, 'birdnet'); const callID = page.locator('#speciesFilter').getByText('Redwing (call)'); expect(callID).not.toBe(undefined) @@ -148,7 +148,7 @@ test(`BirdNET analyse works and second result is 34%`, async () => { // }) // }) -test("Amend file start dialog contains date", async () =>{ +test("Amend file start dialog contains date", async ({page}) =>{ await runExampleAnalysis(page, 'chirpity'); await page.locator('#dropdownMenuButton').click({button: 'right'}); await page.locator('#setFileStart').click(); @@ -159,7 +159,7 @@ test("Amend file start dialog contains date", async () =>{ // await page.locator('#spectrogramWrapper button.btn-secondary').click(); }) -test("Select inverted greyscale colourmap", async () =>{ +test("Select inverted greyscale colourmap", async ({page}) =>{ await runExampleAnalysis(page, 'chirpity'); await changeSettings(page, 'select', 'colourmap', 'igreys', 50) // await page.locator('#spectrogramWrapper button.btn-secondary').click();