Skip to content

Commit

Permalink
Revise e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
otacke committed Sep 24, 2024
1 parent 3fe5e93 commit e6f3dbb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/main.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ test.describe('demo', () => {
await Promise.all([
expect(dialog).toBeVisible(),
expect(dialog.locator('.h5p-core-cancel-button')).toBeVisible(),
expect(dialog.getByText('Yes')).toBeVisible()
expect(dialog.locator('.h5p-confirmation-dialog-confirm-button')).toBeVisible()
]);
});

Expand All @@ -200,15 +200,15 @@ test.describe('demo', () => {
await Promise.all([
expect(dialog).toBeVisible(),
expect(dialog.locator('.h5p-core-cancel-button')).toBeVisible(),
expect(dialog.getByText('Yes')).toBeVisible()
expect(dialog.locator('.h5p-confirmation-dialog-confirm-button')).toBeVisible()
]);
});

test ('user actually finished the map', async () => {
const dialog = await h5pContainer.locator('.h5p-confirmation-dialog-popup');
// 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 dialog.locator('.h5p-confirmation-dialog-confirm-button').click();
await dialog.locator('.h5p-confirmation-dialog-confirm-button').press('Enter');

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

0 comments on commit e6f3dbb

Please sign in to comment.