The video for this lesson is currently being updated, please read the transcript instead.

Page commands

Looking at our "add item to cart" test, we haven't even finished all the steps yet and it's already quite long.

Another way we can abstract implementation details in Nightwatch is via a page command. This is where we encapsulate logic for some multi-step process into a single command.

For example, say you had a search bar on your page. To enter a search you'd have to tell the browser to find the input, set it's value and click the search button.

To view the complete lesson you'll need to login or join this course.


Click to load comments...