diff --git a/src/test/java/com/browserstack/local/pages/LocalPage.java b/src/test/java/com/browserstack/local/pages/LocalPage.java index ee2ad05..2086a2d 100644 --- a/src/test/java/com/browserstack/local/pages/LocalPage.java +++ b/src/test/java/com/browserstack/local/pages/LocalPage.java @@ -4,7 +4,7 @@ import org.openqa.selenium.WebElement; public class LocalPage { - private String DEFAULT_LOCAL_URL = "http://bs-local.com:45691/check"; + private String DEFAULT_LOCAL_URL = "http://bs-local.com:45454/"; private WebDriver driver; private WebElement element; @@ -12,8 +12,8 @@ public LocalPage(WebDriver driver) { this.driver = driver; } - public String getPageSource(){ - return driver.getPageSource(); + public String getPageTitle(){ + return driver.getTitle(); } public void openHealthCheck() { diff --git a/src/test/java/com/browserstack/local/steps/LocalSteps.java b/src/test/java/com/browserstack/local/steps/LocalSteps.java index fce5724..e6d9b2d 100644 --- a/src/test/java/com/browserstack/local/steps/LocalSteps.java +++ b/src/test/java/com/browserstack/local/steps/LocalSteps.java @@ -19,8 +19,8 @@ public void openHealthCheck() { page.openHealthCheck(); } - @Then("I should see \"$keyword\"") - public void pageShouldContain(String keyword) { - Assert.assertTrue(page.getPageSource().contains(keyword)); + @Then("the title should contain \"$keyword\"") + public void pageTitleShouldContain(String keyword) { + Assert.assertTrue(page.getPageTitle().contains(keyword)); } } diff --git a/src/test/resources/stories/local.story b/src/test/resources/stories/local.story index 811128c..bdfdfb2 100644 --- a/src/test/resources/stories/local.story +++ b/src/test/resources/stories/local.story @@ -1,4 +1,4 @@ Scenario: Can check tunnel working When I open health check -Then I should see "Up and running" +Then the title should contain "BrowserStack Local"