Skip to content

Commit 40b4f85

Browse files
authored
Merge pull request #1 from pulkitsharma07/changes
Some fixes.
2 parents d55c4d9 + 96518c7 commit 40b4f85

File tree

11 files changed

+34
-31
lines changed

11 files changed

+34
-31
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212

1313
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
1414
hs_err_pid*
15-
15+
target/
1616
/.idea/
17-
*.iml
17+
*.iml

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@ test_safari:
1717
mvn install -Dbrowser=safari
1818

1919
test_chrome:
20-
mvn install -Dbrowser=chrome
20+
mvn install -Dbrowser=chrome
21+
22+
test_local:
23+
mvn install -Dbrowser=chrome -Dlocal=true

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1515
<cucumber.jvm.parallel.version>2.2.0</cucumber.jvm.parallel.version>
1616
<surefire.maven.plugin.version>2.19.1</surefire.maven.plugin.version>
17-
<acceptance.test.parallel.count>10</acceptance.test.parallel.count>
17+
<acceptance.test.parallel.count>1</acceptance.test.parallel.count>
1818
</properties>
1919

2020
<dependencies>
@@ -54,7 +54,7 @@
5454
<dependency>
5555
<groupId>com.browserstack</groupId>
5656
<artifactId>browserstack-local-java</artifactId>
57-
<version>1.0.0</version>
57+
<version>1.0.1</version>
5858
</dependency>
5959

6060
</dependencies>

src/test/java/com/browserstack/stepdefs/SearchSteps.java

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.browserstack.stepdefs;
22

3+
import com.browserstack.local.Local;
34
import com.browserstack.pageobjects.SearchPage;
45
import cucumber.api.Scenario;
56
import cucumber.api.java.After;
@@ -12,22 +13,34 @@
1213
import org.openqa.selenium.remote.RemoteWebDriver;
1314

1415
import java.net.URL;
16+
import java.util.HashMap;
17+
import java.util.Map;
1518

1619
import static org.junit.Assert.assertEquals;
20+
import static org.junit.Assert.assertTrue;
1721

1822
public class SearchSteps {
1923
private WebDriver driver;
2024
private SearchPage searchPage;
25+
private Local l;
2126

2227
@Before
2328
public void setUp(Scenario scenario) throws Exception {
2429
String USERNAME = System.getenv("BROWSERSTACK_USERNAME");
25-
String ACCESS_KEY = System.getenv("BROWSERSTACK_ACCESSKEY");
30+
String ACCESS_KEY = System.getenv("BROWSERSTACK_ACCESS_KEY");
2631
String URL = "https://" + USERNAME + ":" + ACCESS_KEY + "@hub.browserstack.com/wd/hub";
2732

2833
DesiredCapabilities caps = new DesiredCapabilities();
2934
caps.setCapability("browser", System.getProperty("browser"));
3035

36+
if (System.getProperty("local") != null && System.getProperty("local").equals("true")) {
37+
caps.setCapability("browserstack.local", "true");
38+
l = new Local();
39+
Map<String, String> options = new HashMap<String, String>();
40+
options.put("key", ACCESS_KEY);
41+
l.start(options);
42+
}
43+
3144
driver = new RemoteWebDriver(new URL(URL), caps);
3245
searchPage = new SearchPage(driver);
3346
}
@@ -48,8 +61,14 @@ public void I_should_see_pagetitle(String expectedTitle) throws Throwable {
4861
assertEquals(expectedTitle, driver.getTitle());
4962
}
5063

64+
@Then("the page should contain '(.+)'$")
65+
public void page_should_contain(String expectedTitle) throws Throwable {
66+
assertTrue(driver.getPageSource().contains(expectedTitle));
67+
}
68+
5169
@After
5270
public void teardown() throws Exception {
5371
driver.quit();
72+
if (l != null) l.stop();
5473
}
55-
}
74+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Feature: Verify Local test
2+
3+
Scenario: Navigate to Local check page
4+
Given I am on the website 'http://bs-local.com:45691/check'
5+
Then the page should contain 'Up and running'

target/cucumber_reports/test_results/1.junit

Whitespace-only changes.

target/generated-test-sources/features/Search_Parallel01IT.java

Lines changed: 0 additions & 13 deletions
This file was deleted.

target/maven-archiver/pom.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

Whitespace-only changes.

target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)