What is a proper way of end-to-end (e2e) testing in Vue.js What is a proper way of end-to-end (e2e) testing in Vue.js selenium selenium

What is a proper way of end-to-end (e2e) testing in Vue.js


The tool you are thinking about is Nightwatch.With this, you can do E2E testing with Vue.js.

Even better, this is bundled by default when you are using vue-cli, ready to run.

The command line to create a project with Nightwatch activated by default is vue init webpack myProjectName.

Here are small tutorials about it.

EDIT: Lately I used Webdriver.io a lot, and I must say I prefer it to Nightwatch (better documentation, reactive community with a live gitter, issues that are treated in a timely fashion, etc.)


I recommend to use https://devexpress.github.io/testcafe.

Pros:

  • easy install
  • complete test harness
  • javascript ES2016 with (async/await)
  • flexible selector system
  • smart assertions with retry policy
  • reports

See the simple tutorial here


I recommend Cypress.

  • single NPM dependency
  • video recording right out of the box
  • GUI that shows every step of the test.

Our docs are great: https://on.cypress.io/intro

For Vue specifically see this tutorial: https://vuejsdevelopers.com/2018/01/29/vue-js-e2e-test-hacker-news/ and if you want to do unit testing of Vue components https://github.com/bahmutov/cypress-vue-unit-test

Happy testing.