- Getting Started with Selenium for Automated Website Testing
- Getting Started with Appium for Mobile Native Application Testing
- Selenium Bootcamp by Dave Haeffner
- Appium Bootcamp by Dave Haeffner and Matthew Edwards
- You should read Grunt-Saucelabs Set Up, Configuration, and Usage
- You should have Git or GitHub installed in order to access the project repository
- You need to have node.js installed
- You need to have grunt-saucelabs installed
- You should set up your Sauce Labs authentication credentials as environment variables
Getting the Sample Project
Open a terminal window, clone the example project, and install the dependencies.
What Do These Files Do?
In the Examples directory you will find example files for each type of testing framework, including custom frameworks. The
package.json file pulls in all the
dependencies that are necessary to run your tests on Sauce, and provides metadata about the project you're testing. Check out the official documentation at nmpjs.com for more information about the contents of this file.
GruntFile.js specifies the browsers and operating systems you want to run your tests against and the configuration options for your testing framework. Check out the official Grunt documentation of this file for more information about setting it up. Notice that in this example launches tests for all the frameworks at the same time. If you wanted to launch the tests for a single framework, you would edit grunt.registerTask("test...)
Running the Sample Tests
- Log in to your Sauce Labs account so you can see the results of your tests on your dashboard.
- Open a terminal window and navigate to the location where you downloaded the sample
Run the tests.
- Open a Web browser and navigate to the test page for each testing framework to see the results of your tests.
What Happens When the Tests Run
- Sauce Connect Proxy launches a secure tunnel that enables access to your local machine from the Sauce Cloud so you can run your tests on our browsers.
- Virtual machines are launched on the Sauce cloud to execute the tests on the platforms specified in
Gruntfile.js, which also specifies a concurrency of three virtual machines, so you can run more than one test at a time.
- The Sauce cloud launches all the specified operating systems and browsers, and executes the tests for each framework on each of them.
- We never forget to clean up after ourselves - after returning results, the tunnel is closed and all virtual machines are destroyed, leaving no trace of your tests and code.
- The test results are reported to your Sauce Labs dashboard using the method for your testing framework.
Going Further with Continous Integration
The sample projects also include a sample
.travis.yml file that you can use to include the tests into a TravisCI integration process. Check out the topics under Using Sauce Labs with Continuous Integration Platforms for information on how to use Sauce with continuous integration platforms like TravisCI, Jenkins, and Bamboo.