Exemplo n.º 1
0
    def test_b2c_client_checkout(self, b2c_login, store_and_region, quick_order, product, checkout_section, order_confirmation_page, save_order_information_to_file):
        b2c_login.navigate_to_b2c_login_page()
        b2c_login._take_screenshot("17_navigate_to_login_page.png")

        store_and_region.choose_consumer_store()
        store_and_region._take_screenshot("18_selecting_consumer_store.png")
        store_and_region.choose_united_states_region_b2c()
        store_and_region._take_screenshot("19_selecting_usa_region.png")

        b2c_login.login_as_a_b2c_user(b2c_username, b2c_password)
        time.sleep(10)
        print("\n The B2C user successfully authenticated")
        b2c_login._take_screenshot("20_authenticating_b2c_user.png")

        quick_order.navigate_to_b2c_quick_order_page()
        quick_order._take_screenshot("21_navigating_to_quick_order.png")

        quick_order.place_an_order_in_the_quick_order_page("6875-SB", "AP-8-200", "1000-100")
        quick_order._take_screenshot("22_place_an_order_in_the_quick_order_page.png")
        print("\n B2C user successfully added the products in the cart and reached the Cart section")

        product.click_on_checkout_in_cart()
        product._take_screenshot("23_proceeding_to_checkout.png")
        print("\n B2C user successfully reached the Checkout section")

        checkout_section.b2c_checkout_flow()
        checkout_section._take_screenshot("24_on_checkout.png")
        checkout_section.add_card_details("Visa", "4111111111111111", "12", "2019", "234")
        checkout_section._take_screenshot("25_provided_card_details.png")

        print ("\n B2C user successfully got through the checkout flow")
        order_confirmation_page._take_screenshot("26_on_order_confirmation_page.png")
        print ("\n B2C user placed the order and successfully transitioned to the order confirmation page")
Exemplo n.º 2
0
    def test_guest_checkout(self, product, header_section, store_and_region, guest_login_checkout, checkout, order_confirmation_page, save_order_information_to_file):
        product.navigate_to_product1_page()
        product._take_screenshot("01_product_page_1.png")
        store_and_region.choose_consumer_store()
        store_and_region._take_screenshot("02_choose_consumer_store.png")
        store_and_region.choose_united_states_region_b2c()
        store_and_region._take_screenshot("03_choose_united_states_region.png")
        assert ("Product Number 3470" == product.get_product_id())

        product.click_on_add_to_cart_button()
        product._take_screenshot("04_adding_first_product_to_cart.png")
        product.click_on_continue_shopping()
        product._take_screenshot("05_clicking_on_continue_overlay.png")
        print ("\n Product" + product.get_product_id() + " was successfully added to cart")
        product.navigate_to_product2_page()
        product._take_screenshot("06_product_page_2.png")
        assert ("(1)" == header_section.get_product_count())
        assert ("Product Number 356243" == product.get_product_id())

        product.click_on_add_to_cart_button()
        product._take_screenshot("07_adding_second_product_to_cart.png")
        product.click_on_continue_shopping()
        product._take_screenshot("08_clicking_on_continue_overlay.png")
        print ("Product" + product.get_product_id() + " was successfully added to cart")

        product.navigate_to_product3_page()
        product._take_screenshot("09_product_page_3.png")
        assert ("(2)" == header_section.get_product_count())
        assert ("Product Number 1000-100" == product.get_product_id())

        product.click_on_add_to_cart_button()
        product._take_screenshot("10_adding_third_product_to_cart.png")
        print ("Product" + product.get_product_id() + " was successfully added to cart")
        product.click_on_checkout()
        product._take_screenshot("11_proceeding_to_cart.png")
        assert ("(3)" == header_section.get_product_count())
        print ("\n Guest successfully transitioned to the cart page")

        product.click_on_checkout_in_cart()
        product._take_screenshot("12_proceeding_to_checkout.png")

        guest_login_checkout.checkout_as_guest(guest_email, guest_confirm_email)
        print ("\n Guest successfully authenticated")
        guest_login_checkout._take_screenshot("13_guest_authenticated.png")

        print ("\n Guest successfully transitioned to the checkout page")

        checkout.add_new_address("United States", "Mr.", "Tester", "Test", "Siteworx", "Plopilor 63", "Portland", "Oregon", "54321")
        checkout._take_screenshot("14_provided_new_address.png")

        checkout.add_card_details("Visa", "4111111111111111", "12", "2019", "113")
        checkout._take_screenshot("15_provided_credit_card_details.png")

        print ("\n Guest successfully got through the checkout flow")
        print ("\n Guest placed the order and successfully transitioned to the order confirmation page")

        order_confirmation_page._take_screenshot("16_on_order_confirmation_page.png")
    def test_b2b_client_checkout(self, store_and_region, b2b_login, b2b_family,
                                 product, checkout_section,
                                 order_confirmation_page,
                                 save_order_information_to_file):
        b2b_login.navigate_to_b2b_login_page()
        b2b_login._take_screenshot("27_on_login_page.png")

        store_and_region.choose_business_store()
        store_and_region._take_screenshot("28_selecting_business_store.png")
        store_and_region.choose_united_states_region_b2b()
        store_and_region._take_screenshot("29_selecting_usa_region.png")

        b2b_login.login_as_a_b2b_user(b2b_username, b2b_password)
        time.sleep(10)
        print("\n The B2B user successfully authenticated")
        b2b_family._take_screenshot("29_b2b_authenticated.png")

        b2b_family.add_b2b_product1_in_cart()
        b2b_family._take_screenshot("30_first_product_added.png")
        b2b_family.click_on_continue_shopping()
        b2b_family._take_screenshot("31_click_on_continue_shopping.png")
        print("\n Product was successfully added to cart")

        b2b_family.add_b2b_product2_in_cart()
        b2b_family._take_screenshot("32_second_product_added.png")
        b2b_family.click_on_continue_shopping()
        b2b_family._take_screenshot("33_click_on_continue_shopping.png")
        print("\n Product was successfully added to cart")

        b2b_family.add_b2b_product3_in_cart()
        b2b_family._take_screenshot("34_third_product_added.png")
        b2b_family.click_on_view_in_cart()
        b2b_family._take_screenshot("35_proceeding_to_cart.png")
        print("\n Product was successfully added to cart")

        product.click_on_checkout_in_cart()
        product._take_screenshot("36_proceeding_to_cart.png")
        product.click_on_checkout_in_cart()
        print("\n B2B user successfully reached the Checkout section")

        checkout_section.b2b_checkout_flow("123")
        checkout_section._take_screenshot("37_checking_out.png")
        print("\n B2B user successfully got through the checkout flow")
        order_confirmation_page._take_screenshot(
            "38_on_order_confirmation_page.png")
        print(
            "\n B2C user placed the order and successfully transitioned to the order confirmation page"
        )