NightWatchJS Introduction
What is NightWatch.js?
According to their website, Nightwatch,.js is an integrated, easy to use End-To-End testing solution for web application and websites, written in Node.js.
- Key Point In Using NightWatchJs
- Clean Syntax – simplified but powerful. Javascript and Typescript are supported
- Test Runner – supports grouping of test suites and tags
- Cloud Testing support – integrate with Browerstack, SauceLabs or LambdaTest
- WebDriver Service – uses selenium or webdriver services
- Page Object Support – fluent and easy to work with page object models
- Continuous Integration – integrate with Jenkins, CircleCi, TeamCity and have Junit XML reporting
- Plugin API – flexible command and assertion framework
So basically guys, what I have written here, you will actually see that on the website itself. Will just add it here to have a more meatier content.
Miniminum requirements that you should know
- Should have node installed for you to able to run npm
- Should have editor installed (any that you like but I prefer vscode)
- Should have github account so that it will not be messy in case you will have changegs but can’t return to the previous change.
- Familiarity with package.json
Let’s Get Started (Yeah!)
Open up your vscode and display the terminal and type the npm init nightwatch
You can just hit enter with everything that the terminal asked you and you should see the package.json being created after you run this command.
Next will be setup so choose based on the screenshot given
This is only for local machine setup
Once everything is setup you should be able to see the following folders
These folder will be automatically created and give you an idea what kind of folder structure that you will be going to have or you can also have it on your way
Now we can try running some sample they have
Please check your browser, some of the sample require to have duckgo but you can just leave it as it is.
And you should be able to see the test_output or reports
So that’s it for this introduction and the next one will be learning how to modify the project.
See yah!
I like how you show up step by step, but do you mind explaining briefly on this test scenario? like what is the perpose of this automation test and what result do you expect to achieve?
(excuse me for my basic question level, I dont have much background but I am very interested to learn skills related to QA)