mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-01-20 20:01:22 +00:00
Improved intarnationalization test
This commit is contained in:
parent
4fe90668a6
commit
1e1864277d
@ -19,8 +19,6 @@ Feature: Internationalization
|
||||
| Nederlands | Inloggen |
|
||||
|
||||
Scenario: Keep preferred language after refresh
|
||||
When I select "Deutsch" in the language menu
|
||||
Then the whole user interface appears in "Deutsch"
|
||||
|
||||
Given I previously switched the language to "Deutsch"
|
||||
And I refresh the page
|
||||
Then the whole user interface appears in "Deutsch"
|
||||
|
||||
@ -20,6 +20,11 @@ const openPage = function(page) {
|
||||
cy.visit(`${baseUrl}/${page}`)
|
||||
}
|
||||
|
||||
const switchLanguage = function(name) {
|
||||
cy.get('.login-locale-switch a').click()
|
||||
cy.contains('.locale-menu-popover a', name).click()
|
||||
}
|
||||
|
||||
const login = (email, password) => {
|
||||
cy.visit(`${baseUrl}/login`)
|
||||
cy.get('input[name=email]')
|
||||
@ -55,6 +60,7 @@ Given('my user account has the role {string}', (role) => {
|
||||
// TODO: use db factories instead of seed data
|
||||
})
|
||||
|
||||
|
||||
When('I log out', logout)
|
||||
|
||||
When('I visit the {string} page', page => {
|
||||
@ -100,8 +106,10 @@ Then('I am still logged in', () => {
|
||||
})
|
||||
|
||||
When('I select {string} in the language menu', name => {
|
||||
cy.get('.login-locale-switch a').click()
|
||||
cy.contains('.locale-menu-popover a', name).click()
|
||||
switchLanguage(name)
|
||||
})
|
||||
Given('I previously switched the language to {string}', name => {
|
||||
switchLanguage(name)
|
||||
})
|
||||
Then('the whole user interface appears in {string}', name => {
|
||||
const lang = getLangByName(name)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user