Skip to content

Commit ad81bb8

Browse files
committed
fix: use more specific locators for dialog buttons in playwright tests
Contributed on behalf of STMicroelectronics Signed-off-by: Olaf Lessenich <[email protected]>
1 parent a5b5d28 commit ad81bb8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/playwright/src/tests/theia-electron-app.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ test.describe('Theia Electron Application', () => {
6565
await (await menuBar.openMenu('File')).clickMenuItem('Open File...');
6666
const fileDialog = await app.page.waitForSelector('div[class="dialogBlock"]');
6767
expect(await fileDialog.isVisible()).toBe(true);
68-
await app.page.getByRole('button', { name: 'Cancel' }).click();
68+
await app.page.locator('#theia-dialog-shell').getByRole('button', { name: 'Cancel' }).click();
6969
expect(await fileDialog.isVisible()).toBe(false);
7070
});
7171

@@ -79,7 +79,7 @@ test.describe('Theia Electron Application', () => {
7979

8080
const fileEntry = app.page.getByText('sample.txt');
8181
await fileEntry.click();
82-
await app.page.getByRole('button', { name: 'Open' }).click();
82+
await app.page.locator('#theia-dialog-shell').getByRole('button', { name: 'Open' }).click();
8383

8484
const span = await app.page.waitForSelector('span:has-text("content line 2")');
8585
expect(await span.isVisible()).toBe(true);

examples/playwright/src/tests/theia-workspace.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ test.describe('Theia Workspace', () => {
6161

6262
const fileEntry = app.page.getByText('sample.txt');
6363
await fileEntry.click();
64-
await app.page.getByRole('button', { name: 'Open' }).click();
64+
await app.page.locator('#theia-dialog-shell').getByRole('button', { name: 'Open' }).click();
6565

6666
const span = await app.page.waitForSelector('span:has-text("content line 2")');
6767
expect(await span.isVisible()).toBe(true);

0 commit comments

Comments
 (0)