def test_first(self): self.driver.find_element_by_name('ActionButton').click() email_address = generate_email() self.driver.find_element_by_xpath('//UIATextField').send_keys(email_address) self.driver.find_element_by_name('ActionButton').click() self.driver.find_element_by_name('tos unchecked').click() password = get_default_password() self.driver.find_element_by_xpath('//UIASecureTextField[1]').send_keys(password) self.driver.find_element_by_name('ActionButton').click() self.driver.find_element_by_xpath('//UIATextField').send_keys('Appium') self.driver.find_element_by_name('Birthdate').click() self.driver.find_element_by_name('Next').click() self.driver.find_element_by_xpath('//UIATextField').send_keys('group-many') self.driver.find_element_by_name('ActionButton').click() sleep(5) # Simulate user who stops briefly to read welcome text message self.driver.find_element_by_name('ActionButton').click() self.driver.find_element_by_xpath('//UIAApplication[1]/UIAWindow[1]/UIATableView[2]/UIATableCell[1]/UIAButton[1]').click() self.driver.find_element_by_name('ActionButton').click() online_status = self.driver.find_elements_by_name('ONLINE') offline_status = self.driver.find_elements_by_name('OFFLINE') assert len(online_status) + len(offline_status) == 1, "Neither ONLINE nor OFFLINE status displayed on Your PHA page" if (len(online_offline_status) > 0): print 'offline' else: print 'online'
def enter_new_password(self,password=get_default_password()): password_locator = self.driver.find_element_by_xpath(locators['new_password']) password_locator.click() password_locator.send_keys(password) self.driver.find_element_by_name(locators['tos']).click() self.driver.find_element_by_name(locators['next']).click()