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:
- Export Perfecto credentials as environment variables
- Create a separate config file to run tests locally or in Perfecto
- Modify your NPM scripts to be able to run tests locally or in Perfecto
- Add 3 more browser capabilities to run your tests
- Make sure all your tests run in the same build
The objectives are:
- Export Sauce credentials as environment variables
- Create a separate config file to run tests locally or on Sauce Labs
- Modify your NPM scripts to be able to run tests locally or on Sauce
- Add
@wdio/sauce-service
to have a better integration with Sauce - Add 3 more browser capabilities to run your tests
- Make sure all your tests run in the same build
- Bonus: run tests in the EU data-center
- Bonus: run tests through Sauce Connect Proxy
- 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.