From 66c74fbb09ba99bf8a5b7f369e185a571b311f4e Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Mon, 6 Feb 2023 12:09:30 +0100 Subject: [PATCH] test if avatar menu is visible and scroll top --- ...when_I_click_on_my_profile_picture_in_the_top_right.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cypress/integration/UserProfile.NameDescriptionLocation/I_can_see_my_new_name_{string}_when_I_click_on_my_profile_picture_in_the_top_right.js b/cypress/integration/UserProfile.NameDescriptionLocation/I_can_see_my_new_name_{string}_when_I_click_on_my_profile_picture_in_the_top_right.js index b9e97a304..ca6b4798b 100644 --- a/cypress/integration/UserProfile.NameDescriptionLocation/I_can_see_my_new_name_{string}_when_I_click_on_my_profile_picture_in_the_top_right.js +++ b/cypress/integration/UserProfile.NameDescriptionLocation/I_can_see_my_new_name_{string}_when_I_click_on_my_profile_picture_in_the_top_right.js @@ -1,7 +1,13 @@ import { Then } from "cypress-cucumber-preprocessor/steps"; Then('I can see my new name {string} when I click on my profile picture in the top right', name => { + cy.get(".avatar-menu").then(($menu) => { + if (!$menu.is(':visible')){ + cy.scrollTo("top"); + cy.wait(500); + } + }) cy.get('.avatar-menu').click() // open cy.get('.avatar-menu-popover').contains(name) cy.get('.avatar-menu').click() // close again -}) \ No newline at end of file +})