Beispiel #1
0
def test_product_checkout(browser_driver, get_url):
    ProductPage(browser_driver) \
        .open_product_page() \
        .add_to_card()
    CartPage(browser_driver) \
        .open_cart() \
        .click_checkout_cart()
Beispiel #2
0
def test_update_product(browser_driver, get_url):
    ProductPage(browser_driver) \
        .open_product_page() \
        .add_to_card()
    CartPage(browser_driver) \
        .open_cart() \
        .click_view_cart() \
        .click_update_product_in_cart()
Beispiel #3
0
def test_remove_product(browser_driver, get_url):
    ProductPage(browser_driver) \
        .open_product_page() \
        .add_to_card()
    CartPage(browser_driver) \
        .open_cart() \
        .click_view_cart() \
        .click_remove_product_from_cart()
Beispiel #4
0
def test_add_product_to_cart(browser_driver, get_url):
    ProductPage(browser_driver) \
        .open_product_page() \
        .add_to_card()
    CartPage(browser_driver) \
        .open_cart() \
        .click_view_cart()

    assert browser_driver.title == 'Shopping Cart'
Beispiel #5
0
def test_continue_shopping(browser_driver, get_url):
    ProductPage(browser_driver) \
        .open_product_page() \
        .add_to_card()
    CartPage(browser_driver) \
        .open_cart() \
        .click_view_cart() \
        .continue_shopping()

    assert browser_driver.browser.title == 'Your Store'
Beispiel #6
0
def test_product_quantity(browser_driver, get_url, my_logger, qty):
    """Test for input in quantity field"""
    my_logger.info('Input quantity for Product')
    ProductPage(browser_driver) \
        .open_product_page() \
        .quantity(qty)
    qty_value = browser_driver.find_element(
        *ProductPage.QUANTITY).get_attribute('value')

    assert str(qty_value) == str(qty)
Beispiel #7
0
def test_rating_stage(browser_driver, get_url):
    """Test for rating stage"""
    ProductPage(browser_driver).open_product_page() \
        .rating()
Beispiel #8
0
def test_add_to_card_button(browser_driver, get_url):
    """Test for Add to Card button"""
    ProductPage(browser_driver) \
        .open_product_page() \
        .add_to_card()