diff --git a/circle.yml b/circle.yml index 0ac5734db..b310dcd3c 100644 --- a/circle.yml +++ b/circle.yml @@ -105,7 +105,7 @@ jobs: # when running in parallel, the total number of parallel containers # is in variable CIRCLE_NODE_TOTAL and the current container index in CIRCLE_NODE_INDEX # which starts at 0 and goes to $CIRCLE_NODE_TOTAL - 1 - - run: npm run test:ci -- --chunk $CIRCLE_NODE_INDEX --total-chunks $CIRCLE_NODE_TOTAL + - run: npm run test:ci -- --chunk $CIRCLE_NODE_INDEX --total-chunks $CIRCLE_NODE_TOTAL --record # a single utility script to run multiple examples against Chrome test-examples-chrome: @@ -293,6 +293,8 @@ all_jobs: &all_jobs branches: only: - master + # for https://github.com/cypress-io/cypress-example-recipes/issues/531 + - record-test-examples-job - test-examples-chrome: requires: diff --git a/examples/blogs__a11y/package.json b/examples/blogs__a11y/package.json index 45bb0725c..f619c2994 100644 --- a/examples/blogs__a11y/package.json +++ b/examples/blogs__a11y/package.json @@ -5,6 +5,7 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", - "test:ci": "../../node_modules/.bin/cypress run" + "test:ci": "../../node_modules/.bin/cypress run", + "test:ci:record": "../../node_modules/.bin/cypress run --record" } } diff --git a/examples/blogs__application-actions/package.json b/examples/blogs__application-actions/package.json index e410d0aa1..15c9d5c03 100644 --- a/examples/blogs__application-actions/package.json +++ b/examples/blogs__application-actions/package.json @@ -8,6 +8,7 @@ "cypress:run": "../../node_modules/.bin/cypress run", "cypress:run:chrome": "../../node_modules/.bin/cypress run --browser chrome", "cypress:run:firefox": "../../node_modules/.bin/cypress run --browser firefox", + "cypress:run:record": "../../node_modules/.bin/cypress run --record", "cypress:run:win": "bin-up cypress run", "cypress:run:win:record": "bin-up cypress run --record --group blogs__application-actions", "dev": "../../node_modules/.bin/start-test 8888 cypress:open", @@ -16,6 +17,7 @@ "test:ci": "../../node_modules/.bin/start-test 8888 cypress:run", "test:ci:chrome": "../../node_modules/.bin/start-test 8888 cypress:run:chrome", "test:ci:firefox": "../../node_modules/.bin/start-test 8888 cypress:run:firefox", + "test:ci:record": "../../node_modules/.bin/start-test 8888 cypress:run:record", "test:ci:windows": "bin-up start-test start:win http://localhost:8888 cypress:run:win", "test:ci:windows:record": "bin-up start-test start:win http://localhost:8888 cypress:run:win:record" } diff --git a/examples/blogs__assertion-counting/package.json b/examples/blogs__assertion-counting/package.json index 3c18a91bc..52bbdd67e 100644 --- a/examples/blogs__assertion-counting/package.json +++ b/examples/blogs__assertion-counting/package.json @@ -5,6 +5,7 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", - "test:ci": "../../node_modules/.bin/cypress run" + "test:ci": "../../node_modules/.bin/cypress run", + "test:ci:record": "../../node_modules/.bin/cypress run --record" } } diff --git a/examples/blogs__direct-control-angular/package.json b/examples/blogs__direct-control-angular/package.json index fdd44edbb..0ff662bfc 100644 --- a/examples/blogs__direct-control-angular/package.json +++ b/examples/blogs__direct-control-angular/package.json @@ -6,6 +6,7 @@ "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", "start": "echo", - "test:ci": "npm run cypress:run" + "test:ci": "npm run cypress:run", + "test:ci:record": "npm run cypress:run -- --record" } } diff --git a/examples/blogs__e2e-api-testing/package.json b/examples/blogs__e2e-api-testing/package.json index 4fa753bc8..2f7ec2bc2 100644 --- a/examples/blogs__e2e-api-testing/package.json +++ b/examples/blogs__e2e-api-testing/package.json @@ -5,11 +5,13 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", + "cypress:run:record": "../../node_modules/.bin/cypress run --record", "cypress:run:windows": "bin-up cypress run", "cypress:run:windows:record": "bin-up cypress run --record --group blogs__e2e-api-testing", "start": "../../node_modules/.bin/json-server db.json --port 7081 --quiet", "start:windows": "bin-up json-server db.json --port 7081 --quiet", "test:ci": "../../node_modules/.bin/start-test 7081 cypress:run", + "test:ci:record": "../../node_modules/.bin/start-test 7081 cypress:run:record", "test:ci:windows": "bin-up start-test start:windows 7081 cypress:run:windows", "test:ci:windows:record": "bin-up start-test start:windows 7081 cypress:run:windows:record" } diff --git a/examples/blogs__e2e-snapshots/package.json b/examples/blogs__e2e-snapshots/package.json index d56e9db61..ccb5b84f8 100644 --- a/examples/blogs__e2e-snapshots/package.json +++ b/examples/blogs__e2e-snapshots/package.json @@ -5,10 +5,12 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", + "cypress:run:record": "../../node_modules/.bin/cypress run --record", "dev": "../../node_modules/.bin/start-test 3700 cypress:open", "reset": "node reset-db.js", "reset:db": "node reset-db.js", "start": "../../node_modules/.bin/json-server -p 3700 --static . data.json --middlewares ../../node_modules/json-server-reset", - "test:ci": "../../node_modules/.bin/start-test 3700 cypress:run" + "test:ci": "../../node_modules/.bin/start-test 3700 cypress:run", + "test:ci:record": "../../node_modules/.bin/start-test 3700 cypress:run:record" } } diff --git a/examples/blogs__element-coverage/package.json b/examples/blogs__element-coverage/package.json index 4dc9c7866..470b3204e 100644 --- a/examples/blogs__element-coverage/package.json +++ b/examples/blogs__element-coverage/package.json @@ -6,8 +6,10 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "npm run wait-on && ../../node_modules/.bin/cypress run", + "cypress:run:record": "npm run wait-on && ../../node_modules/.bin/cypress run --record", "start": "../../node_modules/.bin/react-scripts start", "test:ci": "../../node_modules/.bin/start-test 3000 cypress:run", + "test:ci:record": "../../node_modules/.bin/start-test 3000 cypress:run:record", "wait-on": "../../node_modules/.bin/wait-on http://localhost:3000" }, "browserslist": [ diff --git a/examples/blogs__iframes/package.json b/examples/blogs__iframes/package.json index 7e11eb172..32aa432cf 100644 --- a/examples/blogs__iframes/package.json +++ b/examples/blogs__iframes/package.json @@ -7,6 +7,7 @@ "cypress:run": "../../node_modules/.bin/cypress run", "test:ci": "../../node_modules/.bin/cypress run", "test:ci:chrome": "../../node_modules/.bin/cypress run --browser chrome", - "test:ci:firefox": "../../node_modules/.bin/cypress run --browser firefox" + "test:ci:firefox": "../../node_modules/.bin/cypress run --browser firefox", + "test:ci:record": "../../node_modules/.bin/cypress run --record" } } diff --git a/examples/blogs__notification/package.json b/examples/blogs__notification/package.json index 0ca6a951e..9685eb934 100644 --- a/examples/blogs__notification/package.json +++ b/examples/blogs__notification/package.json @@ -7,6 +7,7 @@ "cypress:run": "../../node_modules/.bin/cypress run", "test:ci": "../../node_modules/.bin/cypress run", "test:ci:chrome": "../../node_modules/.bin/cypress run --browser chrome", - "test:ci:chrome:headless": "../../node_modules/.bin/cypress run --browser chrome --headless" + "test:ci:chrome:headless": "../../node_modules/.bin/cypress run --browser chrome --headless", + "test:ci:record": "../../node_modules/.bin/cypress run --record" } } diff --git a/examples/blogs__testing-redux-store/package.json b/examples/blogs__testing-redux-store/package.json index b94d61b9b..c0e5dcd80 100644 --- a/examples/blogs__testing-redux-store/package.json +++ b/examples/blogs__testing-redux-store/package.json @@ -6,8 +6,10 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", + "cypress:run:record": "../../node_modules/.bin/cypress run --record", "start": "../../node_modules/.bin/react-scripts start", - "test:ci": "../../node_modules/.bin/start-test 3000 cypress:run" + "test:ci": "../../node_modules/.bin/start-test 3000 cypress:run", + "test:ci:record": "../../node_modules/.bin/start-test 3000 cypress:run:record" }, "devDependencies": { "cypress-plugin-snapshots": "1.0.6" diff --git a/examples/blogs__use-react-devtools/package.json b/examples/blogs__use-react-devtools/package.json index 1b3518182..c5640fddf 100644 --- a/examples/blogs__use-react-devtools/package.json +++ b/examples/blogs__use-react-devtools/package.json @@ -5,10 +5,12 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", + "cypress:run:record": "../../node_modules/.bin/cypress run --record", "dev": "../../node_modules/.bin/start-test 3000 cypress:open", "start": "../../node_modules/.bin/react-scripts start", "test:ci": "../../node_modules/.bin/start-test 3000 cypress:run", - "test:ci:chrome": "../../node_modules/.bin/start-test 3000 cypress:run" + "test:ci:chrome": "../../node_modules/.bin/start-test 3000 cypress:run", + "test:ci:record": "../../node_modules/.bin/start-test 3000 cypress:run:record" }, "browserslist": { "production": [ diff --git a/examples/blogs__vue-vuex-rest/package.json b/examples/blogs__vue-vuex-rest/package.json index 14ba73bb0..555a1d309 100644 --- a/examples/blogs__vue-vuex-rest/package.json +++ b/examples/blogs__vue-vuex-rest/package.json @@ -7,12 +7,14 @@ "cypress:run": "../../node_modules/.bin/cypress run", "cypress:run:chrome": "../../node_modules/.bin/cypress run --browser chrome", "cypress:run:chrome:headless": "../../node_modules/.bin/cypress run --browser chrome --headless", + "cypress:run:record": "../../node_modules/.bin/cypress run --record", "dev": "../../node_modules/.bin/start-test 3000 cypress:open", "reset": "node reset-db.js", "reset:db": "node reset-db.js", "start": "../../node_modules/.bin/json-server --static . data.json --middlewares ../../node_modules/json-server-reset", "test:ci": "../../node_modules/.bin/start-test 3000 cypress:run", "test:ci:chrome": "../../node_modules/.bin/start-test 3000 cypress:run:chrome", - "test:ci:chrome:headless": "../../node_modules/.bin/start-test 3000 cypress:run:chrome:headless" + "test:ci:chrome:headless": "../../node_modules/.bin/start-test 3000 cypress:run:chrome:headless", + "test:ci:record": "../../node_modules/.bin/start-test 3000 cypress:run:record" } } diff --git a/examples/extending-cypress__chai-assertions/package.json b/examples/extending-cypress__chai-assertions/package.json index 5edca6fad..504ed31c4 100644 --- a/examples/extending-cypress__chai-assertions/package.json +++ b/examples/extending-cypress__chai-assertions/package.json @@ -5,6 +5,7 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", - "test:ci": "../../node_modules/.bin/cypress run" + "test:ci": "../../node_modules/.bin/cypress run", + "test:ci:record": "../../node_modules/.bin/cypress run --record" } } diff --git a/examples/file-upload-react/package.json b/examples/file-upload-react/package.json index dcf958a94..7b29011af 100644 --- a/examples/file-upload-react/package.json +++ b/examples/file-upload-react/package.json @@ -7,6 +7,7 @@ "cypress:run": "../../node_modules/.bin/cypress run", "start": "echo nothing to start, this recipe does not run server", "test:ci": "../../node_modules/.bin/cypress run", + "test:ci:record": "../../node_modules/.bin/cypress run --record", "test:ci:windows": "bin-up cypress run", "test:ci:windows:record": "bin-up cypress run --record --group file-upload-react" } diff --git a/examples/fundamentals__add-custom-command/package.json b/examples/fundamentals__add-custom-command/package.json index 8784bb90d..588f92518 100644 --- a/examples/fundamentals__add-custom-command/package.json +++ b/examples/fundamentals__add-custom-command/package.json @@ -5,6 +5,7 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", - "test:ci": "../../node_modules/.bin/cypress run" + "test:ci": "../../node_modules/.bin/cypress run", + "test:ci:record": "../../node_modules/.bin/cypress run --record" } } diff --git a/examples/fundamentals__custom-browsers/package.json b/examples/fundamentals__custom-browsers/package.json index ba044bb7c..232507b4c 100644 --- a/examples/fundamentals__custom-browsers/package.json +++ b/examples/fundamentals__custom-browsers/package.json @@ -7,6 +7,7 @@ "cypress:run": "../../node_modules/.bin/cypress run", "start": "echo nothing to start", "test:ci": "../../node_modules/.bin/cypress run", - "test:ci:brave": "../../node_modules/.bin/cypress run --config pluginsFile=cypress/plugins/brave.js" + "test:ci:brave": "../../node_modules/.bin/cypress run --config pluginsFile=cypress/plugins/brave.js", + "test:ci:record": "../../node_modules/.bin/cypress run --record" } } diff --git a/examples/fundamentals__dynamic-tests/package.json b/examples/fundamentals__dynamic-tests/package.json index 1ebe0cf7c..c1a226294 100644 --- a/examples/fundamentals__dynamic-tests/package.json +++ b/examples/fundamentals__dynamic-tests/package.json @@ -6,6 +6,7 @@ "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", "test:ci": "npm run cypress:run", + "test:ci:record": "npm run cypress:run -- --record", "test:ci:windows": "bin-up cypress run", "test:ci:windows:record": "bin-up cypress run --record --group dynamic-tests" } diff --git a/examples/fundamentals__fixtures/package.json b/examples/fundamentals__fixtures/package.json index e8c225859..335418bee 100644 --- a/examples/fundamentals__fixtures/package.json +++ b/examples/fundamentals__fixtures/package.json @@ -6,6 +6,7 @@ "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", "test:ci": "../../node_modules/.bin/cypress run", + "test:ci:record": "../../node_modules/.bin/cypress run --record", "test:ci:windows": "bin-up cypress run", "test:ci:windows:record": "bin-up cypress run --record --group fundamentals__fixtures" } diff --git a/examples/fundamentals__module-api/package.json b/examples/fundamentals__module-api/package.json index 3238259df..cf4d6a3db 100644 --- a/examples/fundamentals__module-api/package.json +++ b/examples/fundamentals__module-api/package.json @@ -6,6 +6,7 @@ "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "node ./e2e-tests", "start": "echo nothing to start", - "test:ci": "node ./e2e-tests" + "test:ci": "node ./e2e-tests", + "test:ci:record": "node ./e2e-tests" } } diff --git a/examples/fundamentals__node-modules/package.json b/examples/fundamentals__node-modules/package.json index e4e8fad06..247bd11f9 100644 --- a/examples/fundamentals__node-modules/package.json +++ b/examples/fundamentals__node-modules/package.json @@ -6,6 +6,7 @@ "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", "test:ci": "../../node_modules/.bin/cypress run", + "test:ci:record": "../../node_modules/.bin/cypress run --record", "test:ci:windows": "bin-up cypress run", "test:ci:windows:record": "bin-up cypress run --record --group fundamentals__node_modules" } diff --git a/examples/logging-in__csrf-tokens/package.json b/examples/logging-in__csrf-tokens/package.json index f41d907e0..a88b58bc9 100644 --- a/examples/logging-in__csrf-tokens/package.json +++ b/examples/logging-in__csrf-tokens/package.json @@ -5,8 +5,10 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", + "cypress:run:record": "../../node_modules/.bin/cypress run --record", "dev": "../../node_modules/.bin/start-test 7076 cypress:open", "start": "node server.js --port 7076", - "test:ci": "../../node_modules/.bin/start-test 7076 cypress:run" + "test:ci": "../../node_modules/.bin/start-test 7076 cypress:run", + "test:ci:record": "../../node_modules/.bin/start-test 7076 cypress:run:record" } } diff --git a/examples/logging-in__html-web-forms/package.json b/examples/logging-in__html-web-forms/package.json index 3dc729379..d1be72165 100644 --- a/examples/logging-in__html-web-forms/package.json +++ b/examples/logging-in__html-web-forms/package.json @@ -7,10 +7,12 @@ "cypress:run": "../../node_modules/.bin/cypress run", "cypress:run:chrome": "../../node_modules/.bin/cypress run --browser chrome", "cypress:run:firefox": "../../node_modules/.bin/cypress run --browser firefox", + "cypress:run:record": "../../node_modules/.bin/cypress run --record", "dev": "../../node_modules/.bin/start-test 7077 cypress:open", "start": "node server.js --port 7077", "test:ci": "../../node_modules/.bin/start-test 7077 cypress:run", "test:ci:chrome": "../../node_modules/.bin/start-test 7077 cypress:run:chrome", - "test:ci:firefox": "../../node_modules/.bin/start-test 7077 cypress:run:firefox" + "test:ci:firefox": "../../node_modules/.bin/start-test 7077 cypress:run:firefox", + "test:ci:record": "../../node_modules/.bin/start-test 7077 cypress:run:record" } } diff --git a/examples/logging-in__jwt/package.json b/examples/logging-in__jwt/package.json index d70157169..1fa834160 100644 --- a/examples/logging-in__jwt/package.json +++ b/examples/logging-in__jwt/package.json @@ -5,10 +5,12 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", + "cypress:run:record": "../../node_modules/.bin/cypress run --record", "dev": "../../node_modules/.bin/start-test 8081 cypress:open", "start": "../../node_modules/.bin/run-p start:server start:app", "start:app": "../../node_modules/.bin/webpack-dev-server --port 8081", "start:server": "node server", - "test:ci": "../../node_modules/.bin/start-test 8081 cypress:run" + "test:ci": "../../node_modules/.bin/start-test 8081 cypress:run", + "test:ci:record": "../../node_modules/.bin/start-test 8081 cypress:run:record" } } diff --git a/examples/logging-in__single-sign-on/package.json b/examples/logging-in__single-sign-on/package.json index 44173364a..4bf7f733a 100644 --- a/examples/logging-in__single-sign-on/package.json +++ b/examples/logging-in__single-sign-on/package.json @@ -7,10 +7,12 @@ "cypress:run": "../../node_modules/.bin/cypress run", "cypress:run:chrome": "../../node_modules/.bin/cypress run --browser chrome", "cypress:run:firefox": "../../node_modules/.bin/cypress run --browser firefox", + "cypress:run:record": "../../node_modules/.bin/cypress run --record", "dev": "../../node_modules/.bin/start-test 7074 cypress:open", "start": "node app_server.js --port 7074 & node auth_server.js --port 7075", "test:ci": "../../node_modules/.bin/start-test 7074 cypress:run", "test:ci:chrome": "../../node_modules/.bin/start-test 7074 cypress:run:chrome", - "test:ci:firefox": "../../node_modules/.bin/start-test 7074 cypress:run:firefox" + "test:ci:firefox": "../../node_modules/.bin/start-test 7074 cypress:run:firefox", + "test:ci:record": "../../node_modules/.bin/start-test 7074 cypress:run:record" } } diff --git a/examples/logging-in__using-app-code/package.json b/examples/logging-in__using-app-code/package.json index d70157169..1fa834160 100644 --- a/examples/logging-in__using-app-code/package.json +++ b/examples/logging-in__using-app-code/package.json @@ -5,10 +5,12 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", + "cypress:run:record": "../../node_modules/.bin/cypress run --record", "dev": "../../node_modules/.bin/start-test 8081 cypress:open", "start": "../../node_modules/.bin/run-p start:server start:app", "start:app": "../../node_modules/.bin/webpack-dev-server --port 8081", "start:server": "node server", - "test:ci": "../../node_modules/.bin/start-test 8081 cypress:run" + "test:ci": "../../node_modules/.bin/start-test 8081 cypress:run", + "test:ci:record": "../../node_modules/.bin/start-test 8081 cypress:run:record" } } diff --git a/examples/logging-in__xhr-web-forms/package.json b/examples/logging-in__xhr-web-forms/package.json index 5fac7493c..50f4fa85a 100644 --- a/examples/logging-in__xhr-web-forms/package.json +++ b/examples/logging-in__xhr-web-forms/package.json @@ -5,8 +5,10 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", + "cypress:run:record": "../../node_modules/.bin/cypress run --record", "dev": "../../node_modules/.bin/start-test 7079 cypress:open", "start": "node server.js --port 7079", - "test:ci": "../../node_modules/.bin/start-test 7079 cypress:run" + "test:ci": "../../node_modules/.bin/start-test 7079 cypress:run", + "test:ci:record": "../../node_modules/.bin/start-test 7079 cypress:run:record" } } diff --git a/examples/preprocessors__grep/package.json b/examples/preprocessors__grep/package.json index 086f6f06e..2519067e7 100644 --- a/examples/preprocessors__grep/package.json +++ b/examples/preprocessors__grep/package.json @@ -6,6 +6,7 @@ "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", "start": "echo", - "test:ci": "../../node_modules/.bin/cypress run" + "test:ci": "../../node_modules/.bin/cypress run", + "test:ci:record": "../../node_modules/.bin/cypress run --record" } } diff --git a/examples/preprocessors__typescript-browserify/package.json b/examples/preprocessors__typescript-browserify/package.json index 6de28906b..9d0ad3885 100644 --- a/examples/preprocessors__typescript-browserify/package.json +++ b/examples/preprocessors__typescript-browserify/package.json @@ -6,6 +6,7 @@ "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", "start": "echo", - "test:ci": "../../node_modules/.bin/cypress run" + "test:ci": "../../node_modules/.bin/cypress run", + "test:ci:record": "../../node_modules/.bin/cypress run --record" } } diff --git a/examples/preprocessors__typescript-webpack/package.json b/examples/preprocessors__typescript-webpack/package.json index 4a4011232..aeaf22b28 100644 --- a/examples/preprocessors__typescript-webpack/package.json +++ b/examples/preprocessors__typescript-webpack/package.json @@ -10,6 +10,7 @@ "lint": "../../node_modules/.bin/tslint --project ./tsconfig.json", "postlint": "npm run tsc", "test:ci": "../../node_modules/.bin/cypress run", + "test:ci:record": "../../node_modules/.bin/cypress run --record", "tsc": "../../node_modules/.bin/tsc --pretty --noEmit" } } diff --git a/examples/server-communication__bootstrapping-your-app/package.json b/examples/server-communication__bootstrapping-your-app/package.json index 99174369e..1395a5c46 100644 --- a/examples/server-communication__bootstrapping-your-app/package.json +++ b/examples/server-communication__bootstrapping-your-app/package.json @@ -5,8 +5,10 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", + "cypress:run:record": "../../node_modules/.bin/cypress run --record", "dev": "../../node_modules/.bin/start-test http://localhost:7070/bootstrap.html cypress:open", "start": "node server.js --port 7070", - "test:ci": "../../node_modules/.bin/start-test http://localhost:7070/bootstrap.html cypress:run" + "test:ci": "../../node_modules/.bin/start-test http://localhost:7070/bootstrap.html cypress:run", + "test:ci:record": "../../node_modules/.bin/start-test http://localhost:7070/bootstrap.html cypress:run:record" } } diff --git a/examples/server-communication__env-variables/package.json b/examples/server-communication__env-variables/package.json index 43e97edcb..3674ffafb 100644 --- a/examples/server-communication__env-variables/package.json +++ b/examples/server-communication__env-variables/package.json @@ -5,6 +5,7 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cross-env FOO=42 BAR=baz CYPRESS_ping=123 CYPRESS_HOST=laura.dev.local cypress_api_server=http://localhost:8888/api/v1/ ../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cross-env FOO=42 BAR=baz CYPRESS_ping=123 CYPRESS_HOST=laura.dev.local cypress_api_server=http://localhost:8888/api/v1/ ../../node_modules/.bin/cypress run", - "test:ci": "npm run cypress:run" + "test:ci": "npm run cypress:run", + "test:ci:record": "npm run cypress:run -- --record" } } diff --git a/examples/server-communication__seeding-database-in-node/package.json b/examples/server-communication__seeding-database-in-node/package.json index 0c983a9ff..e0a361d89 100644 --- a/examples/server-communication__seeding-database-in-node/package.json +++ b/examples/server-communication__seeding-database-in-node/package.json @@ -5,7 +5,9 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", + "cypress:run:record": "../../node_modules/.bin/cypress run --record", "start": "node server/index.js --port 7082", - "test:ci": "../../node_modules/.bin/start-test 7082 cypress:run" + "test:ci": "../../node_modules/.bin/start-test 7082 cypress:run", + "test:ci:record": "../../node_modules/.bin/start-test 7082 cypress:run:record" } } diff --git a/examples/server-communication__xhr-assertions/package.json b/examples/server-communication__xhr-assertions/package.json index 7bef979f9..245657e1e 100644 --- a/examples/server-communication__xhr-assertions/package.json +++ b/examples/server-communication__xhr-assertions/package.json @@ -9,6 +9,7 @@ "cypress:run:firefox": "../../node_modules/.bin/cypress run --browser firefox", "test:ci": "npm run cypress:run", "test:ci:chrome": "npm run cypress:run:chrome", - "test:ci:firefox": "npm run cypress:run:firefox" + "test:ci:firefox": "npm run cypress:run:firefox", + "test:ci:record": "npm run cypress:run --record" } } diff --git a/examples/stubbing-spying__console/package.json b/examples/stubbing-spying__console/package.json index 630fd57d3..6feee48c8 100644 --- a/examples/stubbing-spying__console/package.json +++ b/examples/stubbing-spying__console/package.json @@ -10,6 +10,7 @@ "start": "echo", "test:ci": "npm run cypress:run", "test:ci:chrome": "npm run cypress:run:chrome", - "test:ci:firefox": "npm run cypress:run:firefox" + "test:ci:firefox": "npm run cypress:run:firefox", + "test:ci:record": "npm run cypress:run -- --record" } } diff --git a/examples/stubbing-spying__functions/package.json b/examples/stubbing-spying__functions/package.json index 3050b8f06..71a138519 100644 --- a/examples/stubbing-spying__functions/package.json +++ b/examples/stubbing-spying__functions/package.json @@ -6,6 +6,7 @@ "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", "start": "echo nothing to start, this recipe does not run server", - "test:ci": "npm run cypress:run" + "test:ci": "npm run cypress:run", + "test:ci:record": "npm run cypress:run --record" } } diff --git a/examples/stubbing-spying__google-analytics/package.json b/examples/stubbing-spying__google-analytics/package.json index 3c2e064d2..3b5848f63 100644 --- a/examples/stubbing-spying__google-analytics/package.json +++ b/examples/stubbing-spying__google-analytics/package.json @@ -6,6 +6,7 @@ "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", "start": "echo", - "test:ci": "npm run cypress:run" + "test:ci": "npm run cypress:run", + "test:ci:record": "npm run cypress:run --record" } } diff --git a/examples/stubbing-spying__navigator/package.json b/examples/stubbing-spying__navigator/package.json index b2bd83324..11e2315d0 100644 --- a/examples/stubbing-spying__navigator/package.json +++ b/examples/stubbing-spying__navigator/package.json @@ -5,6 +5,7 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", - "test:ci": "npm run cypress:run" + "test:ci": "npm run cypress:run", + "test:ci:record": "npm run cypress:run --record" } -} \ No newline at end of file +} diff --git a/examples/stubbing-spying__window-fetch/package.json b/examples/stubbing-spying__window-fetch/package.json index 57844d1db..0e545491b 100644 --- a/examples/stubbing-spying__window-fetch/package.json +++ b/examples/stubbing-spying__window-fetch/package.json @@ -5,8 +5,10 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", + "cypress:run:record": "../../node_modules/.bin/cypress run --record", "dev": "../../node_modules/.bin/start-test 7080 cypress:open", "start": "node server.js --port 7080", - "test:ci": "../../node_modules/.bin/start-test 7080 cypress:run" + "test:ci": "../../node_modules/.bin/start-test 7080 cypress:run", + "test:ci:record": "../../node_modules/.bin/start-test 7080 cypress:run:record" } } diff --git a/examples/stubbing-spying__window-print/package.json b/examples/stubbing-spying__window-print/package.json index 3823398d6..6cefee7c6 100644 --- a/examples/stubbing-spying__window-print/package.json +++ b/examples/stubbing-spying__window-print/package.json @@ -5,6 +5,7 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", - "test:ci": "npm run cypress:run" + "test:ci": "npm run cypress:run", + "test:ci:record": "npm run cypress:run -- --record" } } diff --git a/examples/stubbing-spying__window/package.json b/examples/stubbing-spying__window/package.json index 2c18a0b9f..ae4e589ee 100644 --- a/examples/stubbing-spying__window/package.json +++ b/examples/stubbing-spying__window/package.json @@ -6,6 +6,7 @@ "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", "start": "echo", - "test:ci": "npm run cypress:run" + "test:ci": "npm run cypress:run", + "test:ci:record": "npm run cypress:run -- --record" } } diff --git a/examples/stubbing__resources/package.json b/examples/stubbing__resources/package.json index 5c439f4c4..62cf563f7 100644 --- a/examples/stubbing__resources/package.json +++ b/examples/stubbing__resources/package.json @@ -5,6 +5,7 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", - "test:ci": "npm run cypress:run" + "test:ci": "npm run cypress:run", + "test:ci:record": "npm run cypress:run -- --record" } } diff --git a/examples/testing-dom__csv-table/package.json b/examples/testing-dom__csv-table/package.json index 904dee64f..f4efe58ea 100644 --- a/examples/testing-dom__csv-table/package.json +++ b/examples/testing-dom__csv-table/package.json @@ -6,6 +6,7 @@ "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", "start": "echo nothing to start", - "test:ci": "npm run cypress:run" + "test:ci": "npm run cypress:run", + "test:ci:record": "npm run cypress:run -- --record" } -} \ No newline at end of file +} diff --git a/examples/testing-dom__drag-drop/package.json b/examples/testing-dom__drag-drop/package.json index 797f1b2e5..d988565d5 100644 --- a/examples/testing-dom__drag-drop/package.json +++ b/examples/testing-dom__drag-drop/package.json @@ -6,9 +6,11 @@ "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", "cypress:run:firefox": "../../node_modules/.bin/cypress run --browser firefox", + "cypress:run:record": "../../node_modules/.bin/cypress run --record", "dev": "../../node_modules/.bin/start-test http://localhost:7071/puzzle.html cypress:open", "start": "node server.js --port 7071", "test:ci": "../../node_modules/.bin/start-test http://localhost:7071/puzzle.html cypress:run", - "test:ci:firefox": "../../node_modules/.bin/start-test http://localhost:7071/puzzle.html cypress:run:firefox" + "test:ci:firefox": "../../node_modules/.bin/start-test http://localhost:7071/puzzle.html cypress:run:firefox", + "test:ci:record": "../../node_modules/.bin/start-test http://localhost:7071/puzzle.html cypress:run:record" } } diff --git a/examples/testing-dom__form-interactions/package.json b/examples/testing-dom__form-interactions/package.json index cfb4a9894..5988a2a8c 100644 --- a/examples/testing-dom__form-interactions/package.json +++ b/examples/testing-dom__form-interactions/package.json @@ -6,9 +6,11 @@ "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", "cypress:run:firefox": "../../node_modules/.bin/cypress run --browser firefox", + "cypress:run:record": "../../node_modules/.bin/cypress run --record", "dev": "../../node_modules/.bin/start-test 7072 cypress:open", "start": "node server.js --port 7072", "test:ci": "../../node_modules/.bin/start-test 7072 cypress:run", - "test:ci:firefox": "../../node_modules/.bin/start-test 7072 cypress:run:firefox" + "test:ci:firefox": "../../node_modules/.bin/start-test 7072 cypress:run:firefox", + "test:ci:record": "../../node_modules/.bin/start-test 7072 cypress:run:record" } } diff --git a/examples/testing-dom__hover-hidden-elements/package.json b/examples/testing-dom__hover-hidden-elements/package.json index dd4d176a5..c9f4064f1 100644 --- a/examples/testing-dom__hover-hidden-elements/package.json +++ b/examples/testing-dom__hover-hidden-elements/package.json @@ -7,10 +7,12 @@ "cypress:run": "../../node_modules/.bin/cypress run", "cypress:run:chrome": "../../node_modules/.bin/cypress run --browser chrome", "cypress:run:firefox": "../../node_modules/.bin/cypress run --browser firefox", + "cypress:run:record": "../../node_modules/.bin/cypress run --record", "dev": "../../node_modules/.bin/start-test 7073 cypress:open", "start": "node server.js --port 7073", "test:ci": "../../node_modules/.bin/start-test 7073 cypress:run", "test:ci:chrome": "../../node_modules/.bin/start-test 7073 cypress:run:chrome", - "test:ci:firefox": "../../node_modules/.bin/start-test 7073 cypress:run:firefox" + "test:ci:firefox": "../../node_modules/.bin/start-test 7073 cypress:run:firefox", + "test:ci:record": "../../node_modules/.bin/start-test 7073 cypress:run:record" } } diff --git a/examples/testing-dom__lit-element/package.json b/examples/testing-dom__lit-element/package.json index 6b91ba346..82b74372e 100644 --- a/examples/testing-dom__lit-element/package.json +++ b/examples/testing-dom__lit-element/package.json @@ -8,6 +8,7 @@ "start": "echo there is no web server to start in this project", "test:ci": "npm run cypress:run", "test:ci:firefox": "npm run cypress:run -- --browser firefox", + "test:ci:record": "npm run cypress:run -- --record", "test:ci:windows": "bin-up cypress run", "test:ci:windows:record": "bin-up cypress run --record --group unit-test-lit-element" } diff --git a/examples/testing-dom__root-style/package.json b/examples/testing-dom__root-style/package.json index dc2cc4f39..2c4a7ecb4 100644 --- a/examples/testing-dom__root-style/package.json +++ b/examples/testing-dom__root-style/package.json @@ -5,6 +5,7 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", - "test:ci": "npm run cypress:run" + "test:ci": "npm run cypress:run", + "test:ci:record": "npm run cypress:run -- --record" } } diff --git a/examples/testing-dom__select2/cypress/integration/spec.js b/examples/testing-dom__select2/cypress/integration/spec.js index fbc62f9a1..04c2f7953 100644 --- a/examples/testing-dom__select2/cypress/integration/spec.js +++ b/examples/testing-dom__select2/cypress/integration/spec.js @@ -212,7 +212,7 @@ describe('select2', () => { // before trying to find a specific item cy.get('.select2-results__option').should('have.length.gt', 3) // and now we can find the user among the results - .contains('Leanne Graham').click() + cy.contains('.select2-results__option', 'Leanne Graham').click() // confirm the right user is found cy.get('#user').should('have.value', '1') diff --git a/examples/testing-dom__select2/package.json b/examples/testing-dom__select2/package.json index 33157a9d8..372d24698 100644 --- a/examples/testing-dom__select2/package.json +++ b/examples/testing-dom__select2/package.json @@ -5,6 +5,7 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", - "test:ci": "npm run cypress:run" + "test:ci": "npm run cypress:run", + "test:ci:record": "npm run cypress:run -- --record" } } diff --git a/examples/testing-dom__tab-handling-links/package.json b/examples/testing-dom__tab-handling-links/package.json index eea3f8a99..3e14b41ae 100644 --- a/examples/testing-dom__tab-handling-links/package.json +++ b/examples/testing-dom__tab-handling-links/package.json @@ -1,12 +1,14 @@ { - "name": "tab-handling-anchor-links", + "name": "testing-dom__tab-handling-links", "version": "1.0.0", "description": "", "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", + "cypress:run:record": "../../node_modules/.bin/cypress run --record", "dev": "../../node_modules/.bin/start-test 7078 cypress:open", "start": "node server.js --port 7078", - "test:ci": "../../node_modules/.bin/start-test 7078 cypress:run" + "test:ci": "../../node_modules/.bin/start-test 7078 cypress:run", + "test:ci:record": "../../node_modules/.bin/start-test 7078 cypress:run:record" } } diff --git a/examples/testing-dom__wait-for-resource/package.json b/examples/testing-dom__wait-for-resource/package.json index f03deaf6a..d13ec2e17 100644 --- a/examples/testing-dom__wait-for-resource/package.json +++ b/examples/testing-dom__wait-for-resource/package.json @@ -7,10 +7,12 @@ "cypress:run": "../../node_modules/.bin/cypress run", "cypress:run:chrome": "../../node_modules/.bin/cypress run --browser chrome", "cypress:run:firefox": "../../node_modules/.bin/cypress run --browser firefox", + "cypress:run:record": "../../node_modules/.bin/cypress run --record", "dev": "../../node_modules/.bin/start-test 4500 cypress:open", "start": "../../node_modules/.bin/http-server -c-1 -p 4500 public", "test:ci": "../../node_modules/.bin/start-test 4500 cypress:run", "test:ci:chrome": "../../node_modules/.bin/start-test 4500 cypress:run:chrome", - "test:ci:firefox": "../../node_modules/.bin/start-test 4500 cypress:run:firefox" + "test:ci:firefox": "../../node_modules/.bin/start-test 4500 cypress:run:firefox", + "test:ci:record": "../../node_modules/.bin/start-test 4500 cypress:run:record" } } diff --git a/examples/unit-testing__application-code/package.json b/examples/unit-testing__application-code/package.json index d1633c031..2afd4e28e 100644 --- a/examples/unit-testing__application-code/package.json +++ b/examples/unit-testing__application-code/package.json @@ -8,6 +8,7 @@ "start": "echo there is no web server to start in this project", "test:ci": "npm run cypress:run", "test:ci:firefox": "npm run cypress:run -- --browser firefox", + "test:ci:record": "npm run cypress:run -- --record", "test:ci:windows": "bin-up cypress run", "test:ci:windows:record": "bin-up cypress run --record --group unit-test-application-code" } diff --git a/examples/unit-testing__react-apollo/package.json b/examples/unit-testing__react-apollo/package.json index 84d080c4e..0b24b8718 100644 --- a/examples/unit-testing__react-apollo/package.json +++ b/examples/unit-testing__react-apollo/package.json @@ -8,6 +8,7 @@ "start": "echo nothing to start, unit testing example", "test:ci": "npm run cypress:run", "test:ci:firefox": "npm run cypress:run -- --browser firefox", + "test:ci:record": "npm run cypress:run -- record", "test:ci:windows": "bin-up cypress run", "test:ci:windows:record": "bin-up cypress run --record --group unit-testing__react-apollo" } diff --git a/examples/unit-testing__react-skeleton/package.json b/examples/unit-testing__react-skeleton/package.json index 6065830d0..825cf6c04 100644 --- a/examples/unit-testing__react-skeleton/package.json +++ b/examples/unit-testing__react-skeleton/package.json @@ -5,9 +5,11 @@ "scripts": { "cypress:open": "../../node_modules/.bin/cypress open", "cypress:run": "../../node_modules/.bin/cypress run", + "cypress:run:record": "../../node_modules/.bin/cypress run --record", "start": "echo nothing to start, unit testing example", "test:ci": "npm run cypress:run", "test:ci:firefox": "npm run cypress:run -- --browser firefox", + "test:ci:record": "npm run cypress:run:record", "test:ci:windows": "bin-up cypress run", "test:ci:windows:record": "bin-up cypress run --record --group unit-testing__react-skeleton" } diff --git a/examples/unit-testing__react/package.json b/examples/unit-testing__react/package.json index 2468a4384..e34c30373 100644 --- a/examples/unit-testing__react/package.json +++ b/examples/unit-testing__react/package.json @@ -8,6 +8,7 @@ "start": "echo nothing to start, unit testing example", "test:ci": "npm run cypress:run", "test:ci:firefox": "npm run cypress:run -- --browser firefox", + "test:ci:record": "npm run cypress:run -- --record", "test:ci:windows": "bin-up cypress run", "test:ci:windows:record": "bin-up cypress run --record --group unit-testing__react" } diff --git a/test-examples.js b/test-examples.js index ddcaa9d48..00b8dee51 100644 --- a/test-examples.js +++ b/test-examples.js @@ -13,6 +13,7 @@ const fs = require('fs') const arg = require('arg') const la = require('lazy-ass') const is = require('check-more-types') +const debug = require('debug')('cypress-example-recipes') // to run "npm run test:ci:chrome" scripts in each example // run this script with "--chrome" CLI flag @@ -78,6 +79,17 @@ const printFolders = (folders) => { folders.forEach((name) => console.log(' -', name)) } +const debugPrintFolders = (folders) => { + if (debug.enabled) { + console.error( + 'Will be running tests in %s', + pluralize('folder', folders.length, true) + ) + } + + folders.forEach((name) => console.error(' -', name)) +} + const hasPackageScriptName = (folder) => { const filename = resolve(join(folder, 'package.json')) @@ -113,6 +125,9 @@ const testExample = (folder) => { } const npmArgs = ['run', scriptName] + + console.log('npm arguments: %s', npmArgs.join(' ')) + const npmOptions = { stdio: 'inherit', cwd: folder } return execa('npm', npmArgs, npmOptions) @@ -185,6 +200,7 @@ bluebird .then((list) => list.sort()) .then(filterByScriptName) .then(filterSomeFolders) +.tap(debugPrintFolders) .then(filterByChunk(args['--chunk'], args['--total-chunks'])) .tap(printFolders) .then(testExamples)