Sauce Connect is a secure tunneling app which allows you to execute tests securely when testing behind firewalls via a secure connection between Sauce Labs’ client cloud and your environment.
Download the version of Sauce Connect that corresponds to your guest's platform. For some reason Sauce Connect v4 never worked for me, so I use Sauce Connect v3 instead.
After unpacking Sauce Connect, cd to its directory and start it up using your SauceLabs credentials:
- Sauce Connect v4:
$ bin/sc -u YOUR-SAUCE-USERNAME -k YOUR-SAUCE-API-KEY
- Sauce Connect v3
$ java -jar ~/Dropbox/Applications/Sauce-Connect-latest/Sauce-Connect.jar YOUR-SAUCE-USERNAME YOUR-SAUCE-API-KEY
The following environment variables are needed before you can run UI tests. Please note that SELENIUM_PLATFORM
, SELENIUM_BROWSER
and SELENIUM_VERSION
can be adjusted to match one of the supported platforms and web browser from Sauce Labs. For more information, check this page. The example below uses Linux
, Firefox
and 29
for these values:
export SELENIUM_HOST=ondemand.saucelabs.com
export SELENIUM_PORT=4444
export SELENIUM_PLATFORM=Linux
export SELENIUM_BROWSER=firefox
export SELENIUM_VERSION=29
export SAUCE_USER_NAME=YOUR-SAUCE-USERNAME
export SAUCE_API_KEY=YOUR-SAUCE-API-KEY
export SELENIUM_DRIVER="sauce-ondemand:?os=$SELENIUM_PLATFORM&browser=$SELENIUM_BROWSER&browser-version=$SELENIUM_VERSION&username=$SAUCE_USER_NAME&access-key=$SAUCE_API_KEY"
export SELENIUM_STARTING_URL='YOUR-SATELLITE-SERVER'
Finally, edit your robottelo.properties
file and make sure to set the remote
attribute to ``1'`. Then run your tests:
$ nosetests -c robottelo.properties tests/foreman/ui/test_login.py