Skip to content

Instantly share code, notes, and snippets.

@mehmetg
Last active December 10, 2015 20:58
Show Gist options
  • Save mehmetg/a84915eed838dbdd3160 to your computer and use it in GitHub Desktop.
Save mehmetg/a84915eed838dbdd3160 to your computer and use it in GitHub Desktop.
/**
* Created by mehmetgerceker on 12/10/15.
*/
import com.saucelabs.saucerest.SauceREST;
import java.io.File;
import java.nio.file.Paths;
public class DownloadJobAssets {
public static void main(String[] args) {
String username = System.getenv("SAUCE_USERNAME");
String password = System.getenv("SAUCE_ACCESS_KEY");
String jobId = System.getenv("SAUCE_JOB_ID");
if (username == null)
username = "";
if (password == null)
password = "";
SauceREST sauceREST = new SauceREST(username, password);
File jobDir = new File(Paths.get(String.format("/tmp/%s", jobId)).toAbsolutePath().toString());
jobDir.mkdir();
sauceREST.downloadLog(jobId, jobDir.getAbsolutePath());
sauceREST.downloadVideo(jobId, jobDir.getAbsolutePath());
System.out.println(String.format("Assets downloaded to: %s", jobDir.getAbsolutePath()));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment