Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
206 views
in Technique[技术] by (71.8m points)

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

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.

question from:https://stackoverflow.com/questions/36684966/what-is-a-proper-way-of-end-to-end-e2e-testing-in-vue-js

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...