Framework Setup


In this section, we will create a single configuration file to store all our Test Runner settings, which will be used when running any of our tests. This file is pretty large, but thankfully the Test Runner provides a utility which asks a series of questions in order to automatically create an appropriate configuration file for us.

Let’s begin 🙂

WDIO Test Runner utility

  1. Open up Terminal (or Command prompt) and change directory (cd) into the project root again…
    cd webdriverio-framework (or whatever your path is)
  2. Enter in the following to begin the Test Runner utility…
    It will recognise that we haven’t yet created a configuration file, so will begin asking us questions in order to create an appropriate one for us.

Where do you want to execute your tests?

  1. For the first question, select to execute our tests on our local machine like below, and press Enter…

Which framework do you want to use?

  1. For the second question, select to use the Cucumber framework like below, and press Enter…

    • Select ‘Yes’ when asked to install the framework adapter for Cucumber…

Where are your Feature files located?

  1. For the third question, enter in an appropriate relative path to where our Cucumber Feature files will exist and press Enter (it is common practice to have a ‘/src/resources’ directory and then have a ‘/features’ directory within the ‘/src/resources’ directory to keep our Feature files in)…

Where are your step definitions located?

  1. For the next question, enter in an appropriate relative path to where our Step Definition files will exist and press Enter (it is again common practice to keep our Step Definition files in a ‘/src/test/steps’ directory).  Step Definitions are the glue that connects our Cucumber Feature files (written in Gherkin language) to our Javascript code…

Which reporter do you want to use?

  1. Next, select the reporter you want to use when running your tests and press Enter. In this blog series, I will be using Spec reporter due to the output gives on passing and failing test cases. You could instead use another like TestRail if you wanted to push the test results into TestRail (For more information please see…

Do you want to add a service to your test setup?

  1. Next, we will select to add the Selenium Standalone service, so that we can automatically start an instance of Selenium Standalone before our tests our run (you could alternatively select a cloud-based testing platform like SauceLabs or BrowserStack if your company uses that).  Select ‘Selenium Standalone’ and press Enter…

Level of logging verbosity

  1. Next, select a suitable level of logging to output and press Enter.  For the purpose of this blog series, I will select ‘silent’ so that less noise is output, but you could select ‘verbose’ to output all logs or choose a specific level of logging like ‘error’ to only output that…

In which directory should screenshots gets saved if a command fails?

  1. For the next question, select a suitable relative path to store an screenshots that are taken when a test fails, and press Enter.  For the purpose of this blog series, I will stick to the default directory path…

What is the base URL?

  1. For the last question, enter the Base URL of the website you will be testing and press Enter.  For the purpose of this blog series, I will be showing an example test of going to DuckDuckGo search engine, searching for Reddit, selecting the first result and then asserting that we are indeed on the Reddit home page. Based on this, my base URL will be

Now that all questions have been answered, the WDIO packages will install. Once complete, a WDIO configuration file (wdio.conf.js) will be created based on all the questions we just answered…

Our WebDriverIO Test Runner is now setup, with its configuration file (wdio.conf.js) existing in our project root.

In the next section, we will begin to create the folder structure for our test framework and add the necessary files.  We will also tweak our Test Runner configuration file a bit to make things run smoother down the line. 🙂



Liked it? Take a second to support Thomas on Patreon!

Previous Article

Next Article

2 Replies to “Part 2. Framework Setup (WDIO TestRunner)”

  1. When installing the cucumber framework adapter, I receive an error “make failed with exit code 2”, “node-gyp” failed with exit code 2″
    “please make sure you are using a supported platform and node version. If you would like to compile fibers on this machine please make sure you have setup your build environment” and it gives me a github article to look at.

    I followed the instructions at the github article ( and when I try to rebuild gyp, it gives me an error
    “No rule to make target ‘Release/’, needed by ‘Release/binding.node’. Stop”

    When I search for this on sites like stack overflow, google, and others, it ends up being a rabbit hole of people yelling at other people and blame gaming each other. Seems to be a common issue that nobody’s sure how to solve.

    Do you have any insight on this?

    1. Hi Paul,

      Sorry for the delay in a reply. Unfortunately I don’t have much insight in to this but if I had to make an educated guess I would say check the version numbers of your wdio packages in the package.json, and maybe try deleting the package.json and regenerating with npm install.


Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.