L&D series: “Pay attention” to Nightwatch.js

Ferawati Hartanti Pratiwi
Inside Bukalapak
Published in
2 min readJun 17, 2020
https://img.freepik.com/free-vector/owl-cartoon_119631-109.jpg?size=338&ext=jpg

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.

.json configuration
.js configuration

When we’re doing $ npm init -y , it will create package.json file. Inside that file, change this script.

Change echo “Error: no test specified” && exit 1

Then $ npm install .

Scripting

Please make sure the folder structure is similar to this.

Folder structure

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

https://nightwatchjs.org/img/banner.png

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 :

--

--

Ferawati Hartanti Pratiwi
Inside Bukalapak

Continuously striving to elevate QA standards with a quality-focused mindset