com.saucelabs.saucebindings.options.ChromeConfigurations Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sauce_bindings Show documentation
Show all versions of sauce_bindings Show documentation
Java library which provides tools for interacting with Sauce Labs
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;
}
}