Skip to content

Instantly share code, notes, and snippets.

@sunjeet-khokhar sunjeet-khokhar/Page.cs Secret
Created Jun 12, 2018

Embed
What would you like to do?
[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
You can’t perform that action at this time.