Full-Stack Web Development with Vue.js and Node

(singke) #1
Testing an MEVN Application Chapter 9

rest of the Avengers unite
to battle their most powerful enemy yet -- the evil Thanos. On a
mission to collect all six
Infinity Stones, Thanos plans to use the artifacts to inflict his
twisted will on reality.')
.click('.input-group__selections')
.pause(1000)
.click('.list a ')
.setValue('input#genre', 'Fantasy/Science fiction film')
.click('#add_movie_btn')
.pause(1000)
.click('.swal-button--confirm')
.pause(1000)
.click('.headline:nth-child(1)')
.pause(1000)
.assert.containsText('#rate_movie', 'Rate this movie')
.click('#rate_movie')
.pause(1000)
.click('.vue-star-rating span:nth-child(3)')
.pause(1000)
.click('.swal-button--confirm')
.pause(1000)
.click('.swal-button--confirm')
.pause(1000)
.click('#logout_btn')
.end();
},
};

To run the e2e script, make sure that we have set up the correct command in


package.json:


...
"scripts": {
"dev": "webpack-dev-server --inline --progress --config
build/webpack.dev.conf.js",
"start": "nodemon server.js",
"unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js -
-single-run",
"e2e": "node test/e2e/runner.js",
"test": "npm run unit && npm run e2e",
"lint": "eslint --ext .js,.vue src test/unit test/e2e/specs",
"build": "node build/build.js",
"heroku-postbuild": "npm install --only=dev --no-shrinkwrap && npm run
build"
},
...
Free download pdf