Last active
December 10, 2015 20:58
-
-
Save mehmetg/a84915eed838dbdd3160 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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