Book Image

Enhanced Test Automation with WebdriverIO

By : Paul M. Grossman, Larry C. Goddard
Book Image

Enhanced Test Automation with WebdriverIO

By: Paul M. Grossman, Larry C. Goddard

Overview of this book

This book helps you embark on a comprehensive journey to master the art of WebdriverIO automation, from installation through to advanced framework development. You’ll start by following step-by-step instructions on installing WebdriverIO, configuring Node packages, and creating a simple test. Here you’ll gain an understanding of the mechanics while also learning to add reporting and screen captures to your test results to enhance your test case documentation. In the next set of chapters, you’ll delve into the intricacies of configuring and developing robust method wrappers, a crucial skill for supporting multiple test suites. The book goes beyond the basics, exploring testing techniques tailored for Jenkins as well as LambdaTest cloud environments. As you progress, you’ll gain a deep understanding of both TypeScript and JavaScript languages and acquire versatile coding skills. By the end of this book, you’ll have developed the expertise to construct a sophisticated test automation framework capable of executing an entire suite of tests using WebdriverIO in either TypeScript or JavaScript, as well as excel in your test automation endeavors and deliver reliable, efficient testing solutions.
Table of Contents (20 chapters)
16
Epilogue
Appendix: The Ultimate Guide to TypeScript Error Messages, Causes, and Solutions

Wash, rinse, repeat

The same principle applies to modifying the type of data in the page classes. As an example, the custom date tokens could be passed like this:

Set JOURNEY="host <today+7>"; yarn ch15
const match = journey.match(/(<.+>)/);
const dateToken = match ? match[0] : "";
Helpers.setValueIfExists(dateField, dateToken);

Now, we have a date token extracted from the journey value. The token is passed to dateField, if it exists, and set to next week’s date. If there is no token, the date is set to an empty string, which the method will return immediately as there is nothing to do.

At this point, we have covered all the processes of a non-deterministic engine. New pages will be reported in the results and must be added to extend the path coverage. If a page is never encountered in a particular path, it does not stop the test. If an error is encountered, it is reported. If the path gets stuck, it is also reported. The data and the...