AssertionsAssertion - is a way of verification. We can verify that data exist on the page, url is the one we expect to have, and.... pretty much anything else.
WairFor... as a way of assertionLet's start with making sure elements existence on the page. For this purpose, we don't even need to use any extra modules. We can simply use:
- waitForDisplayed(); - waits until selector is displayed
- waitForExist(); - waits until selector exists
- waitForClickable(); - waits until selector is clickable
Assert module as a way of assertionFor more complicated cases where we need to verify, let's say URL === '
https://www.google.com', we could use the chai module. Don't forget to install it if you haven't done so:
Assert URL