Пример #1
0
def choose_application_clearance_level(driver, context):  # noqa
    no = utils.get_element_index_by_text(
        Shared(driver).get_radio_buttons_elements(), "uk_unclassified")

    Shared(driver).click_on_radio_buttons(no)

    functions.click_submit(driver)
Пример #2
0
def add_new_external_location_without_country(driver, name, address):  # noqa
    add_new_external_location_form_page = AddNewExternalLocationFormPage(
        driver)
    add_new_external_location_form_page.enter_external_location_name(name)
    add_new_external_location_form_page.enter_external_location_address(
        address)
    functions.click_submit(driver)
Пример #3
0
def add_a_role(driver, permissions, context):
    roles_page = RolesPages(driver)
    roles_page.click_add_a_role_button()
    context.role_name = "test-" + str(utils.get_unformatted_date_time())[:25]
    roles_page.enter_role_name(context.role_name)
    roles_page.select_permissions(permissions)
    functions.click_submit(driver)
Пример #4
0
def eu_military_end_use_details(driver, choice):  # noqa
    end_use_details = EndUseDetailsFormPage(driver)
    if choice == "Yes":
        end_use_details.answer_is_eu_military(True)
    else:
        end_use_details.answer_is_eu_military(False)
    functions.click_submit(driver)
def edit_flagging_rule(driver, context, tier, case_status):
    routing_rules_page = RoutingRulesPage(driver)
    routing_rules_page.edit_row_by_queue_id(context.queue_id)
    routing_rules_page.initial_details_form(tier=tier,
                                            case_status=case_status,
                                            additional_rules=False)
    functions.click_submit(driver)
Пример #6
0
def raise_clc_query(driver, control_code, clc_reason,
                    pv_grading_reason):  # noqa
    raise_clc_query_page = AddGoodPage(driver)
    raise_clc_query_page.enter_control_code_unsure(control_code)
    raise_clc_query_page.enter_control_unsure_details(clc_reason)
    raise_clc_query_page.enter_grading_unsure_details(pv_grading_reason)
    functions.click_submit(driver)
Пример #7
0
def switch_organisations_to_my_second_organisation(driver, context):  # noqa
    Hub(driver).click_switch_link()
    no = utils.get_element_index_by_text(
        Shared(driver).get_radio_buttons_elements(),
        context.org_name_for_switching_organisations)
    Shared(driver).click_on_radio_buttons(no)
    functions.click_submit(driver)
Пример #8
0
def enter_permanent_or_temporary(driver, permanent_or_temporary,
                                 context):  # noqa
    context.perm_or_temp = permanent_or_temporary
    # type needs to be permanent or temporary
    apply = ApplyForALicencePage(driver)
    apply.click_permanent_or_temporary_button(permanent_or_temporary)
    functions.click_submit(driver)
Пример #9
0
def informed_wmd_end_use_details(driver, choice):  # noqa
    end_use_details = EndUseDetailsFormPage(driver)
    if choice == "Yes":
        end_use_details.answer_is_informed_wmd(True, fake.ean(length=13))
    else:
        end_use_details.answer_is_informed_wmd(False)
    functions.click_submit(driver)
Пример #10
0
def eu_compliant_limitations_end_use_details(driver, choice):  # noqa
    end_use_details = EndUseDetailsFormPage(driver)
    if choice == "Yes":
        end_use_details.answer_is_compliant_limitations_eu(True)
    else:
        end_use_details.answer_is_compliant_limitations_eu(
            False, fake.sentence(nb_words=30))
    functions.click_submit(driver)
Пример #11
0
def new_sites_info(driver, context):
    context.new_site_name = faker.word() + datetime.datetime.now().strftime(
        "%m%d%H%M")
    NewSite(driver).enter_new_site_details(context.new_site_name,
                                           faker.street_address(),
                                           faker.postcode(), faker.city(),
                                           faker.state())
    functions.click_submit(driver)
