From 5d8cd73e3036a540dff75895b184d3d8ece249d7 Mon Sep 17 00:00:00 2001 From: Grzegorz Leoniec Date: Tue, 18 Dec 2018 16:07:41 +0100 Subject: [PATCH] Added very simple locale switch test --- cypress/integration/Internationalization.feature | 16 ++++++++++++++++ cypress/integration/common/steps.js | 13 +++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 cypress/integration/Internationalization.feature diff --git a/cypress/integration/Internationalization.feature b/cypress/integration/Internationalization.feature new file mode 100644 index 000000000..51e343f29 --- /dev/null +++ b/cypress/integration/Internationalization.feature @@ -0,0 +1,16 @@ +Feature: Internationalization + As a user + I want users to get the site in my native language + In order to be able to understand the interface + + Scenario: See english loginpage + When I visit the "/login" page + Then I can see the english language flag + + Scenario: See german loginpage + When I visit the "/login" page + And I click on the locale switch + Then I can see the german language flag + Then There should be a locale cooke set to de + When I refresh the page + Then I can see the german language flag diff --git a/cypress/integration/common/steps.js b/cypress/integration/common/steps.js index f6bb9f2b0..49e975ea0 100644 --- a/cypress/integration/common/steps.js +++ b/cypress/integration/common/steps.js @@ -80,6 +80,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 german language flag', () => { + cy.get('.login-locale-switch img[src$="de.svg"]') +}) +When('I click on the locale switch', () => { + cy.get('.login-locale-switch a').click().wait(500) +}) +Then(`There should be a locale cooke set to de`, () => { + cy.getCookie('locale').should('have.property', 'value', 'de') +}) + When('I navigate to the administration dashboard', () => { cy.get('.avatar-menu').click() cy.get('a').contains('Systemverwaltung').click()