Skip to content

Commit

Permalink
Fine-tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
wakaleo committed Sep 29, 2014
1 parent be8f9e0 commit fc2d037
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -33,4 +34,8 @@ public void waitForFieldsToLoad() {
waitFor("#destination option:nth-child(2)");
waitFor(250).milliseconds();
}

public void waitForCalulationResult() {
waitForRenderedElements(By.cssSelector(".calculated-points"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public void openMyAccountPage() {

@When("I calculate the points needed to go from <departure> to <destination>")
public void calculatePointsNeeded(String departure, String destination) {
calculatedPoints = myAccountSteps.calculatePointsNeededBetween(departure,destination);
calculatedPoints = myAccountSteps.calculatePointsNeededBetween(departure,
destination);
}

@Then("I should see <requiredPoints> points")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@

public class MyAccountUISteps {

MyAccountPage myAccountPage;

@Step
public void openAccountPage() {
myAccountPage.open();
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();
}

Expand Down

0 comments on commit fc2d037

Please sign in to comment.