adds script to run cypress tests
This commit is contained in:
parent
40dfde522b
commit
d0178ed6b5
|
@ -5,4 +5,5 @@ package-lock.json
|
||||||
yarn.lock
|
yarn.lock
|
||||||
release/
|
release/
|
||||||
dist/
|
dist/
|
||||||
|
cypress/screenshots
|
||||||
routify
|
routify
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
// What this script does:
|
||||||
|
// 1. Removes the old test folder if it exists (.budibase-cypress)
|
||||||
|
// 2. Initialises using `.budibase-cypress`
|
||||||
|
// 3. Runs the server using said folder
|
||||||
|
|
||||||
|
const rimraf = require("rimraf");
|
||||||
|
const homedir = require('os').homedir() + '/.budibase-cypress';
|
||||||
|
const { exec } = require("child_process")
|
||||||
|
|
||||||
|
rimraf(homedir, function (error) {
|
||||||
|
console.log('Error: ', error);
|
||||||
|
})
|
||||||
|
|
||||||
|
exec(`../../packages/cli/bin/budi init -d ${homedir}`)
|
||||||
|
exec(`../../packages/cli/bin/budi run -d ${homedir}`)
|
|
@ -10,10 +10,10 @@
|
||||||
"test:watch": "jest --watchAll",
|
"test:watch": "jest --watchAll",
|
||||||
"dev:builder": "routify --routify-dir routify -c rollup",
|
"dev:builder": "routify --routify-dir routify -c rollup",
|
||||||
"rollup": "rollup -c -w",
|
"rollup": "rollup -c -w",
|
||||||
"cy:setup": "rm -rf node ~/.budibase-cypress && ../cli/bin/budi init -d ~/.budibase-cypress && node ../cli/bin/budi run -d ~/.budibase-cypress",
|
"cy:setup": "node ./cypress/setup.js",
|
||||||
"cy:run": "cypress run",
|
"cy:run": "cypress run",
|
||||||
"cy:open": "cypress open",
|
"cy:open": "cypress open",
|
||||||
"cy:test": "start-server-and-test cy:setup http://localhost:4001/_builder cy:open"
|
"cy:test": "start-server-and-test cy:setup http://localhost:4001/_builder cy:run"
|
||||||
},
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
"globals": {
|
"globals": {
|
||||||
|
@ -76,6 +76,7 @@
|
||||||
"jest": "^24.8.0",
|
"jest": "^24.8.0",
|
||||||
"ncp": "^2.0.0",
|
"ncp": "^2.0.0",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
|
"rimraf": "^3.0.2",
|
||||||
"rollup": "^1.12.0",
|
"rollup": "^1.12.0",
|
||||||
"rollup-plugin-alias": "^1.5.2",
|
"rollup-plugin-alias": "^1.5.2",
|
||||||
"rollup-plugin-browsersync": "^1.0.0",
|
"rollup-plugin-browsersync": "^1.0.0",
|
||||||
|
|
Loading…
Reference in New Issue