From fc2d037a451ba6fb2e40b47192fa3e2621b1ffb3 Mon Sep 17 00:00:00 2001 From: John Smart Date: Mon, 29 Sep 2014 16:26:12 -0700 Subject: [PATCH] Fine-tuning --- .../services/acceptancetests/pages/MyAccountPage.java | 5 +++++ .../stepdefs/MyAccountStepUIDefinitions.java | 3 ++- .../services/acceptancetests/steps/MyAccountUISteps.java | 7 +++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/acceptance-tests/src/test/java/flyinghigh/services/acceptancetests/pages/MyAccountPage.java b/acceptance-tests/src/test/java/flyinghigh/services/acceptancetests/pages/MyAccountPage.java index fb8e2b0..14417d5 100644 --- a/acceptance-tests/src/test/java/flyinghigh/services/acceptancetests/pages/MyAccountPage.java +++ b/acceptance-tests/src/test/java/flyinghigh/services/acceptancetests/pages/MyAccountPage.java @@ -3,6 +3,7 @@ import flyinghigh.services.acceptancetests.domain.Airport; import javafx.beans.binding.MapExpression; import net.thucydides.core.annotations.DefaultUrl; +import net.thucydides.core.annotations.findby.By; import net.thucydides.core.pages.PageObject; import java.util.List; @@ -33,4 +34,8 @@ public void waitForFieldsToLoad() { waitFor("#destination option:nth-child(2)"); waitFor(250).milliseconds(); } + + public void waitForCalulationResult() { + waitForRenderedElements(By.cssSelector(".calculated-points")); + } } diff --git a/acceptance-tests/src/test/java/flyinghigh/services/acceptancetests/stepdefs/MyAccountStepUIDefinitions.java b/acceptance-tests/src/test/java/flyinghigh/services/acceptancetests/stepdefs/MyAccountStepUIDefinitions.java index 32e2b08..87f81c9 100644 --- a/acceptance-tests/src/test/java/flyinghigh/services/acceptancetests/stepdefs/MyAccountStepUIDefinitions.java +++ b/acceptance-tests/src/test/java/flyinghigh/services/acceptancetests/stepdefs/MyAccountStepUIDefinitions.java @@ -33,7 +33,8 @@ public void openMyAccountPage() { @When("I calculate the points needed to go from to ") public void calculatePointsNeeded(String departure, String destination) { - calculatedPoints = myAccountSteps.calculatePointsNeededBetween(departure,destination); + calculatedPoints = myAccountSteps.calculatePointsNeededBetween(departure, + destination); } @Then("I should see points") diff --git a/acceptance-tests/src/test/java/flyinghigh/services/acceptancetests/steps/MyAccountUISteps.java b/acceptance-tests/src/test/java/flyinghigh/services/acceptancetests/steps/MyAccountUISteps.java index 7fa3560..db48fc7 100644 --- a/acceptance-tests/src/test/java/flyinghigh/services/acceptancetests/steps/MyAccountUISteps.java +++ b/acceptance-tests/src/test/java/flyinghigh/services/acceptancetests/steps/MyAccountUISteps.java @@ -7,7 +7,6 @@ public class MyAccountUISteps { - MyAccountPage myAccountPage; @Step public void openAccountPage() { @@ -15,10 +14,14 @@ public void openAccountPage() { myAccountPage.waitForFieldsToLoad(); } + MyAccountPage myAccountPage; + @Step - public int calculatePointsNeededBetween(String departure, String destination) { + public int calculatePointsNeededBetween(String departure, + String destination) { myAccountPage.selectDepartureCity(departure); myAccountPage.selectDestinationCity(destination); + myAccountPage.waitForCalulationResult(); return myAccountPage.getCalculatedPoints(); }