Skip to content

Instantly share code, notes, and snippets.

@vcsjones
Created January 3, 2012 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vcsjones/1556566 to your computer and use it in GitHub Desktop.
Save vcsjones/1556566 to your computer and use it in GitHub Desktop.
Test
@AfterMethod(alwaysRun = true)
public void shutDownDriver(ITestResult result) throws IOException {
}@AfterMethod(alwaysRun = true)
public void shutDownDriver(ITestResult result) throws IOException {
// Update SauceLabs result
if(testbed.equals("saucelab")) {
String jobID = ((RemoteWebDriver)driver).getSessionId().toString();
SauceREST client = new SauceREST("username", "key");
Map<String, Object>sauceJob = new HashMap<String, Object>();
sauceJob.put("name", "Test method: "+result.getMethod().getMethodName());
if(result.isSuccess()) {
client.jobPassed(jobID);
} else {
client.jobFailed(jobID);
}
client.updateJobInfo(jobID, sauceJob);
}
driver.manage().deleteAllCookies();
driver.quit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment