Skip to content

Commit

Permalink
Work around Playwright issue
Browse files Browse the repository at this point in the history
  • Loading branch information
otacke committed Apr 30, 2024
1 parent 12a7e1f commit 3a69cdf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/main.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,16 @@ test.describe('demo', () => {

await Promise.all([
expect(dialog).toBeVisible(),
expect(dialog.getByText('No', { exact: true })).toBeVisible(),
expect(dialog.locator('.h5p-core-cancel-button')).toBeVisible(),
expect(dialog.getByText('Yes')).toBeVisible()
]);
});

test ('user can stay', async () => {
const dialog = await h5pContainer.locator('.h5p-confirmation-dialog-popup');
await dialog.getByText('No', { exact: true }).click();
// Playwright seems to have trouble with the focus trap except when using --debug
// await dialog.locator('.h5p-core-cancel-button').click();
await dialog.locator('.h5p-core-cancel-button').press('Enter');

await expect(dialog).not.toBeVisible();
});
Expand All @@ -197,14 +199,16 @@ test.describe('demo', () => {

await Promise.all([
expect(dialog).toBeVisible(),
expect(dialog.getByText('No', { exact: true })).toBeVisible(),
expect(dialog.locator('.h5p-core-cancel-button')).toBeVisible(),
expect(dialog.getByText('Yes')).toBeVisible()
]);
});

test ('user actually finished the map', async () => {
const dialog = await h5pContainer.locator('.h5p-confirmation-dialog-popup');
await dialog.getByText('Yes').click();
// Playwright seems to have trouble with the focus trap except when using --debug
// await dialog.getByText('Yes').click();
await dialog.getByText('Yes').press('Enter');

await Promise.all([
expect(dialog).not.toBeVisible(),
Expand Down

0 comments on commit 3a69cdf

Please sign in to comment.