Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 2.77 KB

chapter_08.md

File metadata and controls

36 lines (25 loc) · 2.77 KB

Cloud Integration

Now as we have a pretty decent functional test suite, let's scale this up and run everything on the cloud using more capabilities to ensure that our example applications works cross functional. You can pick between the cloud vendor of your choice.

The objectives are:

  1. Export Perfecto credentials as environment variables
  2. Create a separate config file to run tests locally or in Perfecto
  3. Modify your NPM scripts to be able to run tests locally or in Perfecto
  4. Add 3 more browser capabilities to run your tests
  5. Make sure all your tests run in the same build

The objectives are:

  1. Export Sauce credentials as environment variables
  2. Create a separate config file to run tests locally or on Sauce Labs
  3. Modify your NPM scripts to be able to run tests locally or on Sauce
  4. Add @wdio/sauce-service to have a better integration with Sauce
  5. Add 3 more browser capabilities to run your tests
  6. Make sure all your tests run in the same build
  7. Bonus: run tests in the EU data-center
  8. Bonus: run tests through Sauce Connect Proxy
  9. Bonus: add another workflow to your GitHub Action that runs tests on Sauce Labs (Note: make sure to register your Sauce Labs credentials as environment variable)

If you want to scale up your tests and run them with different configurations using different browser you will realize that it becomes difficult to maintain a set of browser environments with their drivers. Here is where Sauce Labs comes in. Sauce Labs is the world largest grid of browser and mobile environments. With WebdriverIO you only need to provide the username and access key information in your config file to get up and running and be able to run your tests in over 1000 different environments.

As best practice we recommend to create different config files for every environment you want to run your tests in. With that you can easily switch back and forth between these environments. To avoid code duplication it is good to move all configs into a main config file and inherit these configs a config files that define special options to serve its environment.

With the @wdio/sauce-service WebdriverIO provides a simple plugin that improves the integration with Sauce. Among other things it updates the job status for you and gives the job a name based on the test file.

Note: In order to find the correct capabilities for your environment, Sauce Labs has a handy platform configurator that allows you to click together your environment.