Skip to content

Commit 4877520

Browse files
committed
updated test setup as per selenide docs
1 parent be6be27 commit 4877520

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/test/java/com/browserstack/BrowserStackTest.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.testng.annotations.BeforeMethod;
1515
import org.testng.annotations.AfterMethod;
1616

17+
import com.codeborne.selenide.Configuration;
1718
import com.codeborne.selenide.WebDriverRunner;
1819
import org.yaml.snakeyaml.Yaml;
1920

@@ -33,19 +34,19 @@ public BrowserStackTest() {
3334

3435
@BeforeMethod(alwaysRun = true)
3536
public void setUp() throws Exception {
36-
MutableCapabilities capabilities = new MutableCapabilities();
3737
HashMap<String, String> bstackOptions = new HashMap<>();
3838
bstackOptions.put("source", "selenide:sample-master:v1.2");
39-
capabilities.setCapability("bstack:options", bstackOptions);
40-
driver = new RemoteWebDriver(new URL(String.format("https://%s:%[email protected]/wd/hub", userName, accessKey)), capabilities);
41-
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
42-
WebDriverRunner.setWebDriver(driver);
39+
bstackOptions.put("userName", userName);
40+
bstackOptions.put("accessKey", accessKey);
41+
Configuration.timeout = 10000;
42+
Configuration.remote = "https://hub-cloud.browserstack.com/wd/hub";
43+
Configuration.browserCapabilities.setCapability("bstack:options", bstackOptions);
4344
}
4445

45-
@AfterMethod(alwaysRun = true)
46-
public void tearDown() {
47-
WebDriverRunner.getWebDriver().quit();
48-
}
46+
// @AfterMethod(alwaysRun = true)
47+
// public void tearDown() {
48+
// WebDriverRunner.getWebDriver().quit();
49+
// }
4950

5051
private String getUserDir() {
5152
return System.getProperty(USER_DIR);

0 commit comments

Comments
 (0)