@Test public void acceptsSauceLabsSettings() { Map<String, Object> customData = new HashMap<>(); customData.put("foo", "foo"); customData.put("bar", "bar"); List<String> args = new ArrayList<>(); args.add("--silent"); args.add("-a"); args.add("-q"); Map<Prerun, Object> prerun = new HashMap<>(); prerun.put(Prerun.EXECUTABLE, "http: prerun.put(Prerun.ARGS, args); prerun.put(Prerun.BACKGROUND, false); prerun.put(Prerun.TIMEOUT, 120); List<String> tags = new ArrayList<>(); tags.add("Foo"); tags.add("Bar"); tags.add("Foobar"); sauceOptions.setAvoidProxy(true); sauceOptions.setBuild("Sample Build Name"); sauceOptions.setCapturePerformance(true); sauceOptions.setChromedriverVersion("71"); sauceOptions.setCommandTimeout(2); sauceOptions.setCustomData(customData); sauceOptions.setExtendedDebugging(true); sauceOptions.setIdleTimeout(3); sauceOptions.setIedriverVersion("3.141.0"); sauceOptions.setMaxDuration(300); sauceOptions.setName("Test name"); sauceOptions.setParentTunnel("Mommy"); sauceOptions.setPrerun(prerun); sauceOptions.setPriority(0); sauceOptions.setJobVisibility(JobVisibility.TEAM); sauceOptions.setRecordLogs(false); sauceOptions.setRecordScreenshots(false); sauceOptions.setRecordVideo(false); sauceOptions.setScreenResolution("10x10"); sauceOptions.setSeleniumVersion("3.141.59"); sauceOptions.setTags(tags); sauceOptions.setTimeZone("San Francisco"); sauceOptions.setTunnelIdentifier("tunnelname"); sauceOptions.setVideoUploadOnPass(false); assertEquals(true, sauceOptions.getAvoidProxy()); assertEquals("Sample Build Name", sauceOptions.getBuild()); assertEquals(true, sauceOptions.getCapturePerformance()); assertEquals("71", sauceOptions.getChromedriverVersion()); assertEquals(Integer.valueOf(2), sauceOptions.getCommandTimeout()); assertEquals(customData, sauceOptions.getCustomData()); assertEquals(true, sauceOptions.getExtendedDebugging()); assertEquals(Integer.valueOf(3), sauceOptions.getIdleTimeout()); assertEquals("3.141.0", sauceOptions.getIedriverVersion()); assertEquals(Integer.valueOf(300), sauceOptions.getMaxDuration()); assertEquals("Test name", sauceOptions.getName()); assertEquals("Mommy", sauceOptions.getParentTunnel()); assertEquals(prerun, sauceOptions.getPrerun()); assertEquals(Integer.valueOf(0), sauceOptions.getPriority()); assertEquals(JobVisibility.TEAM, sauceOptions.getJobVisibility()); assertEquals(false, sauceOptions.getRecordLogs()); assertEquals(false, sauceOptions.getRecordScreenshots()); assertEquals(false, sauceOptions.getRecordVideo()); assertEquals("10x10", sauceOptions.getScreenResolution()); assertEquals("3.141.59", sauceOptions.getSeleniumVersion()); assertEquals(tags, sauceOptions.getTags()); assertEquals("San Francisco", sauceOptions.getTimeZone()); assertEquals("tunnelname", sauceOptions.getTunnelIdentifier()); assertEquals(false, sauceOptions.getVideoUploadOnPass()); }
public String getBuild() { if (build != null) { return build; } else if (getEnvironmentVariable(knownCITools.get("Jenkins")) != null) { return getEnvironmentVariable("BUILD_NAME") + ": " + getEnvironmentVariable("BUILD_NUMBER"); } else if (getEnvironmentVariable(knownCITools.get("Bamboo")) != null) { return getEnvironmentVariable("bamboo_shortJobName") + ": " + getEnvironmentVariable("bamboo_buildNumber"); } else if (getEnvironmentVariable(knownCITools.get("Travis")) != null) { return getEnvironmentVariable("TRAVIS_JOB_NAME") + ": " + getEnvironmentVariable("TRAVIS_JOB_NUMBER"); } else if (getEnvironmentVariable(knownCITools.get("Circle")) != null) { return getEnvironmentVariable("CIRCLE_JOB") + ": " + getEnvironmentVariable("CIRCLE_BUILD_NUM"); } else if (getEnvironmentVariable(knownCITools.get("GitLab")) != null) { return getEnvironmentVariable("CI_JOB_NAME") + ": " + getEnvironmentVariable("CI_JOB_ID"); } else if (getEnvironmentVariable(knownCITools.get("TeamCity")) != null) { return getEnvironmentVariable("TEAMCITY_PROJECT_NAME") + ": " + getEnvironmentVariable("BUILD_NUMBER"); } else { return "Build Time: " + System.currentTimeMillis(); } }
SauceOptions { public String getBuild() { if (build != null) { return build; } else if (getEnvironmentVariable(knownCITools.get("Jenkins")) != null) { return getEnvironmentVariable("BUILD_NAME") + ": " + getEnvironmentVariable("BUILD_NUMBER"); } else if (getEnvironmentVariable(knownCITools.get("Bamboo")) != null) { return getEnvironmentVariable("bamboo_shortJobName") + ": " + getEnvironmentVariable("bamboo_buildNumber"); } else if (getEnvironmentVariable(knownCITools.get("Travis")) != null) { return getEnvironmentVariable("TRAVIS_JOB_NAME") + ": " + getEnvironmentVariable("TRAVIS_JOB_NUMBER"); } else if (getEnvironmentVariable(knownCITools.get("Circle")) != null) { return getEnvironmentVariable("CIRCLE_JOB") + ": " + getEnvironmentVariable("CIRCLE_BUILD_NUM"); } else if (getEnvironmentVariable(knownCITools.get("GitLab")) != null) { return getEnvironmentVariable("CI_JOB_NAME") + ": " + getEnvironmentVariable("CI_JOB_ID"); } else if (getEnvironmentVariable(knownCITools.get("TeamCity")) != null) { return getEnvironmentVariable("TEAMCITY_PROJECT_NAME") + ": " + getEnvironmentVariable("BUILD_NUMBER"); } else { return "Build Time: " + System.currentTimeMillis(); } } }
SauceOptions { public String getBuild() { if (build != null) { return build; } else if (getEnvironmentVariable(knownCITools.get("Jenkins")) != null) { return getEnvironmentVariable("BUILD_NAME") + ": " + getEnvironmentVariable("BUILD_NUMBER"); } else if (getEnvironmentVariable(knownCITools.get("Bamboo")) != null) { return getEnvironmentVariable("bamboo_shortJobName") + ": " + getEnvironmentVariable("bamboo_buildNumber"); } else if (getEnvironmentVariable(knownCITools.get("Travis")) != null) { return getEnvironmentVariable("TRAVIS_JOB_NAME") + ": " + getEnvironmentVariable("TRAVIS_JOB_NUMBER"); } else if (getEnvironmentVariable(knownCITools.get("Circle")) != null) { return getEnvironmentVariable("CIRCLE_JOB") + ": " + getEnvironmentVariable("CIRCLE_BUILD_NUM"); } else if (getEnvironmentVariable(knownCITools.get("GitLab")) != null) { return getEnvironmentVariable("CI_JOB_NAME") + ": " + getEnvironmentVariable("CI_JOB_ID"); } else if (getEnvironmentVariable(knownCITools.get("TeamCity")) != null) { return getEnvironmentVariable("TEAMCITY_PROJECT_NAME") + ": " + getEnvironmentVariable("BUILD_NUMBER"); } else { return "Build Time: " + System.currentTimeMillis(); } } SauceOptions();  SauceOptions(ChromeOptions options);  SauceOptions(EdgeOptions options);  SauceOptions(FirefoxOptions options);  SauceOptions(InternetExplorerOptions options);  SauceOptions(SafariOptions options); private  SauceOptions(MutableCapabilities options); }
SauceOptions { public String getBuild() { if (build != null) { return build; } else if (getEnvironmentVariable(knownCITools.get("Jenkins")) != null) { return getEnvironmentVariable("BUILD_NAME") + ": " + getEnvironmentVariable("BUILD_NUMBER"); } else if (getEnvironmentVariable(knownCITools.get("Bamboo")) != null) { return getEnvironmentVariable("bamboo_shortJobName") + ": " + getEnvironmentVariable("bamboo_buildNumber"); } else if (getEnvironmentVariable(knownCITools.get("Travis")) != null) { return getEnvironmentVariable("TRAVIS_JOB_NAME") + ": " + getEnvironmentVariable("TRAVIS_JOB_NUMBER"); } else if (getEnvironmentVariable(knownCITools.get("Circle")) != null) { return getEnvironmentVariable("CIRCLE_JOB") + ": " + getEnvironmentVariable("CIRCLE_BUILD_NUM"); } else if (getEnvironmentVariable(knownCITools.get("GitLab")) != null) { return getEnvironmentVariable("CI_JOB_NAME") + ": " + getEnvironmentVariable("CI_JOB_ID"); } else if (getEnvironmentVariable(knownCITools.get("TeamCity")) != null) { return getEnvironmentVariable("TEAMCITY_PROJECT_NAME") + ": " + getEnvironmentVariable("BUILD_NUMBER"); } else { return "Build Time: " + System.currentTimeMillis(); } } SauceOptions();  SauceOptions(ChromeOptions options);  SauceOptions(EdgeOptions options);  SauceOptions(FirefoxOptions options);  SauceOptions(InternetExplorerOptions options);  SauceOptions(SafariOptions options); private  SauceOptions(MutableCapabilities options); Map<Timeouts, Integer> getTimeouts(); MutableCapabilities toCapabilities(); String getBuild(); boolean isKnownCI(); void mergeCapabilities(Map<String, Object> capabilities); void setCapability(String key, Object value); }
SauceOptions { public String getBuild() { if (build != null) { return build; } else if (getEnvironmentVariable(knownCITools.get("Jenkins")) != null) { return getEnvironmentVariable("BUILD_NAME") + ": " + getEnvironmentVariable("BUILD_NUMBER"); } else if (getEnvironmentVariable(knownCITools.get("Bamboo")) != null) { return getEnvironmentVariable("bamboo_shortJobName") + ": " + getEnvironmentVariable("bamboo_buildNumber"); } else if (getEnvironmentVariable(knownCITools.get("Travis")) != null) { return getEnvironmentVariable("TRAVIS_JOB_NAME") + ": " + getEnvironmentVariable("TRAVIS_JOB_NUMBER"); } else if (getEnvironmentVariable(knownCITools.get("Circle")) != null) { return getEnvironmentVariable("CIRCLE_JOB") + ": " + getEnvironmentVariable("CIRCLE_BUILD_NUM"); } else if (getEnvironmentVariable(knownCITools.get("GitLab")) != null) { return getEnvironmentVariable("CI_JOB_NAME") + ": " + getEnvironmentVariable("CI_JOB_ID"); } else if (getEnvironmentVariable(knownCITools.get("TeamCity")) != null) { return getEnvironmentVariable("TEAMCITY_PROJECT_NAME") + ": " + getEnvironmentVariable("BUILD_NUMBER"); } else { return "Build Time: " + System.currentTimeMillis(); } } SauceOptions();  SauceOptions(ChromeOptions options);  SauceOptions(EdgeOptions options);  SauceOptions(FirefoxOptions options);  SauceOptions(InternetExplorerOptions options);  SauceOptions(SafariOptions options); private  SauceOptions(MutableCapabilities options); Map<Timeouts, Integer> getTimeouts(); MutableCapabilities toCapabilities(); String getBuild(); boolean isKnownCI(); void mergeCapabilities(Map<String, Object> capabilities); void setCapability(String key, Object value); public TimeoutStore timeout; static final List<String> primaryEnum; static final List<String> secondaryEnum; static final List<String> w3cDefinedOptions; static final List<String> sauceDefinedOptions; static final Map<String, String> knownCITools; }