4

Super Speed – Time-Travel Paradoxes and Broken Promises

In this chapter, we will discuss how we deal with issues that arise with multithreaded execution in an event loop of a test framework. Then, we’ll look at a way to keep the switches in a framework in a consistent location when we begin to add more complex functionality.

JavaScript is an insanely fast programming language. Because its primary goal is to build website pages as fast as possible, it executes lines of code in an event loop with multiple threads. This is an advantage in building web pages as fast as possible, but it can be a hindrance in test automation that needs events executed in a particular order.

In fact, this speedster is so fast it can time travel. Let us take a look ...

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.