Of cause I can use selenium-standalone with xpath to test an app. But testing SPA could be challenging sometime.
But, for example angularjs's team provides protractor for this purpose.
The reason behind protractor as I can see is that protractor waits till angularjs will be loaded and few more features:
Protractor provides some new locator strategies and functions which are very helpful to automate the AngularJS application. Examples include things like: waitForAngular, By.binding, By.repeater, By.textarea, By.model, WebElement.all, WebElement.evaluate, etc.
So, the question is: Is it any tool or best practice for e2e testing in Vuejs?
UPD: feel free to post links to tutorials, example and everything cool about e2e-testing in vue.js. Thanks.
End-to-end tests do not import any of your Vue application's code, but instead rely completely on testing your application by navigating through entire pages in a real browser. End-to-end tests validate many of the layers in your application.
1. Component Testing with Vue Test Utils & Jest. Jest is a well-liked JavaScript testing framework that comes packed with many goodies for developers focusing on simplicity. It's one of the fastest testing frameworks for Vue single-file components.
End-to-end testing, also known as E2E testing, is a methodology used for ensuring that applications behave as expected and that the flow of data is maintained for all kinds of user tasks and processes. This type of testing approach starts from the end user's perspective and simulates a real-world scenario.
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:
See the simple tutorial here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With