Ejemplo n.º 1
0
 def test_guest_buy_product8(self, browser):
     page = AllProductsPage(browser)
     page.open()
     page.user_in_system()
     page.add_to_basket_button()
     basket_page = BasketPage(browser)
     basket_page.open()
     basket_page.verify_page_name()
     basket_page.verify_items_in_basket()
     basket_page.browser.execute_script("window.scrollBy(0, 200);")
     basket_page.verify_shipping_free()
     basket_page.press_proceed_to_checkout_button()
     shipping_page = ShippingAddressPage(browser)
     shipping_page.press_button_ship_to_this_address()
     payment_page = EnterPaymentDetailsPage(browser)
     payment_page.press_button_continue()
     preview_page = PreviewOrderPage(browser)
     preview_page.verify_address_review()
     preview_page.verify_payment_review()
     preview_page.verify_basket_items_review()
     preview_page.press_place_order_button()
     confirmation_page = OrderConfirmationPage(browser)
     confirmation_page.verify_name_page()
     confirmation_page.verify_address_review()
     confirmation_page.verify_basket_items_review()
     confirmation_page.verify_button_print_page()
Ejemplo n.º 2
0
 def test_guest_buy_product5(self, browser):
     page = MainPage(browser)
     page.open()
     page.user_in_system()
     page.go_to_all_products_button_menu()
     all_products_page = AllProductsPage(browser)
     all_products_page.add_to_basket_button()
     all_products_page.verify_alert1_of_add_to_basket()
     all_products_page.verify_alert2_of_add_to_basket()
     all_products_page.verify_alert3_of_add_to_basket()
     all_products_page.press_checkout_from_alert()
     shipping_page = ShippingAddressPage(browser)
     shipping_page.press_button_ship_to_this_address()
     payment_page = EnterPaymentDetailsPage(browser)
     payment_page.press_button_continue()
     preview_page = PreviewOrderPage(browser)
     preview_page.verify_address_review()
     preview_page.verify_payment_review()
     preview_page.verify_basket_items_review()
     preview_page.press_place_order_button()
     confirmation_page = OrderConfirmationPage(browser)
     confirmation_page.verify_name_page()
     confirmation_page.verify_address_review()
     confirmation_page.verify_basket_items_review()
     confirmation_page.verify_button_print_page()
Ejemplo n.º 3
0
 def test_guest_buy_product6(self, browser):
     page = AllProductsPage(browser)
     page.open()
     page.user_in_system()
     page.add_to_basket_button()
     page.verify_alert1_of_add_to_basket()
     page.verify_alert2_of_add_to_basket()
     page.verify_alert3_of_add_to_basket()
     page.press_checkout_from_alert()
     shipping_page = ShippingAddressPage(browser)
     shipping_page.press_return_to_basket()
     basket_page = BasketPage(browser)
     basket_page.open()
Ejemplo n.º 4
0
 def test_buy_product_from_main_page(self, browser):
     page = MainPage(browser)
     page.open()
     page.user_in_system()
     page.add_to_basket_from_main_page()
     page.press_basket_button()
     basket_page = BasketPage(browser)
     basket_page.open()
     basket_page.verify_page_name()
     basket_page.verify_items_in_basket()
     basket_page.verify_shipping_free()
     basket_page.press_proceed_to_checkout_button()
     shipping_address_page = ShippingAddressPage(browser)
     shipping_address_page.open()
     shipping_address_page.fill_all_fields_in_shipping_form()
     shipping_address_page.press_continue_button()
     enter_payment_details_page = EnterPaymentDetailsPage(browser)
     enter_payment_details_page.open()
     enter_payment_details_page.verify_name_page()
     enter_payment_details_page.press_button_continue()
     preview_order_page = PreviewOrderPage(browser)
     preview_order_page.open()
     preview_order_page.verify_name_page()
     preview_order_page.verify_address_review()
     preview_order_page.verify_payment_review()
     preview_order_page.verify_basket_items_review()
     preview_order_page.press_place_order_button()
     order_confirmation_page = OrderConfirmationPage(browser)
     order_confirmation_page.open()
     order_confirmation_page.verify_name_page()
     order_confirmation_page.verify_address_review()
     order_confirmation_page.verify_basket_items_review()
     order_confirmation_page.verify_button_print_page()
     order_confirmation_page.verify_continue_shopping()
Ejemplo n.º 5
0
 def test_guest_buy_product5(self, browser):
     page = AllProductsPage(browser)
     page.open()
     page.add_to_basket_button()
     page.verify_alert1_of_add_to_basket()
     page.verify_alert2_of_add_to_basket()
     page.verify_alert3_of_add_to_basket()
     page.press_checkout_from_alert()
     checkout_page = CheckoutPage(browser)
     checkout_page.fill_email_in_checkout_guest()
     checkout_page.new_customer_button_checked()
     checkout_page.fill_password_guest()
     checkout_page.button_continue()
     shipping_page = ShippingAddressPage(browser)
     shipping_page.press_return_to_basket()
    def test_update_shipping_address_failed(self):
        email = "test{}@mail.com".format(random.randint(0, 10000))
        my_account_page = MyAccountPage(self.driver)
        my_account_page.open_page()
        my_account_page.create_account(email, "haslotest12")
        shipping_address_page = ShippingAddressPage(self.driver)
        shipping_address_page.open_edit_shipping_address()
        shipping_address_page.set_personal_data("", "")
        shipping_address_page.set_address("", "", "")
        shipping_address_page.save_address()
        generic = Generic(self.driver)
        error_msg = generic.get_error_msg_text()

        assert "First name is a required field." in error_msg
        assert "Last name is a required field." in error_msg
        assert "Street address is a required field." in error_msg
        assert "Postcode / ZIP is a required field." in error_msg
        assert "Town / City is a required field." in error_msg
