From 90ee74efb63364b9778fc14efb07c6c7cb42de35 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 | 1 + package.json | 6 +- src/App.vue | 3 +- tests/e2e/.eslintrc.js | 5 + tests/e2e/custom-assertions/elementCount.js | 34 + tests/e2e/custom-commands/customExecute.js | 37 + tests/e2e/custom-commands/openHomepage.js | 23 + .../e2e/custom-commands/openHomepageClass.js | 24 + tests/e2e/globals.js | 104 ++ tests/e2e/page-objects/homepage.js | 52 + tests/e2e/specs/test.js | 19 + yarn.lock | 1140 ++++++++++++++++- 12 files changed, 1375 insertions(+), 73 deletions(-) create mode 100644 tests/e2e/.eslintrc.js create mode 100644 tests/e2e/custom-assertions/elementCount.js create mode 100644 tests/e2e/custom-commands/customExecute.js create mode 100644 tests/e2e/custom-commands/openHomepage.js create mode 100644 tests/e2e/custom-commands/openHomepageClass.js create mode 100644 tests/e2e/globals.js create mode 100644 tests/e2e/page-objects/homepage.js create mode 100644 tests/e2e/specs/test.js diff --git a/.gitignore b/.gitignore index 403adbc..fb3edfe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .DS_Store node_modules /dist +logs/ # 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 }}