All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.saucelabs.saucebindings.options.ChromeConfigurations Maven / Gradle / Ivy

The newest version!
package com.saucelabs.saucebindings.options;

import org.openqa.selenium.chrome.ChromeOptions;

public class ChromeConfigurations extends VDCConfigurations {
  ChromeConfigurations(ChromeOptions chromeOptions) {
    sauceOptions = new SauceOptions(chromeOptions);
  }

  /**
   * Enables Performance Capture feature
   *
   * @return instance of configuration
   */
  public ChromeConfigurations setCapturePerformance() {
    sauceOptions.sauce().setExtendedDebugging(true);
    sauceOptions.sauce().setCapturePerformance(true);
    if (sauceOptions.sauce().getName() == null) {
      throw new InvalidSauceOptionsArgumentException(
          "Need to call `setName()` before `setCapturePerformance`");
    }
    return this;
  }

  /**
   * Chrome requires the major browser version to match the major driver version This setting might
   * be useful if there is a bug in the minor or point version of the default chromedriver
   *
   * @param version the specific version of driver to use for the test
   * @return instance of configuration
   */
  // Use case is a different point release than the driver provided by default
  // TODO - consider ensuring this matches browser major version number
  public ChromeConfigurations setChromedriverVersion(String version) {
    sauceOptions.sauce().setChromedriverVersion(version);
    return this;
  }

  /**
   * Toggles on Extended Debugging for the job
   *
   * @return instance of configuration
   * @see Using Extended
   *     Debugging
   */
  public ChromeConfigurations setExtendedDebugging() {
    sauceOptions.sauce().setExtendedDebugging(true);
    return this;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy