Skip to content

Puquios/sauce-labs_setup

Repository files navigation

Example IBM Bluemix Pipelines using Sauce Labs

A simple pipeline with a HelloWorld Node.js application that runs tests via Sauce Labs. This is an easy way to get a pre-configured pipeline with all the environment variables set and ready to go! The Sauce Labs username and API key fields will need to be filled in with valid information before the stage will run correctly.

Click the links below to see a project running in Bluemix!

##Pipeline with a Build stage -> Deploy/Test stage:

Deploy To Bluemix

The application:

Helloworld node application

The pipeline:

  • Build
    • Pulls in code from the Git repo and builds it.
  • Deploy
    • Deploys the HelloWorld Node.js app to Bluemix and exports the app name for use in the testing job.
    • Runs a suite of tests via Sauce Labs against the deployed app. All the needed environment variables have been set.

##Pipeline with a Build stage -> Deploy stage - > Test stage:

Deploy To Bluemix

The application:

Helloworld node application

The pipeline:

  • Build
    • Pulls in code from the Git repo and builds it.
  • Deploy
    • Deploys the HelloWorld Node.js app to Bluemix.
  • Test
    • Runs a suite of tests via Sauce Labs against the deployed app. All the needed environment variables have been set.

Simple set up instructions:

##Adding Sauce Labs to an existing stage:

  1. Click the "Add Job" button inside the desired stage and select "Test"
  2. Name the new Test Job accordingly and select "Sauce Labs" from the Tester Type dropdown
  3. Enter your Sauce Labs username and access key in the provided input fields
  4. Select the execution command that best fits your code configuration or enter a custom command
  5. Select whether to download the videos and Selenium logs for the Sauce Labs jobs
  6. Select whether or not to enable test reporting. For best results, use the mocha-jenkins-reporter in JavaScript
  7. Click on the "Environment Properties" tab at the top, hit "Add Property" and select "Text Property"
  8. Add the property CF_APP_NAME and delete the prefilled value
  9. Do the same for APP_URL
  10. Ensure that the following code is included in the deploy stage script box: export CF_APP_NAME="$CF_APP"
  11. Hit the "Save" button and the stage is complete!

##Adding a Sauce Labs test job to its own, new stage:

  1. Click the "Add Stage" button in the Pipeline
  2. Name the new stage accordingly and click on the "Jobs" tab
  3. Click the "Add Job" button again and select "Test"
  4. Name the new Test Job accordingly and select "Sauce Labs" from the Tester Type dropdown
  5. Enter your Sauce Labs username and access key in the provided input fields
  6. Select the execution command that best fits your code configuration or enter a custom command
  7. Select whether to download the videos and Selenium logs for the Sauce Labs jobs
  8. Select whether or not to enable test reporting. For best results, use the mocha-jenkins-reporter in JavaScript
  9. Click on the "Environment Properties" tab at the top, hit "Add Property" and select "Text Property"
  10. Add the property APP_URL with the URL for the application as the value.
  11. Hit the "Save" button and the stage is complete!

###References:

See Sauce Labs extension for the extension.

About

Simple Sauce Labs pipeline

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published