Пример #12
0
def create_standard_application(driver, good_type, country, context):  # noqa
    ExporterHubPage(driver).click_apply_for_a_licence()
    ApplyForALicencePage(driver).select_licence_type("export_licence")
    functions.click_submit(driver)
    enter_type_of_application(driver, "ogel", context)
    ogel = OgelPage(driver)
    ogel.enter_control_list_entry(good_type)
    ogel.enter_country(country)
Пример #13
0
def create_standard_individual_transhipment_application(driver,
                                                        context):  # noqa
    ExporterHubPage(driver).click_apply_for_a_licence()
    ApplyForALicencePage(driver).select_licence_type("transhipment")
    functions.click_submit(driver)
    enter_type_of_application(driver, "sitl", context)
    enter_application_name(driver, context)
    enter_export_licence(driver, "yes", "123456", context)
Пример #14
0
def i_enter_detail_for_the_good_on_the_application(driver, value, quantity,
                                                   unit):
    StandardApplicationGoodDetails(driver).enter_value(value)
    StandardApplicationGoodDetails(driver).enter_quantity(quantity)
    StandardApplicationGoodDetails(driver).select_unit(unit)
    StandardApplicationGoodDetails(driver).check_is_good_incorporated_false()

    functions.click_submit(driver)
def enter_details_of_copied_application(driver, context, name, option, code):
    ApplyForALicencePage(driver).enter_name_or_reference_for_application(name)
    functions.click_submit(driver)
    ApplyForALicencePage(driver).click_export_licence_yes_or_no(option)
    ApplyForALicencePage(driver).type_into_reference_number(code)
    context.name = name
    context.reference_code = code
    functions.click_submit(driver)
Пример #16
0
def create_standard_application(driver, export_type, context):  # noqa
    ExporterHubPage(driver).click_apply_for_a_licence()
    ApplyForALicencePage(driver).select_licence_type("export_licence")
    functions.click_submit(driver)
    enter_type_of_application(driver, "siel", context)
    enter_permanent_or_temporary(driver, export_type, context)
    enter_application_name(driver, context)
    enter_export_licence(driver, "yes", "123456", context)
Пример #17
0
def temporary_export_direct_control(driver, choice):  # noqa
    temporary_export_details = TemporaryExportDetailsFormPage(driver)
    if choice == "Yes":
        temporary_export_details.answer_is_temp_direct_control(True)
    else:
        temporary_export_details.answer_is_temp_direct_control(
            False, fake.sentence(nb_words=30))
    functions.click_submit(driver)
Пример #18
0
def suspected_wmd_end_use_details(driver, choice):  # noqa
    end_use_details = EndUseDetailsFormPage(driver)
    if choice == "Yes":
        end_use_details.answer_is_suspected_wmd(True,
                                                fake.sentence(nb_words=30))
    else:
        end_use_details.answer_is_suspected_wmd(False)
    functions.click_submit(driver)
Пример #19
0
def military_end_use_details(driver, choice):  # noqa
    end_use_details = EndUseDetailsFormPage(driver)
    if choice == "Yes":
        end_use_details.answer_military_end_use_controls(
            True, fake.ean(length=13))
    else:
        end_use_details.answer_military_end_use_controls(False)
    functions.click_submit(driver)
Пример #20
0
 def create_new_or_copy_existing(self, copy_existing: bool):
     if copy_existing:
         self.driver.find_element_by_id(
             f"{self.INPUT_CREATE_NEW_OR_COPY_ID}-yes").click()
     else:
         self.driver.find_element_by_id(
             f"{self.INPUT_CREATE_NEW_OR_COPY_ID}-no").click()
     functions.click_submit(self.driver)
Пример #21
0
def create_a_new_good_in_application(driver, description, part_number,
                                     controlled, control_code, graded):
    add_goods_page = AddGoodPage(driver)
    add_goods_page.enter_description_of_goods(description)
    add_goods_page.select_is_your_good_controlled(controlled)
    add_goods_page.enter_control_list_entries(control_code)
    add_goods_page.select_is_your_good_graded(graded)
    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)
