Skip to content

Instantly share code, notes, and snippets.

@trivial-search
Created June 12, 2018 00:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trivial-search/d5917312ca3b9d309379f01548cca594 to your computer and use it in GitHub Desktop.
Save trivial-search/d5917312ca3b9d309379f01548cca594 to your computer and use it in GitHub Desktop.
[Test()]
public void TradeMe_verify_logged_in_POM()
{
// Use a Page Object method to enter user name
Trade_Me_PageObject.Enter_UserName("xxxxxx@gmail.com");
// Use a Page Object method to enter password
Trade_Me_PageObject.Enter_Password("xxxxxx");
// Use a Page Object method to press log in button
Trade_Me_PageObject.Tap_LoginButton();
// explicit wait .. this still needs to be refactored ;)
WebDriverWait wait = new WebDriverWait(app, TimeSpan.FromSeconds(30));
wait.Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.Id("nz.co.trademe.trademe:id/menuAccount")));
// Use a Page Object method to click account icon
Trade_Me_PageObject.Tap_AccountIcon();
// another explicit wait... this needs to be refactored too
wait.Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.Id("nz.co.trademe.trademe:id/buttonLogout")));
// perform an assert on the account name returned by the Page Object class
Assert.AreEqual(Trade_Me_PageObject.Return_AccountName_UnderTest(), "sunjeet81_1");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment