How to do it...

Create a new folder for this recipe and create a new file inside it, named index.html.

This file will contain our Vue application and it is what we will test. Write the following in this file:

<!DOCTYPE html><html><head>  <title>Nightwatch tests</title>  <script src=""></script></head><body>  <div id="app">  </div>  <script>  </script></body></html>

As you can see, this is just the usual boilerplate for a small Vue application. Inside the <div>, put a header and a button; when we click on the button, the text Hello Nightwatch! will be displayed:

<div id="app">  <h2>Welcome to my test page</h2>  <button @click="show = true">Show</button>  <p v-show="show">Hello Nightwatch!</p></div>

Inside the script ...

Get Vue.js 2 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.