1414import org .testng .annotations .BeforeMethod ;
1515import org .testng .annotations .AfterMethod ;
1616
17+ import com .codeborne .selenide .Configuration ;
1718import com .codeborne .selenide .WebDriverRunner ;
1819import 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