- 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
test configuration properties to point to your project files.
- You should have Git or GitHub installed in order to access the project repository, but you can also download the sample project directly from Git
- You need to have node.js installed
- You should set up your Sauce Labs authentication credentials as environment variables
Installing Karma and the Sample Karma Project
Open a terminal window and clone the Karma sample project from GitHub, and navigate to the
No Git, No Problem
You can also download the project directly from GitHub without needing to use the Git interface.
Run this command to install the Karma command command line interface globally, and to install the sample project's local node.js dependencies.
Changing Browser and Frameworks in the Sample Project
By default, this example runs Jasmine tests in Chrome and Firefox on your local machine. You can add more browsers by editing the
browsers array in the
karma.conf.js file, or change the test framework in the
Running Karma on Sauce Labs with the Karma-Sauce-Launcher
- To use Karma with Sauce Labs and run the example project, you first need to set up your Sauce authentication credentials as environment variables.
After your environment variables are set, run the tests with this command.
This will launch Sauce Connect to establish a tunnel between your local machine and the Sauce Labs testing cloud. You can speed up the time it takes to connect to Sauce by starting Sauce Connect in the background. Check out Setting Up Sauce Connect Proxy for information on downloading the binaries for your operating system and running Sauce Connect. If you want to launch Sauce Connect from your command line rather than as part of the karma-sauce-launcher start up, you need to edit the
sauceLabs dictionary in the
karma.conf-ci.js file so that the
startConnect option is set to
Reset Before Using with a CI Platform
If you set the
startConnect option to
false, be sure to re-set it to
true before you try to use the karma-sauce-launcher with a continuous integration platform.
Using the Karma-Sauce-Launcher with a Continuous Integration Platform
The topics under Using Sauce Labs with Continuous Integration Platforms describe how to set up your CI platform to integrate with Sauce. These integrations require that you have your Sauce Labs authentication credentials set as environment variables. The sample
karma.conf-ci.js file is already set up to read environment variables for CI platforms, so you shouldn't need to modify it as long as
process.env.SAUCE_ACCESS_KEY are set properly during the build.