In automation, validations in test scripts are also called assertions . Some WebdriverIO assertions were covered in Chapter 4 (i.e., element APIs). Node.js has a built-in assertion library that is called with const assert = require('assert'). No installation is required. However, you can implement more powerful assertions with the user-friendly Chai Assertion Library in your framework. Install Chai using npm install chai -save--dev at a terminal.
10. Assertions
Get Practical WebDriverIO: Learn to Automate Effectively Using WebDriverIO APIs now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.