From aadcfeaaa92ed0f19a9d0c80d58a19fb2e04f439 Mon Sep 17 00:00:00 2001 From: Alireza Date: Tue, 3 Oct 2023 19:26:57 +0200 Subject: [PATCH] test: fix a flakiness in menu tests --- packages/jui/src/Menu/Menu.cy.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/jui/src/Menu/Menu.cy.tsx b/packages/jui/src/Menu/Menu.cy.tsx index 8aa21db2..16428b12 100644 --- a/packages/jui/src/Menu/Menu.cy.tsx +++ b/packages/jui/src/Menu/Menu.cy.tsx @@ -734,9 +734,11 @@ describe("ContextMenu", () => { // to viewport. cy.mount(); cy.scrollTo("bottom", { duration: 0 }); - cy.get("#context-menu-container").rightclick("bottomRight", { - scrollBehavior: false, - }); + cy.get("#context-menu-container") + .realMouseMove(0, 0) // this fixes a flakiness in screenshots, which depends on whether other test cases are run before this + .rightclick("bottomRight", { + scrollBehavior: false, + }); matchImageSnapshot("context-menu-opened"); });