mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Merge pull request #1417 from Human-Connection/dependabot/npm_and_yarn/cypress-cucumber-preprocessor-1.16.0
Bump cypress-cucumber-preprocessor from 1.15.1 to 1.16.0
This commit is contained in:
commit
3e0565d19d
@ -28,6 +28,17 @@ To start the services that are required for cypress testing, run this:
|
|||||||
$ yarn cypress:setup
|
$ yarn cypress:setup
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Install cypress
|
||||||
|
|
||||||
|
Even if the required services for testing run via docker, depending on your
|
||||||
|
setup, the cypress tests themselves run on your host machine. So with our
|
||||||
|
without docker, you would have to install cypress and its dependencies first:
|
||||||
|
|
||||||
|
```
|
||||||
|
# in the root folder /
|
||||||
|
yarn install
|
||||||
|
```
|
||||||
|
|
||||||
## Run cypress
|
## Run cypress
|
||||||
|
|
||||||
After verifying that there are no errors with the servers starting, open another tab in your terminal and run the following command:
|
After verifying that there are no errors with the servers starting, open another tab in your terminal and run the following command:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { Given, When, Then } from "cypress-cucumber-preprocessor/steps";
|
import { Given, When, Then } from "cypress-cucumber-preprocessor/steps";
|
||||||
import { getLangByName } from "../../support/helpers";
|
import helpers from "../../support/helpers";
|
||||||
import slugify from "slug";
|
import slugify from "slug";
|
||||||
|
|
||||||
/* global cy */
|
/* global cy */
|
||||||
@ -131,14 +131,17 @@ Then("I am still logged in", () => {
|
|||||||
When("I select {string} in the language menu", name => {
|
When("I select {string} in the language menu", name => {
|
||||||
cy.switchLanguage(name, true);
|
cy.switchLanguage(name, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
Given("I previously switched the language to {string}", name => {
|
Given("I previously switched the language to {string}", name => {
|
||||||
cy.switchLanguage(name, true);
|
cy.switchLanguage(name, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
Then("the whole user interface appears in {string}", name => {
|
Then("the whole user interface appears in {string}", name => {
|
||||||
const lang = getLangByName(name);
|
const { code } = helpers.getLangByName(name);
|
||||||
cy.get(`html[lang=${lang.code}]`);
|
cy.get(`html[lang=${code}]`);
|
||||||
cy.getCookie("locale").should("have.property", "value", lang.code);
|
cy.getCookie("locale").should("have.property", "value", code);
|
||||||
});
|
});
|
||||||
|
|
||||||
Then("I see a button with the label {string}", label => {
|
Then("I see a button with the label {string}", label => {
|
||||||
cy.contains("button", label);
|
cy.contains("button", label);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
/* globals Cypress cy */
|
/* globals Cypress cy */
|
||||||
import "cypress-file-upload";
|
import "cypress-file-upload";
|
||||||
import { getLangByName } from "./helpers";
|
import helpers from "./helpers";
|
||||||
import users from "../fixtures/users.json";
|
import users from "../fixtures/users.json";
|
||||||
|
|
||||||
const switchLang = name => {
|
const switchLang = name => {
|
||||||
@ -22,8 +22,9 @@ const switchLang = name => {
|
|||||||
cy.contains(".locale-menu-popover a", name).click();
|
cy.contains(".locale-menu-popover a", name).click();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Cypress.Commands.add("switchLanguage", (name, force) => {
|
Cypress.Commands.add("switchLanguage", (name, force) => {
|
||||||
const code = getLangByName(name).code;
|
const { code } = helpers.getLangByName(name);
|
||||||
if (force) {
|
if (force) {
|
||||||
switchLang(name);
|
switchLang(name);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
import find from 'lodash/find'
|
import find from 'lodash/find'
|
||||||
|
import locales from '../../webapp/locales'
|
||||||
|
|
||||||
const helpers = {
|
export default {
|
||||||
locales: require('../../webapp/locales'),
|
getLangByName(name) {
|
||||||
getLangByName: name => {
|
return find(locales, { name })
|
||||||
return find(helpers.locales, { name })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default helpers
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
"codecov": "^3.5.0",
|
"codecov": "^3.5.0",
|
||||||
"cross-env": "^5.2.0",
|
"cross-env": "^5.2.0",
|
||||||
"cypress": "^3.4.1",
|
"cypress": "^3.4.1",
|
||||||
"cypress-cucumber-preprocessor": "^1.15.1",
|
"cypress-cucumber-preprocessor": "^1.16.0",
|
||||||
"cypress-file-upload": "^3.3.3",
|
"cypress-file-upload": "^3.3.3",
|
||||||
"cypress-plugin-retries": "^1.2.2",
|
"cypress-plugin-retries": "^1.2.2",
|
||||||
"dotenv": "^8.1.0",
|
"dotenv": "^8.1.0",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user