Waltir
By: Waltir

Headless Tests in Nightwatch JS

Cover Image for Headless Tests in Nightwatch JS

The Nightwatch documentation unfortunately does not cover how to run your tests in a headless mode so I thought it would be worth writing a small post about it. For those of you that are not familiar with the term ‘headless’ it simply means running a automated browser window that does not physically appear anywhere on your machine.

giphy

To enable headless this headless mode you’ll want to add ”headless” to your ”chromeOptions” like so:

gist:waltir/c5ca2a9d68e0a4a07629592c8152916e

That’s all it takes to initiate a headless mode in Nightwatch. Hopefully this is able to help some of my fellow Nightwatch users out.

giphy

More Posts

Cover Image for Blocking Ad Traffic In Nightwatch JS
Blocking Ad Traffic In Nightwatch JS
Waltir
By: Waltir

Example showing how you can block unwanted ad traffic in your Nightwatch JS tests....

Cover Image for Blocking Ad Traffic In Cypress
Blocking Ad Traffic In Cypress
Waltir
By: Waltir

Example showing how you can block unwanted ad traffic in your Cypress tests....

Cover Image for Three Ways To Resize The Browser In Nightwatch
Three Ways To Resize The Browser In Nightwatch
Waltir
By: Waltir

Outlining the three different ways to resize the browser in Nightwatch JS with examples....

Cover Image for Happy Path VS Sad Path Testing
Happy Path VS Sad Path Testing
Waltir
By: Waltir

As a test engineer it is crucial that both happy path and sad path use cases have been considered and fully tested...