Esempio n. 1
0
 def test_my_account_06_ninja(self):
     myacc = MyAccountNinja(self.driver)
     # Click on "My Account" link
     myacc.click_my_account_link()
     # Click on "Login" link
     myacc.click_login_link()
     # Enter a valid email address
     myacc.set_email(self.email_address)
     # Enter a valid password
     myacc.set_password(self.password)
     # Click on "Login" button
     myacc.click_login_button()
     # Click on "Edit Account" link
     myacc.click_edit_account_link()
     # Enter new "First Name"
     myacc.set_first_name(self.first_name)
     # Enter new "Last Name"
     myacc.set_last_name(self.last_name)
     # Enter new "E-Mail"
     myacc.set_new_email(self.new_email)
     # Enter new "Telephone"
     myacc.set_telephone(self.telephone)
     # Click on "Continue" button
     myacc.click_continue_button()
     # Click "Edit Account"
     myacc.click_edit_account_link()
     # Verify if all the field changed with new data
     new_first_name = "Jacky"
     new_last_name = "Boy"
     new_email_address = "*****@*****.**"
     new_telephone = "+121233344455"
     elem = self.driver.find_element_by_xpath(
         MyAccountNinja.first_name_field)
     element = elem.get_attribute("value")
     time.sleep(2)
     #
     assert element == new_first_name, "ERROR. First name hasn't been changed."
     elem = self.driver.find_element_by_xpath(
         MyAccountNinja.last_name_field)
     element = elem.get_attribute("value")
     assert element == new_last_name, "ERROR. Last name hasn't been changed."
     elem = self.driver.find_element_by_xpath(MyAccountNinja.email_field)
     element = elem.get_attribute("value")
     assert element == new_email_address, "ERROR. E-Mail hasn't been changed."
     elem = self.driver.find_element_by_xpath(
         MyAccountNinja.telephone_field)
     element = elem.get_attribute("value")
     assert element == new_telephone, "ERROR. Telephone hasn't been changed."
     myacc.set_new_email(self.email_address)
     myacc.click_continue_button()
Esempio n. 2
0
 def test_my_account_12_ninja(self):
     wait = WebDriverWait(self.driver, 10)
     myacc = MyAccountNinja(self.driver)
     # Click on "My Account" link
     myacc.click_my_account_link()
     # Click on "Login" link
     myacc.click_login_link()
     # Enter a valid email address
     myacc.set_email(self.email_address)
     # Enter a valid password
     myacc.set_password(self.password)
     # Click on "Login" button
     myacc.click_login_button()
     # Click on "Edit Account" link
     myacc.click_edit_account_link()
     # Enter more than 32 characters in "First Name" field
     myacc.set_first_name(self.first_name)
     # Enter more than 32 characters in "Last Name" field
     myacc.set_last_name(self.last_name)
     # Enter an invalid email in "E-Mail" field
     myacc.set_email(self.email_empty)
     # Enter more than 32 characters in "Telephone" field
     myacc.set_telephone(self.telephone)
     # Click "Continue" button
     myacc.click_continue_button()
     # Verify if error messages are present for every field
     element = wait.until(
         EC.presence_of_element_located(
             (By.XPATH, MyAccountNinja.warning_first_name))).is_displayed()
     assert element, "ERROR. 'First Name' warning text is not displayed."
     element = self.driver.find_element_by_xpath(
         MyAccountNinja.warning_last_name).is_displayed()
     assert element, "ERROR. 'Last Name' warning text is not displayed."
     element = self.driver.find_element_by_xpath(
         MyAccountNinja.warning_email).is_displayed()
     assert element, "ERROR. 'E-mail' warning text is not displayed."
     element = self.driver.find_element_by_xpath(
         MyAccountNinja.warning_telephone).is_displayed()
     assert element, "ERROR. 'Telephone' warning text is not displayed."
Esempio n. 3
0
 def test_my_account_05_ninja(self):
     myacc = MyAccountNinja(self.driver)
     # Click on "My Account" link
     myacc.click_my_account_link()
     # Click on "Login" link
     myacc.click_login_link()
     # Enter a valid email address
     myacc.set_email(self.email_address)
     # Enter a valid password
     myacc.set_password(self.password)
     # Click on "Login" button
     myacc.click_login_button()
     # Click on "Edit Account" link
     myacc.click_edit_account_link()
     # Enter an empty text in "First Name" field
     myacc.set_first_name(self.first_name)
     # Enter an empty text in "Last Name" field
     myacc.set_last_name(self.last_name)
     # Enter an empty text in "E-Mail" field
     myacc.set_email(self.email_empty)
     # Enter an empty text in "Telephone" field
     myacc.set_telephone(self.telephone)
     # Click "Continue" button
     myacc.click_continue_button()
     # Verify if error messages are present for every field
     element = self.driver.find_element_by_xpath(
         MyAccountNinja.warning_first_name).is_displayed()
     assert element, "ERROR. 'First Name' warning text is not displayed."
     element = self.driver.find_element_by_xpath(
         MyAccountNinja.warning_last_name).is_displayed()
     assert element, "ERROR. 'Last Name' warning text is not displayed."
     element = self.driver.find_element_by_xpath(
         MyAccountNinja.warning_email).is_displayed()
     assert element, "ERROR. 'E-mail' warning text is not displayed."
     element = self.driver.find_element_by_xpath(
         MyAccountNinja.warning_telephone).is_displayed()
     assert element, "ERROR. 'Telephone' warning text is not displayed."