From c0a4dae3e57e77d585aeaf5c1c6b7aaf45fc2c3c Mon Sep 17 00:00:00 2001 From: Grzegorz Leoniec Date: Wed, 19 Dec 2018 19:39:46 +0100 Subject: [PATCH] fixed internationalization tests for new dropdown --- components/LocaleSwitch.vue | 5 ++++- .../integration/Internationalization.feature | 8 ++++---- cypress/integration/common/steps.js | 19 ++++++++++++------- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/components/LocaleSwitch.vue b/components/LocaleSwitch.vue index e9c1dde39..a31679078 100644 --- a/components/LocaleSwitch.vue +++ b/components/LocaleSwitch.vue @@ -28,7 +28,10 @@ > { When('I log out through the menu in the top right corner', () => { cy.get('.avatar-menu').click() - cy.get('.avatar-menu-popover') + cy.get('.locale-menu-popover') .find('a') .contains('Logout') .click() @@ -78,14 +78,19 @@ Then('I am still logged in', () => { cy.get('.avatar-menu-popover').contains(username) }) -When('I can see the english language flag', () => { - cy.get('.login-locale-switch img[src$="en.svg"]') +When('I can see the english is selected', () => { + cy.get('.login-locale-switch img[alt="English"]') }) -When('I can see the german language flag', () => { - cy.get('.login-locale-switch img[src$="de.svg"]') +When('I can see the german is selected', () => { + cy.get('.login-locale-switch img[alt="Deutsch"]') }) -When('I click on the locale switch', () => { - cy.get('.login-locale-switch a').click().wait(500) +When('I select german', () => { + cy.get('.login-locale-switch a') + .click() + .wait(50) + cy.get('.locale-menu-popover a.de') + .click() + .wait(500) }) Then(`There should be a locale cooke set to de`, () => { cy.getCookie('locale').should('have.property', 'value', 'de')