This repository demonstrates how to use WebdriverIO with the tape test framework.
It includes a test file (tests/test.spec.js
) that:
- opens the Firefox browser (as defined in
tests/conf.js
); - visits the URL
https://duckduckgo.com
; and - tests the title of the page to match an expected value.
- Docker with
selenium-standalone
installed; see here.
npm install
Run the Docker service containing the Selenium server that will run all tests.
docker run -it -p 4444:4444 vvoyer/selenium-standalone
Run the example test:
npm test
The result should be something similar to the below output:
TAP version 13
# should visit DuckDuckGo
ok 1 should be equal
1..1
# tests 1
# pass 1
# ok
The example test checks the <title>
tag of
DuckDuckGo. If the test fails, it is because the
title has changed (the output should indicate this).
Credit to Patrick Arlt for their gist that helped with the development of the test file.