Пример #23
0
def add_good_software_technology_purpose_details(driver, edited_details,
                                                 context):  # noqa
    goods_page = GoodsPage(driver)
    good_details_page = AddGoodDetails(driver)

    goods_page.click_on_good_edit_software_technology_details()
    good_details_page.enter_software_technology_purpose_details(
        text=edited_details)
    functions.click_submit(driver)
Пример #24
0
def create_open_app(driver, export_type, context):  # noqa
    ExporterHubPage(driver).click_apply_for_a_licence()
    ApplyForALicencePage(driver).select_licence_type("export_licence")
    functions.click_submit(driver)
    enter_type_of_application(driver, "oiel", context)
    choose_open_licence_category(driver, "military", context)
    enter_permanent_or_temporary(driver, export_type, context)
    enter_application_name(driver, context)
    answer_firearms_question(driver)
Пример #25
0
def create_standard_individual_trade_control_application(driver,
                                                         context):  # noqa
    ExporterHubPage(driver).click_apply_for_a_licence()
    apply_for_licence_page = ApplyForALicencePage(driver)
    apply_for_licence_page.select_licence_type("trade_control_licence")
    functions.click_submit(driver)
    enter_type_of_application(driver, "sicl", context)
    enter_application_name(driver, context)
    apply_for_licence_page.select_trade_control_activity()
    apply_for_licence_page.select_trade_control_product_category()
def create_routing_rule(driver, context, tier, case_status):
    routing_rules_page = RoutingRulesPage(driver)
    routing_rules_page.create_new_routing_rule()
    routing_rules_page.select_team(SystemTeamsID.ADMIN.value)
    functions.click_submit(driver)
    routing_rules_page.initial_details_form(tier=tier,
                                            case_status=case_status,
                                            queue=context.queue_name,
                                            additional_rules=False)
    functions.click_submit(driver)
def add_user(driver, context):
    user_page = UsersPage(driver)
    user_page.click_add_a_user_button()
    fake = Faker()
    context.added_email = fake.free_email()
    user_page.enter_email(context.added_email)
    user_page.select_option_from_team_drop_down_by_visible_text("Admin")
    user_page.select_option_from_role_drop_down_by_visible_text("Default")
    user_page.select_option_from_default_queue_drop_down_by_visible_text(
        "All cases")
    functions.click_submit(driver)
Пример #28
0
def add_good_grading(driver, prefix, grading, suffix, issuing_authority,
                     reference, date_of_issue, context):  # noqa
    goods_grading_page = AddGoodGradingPage(driver)
    goods_grading_page.enter_prefix_of_goods_grading(prefix)
    goods_grading_page.enter_good_grading(grading)
    goods_grading_page.enter_suffix_of_goods_grading(suffix)
    goods_grading_page.enter_issuing_authority(issuing_authority)
    goods_grading_page.enter_reference(reference)
    date = date_of_issue.split("-")
    goods_grading_page.enter_date_of_issue(date[0], date[1], date[2])
    functions.click_submit(driver)
def add_new_additional_information(driver, context):  # noqa
    page = F680AdditionalInformationPage(driver, "submit")
    page.enter_no_date()
    page.enter_foreign_technology()
    page.enter_locally_manufactured()
    page.enter_mtcr_type()
    page.enter_electronic_warfare_requirement()
    page.enter_uk_service_equipment()
    page.enter_uk_service_equipment_type()
    page.enter_prospect_value()
    functions.click_submit(driver, button_value="finish")
Пример #30
0
def change_members_role(driver, context, api_test_client):
    site = api_test_client.organisations.add_site(context.org_id)

    MemberPage(driver).click_assign_sites_button()

    site_checkbox = driver.find_element_by_id(site["name"])
    scroll_to_element_by_id(driver, site["name"])
    site_checkbox.click()
    functions.click_submit(driver)

    assert site["name"] in Shared(driver).get_text_of_body(), "user was expected to be assigned to site"