Skip to content

Commit

Permalink
AlexeiBarantsev: Implementing ability to disable video recording on s…
Browse files Browse the repository at this point in the history
…auce (RC tests are too long and cause out of memory error)

r18289
  • Loading branch information
barancev committed Dec 10, 2012
1 parent 82291ab commit b0c770c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ public class SauceDriver extends RemoteWebDriver {
private static final String SAUCE_APIKEY_ENV_NAME = "SAUCE_APIKEY";
private static final String SAUCE_USERNAME_ENV_NAME = "SAUCE_USERNAME";
private static final String DESIRED_BROWSER_VERSION_ENV_NAME = "SAUCE_BROWSER_VERSION";
private static final String SAUCE_DISABLE_VIDEO_ENV_NAME = "SAUCE_DISABLE_VIDEO";

private static final String USE_SAUCE_ENV_NAME = "USE_SAUCE";

// Should be one of the values listed for Platform, e.g. xp, win7, android, ...
private static final String DESIRED_OS_ENV_NAME = "SAUCE_OS";
// Optional to override default
Expand Down Expand Up @@ -94,6 +95,7 @@ private static Capabilities munge(Capabilities desiredCapabilities, String selen
mungedCapabilities.setCapability("selenium-version", seleniumVersion);
mungedCapabilities.setCapability("idle-timeout", 180);
mungedCapabilities.setCapability("disable-popup-handler", true);
mungedCapabilities.setCapability("record-video", shouldRecordVideo());

mungedCapabilities.setCapability("prevent-requeue", true);

Expand Down Expand Up @@ -121,6 +123,10 @@ public static boolean shouldUseSauce() {
return System.getenv(USE_SAUCE_ENV_NAME) != null;
}

public static boolean shouldRecordVideo() {
return ! Boolean.parseBoolean(System.getenv(SAUCE_DISABLE_VIDEO_ENV_NAME));
}

public static Platform getEffectivePlatform() {
return Platform.extractFromSysProperty(getDesiredOS());
}
Expand Down

0 comments on commit b0c770c

Please sign in to comment.