Adding a helpers file
We begin by preparing our helper commands, which require the utility-types
package in order to support optional parameters in TypeScript. This package is installed with the following command:
> yarn add utility-types
We will next add a \helpers
folder that contains a helpers.ts
file module. This contains several methods for resolving issues in the framework. This is where we will store the majority of our custom supporting code for the framework.
To create a helpers file in a WebdriverIO project written in TypeScript, we need to do the following:
- Create a new directory in our project to store our helper functions. This directory will be called
helpers
, located within oursrc
directory. - Within the
helpers
directory, create a new TypeScript file for our helper functions. Let’s call this filehelpers.ts
. - At the top of the
helpers.ts
file, we need to import the necessary types and functions to support file paths, global objects, and...