Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Wait for page silence before and after login
Browse files Browse the repository at this point in the history
  • Loading branch information
seanf authored and djansen-redhat committed Mar 6, 2015
1 parent 0027ae7 commit 1bab304
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions functional-test/src/main/java/org/zanata/page/BasePage.java
Expand Up @@ -23,7 +23,6 @@
import java.util.List;

import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverException;
Expand Down Expand Up @@ -156,21 +155,24 @@ public RegisterPage goToRegistration() {

public SignInPage clickSignInLink() {
log.info("Click Log In");
waitForPageSilence();
WebElement signInLink = getDriver().findElement(BY_SIGN_IN);
signInLink.click();
return new SignInPage(getDriver());
}

public boolean hasLoggedIn() {
log.info("Query user is logged in");
waitForPageSilence();
List<WebElement> avatar = getDriver().findElements(BY_USER_AVATAR);
return avatar.size() > 0;
}

public String loggedInAs() {
log.info("Query logged in user name");
return waitForWebElement(BY_USER_AVATAR).getAttribute(
"data-original-title");
waitForPageSilence();
return waitForWebElement(BY_USER_AVATAR)
.getAttribute("data-original-title");
}

public HomePage logout() {
Expand Down

0 comments on commit 1bab304

Please sign in to comment.