Skip to content

Commit

Permalink
scroll closes context menu workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxiLein committed Oct 28, 2024
1 parent 0183fa2 commit 0cb124c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/ms2/processes/process-list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,12 @@ test('create a new folder and remove it with context menu', async ({ processList
const folderLocator = page.getByText(folderId);
await expect(folderLocator).toBeVisible();

// await folderLocator.scrollIntoViewIfNeeded();
/* The playwright browser crops it's view which can cause unwanted scroling */
/* Clicking calls scrollIntoView before clicking, which can cause the context menu to close */
/* Workauround: */
await page.evaluate(() => window!.scrollTo(0, 0));
await folderLocator.scrollIntoViewIfNeeded();

folderLocator.click({ button: 'right' });
const menuLocator = page.getByRole('menuitem', { name: 'delete Delete' });
await menuLocator.click();
Expand Down

0 comments on commit 0cb124c

Please sign in to comment.