Example of using mock-server
when running selenium tests.
git clone https://github.com/staticdeploy/mock-server.git
cd mock-server/examples/selenium-tests
yarn install
yarn selenium-tests
Note: the first time you run
yarn selenium-tests
, the selenium binary (~20MB) is downloaded, so it might take a little while. Subsequent runs are faster.
The example uses WebDriver.io to run one selenium test against the simple app of the react example. WebDriver.io is configured to:
- build the app
- start a static server to serve it
- start the mock server
- run the selenium test in chrome
When the test is run, the app loads and calls an API mocked by the mock server. The test assertion depends on the server response.