adds script to run cypress tests

This commit is contained in:
kevmodrome 2020-06-11 17:59:11 +02:00
parent f5e3df09d6
commit 59442f18cb
3 changed files with 19 additions and 2 deletions

View File

@ -5,4 +5,5 @@ package-lock.json
yarn.lock
release/
dist/
cypress/screenshots
routify

View File

@ -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}`)

View File

@ -10,10 +10,10 @@
"test:watch": "jest --watchAll",
"dev:builder": "routify --routify-dir routify -c rollup",
"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: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": {
"globals": {
@ -76,6 +76,7 @@
"jest": "^24.8.0",
"ncp": "^2.0.0",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.2",
"rollup": "^1.12.0",
"rollup-plugin-alias": "^1.5.2",
"rollup-plugin-browsersync": "^1.0.0",