Skip to content

Commit 9c79409

Browse files
committed
start local in beforeSpec if local is null
1 parent 7e0fd09 commit 9c79409

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/test/java/com/browserstack/gauge/pages/SearchSpec.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,21 @@ public void setUp() throws Exception {
4242
HashMap<String, Object> browserstackOptions = new HashMap<String, Object>();
4343

4444
if (!(System.getenv("LOCAL").isEmpty()) && System.getenv("LOCAL").equalsIgnoreCase("true")) {
45-
if (local != null && local.isRunning()) {
46-
browserstackOptions.put("local", "true");
45+
if(local == null || !local.isRunning()){
46+
local = new Local();
47+
Map<String, String> options = new HashMap<String, String>();
48+
options.put("key", AUTOMATE_KEY);
49+
local.start(options);
4750
}
51+
browserstackOptions.put("local", "true");
4852
}
4953

5054
// Capabilities from environment
5155
if(System.getenv("DEVICE") != null){
5256
caps.setCapability("browserName", System.getenv("BROWSERNAME"));
53-
caps.setCapability("os", System.getenv("PLATFORM"));
54-
caps.setCapability("deviceName", System.getenv("DEVICE"));
57+
caps.setCapability("platformName", System.getenv("PLATFORM"));
58+
59+
browserstackOptions.put("deviceName", System.getenv("DEVICE"));
5560
}
5661
else {
5762
caps.setCapability("browserName", System.getenv("BROWSERNAME"));

0 commit comments

Comments
 (0)