Exemple #1
0
def step_impl(context, name):
    # //tbody/tr/td/input ---first
    # //td/input ---all
    # .btn-danger ---delete
    driver = context.response

    del_item(driver, False)

    # ------- test-cleanup -------
    viewProducts.step_search(context, "New product")
    del_item(driver, False)
Exemple #2
0
def step_impl(context, name, status):
    viewProducts.open_products_from_homepage(context.response)
    viewProducts.step_search(context, name)

    driver = context.response

    elem = WebDriverWait(driver, 10).until(
        ec.visibility_of_element_located(
            (By.XPATH, "//tbody/tr/td[7]")))

    assert elem.text == status
Exemple #3
0
def step_impl(context, name):
    driver = context.response

    viewProducts.open_products_from_homepage(driver)
    viewProducts.step_search(context, name)

    src = driver.page_source
    assert not re.search("No results!", src)

    elem = WebDriverWait(driver, 10).until(
        ec.visibility_of_element_located((By.XPATH, "//tbody/tr/td[3]")))

    assert elem.text == name
Exemple #4
0
def step_impl(context, name, price):

    viewProducts.step_search(context, name)

    driver = context.response

    elem1 = WebDriverWait(driver, 10).until(
        ec.visibility_of_element_located(
            (By.XPATH, "//tbody/tr/td[3]")))
    elem2 = WebDriverWait(driver, 10).until(
        ec.visibility_of_element_located(
            (By.XPATH, "//tbody/tr/td[5]")))

    el_name = elem1.text
    el_price = elem2.text

    assert el_name == name
    assert el_price == price
Exemple #5
0
def step_impl(context, name):
    viewProducts.step_search(context, name)

    viewProducts.step_no_res(context)