示例#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()
示例#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()
示例#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()
示例#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'
示例#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'
示例#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)
示例#7
0
def test_rating_stage(browser_driver, get_url):
    """Test for rating stage"""
    ProductPage(browser_driver).open_product_page() \
        .rating()
示例#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()