Skip to content

Commit

Permalink
playwright: add test for opening a file via context menu
Browse files Browse the repository at this point in the history
Contributed on behalf of STMicroelectronics

Signed-off-by: Olaf Lessenich <[email protected]>
  • Loading branch information
xai committed Aug 29, 2023
1 parent 7776511 commit 87dcd72
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/playwright/src/tests/theia-electron-app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,15 @@ test.describe('Theia Electron Application', () => {
await (await menuBar.openMenu('View')).clickMenuItem('Explorer');
expect(await explorerView.isDisplayed()).toBe(false);
});

test('open a file via the context menu', async () => {
await (await menuBar.openMenu('View')).clickMenuItem('Explorer');
const explorerView = new TheiaExplorerView(app);
expect(await explorerView.isDisplayed()).toBe(true);
await app.page.getByText('sample.txt').click({ button: 'right' });
await app.page.locator('li').filter({ hasText: /^Open$/ }).locator('div').first().click();
const span = await app.page.waitForSelector('span:has-text("content line 2")');
expect(await span.isVisible()).toBe(true);
});
});

0 comments on commit 87dcd72

Please sign in to comment.