From 212ba99abddb3a7f3f7669e11f9e2a4cfb3204f2 Mon Sep 17 00:00:00 2001 From: Paul Hammant Date: Mon, 17 Apr 2023 19:39:31 +0100 Subject: [PATCH] add nightwatch tests --- .gitignore | 2 + package.json | 6 +- src/App.vue | 3 +- tests/e2e/.eslintrc.js | 5 + tests/e2e/custom-assertions/nop.js | 1 + tests/e2e/custom-commands/nop.js | 0 tests/e2e/globals.js | 104 +++ tests/e2e/page-objects/nop.js | 0 tests/e2e/specs/test.js | 41 + yarn.lock | 1140 ++++++++++++++++++++++++++-- 10 files changed, 1229 insertions(+), 73 deletions(-) create mode 100644 tests/e2e/.eslintrc.js create mode 100644 tests/e2e/custom-assertions/nop.js create mode 100644 tests/e2e/custom-commands/nop.js create mode 100644 tests/e2e/globals.js create mode 100644 tests/e2e/page-objects/nop.js create mode 100644 tests/e2e/specs/test.js diff --git a/.gitignore b/.gitignore index 403adbc..dc8924c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ .DS_Store node_modules /dist +logs/ +tests/e2e/reports/ # local env files diff --git a/package.json b/package.json index 70b5832..fe94f48 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "serve": "vue-cli-service serve", "build": "vue-cli-service build", "test:unit": "vue-cli-service test:unit", + "test:e2e": "vue-cli-service test:e2e", "lint": "vue-cli-service lint" }, "dependencies": { @@ -16,7 +17,9 @@ "vuex": "^4.0.0-0" }, "devDependencies": { + "@babel/eslint-parser": "^7.21.0", "@vue/cli-plugin-babel": "~5.0.8", + "@vue/cli-plugin-e2e-nightwatch": "~5.0.0", "@vue/cli-plugin-eslint": "~5.0.8", "@vue/cli-plugin-router": "~5.0.8", "@vue/cli-plugin-unit-jest": "~5.0.8", @@ -24,9 +27,10 @@ "@vue/cli-service": "~5.0.8", "@vue/compiler-sfc": "^3.0.0", "@vue/test-utils": "^2.0.0-0", - "@babel/eslint-parser": "^7.21.0", + "chromedriver": "112", "eslint": "^8.38.0", "eslint-plugin-vue": "^9.11.0", + "geckodriver": "^3.0.1", "typescript": "~5.0.4", "vue-jest": "^5.0.0-0", "vue3-jest": "^27.0.0-alpha.1" diff --git a/src/App.vue b/src/App.vue index 3778c9d..c515097 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,8 +2,7 @@
Count: {{ count }}. Count is even.
Count: {{ count }}. Count is odd.
- -
PostID: {{ postId }}
+
PostID: {{ postId }}