Skip to content

Commit

Permalink
e2e-test: editor action test - use mouse down (#5839)
Browse files Browse the repository at this point in the history
Per the changes in #5834,
needed to adjust test to use mouse down in order to be able to click the
menu.

### QA Notes

This particular test only runs on `browser` so now triggering here, but
confirmed it works locally.
  • Loading branch information
midleman authored Dec 20, 2024
1 parent 10f1afb commit fc1fdd3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/e2e/areas/action-bar/editor-action-bar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ test.describe('Editor Action Bar', {
annotation: [{ type: 'info', description: 'electron test unable to interact with dropdown native menu' }],
}, async function ({ app, page }) {
await openNotebook(app, 'workspaces/large_r_notebook/spotify.ipynb');
await verifySplitEditor(page, 'spotify.ipynb');

if (app.web) {
await verifyToggleLineNumbers(page);
await verifyToggleBreadcrumb(page);
}

await verifySplitEditor(page, 'spotify.ipynb');
});
});

Expand Down Expand Up @@ -113,7 +114,9 @@ async function verifyOpenInNewWindow(page, expectedText: string) {
async function clickCustomizeNotebookMenuItem(page, menuItem: string) {
const role = menuItem.includes('Line Numbers') ? 'menuitemcheckbox' : 'menuitem';
const dropdownButton = page.getByLabel('Customize Notebook...').nth(1);
await dropdownButton.evaluate((button) => (button as HTMLElement).click());
await dropdownButton.evaluate((button) => {
(button as HTMLElement).dispatchEvent(new MouseEvent('mousedown', { bubbles: true, cancelable: true }));
});

const toggleMenuItem = page.getByRole(role, { name: menuItem });
await toggleMenuItem.hover();
Expand Down

0 comments on commit fc1fdd3

Please sign in to comment.