Skip to content
Snippets Groups Projects
Unverified Commit 7620a76c authored by Paul Rosenzweig's avatar Paul Rosenzweig Committed by GitHub
Browse files

Generate snapshots before running Cypress tests (#12301)

parent b320f4d2
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
/cypress /cypress
/deploy/artifacts/* /deploy/artifacts/*
/docs/uberdoc.html /docs/uberdoc.html
/frontend/test/snapshots/*
/lein-plugins/*/target /lein-plugins/*/target
/local/src /local/src
/local/src /local/src
......
...@@ -53,6 +53,9 @@ const init = async () => { ...@@ -53,6 +53,9 @@ const init = async () => {
console.log(chalk.bold("Starting backend")); console.log(chalk.bold("Starting backend"));
await BackendResource.start(server); await BackendResource.start(server);
console.log(chalk.bold("Generating snapshots"));
await generateSnapshots();
console.log(chalk.bold("Starting Cypress")); console.log(chalk.bold("Starting Cypress"));
const cypressProcess = spawn( const cypressProcess = spawn(
"yarn", "yarn",
...@@ -98,3 +101,22 @@ launch(); ...@@ -98,3 +101,22 @@ launch();
process.on("SIGTERM", cleanup); process.on("SIGTERM", cleanup);
process.on("SIGINT", cleanup); process.on("SIGINT", cleanup);
async function generateSnapshots() {
const cypressProcess = spawn(
"yarn",
[
"cypress",
"run",
"--config-file",
"frontend/test/cypress-snapshots.json",
"--config",
`baseUrl=${server.host}`,
],
{ stdio: "inherit" },
);
return new Promise((resolve, reject) => {
cypressProcess.on("exit", resolve);
});
}
This diff is collapsed.
This diff is collapsed.
...@@ -215,8 +215,7 @@ ...@@ -215,8 +215,7 @@
"ci-backend": "lein docstring-checker && lein bikeshed && lein eastwood && lein test", "ci-backend": "lein docstring-checker && lein bikeshed && lein eastwood && lein test",
"test-cypress": "yarn build && ./bin/build-for-test && yarn test-cypress-no-build", "test-cypress": "yarn build && ./bin/build-for-test && yarn test-cypress-no-build",
"test-cypress-open": "./bin/build-for-test && yarn test-cypress-no-build --open", "test-cypress-open": "./bin/build-for-test && yarn test-cypress-no-build --open",
"test-cypress-no-build": "yarn && CONFIG_FILE=frontend/test/cypress.json babel-node ./frontend/test/__runner__/run_cypress_tests.js", "test-cypress-no-build": "yarn && CONFIG_FILE=frontend/test/cypress.json babel-node ./frontend/test/__runner__/run_cypress_tests.js"
"create-cypress-snapshots": "yarn && CONFIG_FILE=frontend/test/cypress-snapshots.json babel-node ./frontend/test/__runner__/run_cypress_tests.js"
}, },
"lint-staged": { "lint-staged": {
"frontend/**/*.{js,jsx,css}": [ "frontend/**/*.{js,jsx,css}": [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment