diff --git a/.github/workflows/check-installation.yml b/.github/workflows/check-installation.yml index b1ca048..3076860 100644 --- a/.github/workflows/check-installation.yml +++ b/.github/workflows/check-installation.yml @@ -158,7 +158,7 @@ jobs: # Tests - name: Test packaged application - if: runner.os == 'Windows' + if: runner.os != 'Linux' run: npm test diff --git a/package.json b/package.json index 5f71638..ec8639d 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "export": "electron-builder build --m -p always", "AppImage": "electron-builder build --linux --x64 -p always", "build": "electron-builder --win --x64 -p always", + "testBuild": "electron-builder --win --x64", "postinstall": "electron-builder install-app-deps", "test": "playwright test" }, diff --git a/test/menu.spec.ts b/test/menu.spec.ts index 79e6dd5..dc8a148 100644 --- a/test/menu.spec.ts +++ b/test/menu.spec.ts @@ -74,7 +74,8 @@ test.beforeAll(async () => { clearInterval(checkPage); resolve(); } - }, 5000); }); + }, 5000); + }); }) test.afterAll(async () => { @@ -84,6 +85,11 @@ test.afterAll(async () => { test.describe.configure({ mode: 'parallel', retries: 2, timeout: 20_000 }); +/* +REMEMBER TO REBUILD THE APP IF THE *APPLICATION CODE* NEEDS TO BE CHANGED + ---------------- +*/ + // test('Tour modal appears', async () => { // await page.locator('#tourModal').waitFor({state: 'visible'}); // await page.waitForTimeout(500); @@ -109,7 +115,9 @@ async function openExampleFile(){ async function changeSettings(type, elementID, value, timeout){ elementID = '#' + elementID; - await page.locator('#navbarSettings').click() + await page.locator('#navbarSettings').click(); + // for Birdnet's 34%$ + await page.locator('#confidence').fill('30'); if (type === 'select'){ await page.selectOption(elementID, value); } else if (type === 'switch'){ @@ -173,10 +181,12 @@ test(`BirdNET analyse works and second result is 34%`, async () => { test("Amend file start dialog contains date", async () =>{ await runExampleAnalysis('chirpity'); await page.locator('#dropdownMenuButton').click({button: 'right'}); - await page.locator('#setFileStart').click() - const fileStart = await page.locator('#fileStart') - expect(fileStart).toHaveValue('2024-11-06T15:28') - await page.locator('#spectrogramWrapper button.btn-secondary').click(); + await page.locator('#setFileStart').click(); + const fileStart = await page.locator('#fileStart'); + const entry = await fileStart.inputValue(); + const currentYear = new Date().getFullYear().toString(); + expect(entry.toString()).toContain(currentYear); + // await page.locator('#spectrogramWrapper button.btn-secondary').click(); }) // test('Check spectrogram before and after applying filter are different', async () => {