From f5c05de9741de88ed149238eecc4ae4b5e6aa569 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Mon, 6 Feb 2023 11:34:15 +0100 Subject: [PATCH] only scroll to top if avatar menu is not visible --- cypress/integration/common/I_log_out.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cypress/integration/common/I_log_out.js b/cypress/integration/common/I_log_out.js index 2f7b6d848..60185bc45 100644 --- a/cypress/integration/common/I_log_out.js +++ b/cypress/integration/common/I_log_out.js @@ -1,7 +1,12 @@ import { When } from "cypress-cucumber-preprocessor/steps"; When("I log out", () => { - cy.scrollTo('top') + cy.get(".avatar-menu").then(($menu) => { + if (!$menu.is(':visible')){ + cy.scrollTo("top"); + cy.wait(500); + } + }) cy.get(".avatar-menu") .click(); cy.get(".avatar-menu-popover")