예제 #1
0
    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)
예제 #2
0
    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)
예제 #3
0
    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)
예제 #4
0
    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)
예제 #5
0
    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)
예제 #6
0
    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)
예제 #7
0
    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)
예제 #8
0
    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)
예제 #9
0
    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)
예제 #10
0
    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)
예제 #11
0
    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)