8
The Assert Wrapper – the Importance of Embedded Details
In this chapter, we will be writing our first assertion wrapper. Assertions allow us to pass or fail a test as well as add detail regarding the expected and actual results. WebdriverIO has at least three ways to implement assertions and each has its own style. First, there is the standard Jest expect assertion library, which is basic to evaluate numbers, strings, and even regular expression matchers. Then there is the expect-webdriverio assertion library, which is an extension of the Jest matchers. These take web objects and perform assertions on both values and states. Lastly, there is the Chai assertion library, which provides soft assertions and a variety of implementation styles. ...
Get Enhanced Test Automation with WebdriverIO 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.