Skip to content
This repository has been archived by the owner on Sep 20, 2019. It is now read-only.

Commit

Permalink
Setup e2e tests with Nightwatch and test Error404
Browse files Browse the repository at this point in the history
  • Loading branch information
mehcode committed Aug 23, 2019
1 parent ee74d78 commit 2d50b8a
Show file tree
Hide file tree
Showing 6 changed files with 332 additions and 208 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ yarn-error.log*

# Firebase
.firebase/

# Nightwatch
tests/e2e/reports
selenium*.log
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test:

script:
- yarn lint
- yarn test
- yarn test:unit
- yarn build

only:
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"lint:css": "stylelint --fix 'src/**/*.vue' 'src/**/*.css'",
"test": "npm-run-all test:unit",
"test:unit": "vue-cli-service test:unit",
"test:e2e": "vue-cli-service test:e2e",
"firebase:deploy": "firebase deploy",
"deploy": "npm-run-all test build firebase:deploy"
},
Expand Down Expand Up @@ -38,7 +39,7 @@
"@types/ua-parser-js": "^0.7.33",
"@types/zxcvbn": "^4.4.0",
"@vue/cli-plugin-babel": "^4.0.0-beta.3",
"@vue/cli-plugin-e2e-nightwatch": "^4.0.0-rc.0",
"@vue/cli-plugin-e2e-nightwatch": "^3.11.0",
"@vue/cli-plugin-eslint": "^4.0.0-beta.3",
"@vue/cli-plugin-typescript": "^4.0.0-beta.3",
"@vue/cli-plugin-unit-jest": "^4.0.0-beta.3",
Expand Down
Empty file.
7 changes: 2 additions & 5 deletions tests/e2e/specs/Error404.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
module.exports = {
"renders 404 when navigating to an unknown route"(browser) {
"renders 404 when navigating to an unknown route": browser => {
browser
.url(
`${process.env.VUE_DEV_SERVER_URL}/not-a-real-path-in-this-app`
)
.url(`${process.env.VUE_DEV_SERVER_URL}not-a-real-path-in-the-app`)
.waitForElementVisible(".error-404", 5000)
.assert.elementPresent(".hello")
.assert.containsText(".error-code", "404")
.end();
}
Expand Down
Loading

0 comments on commit 2d50b8a

Please sign in to comment.