Skip to content

Commit

Permalink
Merge branch 'next'
Browse files Browse the repository at this point in the history
  • Loading branch information
Eliastik committed Jun 16, 2024
2 parents c0e8c36 + 9bcd17f commit d5e9453
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
8 changes: 4 additions & 4 deletions tests/audioeditor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ test("validating settings should work", async ({ page }) => {

await loadingPopup.waitFor({ state: "attached", timeout: 5000 });

expect(await loadingPopup.count()).toBe(1);
await expect(loadingPopup).toHaveCount(1);

await loadingPopup.waitFor({ state: "detached", timeout: 5000 });

const errorPopup = page.locator("#errorProcessingAudioDialog");

expect(await errorPopup.count()).toBe(0);
await expect(errorPopup).toHaveCount(0);
});

test("cancelling audio processing should work", async ({ page }) => {
Expand All @@ -134,11 +134,11 @@ test("cancelling audio processing should work", async ({ page }) => {

await cancelButton.waitFor({ state: "visible", timeout: 10000 });

expect(await loadingPopup.count()).toBe(1);
await expect(loadingPopup).toHaveCount(1);

await cancelButton.click();

await loadingPopup.waitFor({ state: "detached", timeout: 10000 });

expect(await loadingPopup.count()).toBe(0);
await expect(loadingPopup).toHaveCount(0);
});
2 changes: 1 addition & 1 deletion tests/audioplayer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ test("pausing and stopping audio should work - compatibility mode", async ({ pag

await page.waitForTimeout(3000);

expect(await pauseButton.count()).toBe(0);
await expect(pauseButton).toHaveCount(0);

await stopAudioPlaying(page);

Expand Down
17 changes: 10 additions & 7 deletions tests/homepage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test("should display title", async ({ page }) => {
});

test("opening wrong file should display error", async ({ page }) => {
const openFileButton = page.locator("body > div:not(.navbar) > button");
const openFileButton = page.locator("body > div:not(.navbar) button", { hasText: "Select an audio file" });
const fileChooserPromise = page.waitForEvent("filechooser");

openFileButton.click();
Expand All @@ -21,11 +21,13 @@ test("opening wrong file should display error", async ({ page }) => {

const modalErrorLoadingDialog = page.locator("#errorLoadingAudioDialog +.modal");

expect(await modalErrorLoadingDialog.isVisible());
await modalErrorLoadingDialog.waitFor({ state: "attached", timeout: 5000 });

await expect(modalErrorLoadingDialog).toHaveCount(1);
});

test("opening audio file should not display error", async ({ page }) => {
const openFileButton = page.locator("body > div:not(.navbar) > button");
const openFileButton = page.locator("body > div:not(.navbar) button", { hasText: "Select an audio file" });
const fileChooserPromise = page.waitForEvent("filechooser");

openFileButton.click();
Expand All @@ -35,12 +37,13 @@ test("opening audio file should not display error", async ({ page }) => {

const modalErrorLoadingDialog = page.locator("#errorLoadingAudioDialog +.modal");

expect(!(await modalErrorLoadingDialog.isVisible()));
});
await modalErrorLoadingDialog.waitFor({ state: "detached", timeout: 5000 });

await expect(modalErrorLoadingDialog).toHaveCount(0);
});

test("returning to homepage should work", async ({ page }) => {
const openFileButton = page.locator("body > div:not(.navbar) > button");
const openFileButton = page.locator("body > div:not(.navbar) button", { hasText: "Select an audio file" });
const fileChooserPromise = page.waitForEvent("filechooser");

openFileButton.click();
Expand All @@ -66,5 +69,5 @@ test("returning to homepage should work", async ({ page }) => {

await returnToHomeModalButton.click();

expect(await openFileButton.isVisible());
await expect(openFileButton).toBeVisible();
});
4 changes: 2 additions & 2 deletions tests/settings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ test("disabling initial audio rendering and enabling compatibility mode should w

await openAudioFile(page);

await page.waitForTimeout(2000);

const playButton = page.locator("#playButton");

await playButton.waitFor({ state: "visible", timeout: 500 });

await playButton.click();

await page.waitForTimeout(3000);

const stopButton = page.locator("#stopPlayingButton");

await stopButton.waitFor({ state: "visible", timeout: 10000 });
Expand Down

0 comments on commit d5e9453

Please sign in to comment.