Skip to content

Latest commit

 

History

History

selenium-tests

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

selenium-tests example

Example of using mock-server when running selenium tests.

Run the example

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.

What happens in the example

The example uses WebDriver.io to run one selenium test against the simple app of the react example. WebDriver.io is configured to:

  1. build the app
  2. start a static server to serve it
  3. start the mock server
  4. 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.