// Path: common/src/main/java/com/saucelabs/common/InvalidTestStatusException.java
// public class InvalidTestStatusException extends Throwable {
// }
// 
// Path: common/src/main/java/com/saucelabs/common/SauceApi.java
// public class SauceApi {
// 
//     private WebDriver webDriver;
// 
//     public SauceApi(WebDriver webDriver) {
//         this.webDriver = webDriver;
//     }
// 
//     public SauceApi() {
//     }
// 
//     public void setTestStatus(String testResult) {
//         //TODO finish implementation
//         //testResult = testResult.toLowerCase();
//         //isValidTestStatus(testResult);
//         new JavaScriptInvoker(webDriver).
//             executeScript(SauceJavaScriptStrings.testStatusPrefix + testResult);
//     }
// 
// //    private void isValidTestStatus(String testResult) throws InvalidTestStatusException {
// //        if(!testResult.equals("passed")  || !testResult.equals("failed")  ||
// //            !testResult.equals("true") || !testResult.equals("false"))
// //        {
// //            throw new InvalidTestStatusException();
// //        }
// //    }
// 
//     public void setTestName(String testName) {
//         new JavaScriptInvoker(webDriver).executeScript(SauceJavaScriptStrings.testNamePrefix + testName);
//     }
// 
//     public void setTestTags(String tags) {
//         new JavaScriptInvoker(webDriver).executeScript(SauceJavaScriptStrings.tagsPrefix + tags);
//     }
// 
//     public void comment(String comment) {
//         new JavaScriptInvoker(webDriver).executeScript(SauceJavaScriptStrings.sauceContextPrefix + comment);
//     }
// 
//     public void setBuildName(String buildName) {
//         new JavaScriptInvoker(webDriver).executeScript(SauceJavaScriptStrings.buildPrefix + buildName);
//     }
// 
//     public void setBreakpoint() {
//         new JavaScriptInvoker(webDriver).executeScript(SauceJavaScriptStrings.breakStatement);
//     }
// }


import com.saucelabs.common.InvalidTestStatusException;
import com.saucelabs.common.SauceApi;
import com.saucelabs.saucerest.DataCenter;
import com.saucelabs.saucerest.SauceREST;
import io.restassured.path.json.JsonPath;
import org.junit.*;
import org.junit.rules.TestName;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.MutableCapabilities;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.remote.SessionId;
import java.net.MalformedURLException;
import java.net.URL;
package com.saucelabs.common.acceptance;




public class SauceApiAcceptanceTest
{
    private String username = System.getenv("SAUCE_USERNAME");
    private String accesskey = System.getenv("SAUCE_ACCESS_KEY");
    private String SAUCE_REMOTE_URL = "https://ondemand.saucelabs.com/wd/hub";
    private WebDriver driver;
    private SessionId sessionId;

    @Rule
    public TestName testName = new TestName();

    @Before
    public void runBeforeEachTest() throws MalformedURLException {
        MutableCapabilities sauceOptions = getMutableCapabilities();
        ChromeOptions chromeOpts = getChromeOptions(sauceOptions);

        driver = new RemoteWebDriver(new URL(SAUCE_REMOTE_URL), chromeOpts);
        sessionId = ((RemoteWebDriver) driver).getSessionId();
        driver.navigate().to("https://www.saucedemo.com");
    }

    @Test
// Path: common/src/main/java/com/saucelabs/common/InvalidTestStatusException.java
// public class InvalidTestStatusException extends Throwable {
// }
// 
// Path: common/src/main/java/com/saucelabs/common/SauceApi.java
// public class SauceApi {
// 
//     private WebDriver webDriver;
// 
//     public SauceApi(WebDriver webDriver) {
//         this.webDriver = webDriver;
//     }
// 
//     public SauceApi() {
//     }
// 
//     public void setTestStatus(String testResult) {
//         //TODO finish implementation
//         //testResult = testResult.toLowerCase();
//         //isValidTestStatus(testResult);
//         new JavaScriptInvoker(webDriver).
//             executeScript(SauceJavaScriptStrings.testStatusPrefix + testResult);
//     }
// 
// //    private void isValidTestStatus(String testResult) throws InvalidTestStatusException {
// //        if(!testResult.equals("passed")  || !testResult.equals("failed")  ||
// //            !testResult.equals("true") || !testResult.equals("false"))
// //        {
// //            throw new InvalidTestStatusException();
// //        }
// //    }
// 
//     public void setTestName(String testName) {
//         new JavaScriptInvoker(webDriver).executeScript(SauceJavaScriptStrings.testNamePrefix + testName);
//     }
// 
//     public void setTestTags(String tags) {
//         new JavaScriptInvoker(webDriver).executeScript(SauceJavaScriptStrings.tagsPrefix + tags);
//     }
// 
//     public void comment(String comment) {
//         new JavaScriptInvoker(webDriver).executeScript(SauceJavaScriptStrings.sauceContextPrefix + comment);
//     }
// 
//     public void setBuildName(String buildName) {
//         new JavaScriptInvoker(webDriver).executeScript(SauceJavaScriptStrings.buildPrefix + buildName);
//     }
// 
//     public void setBreakpoint() {
//         new JavaScriptInvoker(webDriver).executeScript(SauceJavaScriptStrings.breakStatement);
//     }
// }


// Path: common/src/test/java/com/saucelabs/common/acceptance/SauceApiAcceptanceTest.java
import com.saucelabs.common.InvalidTestStatusException;
import com.saucelabs.common.SauceApi;
import com.saucelabs.saucerest.DataCenter;
import com.saucelabs.saucerest.SauceREST;
import io.restassured.path.json.JsonPath;
import org.junit.*;
import org.junit.rules.TestName;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.MutableCapabilities;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.remote.SessionId;
import java.net.MalformedURLException;
import java.net.URL;

package com.saucelabs.common.acceptance;




public class SauceApiAcceptanceTest
{
    private String username = System.getenv("SAUCE_USERNAME");
    private String accesskey = System.getenv("SAUCE_ACCESS_KEY");
    private String SAUCE_REMOTE_URL = "https://ondemand.saucelabs.com/wd/hub";
    private WebDriver driver;
    private SessionId sessionId;

    @Rule
    public TestName testName = new TestName();

    @Before
    public void runBeforeEachTest() throws MalformedURLException {
        MutableCapabilities sauceOptions = getMutableCapabilities();
        ChromeOptions chromeOpts = getChromeOptions(sauceOptions);

        driver = new RemoteWebDriver(new URL(SAUCE_REMOTE_URL), chromeOpts);
        sessionId = ((RemoteWebDriver) driver).getSessionId();
        driver.navigate().to("https://www.saucedemo.com");
    }

    @Test
    public void shouldSetTestStatusToPassed() throws InvalidTestStatusException {