The Sauce Labs Cookbook

Sauce Headless

Front End Performance Testing


External Resources

More Info

Page tree
Skip to end of metadata
Go to start of metadata

This topic describes how to configure TeamCity to work with Sauce for a Java-based project. It includes setting up demo tests you can use to test your configuration and see how Sauce interacts with TeamCity.

Create the Project

  1. In the TeamCity dashboard, click Administration
  2. Click Create Project
  3. For Name, enter Sauce Demo.
    This will populate the required field Project ID with SauceDemo
  4. Click Create
  5. Click the VCS Roots tab. 
  6. Click Create VCS root.
  7. For Fetch URL, enter to use the sample Java/JUnit test framework.
  8. For Default Branch, enter Master
  9. Click Save

Create the Build Configuration

  1. Click the General tab. 
  2. Click Create build configuration
  3. For Name, enter Maven
  4. Click VCS settings.
  5. In the Attach existing VCS root, select
  6. Click Add build step
  7. In the Runner type menu, select Maven
  8. For Goals, enter test
  9. Click Save
  10. Click Add build feature.
  11. Select Sauce Labs Build Feature
  12. Enter your Sauce username and access key
  13. Select Enable Sauce Connect if you want to launch an instance of Sauce Connect prior to running your job. 
    If you launch Sauce Connect, the instance will close when the job completes.  
  14. Select the operating system and browser combination you want to test against. 
    See Referencing Environment Variables for TeamCity Jobs for more information about how your browser and general settings are used to populate environment variables for your tests. 
  15. Click Save

Integrate the Tests

  1. Got the TeamCity dashboard. 
  2. Click Run
    All three of the sample tests should compile and run. 
  3. When the build completes, click Results.
  4. Click the Sauce Labs Results tab. 
  5. Click on Job ID link to view the test report, which will list the steps performed the test and include a video of the test.