Skip to content

Running WebdriverIO tests

tpronk edited this page Jul 21, 2021 · 4 revisions

Home - WebdriverIO testing - Running WebdriverIO tests


Overview

A WebdriverIO testrun can be started via the command below, with a set of CLI options (or environment variables) for configuring the testrun.

npx wdio scripts/shared/wdio.conf.cjs

Examples

Example 1

Run all tests via a local Selenium server, with experiments hosted on a local web-server (at the URL http://localhost/psychojs/{{experiment}}). Note that when you're using the bash shell, you'll need to escape the star wildcard (\*)

npx wdio scripts/shared/wdio.conf.cjs --server local --url local --label *

Example 2

Run the tests associated with label "wdio_img", via a local Selenium server. Experiments are assumed to be hosted on Pavlovia, so their URLs are obtained via the pavlovia_url property of the Test configuration file of each test.

npx wdio scripts/shared/wdio.conf.cjs --server local --url pavlovia --label wdio_img

Example 3

This example requires features only available to the PsychoPy/PsychoJS team

Run all tests via BrowserStack, on all platforms supported by BrowserStack, with branch having the value "thomas". Experiments are assumed to be hosted on Pavlovia, so their URLs are obtained via the pavlovia_url property of the Test configuration file of each test.

npx wdio scripts/shared/wdio.conf.cjs --server bs --url pavlovia --label * --branch thomas --platform *

Example 4

This example requires features only available to the PsychoPy/PsychoJS team

Run a test with the following settings:

  • Via BrowserStack
  • Using the stager as web-server (with experiments hosted at the URL https://staging.psychopy.org/experiments/html/<branch>/{{experiment}})
  • Run only the wdio_img test
  • Use thomas as name for the branch
  • Run the tests on each Windows 10 web-browser that is supported by BrowserStack
  • Use test1 as name for the testrun
  • Upload the testlogs to the PsychoPy staging server, where they will be available at https://staging.psychopy.org/report/<branch>/test1/wdio_img

npx wdio scripts/shared/wdio.conf.cjs --server bs --url stager --label wdio_img --branch thomas --platform Windows*10* --testrun test1 --uploadResults

Clone this wiki locally