def test_newsletter(self): self.driver.get(login.login_url) services.send_keys_by_xpath(self, login.login_mail_input, account.account_mail_newsletter) login.check_login(self) services.assert_and_click(self, By.LINK_TEXT, account.account_newsletter) services.assert_and_click(self, By.XPATH, account.account_newsletter_1) services.assert_and_click(self, By.CSS_SELECTOR, account.account_submit) services.assert_and_click(self, By.LINK_TEXT, account.account_newsletter) services.assert_and_click(self, By.XPATH, account.account_newsletter_0) services.assert_and_click(self, By.CSS_SELECTOR, account.account_submit) login.check_logout(self)
def test_basket_reorder(self): self.driver.get(login.login_url) services.send_keys_by_xpath(self, login.login_mail_input, basket.reorder_mail) login.check_login(self) services.assert_and_click(self, By.LINK_TEXT, basket.reorder_history) services.assert_and_click(self, By.CSS_SELECTOR, basket.reorder_view) services.assert_and_click(self, By.CSS_SELECTOR, basket.reorder_add) services.is_element_visible(self, By.CSS_SELECTOR, basket.reorder_success) services.assert_and_click(self, By.XPATH, basket.basket_cart) services.assert_and_click(self, By.CSS_SELECTOR, basket.basket_remove) services.is_element_visible(self, By.XPATH, basket.basket_empty) services.assert_text(self, By.XPATH, basket.basket_empty, basket.basket_empty_text) self.driver.get(login.login_url) login.check_logout(self)
def test_return(self): self.driver.get(login.login_url) services.send_keys_by_xpath(self, login.login_mail_input, checkout.checkout_return_email) login.check_login(self) services.assert_and_click(self, By.LINK_TEXT, basket.reorder_history) services.assert_and_click(self, By.CSS_SELECTOR, basket.reorder_view) services.assert_and_click(self, By.CSS_SELECTOR, checkout.return_button) services.assert_and_click(self, By.CSS_SELECTOR, checkout.return_submit) services.assert_text(self, By.CSS_SELECTOR, checkout.return_necessary_option, checkout.return_option_text) services.assert_and_click(self, By.NAME, checkout.return_radio) services.assert_and_click(self, By.CSS_SELECTOR, checkout.return_submit) services.assert_text(self, By.XPATH, checkout.return_success, checkout.return_success_text) login.check_logout(self)
def check_login(self): services.send_keys_by_xpath(self, login.login_pwd_input, login.login_pwd) services.assert_and_click(self, By.CSS_SELECTOR, login.login_submit) services.assert_text(self, By.XPATH, login.login_my_acc, login.login_success)
def test_login_failed(self): self.driver.get(login.login_url) services.send_keys_by_xpath(self, login.login_mail_input, login.login_fail_mail) services.send_keys_by_xpath(self, login.login_pwd_input, login.login_fail_pwd) services.assert_and_click(self, By.CSS_SELECTOR, login.login_submit) services.assert_text(self, By.CSS_SELECTOR, login.login_alert, login.login_fail_msg)
def test_gc_add(self): services.assert_and_click(self, By.LINK_TEXT, basket.basket_gc) services.send_keys_by_xpath(self, basket.basket_gc_name, basket.basket_gc_data) services.send_keys_by_xpath(self, basket.basket_gc_mail, basket.basket_gc_data_mail) services.send_keys_by_xpath(self, basket.basket_gc_sender_name, basket.basket_gc_data) services.send_keys_by_xpath(self, basket.basket_gc_sender_mail, basket.basket_gc_data_mail) services.assert_and_click(self, By.XPATH, basket.basket_gc_radio) services.assert_and_click(self, By.XPATH, basket.basket_gc_submit) services.assert_text(self, By.CSS_SELECTOR, basket.basket_gc_alert_fail, basket.basket_gc_fail_text) services.assert_and_click(self, By.NAME, basket.basket_gc_checkbox) services.assert_and_click(self, By.XPATH, basket.basket_gc_submit) services.assert_and_click(self, By.LINK_TEXT, basket.basket_gc_continue) services.assert_and_click(self, By.CSS_SELECTOR, basket.basket_remove) services.assert_text(self, By.XPATH, basket.basket_empty, basket.basket_empty_text)
def test_search(self): services.send_keys_by_xpath(self, search.search_input, search.search_case) services.assert_and_click(self, By.XPATH, search.search_submit) services.assert_text(self, By.LINK_TEXT, search.search_result, search.search_case) services.clear_element_by_xpath(self, search.search_input) services.assert_and_click(self, By.XPATH, search.search_submit) services.assert_text(self, By.XPATH, search.search_failed, search.search_failed_msg)
def test_change_data(self): self.driver.get(login.login_url) services.send_keys_by_xpath(self, login.login_mail_input, account.account_mail_missing) login.check_login(self) services.assert_and_click(self, By.LINK_TEXT, account.account_edit) services.clear_element_by_xpath(self, account.account_edit_phone) services.send_keys_by_xpath(self, account.account_edit_phone, account.account_data_random) services.assert_and_click(self, By.CSS_SELECTOR, account.account_submit) services.assert_text(self, By.CSS_SELECTOR, account.account_success, account.account_updated) login.check_logout(self)
def test_forgotten_pwd(self): self.driver.get(login.login_url) services.assert_and_click(self, By.LINK_TEXT, login.login_forgotten_pwd) services.send_keys_by_xpath(self, login.login_mail_input, login.login_fail_mail) services.assert_and_click(self, By.CSS_SELECTOR, login.login_submit) services.assert_text(self, By.CSS_SELECTOR, login.login_alert, login.login_forgotten_msg_alert) services.clear_element_by_xpath(self, login.login_mail_input) services.send_keys_by_xpath(self, login.login_mail_input, login.login_mail) services.assert_and_click(self, By.CSS_SELECTOR, login.login_submit) services.assert_text(self, By.CSS_SELECTOR, login.login_alert, login.login_forgotten_msg_success)
def test_last_address(self): self.driver.get(login.login_url) services.send_keys_by_xpath(self, login.login_mail_input, account.account_mail_failed) login.check_login(self) services.assert_and_click(self, By.LINK_TEXT, account.account_address_book) services.assert_and_click(self, By.CSS_SELECTOR, account.account_delete) services.assert_text(self, By.CSS_SELECTOR, account.account_failed, account.account_last_address_text) login.check_logout(self)
def test_affiliate(self): self.driver.get(login.login_url) services.send_keys_by_xpath(self, login.login_mail_input, account.account_mail_affiliate) login.check_login(self) services.assert_and_click(self, By.LINK_TEXT, account.account_affiliate) services.send_keys_by_xpath(self, account.account_affiliate_tax, account.account_data_random) services.assert_and_click(self, By.CSS_SELECTOR, account.account_submit) services.assert_text(self, By.CSS_SELECTOR, account.account_success, account.account_updated) login.check_logout(self)
def test_address_missing_fields(self): self.driver.get(login.login_url) services.send_keys_by_xpath(self, login.login_mail_input, account.account_mail_missing) login.check_login(self) services.assert_and_click(self, By.LINK_TEXT, account.account_address_book) services.assert_and_click(self, By.LINK_TEXT, account.account_add_address) services.assert_and_click(self, By.CSS_SELECTOR, account.account_submit) services.assert_text(self, By.CSS_SELECTOR, account.account_missing, account.account_missing_text) login.check_logout(self)
def test_checkout(self): self.driver.get(login.login_url) services.send_keys_by_xpath(self, login.login_mail_input, checkout.checkout_mail) login.check_login(self) self.driver.get(basket.basket_pp) services.assert_and_click(self, By.XPATH, basket.basket_add) services.assert_and_click(self, By.XPATH, basket.basket_cart) services.assert_and_click(self, By.LINK_TEXT, checkout.checkout_btn) services.assert_and_click(self, By.XPATH, checkout.checkout_payment) services.assert_and_click(self, By.XPATH, checkout.checkout_shipping) services.assert_and_click(self, By.XPATH, checkout.checkout_shipping_method) services.assert_and_click(self, By.XPATH, checkout.checkout_payment_method) services.assert_text(self, By.CSS_SELECTOR, checkout.checkout_alert_checkbox, checkout.checkout_alert_msg) services.assert_and_click(self, By.NAME, checkout.checkout_checkbox) services.assert_and_click(self, By.XPATH, checkout.checkout_payment_method) services.assert_and_click(self, By.XPATH, checkout.checkout_confirm) services.wait_for_title(self, checkout.checkout_placed_title) services.assert_text(self, By.XPATH, checkout.checkout_order_placed, checkout.checkout_order_placed_msg) self.driver.get(login.login_url) login.check_logout(self)
def test_contact(self): services.assert_and_click(self, By.LINK_TEXT, contact.contact_link) services.send_keys_by_xpath(self, contact.contact_name, contact.contact_data_name) services.send_keys_by_xpath(self, contact.contact_mail, contact.contact_data_mail) services.send_keys_by_xpath(self, contact.contact_message, contact.contact_data_short_message) services.assert_and_click(self, By.XPATH, contact.contact_submit) services.assert_text(self, By.XPATH, contact.contact_success, contact.contact_success_text)
def test_contact(self): services.assert_and_click(self, By.LINK_TEXT, contact.contact_link) services.send_keys_by_xpath(self, contact.contact_name, contact.contact_data_name) services.send_keys_by_xpath(self, contact.contact_mail, contact.contact_data_name) services.send_keys_by_xpath(self, contact.contact_message, contact.contact_data_message) services.assert_and_click(self, By.XPATH, contact.contact_submit) services.assert_text(self, By.CSS_SELECTOR, contact.contact_danger, contact.contact_danger_mail_text)
def test_pwd_change(self): self.driver.get(login.login_url) services.send_keys_by_xpath(self, login.login_mail_input, login.pwd_change_mail) login.check_login(self) services.assert_and_click(self, By.LINK_TEXT, login.login_pwd_change) services.send_keys_by_xpath(self, login.login_pwd_input, login.pwd_change_changed_pass) services.send_keys_by_xpath(self, login.pwd_change_input_confirm, login.pwd_change_changed_pass) services.assert_and_click(self, By.XPATH, login.pwd_change_submit) login.check_logout(self) self.driver.get(login.login_url) services.send_keys_by_xpath(self, login.login_mail_input, login.pwd_change_mail) services.send_keys_by_xpath(self, login.login_pwd_input, login.pwd_change_changed_pass) services.assert_and_click(self, By.CSS_SELECTOR, login.login_submit) services.assert_and_click(self, By.LINK_TEXT, login.login_pwd_change) services.send_keys_by_xpath(self, login.login_pwd_input, login.pwd_change_default_pass) services.send_keys_by_xpath(self, login.pwd_change_input_confirm, login.pwd_change_default_pass) services.assert_and_click(self, By.XPATH, login.pwd_change_submit) services.assert_text(self, By.CSS_SELECTOR, login.login_alert, login.pwd_change_success) login.check_logout(self)
def test_add_address(self): self.driver.get(login.login_url) services.send_keys_by_xpath(self, login.login_mail_input, account.account_mail) login.check_login(self) services.assert_and_click(self, By.LINK_TEXT, account.account_address_book) services.assert_and_click(self, By.LINK_TEXT, account.account_add_address) services.send_keys_by_xpath(self, account.account_fname, account.account_data) services.send_keys_by_xpath(self, account.account_lname, account.account_data) services.send_keys_by_xpath(self, account.account_company, account.account_data) services.send_keys_by_xpath(self, account.account_address1, account.account_data) services.send_keys_by_xpath(self, account.account_address2, account.account_data) services.send_keys_by_xpath(self, account.account_city, account.account_data) services.send_keys_by_xpath(self, account.account_postcode, account.account_data_postcode) services.assert_and_click(self, By.XPATH, account.account_region_select) services.assert_and_click(self, By.CSS_SELECTOR, account.account_submit) services.assert_text(self, By.CSS_SELECTOR, account.account_success, account.account_added_text) services.assert_and_click(self, By.CSS_SELECTOR, account.account_delete) services.assert_text(self, By.CSS_SELECTOR, account.account_success, account.account_deleted_text) login.check_logout(self)
def test_register(self): self.driver.get(register.register_url) services.assert_and_click(self, By.CSS_SELECTOR, register.register_btn) services.send_keys_by_xpath(self, register.register_fname, register.register_data_fname) services.send_keys_by_xpath(self, register.register_lname, register.register_data_lname) services.send_keys_by_xpath(self, register.register_mail, register.register_data_mail) services.send_keys_by_xpath(self, register.register_phone, register.register_data_phone) services.send_keys_by_xpath(self, register.register_pwd, register.register_data_pwd) services.send_keys_by_xpath(self, register.register_pwd_conf, register.register_data_pwd) services.assert_and_click(self, By.NAME, register.register_checkbox) services.assert_and_click(self, By.CSS_SELECTOR, register.register_submit) services.assert_text(self, By.XPATH, register.register_success_h1, "Account") services.assert_and_click(self, By.CSS_SELECTOR, register.register_success_continue) login.check_logout(self)