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.
Click to load comments...