public void TradeMe_verify_logged_account() { AppiumWebElement TradeMe_Login = app.FindElementById("nz.co.trademe.trademe:id/editTextLoginEmail"); Assert.IsNotNull(TradeMe_Login); TradeMe_Login.SendKeys("*****@*****.**"); AppiumWebElement TradeMe_Pwd = app.FindElementById("nz.co.trademe.trademe:id/editTextLoginPassword"); TradeMe_Pwd.SendKeys("yorks64"); AppiumWebElement Login_Button = app.FindElementById("nz.co.trademe.trademe:id/buttonLogin"); Login_Button.Tap(1, 1); WebDriverWait wait = new WebDriverWait(app, TimeSpan.FromSeconds(30)); wait.Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.Id("nz.co.trademe.trademe:id/menuAccount"))); AppiumWebElement account_icon = app.FindElementByAccessibilityId("Account"); account_icon.Tap(1, 1); WebDriverWait wait1 = new WebDriverWait(app, TimeSpan.FromSeconds(30)); wait1.Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.Id("nz.co.trademe.trademe:id/buttonLogout"))); AppiumWebElement account_name = app.FindElementById("nz.co.trademe.trademe:id/textViewAboutMemberUsername"); Assert.AreEqual(account_name.Text, "sunjeet81"); AppiumWebElement logout_button = app.FindElementById("nz.co.trademe.trademe:id/buttonLogout"); logout_button.Tap(1, 1); WebDriverWait wait2 = new WebDriverWait(app, TimeSpan.FromSeconds(30)); wait2.Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.Id("nz.co.trademe.trademe:id/buttonDialogGenericConfirm"))); AppiumWebElement confirm_button = app.FindElementByAccessibilityId("Confirm"); confirm_button.Tap(1, 1); Assert.IsNotNull(app.FindElementByAccessibilityId("Login")); }
public void TradeMe_verify_logged_in() { // Find the login input field AppiumWebElement TradeMe_Login = app.FindElementById("nz.co.trademe.trademe:id/editTextLoginEmail"); // key in your user name TradeMe_Login.SendKeys("*****@*****.**"); // Find the password field AppiumWebElement TradeMe_Pwd = app.FindElementById("nz.co.trademe.trademe:id/editTextLoginPassword"); // key in the password TradeMe_Pwd.SendKeys("yorks64"); // Find the login button AppiumWebElement Login_Button = app.FindElementById("nz.co.trademe.trademe:id/buttonLogin"); // Tap the login button Login_Button.Tap(1, 1); // Wait for the account menu item to be displayed WebDriverWait wait = new WebDriverWait(app, TimeSpan.FromSeconds(30)); wait.Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.Id("nz.co.trademe.trademe:id/menuAccount"))); // Find icon for my account AppiumWebElement account_icon = app.FindElementByAccessibilityId("Account"); // tap the icon account_icon.Tap(1, 1); // confirm that the logout button is visible, this is in turn ensure that the user name isbeing displayed wait.Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.Id("nz.co.trademe.trademe:id/buttonLogout"))); // find and assert on the text of the user name AppiumWebElement account_name = app.FindElementById("nz.co.trademe.trademe:id/textViewAboutMemberUsername"); Assert.AreEqual(account_name.Text, "sunjeet81"); }
public AppiumWebElement Create_a_NewNote() { AppiumWebElement new_note = driver.FindElementByAccessibilityId("New note"); new_note.Tap(1, 1); AppiumWebElement new_note_screen = driver.FindElementById("android:id/action_bar_title"); return(new_note_screen); }
public void TradeMe_verify_logged_out() { AppiumWebElement logout_button = app.FindElementById("nz.co.trademe.trademe:id/buttonLogout"); logout_button.Tap(1, 1); WebDriverWait wait = new WebDriverWait(app, TimeSpan.FromSeconds(30)); wait.Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.Id("nz.co.trademe.trademe:id/buttonDialogGenericConfirm"))); AppiumWebElement confirm_button = app.FindElementByAccessibilityId("Confirm"); confirm_button.Tap(1, 1); wait.Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.Id("Login"))); Assert.IsNotNull(app.FindElementByAccessibilityId("Login")); }
public void FindByClassChainTest() { ReadOnlyCollection <AppiumWebElement> sliderCellStaticTextElements_1 = driver .FindElements(new ByIosClassChain("**/XCUIElementTypeCell/XCUIElementTypeStaticText[`name == 'Sliders'`]")); Assert.AreEqual(sliderCellStaticTextElements_1.Count, 1); ReadOnlyCollection <AppiumWebElement> sliderCellStaticTextElements_2 = driver .FindElementsByIosClassChain("**/XCUIElementTypeCell"); Assert.AreEqual(sliderCellStaticTextElements_2.Count, 18); AppiumWebElement actionSheetsCell = driver.FindElement(new ByIosClassChain("**/XCUIElementTypeCell/XCUIElementTypeStaticText[`name == 'Action Sheets'`]")); actionSheetsCell.Tap(1, 250); driver.FindElementByIosClassChain("**/XCUIElementTypeNavigationBar/XCUIElementTypeButton").Click(); }