Ajoute des script npm pour lancer les tests E2E
parent
502682fe65
commit
8e3a0ba501
|
@ -49,8 +49,8 @@ jobs:
|
|||
- install
|
||||
- run: |
|
||||
yarn run compile
|
||||
yarn run serve:<< parameters.site >> &
|
||||
yarn run cypress run --record --key 21660df5-36a5-4c49-b23d-801799b0c759 --env language=<< parameters.language >> --spec 'cypress/integration/<< parameters.cypress_folder >>/**/*.js'
|
||||
yarn run << parameters.site >>:serve &
|
||||
yarn run cypress run --record --key 21660df5-36a5-4c49-b23d-801799b0c759 --env language=<< parameters.language >> --config integrationFolder=cypress/integration/<< parameters.cypress_folder >>'
|
||||
|
||||
production-end-to-end-test:
|
||||
parameters:
|
||||
|
@ -76,7 +76,7 @@ jobs:
|
|||
- run: npm install --save-dev cypress
|
||||
- run: sleep 300
|
||||
- run: |
|
||||
if ./node_modules/.bin/cypress run --record --key 21660df5-36a5-4c49-b23d-801799b0c759 --env language=<< parameters.language >> --spec 'cypress/integration/<< parameters.cypress_folder >>/**/*.js';
|
||||
if ./node_modules/.bin/cypress run --record --key 21660df5-36a5-4c49-b23d-801799b0c759 --env language=<< parameters.language >> --config integrationFolder=cypress/integration/<< parameters.cypress_folder >>;
|
||||
then
|
||||
echo "SUCCESS \o/"
|
||||
else
|
||||
|
|
|
@ -4,5 +4,6 @@
|
|||
"env": {
|
||||
"language": "fr"
|
||||
},
|
||||
"integrationFolder": "cypress/integration/mon-entreprise",
|
||||
"chromeWebSecurity": false
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
describe('Landing test', function() {
|
||||
console.log('language', Cypress.env('language'), Cypress.env())
|
||||
const fr = Cypress.env('language') === 'fr'
|
||||
it('should not crash', function() {
|
||||
cy.visit('/')
|
||||
|
|
12
package.json
12
package.json
|
@ -60,24 +60,28 @@
|
|||
"scripts": {
|
||||
"compile": "webpack --config source/webpack.prod.js",
|
||||
"stats": "webpack --config source/webpack.prod.js --profile --json > stats.json",
|
||||
"serve:embauche": "cp dist/embauche.html dist/index.html && serve -s dist",
|
||||
"eslint-check": "eslint --print-config .eslintrc | eslint-config-prettier-check",
|
||||
"eslint": "LIST=`git diff --cached --name-only --diff-filter=AMR HEAD | grep .*\\.js | grep -v json`; if [ \"$LIST\" ]; then eslint $LIST; fi",
|
||||
"externalize": "node source/externalize.js",
|
||||
"heroku-postbuild": "yarn install --production=false && yarn compile",
|
||||
"serve:mycompanyinfrance": "serve --config serve.infrance.json",
|
||||
"serve:mon-entreprise": "serve --config serve.mon-entreprise.json",
|
||||
"pretest": "LIST=`git diff --name-only --diff-filter=AMR HEAD^..HEAD | grep .*\\.js | grep -v json`; if [ \"$LIST\" ]; then eslint $LIST; fi && flow check",
|
||||
"start": "node source/server.js",
|
||||
"test-inversions": "yarn test-watch --grep 'inversions'",
|
||||
"test-meca": "yarn test-watch --grep 'Mécanismes'",
|
||||
"test-rules": "yarn test-watch --grep 'notre base de règles'",
|
||||
"test-cypress" : "yarn run cypress run",
|
||||
"test-watch": "yarn test-common --watch",
|
||||
"test-common": "mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --include componentTestSetup.js --require mock-local-storage --require test/helpers/browser.js \"./{,!(node_modules)/**/}!(webpack).test.js\"",
|
||||
"test": "yarn test-common",
|
||||
"test-components": "mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --include componentTestSetup.js --require mock-local-storage ---require test/helpers/browser.js \"source/components/**/*.test.js\" --watch",
|
||||
"test-lib": "yarn test-common --grep 'library'",
|
||||
"compile-lib": "yarn webpack --config source/webpack.lib.js"
|
||||
"compile-lib": "yarn webpack --config source/webpack.lib.js",
|
||||
"mon-entreprise:serve": "serve --config serve.mon-entreprise.json",
|
||||
"mon-entreprise:test": "cypress open",
|
||||
"mycompanyinfrance:serve": "serve --config serve.infrance.json",
|
||||
"mycompanyinfrance:test": "cypress open --env language=en --config baseUrl=http://localhost:8080/infrance",
|
||||
"embauche:serve": "cp dist/embauche.html dist/index.html && serve -s dist",
|
||||
"embauche:test": "cypress open --config baseUrl=http://localhost:8080/embauche,integrationFolder=cypress/integration/embauche"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.1.0",
|
||||
|
|
Loading…
Reference in New Issue