Skip to content

Creating a new WebdriverIO testscript

tpronk edited this page Apr 29, 2021 · 3 revisions

Home - WebdriverIO testing - Creating a new WebdriverIO test - Creating a new WebdriverIO testscript


General guidelines

To get started, see this existing test: tests/wdio_img

  • Give your testscript the same name as your test experiment, for example e2e_img.cjs
  • Save your testscript in same directory as where your test experiment is: ./test/tests_e2e
  • Have your testscript import ../shared/SharedBehaviors.cjs
  • The testing testscript should be a CommonJS module that exports a function run which accepts one argument: calibration

Available features

Inside of your testscript, you've got the following features at your disposal:

  • The WebDriverIO API for sending commands to a web-browser. Since PsychoJS draws stimuli via a canvas, most functions for element selection can't be used, but function of the browser object can be used.
  • The jasmine API for making assertions.
  • SharedBehaviors takes care of behavior commonly required when testing a PsychoJS experiment.
  • Custom browser commands takes care of tasks commonly required when testing a PsychoJS experiment.

Clone this wiki locally