SauceLabs Plugin

The plugin provides integration with continuous testing cloud SauceLabs.

Installation

  1. Copy the below line to dependencies section of the project build.gradle file

    Please make sure to use the same version for all VIVIDUS dependencies.
    Example 1. build.gradle
    implementation(group: 'org.vividus', name: 'vividus-plugin-saucelabs', version: '0.6.2')
  2. If the project was imported to the IDE before adding new dependency, re-generate the configuration files for the used IDE and then refresh the project in the used IDE.

Profiles

The plugin defines profiles with a set of the preconfigured properties.

saucelabs/web

Use in conjunction with web application profiles.

saucelabs/web/phone/iphone

Use in conjunction with web application phone profiles.

Required properties:

  • selenium.grid.device-name

  • selenium.grid.platform-version

saucelabs/web/phone/android

Use in conjunction with web application phone profiles.

Required properties:

  • selenium.grid.device-name

  • selenium.grid.platform-version

saucelabs/mobile_app

Use in conjunction with native mobile application profiles.

Required properties:

  • selenium.grid.device-name

  • selenium.grid.appium-version

  • selenium.grid.platform-version

SauceLabs profiles can be enabled by adding the corresponding entry to configuration.profiles property.

Example 2. Configure Chrome on SauceLabs
configuration.profiles=saucelabs/web,web/desktop/chrome
SauceLabs profile must be first.

Explore SauceLabs Capabilities for more fine-grained configuration.

Links to SauceLabs test runs can be found in Allure report

Properties

The properties marked with bold are mandatory.
Property Name Acceptable values Default Description

selenium.grid.host

hostname

<empty>

Sauce Labs OnDemand host to be used to create a new session

selenium.grid.username

username

<empty>

Sauce Labs username

selenium.grid.password

password

<empty>

Sauce Labs access key

saucelabs.data-center

  • US_WEST

  • US_EAST

  • EU_CENTRAL

Sauce Labs data center to use

saucelabs.sauce-connect.enabled

true
false

false

Enables Sauce Connect Proxy

saucelabs.sauce-connect.use-latest-version

true
false

true

If false, then use embedded Sauce Connect (4.8.2), otherwise check and download newer version if available.

saucelabs.sauce-connect.command-line-arguments

String line with CLI flags

Used to provide set of custom Sauce Connect command line arguments

saucelabs.sauce-connect.skip-host-glob-patterns

Comma (,) separated list of host glob patterns

This property comes into effect only if proxy is used, otherwise its value is ignored. The property specifies the list of glob patterns for hosts that are connected-to directly, others are connected through the proxy. By default the list inicludes

  • *.miso.saucelabs.com

  • *.api.testobject.com

  • *.saucelabs.com

  • saucelabs.com

host patterns to avoid sending of status information by SauceConnect to SauceLabs REST API throughout the lifetime of a tunnel via proxy used by tests.

Example 3. Configuration snippet to run tests in Chrome browser on Sauce Labs US West data center
configuration.profiles=saucelabs/web,web/desktop/chrome

selenium.grid.host=ondemand.us-west-1.saucelabs.com
selenium.grid.username=secretsauce
selenium.grid.password=87380d3afd8fd8aed55a
saucelabs.data-center=US_WEST
Example 4. Configuration snippet to run mobile app tests using iOS Sumulator on Sauce Labs US West data center
configuration.profiles=saucelabs/mobile_app,mobile_app/ios

selenium.grid.host=ondemand.us-west-1.saucelabs.com
selenium.grid.username=secretsauce
selenium.grid.password=87380d3afd8fd8aed55a
saucelabs.data-center=US_WEST

selenium.grid.device-name=iPhone Simulator
selenium.grid.appium-version=2.0.0
selenium.grid.platform-version=16.2

# https://docs.saucelabs.com/mobile-apps/app-storage/
selenium.grid.capabilities.app=myapp.app
Example 5. Configuration snippet to run mobile app tests using Android Emulator on Sauce Labs US West data center
configuration.profiles=saucelabs/mobile_app,mobile_app/android

selenium.grid.host=ondemand.us-west-1.saucelabs.com
selenium.grid.username=secretsauce
selenium.grid.password=87380d3afd8fd8aed55a
saucelabs.data-center=US_WEST

selenium.grid.device-name=Android GoogleAPI Emulator
selenium.grid.appium-version=2.0.0
selenium.grid.platform-version=13.0

# https://docs.saucelabs.com/mobile-apps/app-storage/
selenium.grid.capabilities.app=myapp.apk

Sauce Orchestrate

The Sauce Orchestrate is a new and unique approach to web and mobile application testing that increases test execution speed and enables end-to-end test orchestration.

Prerequisites to install:

How to run VIVIDUS steps using Sauce Orchestrate:

  1. Go to the project root directory.

  2. Build a docker image with tests and push it to a docker registry as described in this article.

  3. Create a .sauce/config.yml file in the project root with the following content:

    apiVersion: v1alpha
    kind: imagerunner
    sauce:
      region: us-west-1
    suites:
      - name: VIVIDUS test suite
        workload: webdriver
        resourceProfile: c2m2
        # replace the image value with the actual one
        image: vividus.jfrog.io/tests-docker-release/vividus-sample-tests:0.1.0-SNAPSHOT
        imagePullAuth:
          user: $DOCKER_REGISTRY_USERNAME
          token: $DOCKER_REGISTRY_PASSWORD
        artifacts:
          - '/vividus/output/reports/*'
    
    artifacts:
      cleanup: true
      download:
        when: always
        match:
          - "*"
        directory: ./report
    • Please see saucectl configuration for more details.

    • Make sure region configuration value corresponds to the region specified by the saucelabs.data-center property, please see region docs for mapping.

    • The DOCKER_REGISTRY_USERNAME and DOCKER_REGISTRY_PASSWORD are expected to be set during the 2nd step of the guide.

  4. Start tests by using saucectl:

    saucectl run
  5. Wait until the tests run is finished and see report folder in the project root for reports.