Skip to end of metadata
Go to start of metadata

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

Using the Java Helper Library with TestNG and JUnit

If you are using the Java Helper Libraries with TestNG or JUnit 

 

Create a Plan

  1. In Bamboo, click Create Plan
  2. Click Create New Plan
  3. Under Plan Details, for Project, select New Project
  4. For Project Name, enter Sauce Demo
  5. For Project Key, enter SAUCE.
  6. For Plan Name, enter Java
  7. For Plan Key, enter Demo
  8. Under Source Repositories, in the Source Repository menu, select Git
  9. For Repository URL, enter https://github.com/rossrowe/sauce-ci-java-demo.
  10. For Branch, enter Master
  11. For Authentication Type, select None
  12. Select Use shallow clones

Configure Tasks

  1. Click Configure Tasks
  2. Click Add Task
  3. Select Maven 3.x.
  4. For Task Description enter Run Tests.
  5. Click Save.
  6. Click Create

Configure the Plan

  1. Under Plan Configuration > Stages and Jobs > Default Stage, select Default Job
  2. Click Miscellaneous
  3. For Job Name, enter Default Job
  4. Select Job Enabled
  5. Click Save

Enable the Sauce Plugin

  1. Select Enable Sauce OnDemand
  2. In General Settings, select the Selenium Version you want to use for your tests. 
  3. Select the Browser you want to run your tests against. 
    See Referencing Environment Variables for Bamboo Jobs for more information about how your browser and general settings are used to populate environment variables for your tests. 
  4. Enter the Max Duration, Idle Timeout, and Starting Browser URL settings for your test. 
  5. Click Save.

Sauce Connect Automatically Enabled

In the General Settings you will see that Enable Sauce Connect is selected by default, which will launch an instance of Sauce Connect prior to the running of your Job. This instance will close when the Job completes.

Run the Example Tests

  1. Go the Bamboo dashboard. 
  2. Click the Enable icon. 
  3. Click the Run icon. 
  4. After the tests complete, click Sauce Jobs
  5. Click the Job ID of any job to see the steps performed by the test as well as a test video.