Follow @mattwr18 suggestions

This commit is contained in:
roschaefer 2019-11-15 11:51:53 +01:00
parent edbb0c3d1f
commit c20a656405
3 changed files with 8 additions and 4 deletions

View File

@ -5,9 +5,12 @@ import {
} from "cypress-cucumber-preprocessor/steps";
import helpers from "../../support/helpers";
import { VERSION } from '../../constants/terms-and-conditions-version.js'
import locales from '../../../webapp/locales'
import orderBy from 'lodash/orderBy'
/* global cy */
const languages = orderBy(locales, 'name')
let lastPost = {};
let loginCredentials = {
@ -245,9 +248,10 @@ Then("I select a category", () => {
.click();
});
When("I choose a language for the post", () => {
When("I choose {string} as the language for the post", (languageCode) => {
cy.get('.ds-flex-item > .ds-form-item .ds-select ')
.click().get('.ds-select-option').first().click()
.click().get('.ds-select-option')
.eq(languages.findIndex(l => l.code === languageCode)).click()
})
Then("the post shows up on the landing page at position {int}", index => {

View File

@ -20,7 +20,7 @@ Feature: Notification for a mention
"""
And mention "@matt-rider" in the text
And I select a category
And I choose a language for the post
And I choose "en" as the language for the post
And I click on "Save"
When I log out
And I log in with the following credentials:

View File

@ -18,7 +18,7 @@ Feature: Create a post
for active citizenship.
"""
And I select a category
And I choose a language for the post
And I choose "en" as the language for the post
And I click on "Save"
Then I get redirected to ".../my-first-post"
And the post was saved successfully