mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Follow @mattwr18 suggestions
This commit is contained in:
parent
edbb0c3d1f
commit
c20a656405
@ -5,9 +5,12 @@ import {
|
|||||||
} from "cypress-cucumber-preprocessor/steps";
|
} from "cypress-cucumber-preprocessor/steps";
|
||||||
import helpers from "../../support/helpers";
|
import helpers from "../../support/helpers";
|
||||||
import { VERSION } from '../../constants/terms-and-conditions-version.js'
|
import { VERSION } from '../../constants/terms-and-conditions-version.js'
|
||||||
|
import locales from '../../../webapp/locales'
|
||||||
|
import orderBy from 'lodash/orderBy'
|
||||||
|
|
||||||
/* global cy */
|
/* global cy */
|
||||||
|
|
||||||
|
const languages = orderBy(locales, 'name')
|
||||||
let lastPost = {};
|
let lastPost = {};
|
||||||
|
|
||||||
let loginCredentials = {
|
let loginCredentials = {
|
||||||
@ -245,9 +248,10 @@ Then("I select a category", () => {
|
|||||||
.click();
|
.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 ')
|
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 => {
|
Then("the post shows up on the landing page at position {int}", index => {
|
||||||
|
|||||||
@ -20,7 +20,7 @@ Feature: Notification for a mention
|
|||||||
"""
|
"""
|
||||||
And mention "@matt-rider" in the text
|
And mention "@matt-rider" in the text
|
||||||
And I select a category
|
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"
|
And I click on "Save"
|
||||||
When I log out
|
When I log out
|
||||||
And I log in with the following credentials:
|
And I log in with the following credentials:
|
||||||
|
|||||||
@ -18,7 +18,7 @@ Feature: Create a post
|
|||||||
for active citizenship.
|
for active citizenship.
|
||||||
"""
|
"""
|
||||||
And I select a category
|
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"
|
And I click on "Save"
|
||||||
Then I get redirected to ".../my-first-post"
|
Then I get redirected to ".../my-first-post"
|
||||||
And the post was saved successfully
|
And the post was saved successfully
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user