Skip to content

Commit

Permalink
more readme updates
Browse files Browse the repository at this point in the history
  • Loading branch information
iainrose committed Feb 11, 2012
1 parent f2f80f4 commit e9a1cb2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README
Expand Up @@ -58,6 +58,9 @@ Right click on the test and select 'run' or 'debug'

-- Running the tests using Gradle

Unless you have Gradle installed, you'll need to use the Gradle wrapper which is included in the project
./gradlew or gradle.bat on Windows

To run all tests (uses Firefox by default)
./gradlew clean test

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/AbstractPageObject.java
Expand Up @@ -18,20 +18,20 @@ public AbstractPageObject(WebDriver driver) {
isLoaded();
}

// Each page object must implement this method to return the identifier of a unique WebElement on that page
// Each page object must implement this method to return the identifier of a unique WebElement on that page.
// The presence of this unique element will be used to assert that the expected page has finished loading
protected abstract By getUniqueElement();

protected void isLoaded() throws Error {
//Define a list of WebElemnet that match the unique element locator for the page
//Define a list of WebElements that match the unique element locator for the page
List<WebElement> uniqueElement = driver.findElements(getUniqueElement());

// Assert that the unique element is present in the DOM
Assert.assertTrue((uniqueElement.size() > 0),
"Unique Element \'" + getUniqueElement().toString() + "\' not found for " + this.getClass().getSimpleName());

// Wait until the unique element is visible in the browser and ready to use. This helps make sure the page is
//loaded before the tests continue.
// Wait until the unique element is visible in the browser and ready to use. This helps make sure the page is
// loaded before the next step of the tests continue.
wait.until(ExpectedConditions.visibilityOfElementLocated(getUniqueElement()));
}

Expand Down

0 comments on commit e9a1cb2

Please sign in to comment.