diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 04bb37e7e5..82cecb5f62 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -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 diff --git a/cypress.json b/cypress.json index 3463a86306..0e2f33593c 100644 --- a/cypress.json +++ b/cypress.json @@ -1,7 +1,7 @@ { - "viewportWidth": 1080, - "viewportHeight": 920, - "video": false, - "testFiles": "**/*.spec.js", - "ignoreTestFiles": "**/*.test.js" - } \ No newline at end of file + "viewportWidth": 1080, + "viewportHeight": 920, + "video": false, + "testFiles": "**/theme/theme.spec.js", + "ignoreTestFiles": ["**/*.test.js"] +} diff --git a/package.json b/package.json index 5ae03fc2f0..7a8541604c 100644 --- a/package.json +++ b/package.json @@ -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": "", @@ -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", diff --git a/src-script/zap-uitest.js b/src-script/zap-uitest.js new file mode 100755 index 0000000000..d6ce38dc6c --- /dev/null +++ b/src-script/zap-uitest.js @@ -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) + } +})