An example project for testing an OpenFin application with Webdriver.io v5+ using the test runner configuration approach that should work across Windows, Mac, and Linx and is also compatible with execution on Testable.
- Install the latest Node.js and npm
git clone
this repository and change into the directory- Run
npm install
to install all dependencies. - For Windows, install the Hello OpenFin app
- For Mac/Linux, install the Testable fork of openfin-cli that makes sure the devtools port works correctly:
npm install -g testable-openfin-cli
. - Download and install chromedriver v2.37 (for compatibility with OpenFin 12.x).
- Start chromedriver on the default port (9515)
- From the project directory run wdio to execute the test:
./node_modules/.bin/wdio wdio.conf.js
And that's it. The test will launch openfin as the chromium instance to drive via the webdriver protocol and run all tests found in the test.js
spec.
There are a few key differences from hello-openfin-selenium-example to get this test running on Testable.
RunOpenFin.bat
The location of the OpenFin binary is hard-coded to the location on our test runner:
SET openfinLocation=C:\Users\Administrator\AppData\Local\OpenFin
wdio.conf.js
The config url is set to process.env.CONFIG_URL
. This path refers to a modified version of the application config json that will successfully launch multiple times on the same test runner for simulating multiple virtual users per instance.
To run this on Testable simply upload all the files, zip up the directory and upload into a Testable scenario, or connect it via a VCS link. Check out the OpenFin getting started guide for more details.