def the_good_is_added_to_the_application(driver, context): # noqa body_text = Shared(driver).get_text_of_body() assert len(StandardApplicationGoodsPage( driver).get_goods()) == 1 # Only one good added assert StandardApplicationGoodsPage( driver).get_goods_total_value() == "£1.00" # Value assert "2.0" in body_text # Quantity assert "Number of articles" in body_text # Unit assert context.is_good_incorporated in body_text # Incorporated # Go back to task list functions.click_back_link(driver)
def the_good_is_added_to_the_exhibition_application(driver, context): # noqa assert len(StandardApplicationGoodsPage( driver).get_goods()) == 1 # Only one good added assert "Equipment" in Shared(driver).get_table_row(1).text # Go back to task list functions.click_back_link(driver)
def i_add_a_non_incorporated_good_to_the_application(driver, context): # noqa StandardApplicationGoodsPage(driver).click_add_preexisting_good_button() # Click the "Add to application" link on the first good driver.find_elements_by_id("add-to-application")[0].click() # Enter good details StandardApplicationGoodDetails(driver).enter_value("1") StandardApplicationGoodDetails(driver).enter_quantity("2") StandardApplicationGoodDetails(driver).select_unit("Number of articles") StandardApplicationGoodDetails(driver).check_is_good_incorporated_true() context.is_good_incorporated = "Yes" functions.click_submit(driver)
def i_add_a_exhibition_style_good_on_application(driver, context): # noqa goods_page = StandardApplicationGoodsPage(driver) goods_page.click_add_preexisting_good_button() goods_page.click_add_to_application() # Enter good details context.good_type = "equipment" ExhibitionClearanceGoodPage(driver).click_good_type(context.good_type) functions.click_submit(driver)
def i_add_a_non_incorporated_good_to_the_application(driver, context): # noqa goods_page = StandardApplicationGoodsPage(driver) goods_page.click_add_preexisting_good_button() goods_page.click_add_to_application() # Enter good details goods_details_page = StandardApplicationGoodDetails(driver) goods_details_page.enter_value("1") goods_details_page.enter_quantity("2") goods_details_page.select_unit("Number of articles") goods_details_page.check_is_good_incorporated_false() context.is_good_incorporated = "No" functions.click_submit(driver)
def no_goods_are_left_on_the_application(driver): # noqa assert not StandardApplicationGoodsPage( driver).goods_exist_on_the_application()
def i_remove_a_good_from_the_application(driver): # noqa StandardApplicationGoodsPage(driver).get_remove_good_link().click()
def i_add_an_existing_good_to_the_application(driver, context): # noqa goods_page = StandardApplicationGoodsPage(driver) goods_page.click_add_preexisting_good_button() # Click the "Add to application" link on the first good driver.find_elements_by_id("add-to-application")[0].click()
def product_with_description_is_added_to_application(driver, description): # noqa products_page = StandardApplicationGoodsPage(driver) assert products_page.good_with_description_exists(description)
def product_with_name_is_added_to_application(driver, expected): # noqa products_page = StandardApplicationGoodsPage(driver) actual = products_page.get_product_name() assert actual == expected
def i_choose_to_add_product_from_product_list(driver, context): # noqa StandardApplicationGoodsPage(driver).click_add_preexisting_good_button()
def i_choose_to_add_a_new_product(driver, context): # noqa StandardApplicationGoodsPage(driver).click_add_new_good_button()
def i_remove_a_good_from_the_application(driver): remove_good_link = StandardApplicationGoodsPage(driver).find_remove_goods_type_link() driver.execute_script("arguments[0].click();", remove_good_link)