L&D series: “Pay attention” to Nightwatch.js
Learning and Development chapter 3.
This is my first time to discuss related to JS. I found out about this a few months ago. Still a newbie in this sector. So, I’ll just share my experience to you.
Installation
$ npm init -y
$ npm install nightwatch geckodriver chromedriver
$ npm install nightwatch-custom-commands-assertions
$ npm install dotenv
Configuration
Please choose one of these file configurations. We can create .json or .js file.
When we’re doing $ npm init -y
, it will create package.json
file. Inside that file, change this script.
Then $ npm install
.
Scripting
Please make sure the folder structure is similar to this.
Let’s create our scenario inside tests/example
folder.
Next, create our page object inside pages
folder.
Run with $ npm run test -- -t @web
Result
Please watch me in my next Learning and Development chapter (an easy way to do this is to follow my Medium account). See ya — MperMperPisang
References :