Skip to content

Commit

Permalink
Temporarily only leave a single Cypress tests and update CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
tecimovic committed Feb 3, 2022
1 parent 2183c7e commit 068b439
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ jobs:
- run: npm run build-spa
- run: npm run lint
- run: npm run test
- run: xvfb-run -a npm run test:e2e-ci
- run: xvfb-run -a npm run self-check
- run: npm run gen
- run: npm run genmatter
- run: npm run gendotdot
- run: xvfb-run -a npm run test:e2e-ci
- run: export GH_TOKEN=${{ secrets.GITHUB_TOKEN}} && npm run dist-linux
- run: xvfb-run -a dist/linux-unpacked/zap selfCheck
- name: Archive .rpm file
Expand Down
12 changes: 6 additions & 6 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"viewportWidth": 1080,
"viewportHeight": 920,
"video": false,
"testFiles": "**/*.spec.js",
"ignoreTestFiles": "**/*.test.js"
}
"viewportWidth": 1080,
"viewportHeight": 920,
"video": false,
"testFiles": "**/theme/theme.spec.js",
"ignoreTestFiles": ["**/*.test.js"]
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "commonjs",
"name": "zap",
"version": "2022.1.23",
"version": "2022.2.2",
"description": "Configuration tool for the Zigbee Cluster Library",
"productName": "zap",
"cordovaId": "",
Expand All @@ -25,8 +25,8 @@
"test:unit:coverage": "jest --coverage",
"test:unit:watch": "jest --watch",
"test:unit:watchAll": "jest --watchAll",
"test:e2e": "npm run zap-devserver | start-test \"quasar dev\" http-get://localhost:8080 \"cypress open\"",
"test:e2e-ci": "xvfb-run -a npm run zap-devserver | start-test \"quasar dev\" http-get://localhost:8080 \"cypress run\"",
"test:e2e": "node src-script/zap-uitest.js open",
"test:e2e-ci": "node src-script/zap-uitest.js run",
"postinstall": "electron-builder install-app-deps && husky install && npm rebuild canvas --update-binary",
"wpzap": "npm run build-spa && npm run build-backend && npm run dist-mac && npm run apack:mac",
"zap": "node src-script/zap-start.js --logToStdout --gen ./test/gen-template/zigbee/gen-templates.json",
Expand Down
54 changes: 54 additions & 0 deletions src-script/zap-uitest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env node
/**
*
* Copyright (c) 2020 Silicon Labs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

const scriptUtil = require('./script-util.js')

let cypressMode = 'run'

if (process.argv.length > 2) {
cypressMode = process.argv[2]
}

let returnCode = 0
let svr = scriptUtil.executeCmd(null, 'npm', ['run', 'zap-devserver'])

let cyp = scriptUtil.executeCmd(null, 'npx', [
'start-test',
'quasar dev',
'http-get://localhost:8080',
`cypress ${cypressMode}`,
])

cyp
.then(() => {
returnCode = 0
scriptUtil.executeCmd(null, 'npm', ['run', 'stop'])
})
.catch(() => {
returnCode = 1
scriptUtil.executeCmd(null, 'npm', ['run', 'stop'])
})

svr.then(() => {
if (returnCode == 0) {
console.log('😎 All done: Cypress tests passed and server shut down.')
} else {
console.log('⛔ Error: Cypress tests failed, server shut down.')
process.exit(returnCode)
}
})

0 comments on commit 068b439

Please sign in to comment.