From fc1fdd37c820327e73a7e07a8cbfe37b1776b4b3 Mon Sep 17 00:00:00 2001 From: Marie Idleman Date: Fri, 20 Dec 2024 05:48:16 -0600 Subject: [PATCH] e2e-test: editor action test - use mouse down (#5839) Per the changes in https://github.com/posit-dev/positron/pull/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. --- test/e2e/areas/action-bar/editor-action-bar.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/e2e/areas/action-bar/editor-action-bar.test.ts b/test/e2e/areas/action-bar/editor-action-bar.test.ts index f0802ca0a11..8eaf0978c65 100644 --- a/test/e2e/areas/action-bar/editor-action-bar.test.ts +++ b/test/e2e/areas/action-bar/editor-action-bar.test.ts @@ -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'); }); }); @@ -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();