Skip to content

Commit 8896edb

Browse files
committed
Fix flaky playwright Theia Main Menu test
We are observing cases where the `.getByRole('button', { name: 'OK' })` resolved to multiple elements (e.g. [here](https://github.com/eclipse-theia/theia/actions/runs/10025491100)). With this change we limit the selection to the dialog shell and hopefully remove this ambiguity. Contributed on behalf of STMicroelectronics. Change-Id: I5ee5b3fc6a683f68da99e219b32784c3f5d4bfb7
1 parent 7cbfc7a commit 8896edb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/playwright/src/tests/theia-main-menu.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ test.describe('Theia Main Menu', () => {
9797
await (await menuBar.openMenu('Help')).clickMenuItem('About');
9898
const aboutDialog = new TheiaAboutDialog(app);
9999
expect(await aboutDialog.isVisible()).toBe(true);
100-
await aboutDialog.page.getByRole('button', { name: 'OK' }).click();
100+
await aboutDialog.page.locator('#theia-dialog-shell').getByRole('button', { name: 'OK' }).click();
101101
expect(await aboutDialog.isVisible()).toBe(false);
102102
});
103103

0 commit comments

Comments
 (0)