Ejemplo n.º 7
0
 def test_guest_buy_product2(self, browser):
     page = AllProductsPage(browser)
     page.open()
     page.user_in_system()
     page.add_to_basket_button()
     page.verify_alert1_of_add_to_basket()
     page.verify_alert2_of_add_to_basket()
     page.verify_alert3_of_add_to_basket()
     page.press_view_basket_from_alert()
     basket_page = BasketPage(browser)
     basket_page.verify_page_name()
     basket_page.verify_items_in_basket()
     basket_page.verify_price_of_item()
     basket_page.press_proceed_to_checkout_button()
     shipping_page = ShippingAddressPage(browser)
     shipping_page.fill_required_fields_in_shipping_form()
     shipping_page.press_continue_button()
     payment_page = EnterPaymentDetailsPage(browser)
     payment_page.press_button_continue()
     preview_page = PreviewOrderPage(browser)
     preview_page.verify_address_review()
     preview_page.verify_payment_review()
     preview_page.verify_basket_items_review()
     preview_page.press_place_order_button()
     confirmation_page = OrderConfirmationPage(browser)
     confirmation_page.verify_name_page()
     confirmation_page.verify_address_review()
     confirmation_page.verify_basket_items_review()
     confirmation_page.verify_button_print_page()
Ejemplo n.º 8
0
 def test_guest_buy_product6(self, browser):
     page = AllProductsPage(browser)
     page.open()
     page.add_to_basket_button()
     basket_page = BasketPage(browser)
     basket_page.open()
     basket_page.verify_page_name()
     basket_page.verify_items_in_basket()
     basket_page.verify_shipping_free()
     basket_page.press_proceed_to_checkout_button()
     checkout_page = CheckoutPage(browser)
     checkout_page.fill_email_in_checkout_guest()
     checkout_page.new_customer_button_checked()
     checkout_page.fill_password_guest()
     checkout_page.button_continue()
     shipping_page = ShippingAddressPage(browser)
     shipping_page.fill_all_fields_in_shipping_form()
     shipping_page.press_continue_button()
     payment_page = EnterPaymentDetailsPage(browser)
     payment_page.press_button_continue()
     preview_page = PreviewOrderPage(browser)
     preview_page.verify_address_review()
     preview_page.verify_payment_review()
     preview_page.verify_basket_items_review()
     preview_page.press_place_order_button()
     confirmation_page = OrderConfirmationPage(browser)
     confirmation_page.verify_name_page()
     confirmation_page.verify_address_review()
     confirmation_page.verify_basket_items_review()
     confirmation_page.verify_button_print_page()
Ejemplo n.º 9
0
 def test_buy_product_from_main_page_2(self, browser):
     page = MainPage(browser)
     page.open()
     page.add_to_basket_from_main_page()
     page.press_basket_button()
     basket_page = BasketPage(browser)
     basket_page.open()
     basket_page.verify_page_name()
     basket_page.verify_items_in_basket()
     basket_page.verify_price_of_item()
     basket_page.verify_shipping_free()
     basket_page.verify_price_the_city_and_the_stars()
     basket_page.press_proceed_to_checkout_button()
     checkout_page = CheckoutPage(browser)
     checkout_page.open()
     checkout_page.fill_email_in_checkout_guest()
     checkout_page.new_customer_button_checked()
     checkout_page.fill_password_guest()
     checkout_page.button_continue()
     shipping_address_page = ShippingAddressPage(browser)
     shipping_address_page.open()
     shipping_address_page.fill_required_fields_in_shipping_form()
     shipping_address_page.press_continue_button()
     enter_payment_details_page = EnterPaymentDetailsPage(browser)
     enter_payment_details_page.open()
     enter_payment_details_page.verify_name_page()
     enter_payment_details_page.press_button_continue()
     preview_order_page = PreviewOrderPage(browser)
     preview_order_page.open()
     preview_order_page.verify_name_page()
     preview_order_page.verify_address_review()
     preview_order_page.verify_payment_review()
     preview_order_page.verify_basket_items_review()
     preview_order_page.press_place_order_button()
     order_confirmation_page = OrderConfirmationPage(browser)
     order_confirmation_page.open()
     order_confirmation_page.verify_name_page()
     order_confirmation_page.verify_address_review()
     order_confirmation_page.verify_basket_items_review()
     order_confirmation_page.verify_button_print_page()
     order_confirmation_page.verify_continue_shopping()
    def test_update_shipping_address_passed(self):
        email = "test{}@mail.com".format(random.randint(0, 10000))
        my_account_page = MyAccountPage(self.driver)
        my_account_page.open_page()
        my_account_page.create_account(email, "haslotest12")
        shipping_address_page = ShippingAddressPage(self.driver)
        shipping_address_page.open_edit_shipping_address()
        shipping_address_page.set_personal_data("John", "Wick")
        shipping_address_page.select_country("Poland")
        shipping_address_page.set_address("Butterfly 2", "00-002", "Warsaw")
        shipping_address_page.save_address()
        generic = Generic(self.driver)

        assert "Address changed successfully." in generic.get_msg_text()