Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattk70 committed Nov 14, 2024
1 parent c0c88cf commit 96e5853
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ jobs:

# Tests
- name: Test packaged application
if: runner.os == 'Windows'
if: runner.os != 'Linux'
run: npm test


1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
22 changes: 16 additions & 6 deletions test/menu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ test.beforeAll(async () => {
clearInterval(checkPage);
resolve();
}
}, 5000); });
}, 5000);
});
})

test.afterAll(async () => {
Expand All @@ -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);
Expand All @@ -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'){
Expand Down Expand Up @@ -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 () => {
Expand Down

0 comments on commit 96e5853

Please sign in to comment.