def fill_design_page_single_pref( selenium, base_url, request, default_data, experiment_type, fill_overview ): """Fills design page according to single pref requirements.""" design = DesignPage(selenium, base_url, experiment_url=f"{fill_overview.url}").open() design = design.wait_for_page_to_load() design.input_firefox_pref_name( default_data.branches[0].preferences.preference_branch_name ) design.select_firefox_pref_type(default_data.branches[0].preferences.preference_type) design.select_firefox_pref_branch( default_data.branches[0].preferences.preference_branch_type ) current_branchs = design.current_branches control_branch = current_branchs[0] control_branch.branch_name = default_data.branches[0].branch_name control_branch.branch_description = "THIS IS A TEST" control_branch.branch_value = default_data.branches[0].preferences.preference_value current_branchs[1].branch_name = default_data.branches[1].branch_name current_branchs[1].branch_description = "THIS IS A TEST" current_branchs[1].branch_value = default_data.branches[ 1 ].preferences.preference_value design.save_btn() return design
def fill_design_page_branched_multi_addon(selenium, base_url, request, variables, experiment_type, fill_overview): """Fills design page according to branched multi addon requirements.""" design = DesignPage(selenium, base_url, experiment_url=f"{fill_overview.url}").open() design = design.wait_for_page_to_load() design.enable_multi_addon() current_branchs = design.current_branches control_branch = current_branchs[0] control_branch.branch_name = ( f"{variables[experiment_type]['branches'][0]['branch_name']}") control_branch.branch_description = "THIS IS A TEST" control_branch.branch_description = ( f"{variables[experiment_type]['branches'][0]['branch_description']}") control_branch.signed_addon_url = ( f"{variables[experiment_type]['branches'][0]['addon_url']}") current_branchs[ 1].branch_name = f"{variables[experiment_type]['branches'][1]['branch_name']}" current_branchs[1].branch_description = "THIS IS A TEST" current_branchs[1].branch_description = ( f"{variables[experiment_type]['branches'][1]['branch_description']}") current_branchs[ 1].signed_addon_url = f"{variables[experiment_type]['branches'][0]['addon_url']}" design.save_btn() return design
def fill_design_page_single_pref(selenium, base_url, request, variables, experiment_type, fill_overview): """Fills design page according to single pref requirements.""" design = DesignPage(selenium, base_url, experiment_url=f"{fill_overview.url}").open() design = design.wait_for_page_to_load() design.input_firefox_pref_name( f"{variables[experiment_type]['branches'][0]['firefox_pref_name']}") design.select_firefox_pref_type( f"{variables[experiment_type]['branches'][0]['firefox_pref_type']}") design.select_firefox_pref_branch( f"{variables[experiment_type]['branches'][0]['firefox_pref_branch']}") current_branchs = design.current_branches control_branch = current_branchs[0] control_branch.branch_name = ( f"{variables[experiment_type]['branches'][0]['branch_name']}") control_branch.branch_description = "THIS IS A TEST" control_branch.branch_value = ( f"{variables[experiment_type]['branches'][0]['branch_value']}") current_branchs[ 1].branch_name = f"{variables[experiment_type]['branches'][1]['branch_name']}" current_branchs[1].branch_description = "THIS IS A TEST" current_branchs[ 1].branch_value = f"{variables[experiment_type]['branches'][1]['branch_value']}" design.save_btn() return design
def fill_design_page_multi_prefs(selenium, base_url, request, variables, fill_overview): """Fills design page according to multi pref requirements.""" experiment_type = getattr(request.module, "experiment_type", None) design = DesignPage(selenium, base_url, experiment_url=f"{fill_overview.url}").open() design = design.wait_for_page_to_load() design.enable_multipref() branches = design.current_branches for count, branch in enumerate(variables[experiment_type]["branches"]): branches[count].branch_name = f"{branch['branch_name']}" branches[count].branch_description = f"{branch['branch_description']}" branches[count].add_pref_button.click() prefs = branches[count].prefs(count) for pref_num in range(0, len(branch["preferences"])): # Fill in multi prefs prefs[ pref_num ].pref_branch = f"{branch['preferences'][pref_num]['firefox_pref_branch']}" prefs[ pref_num ].pref_type = f"{branch['preferences'][pref_num]['firefox_pref_type']}" prefs[ pref_num ].pref_name = f"{branch['preferences'][pref_num]['firefox_pref_name']}" prefs[ pref_num ].pref_value = f"{branch['preferences'][pref_num]['firefox_pref_value']}" design.save_btn() return design
def fill_design_page_addon_rollout( selenium, base_url, request, default_data, experiment_type, fill_overview ): """Fills design page according to addon rollout requirements.""" design = DesignPage(selenium, base_url, experiment_url=f"{fill_overview.url}").open() design = design.wait_for_page_to_load() design.design_details = "THE DESIGN IS FANCY" design.enable_addon_rollout() prefs = design.rollout_prefs prefs.addon_url = default_data.branches[0].addon_url design.save_btn() return design
def fill_design_page_generic_experiment( selenium, base_url, request, default_data, experiment_type, fill_overview ): """Fills design page according to single pref requirements.""" design = DesignPage(selenium, base_url, experiment_url=f"{fill_overview.url}").open() current_branches = design.current_branches design.design_details = "THE DESIGN IS FANCY" control_branch = current_branches[0] control_branch.branch_name = default_data.branches[0].branch_name control_branch.branch_description = "THIS IS A TEST" current_branches[1].branch_name = default_data.branches[1].branch_name current_branches[1].branch_description = "THIS IS A TEST" design.save_btn() return design
def fill_design_page_pref_rollout( selenium, base_url, request, default_data, experiment_type, fill_overview ): """Fills design page according to pref rollout requirements.""" design = DesignPage(selenium, base_url, experiment_url=f"{fill_overview.url}").open() design = design.wait_for_page_to_load() design.design_details = "THE DESIGN IS FANCY" prefs = design.rollout_prefs pref_data = default_data.branches[0].preferences prefs.pref_branch = pref_data.preference_branch_type prefs.pref_type = pref_data.preference_type prefs.pref_name = pref_data.preference_branch_name prefs.pref_value = pref_data.preference_value design.save_btn() return design
def fill_design_page_branched_single_addon( selenium, base_url, request, default_data, experiment_type, fill_overview ): """Fills design page according to branched single addon requirements.""" design = DesignPage(selenium, base_url, experiment_url=f"{fill_overview.url}").open() design = design.wait_for_page_to_load() design.signed_addon_url = default_data.addon_url current_branchs = design.current_branches control_branch = current_branchs[0] control_branch.branch_name = default_data.branches[0].branch_name control_branch.branch_description = "THIS IS A TEST" control_branch.branch_description = default_data.branches[0].branch_description current_branchs[1].branch_name = default_data.branches[1].branch_name current_branchs[1].branch_description = "THIS IS A TEST" current_branchs[1].branch_description = default_data.branches[1].branch_description design.save_btn() return design
def fill_design_page(selenium, base_url, request, fill_overview): """Fills design page according to generic requirements.""" design = DesignPage(selenium, base_url, experiment_url=f"{fill_overview.url}").open() design = design.wait_for_page_to_load() design.input_firefox_pref_name("default_fixture") design.select_firefox_pref_type("boolean") design.select_firefox_pref_branch("default") current_branchs = design.current_branches control_branch = current_branchs[0] control_branch.branch_name = "Fixture Branch" control_branch.branch_description = "THIS IS A TEST" control_branch.branch_value = "true" current_branchs[1].branch_name = "Fixture Branch 2" current_branchs[1].branch_description = "THIS IS A TEST" current_branchs[1].branch_value = "false" design.save_btn() return design
def fill_design_page(selenium, base_url, request, variables, fill_overview): experiment_type = getattr(request.module, "experiment_type", None) design = DesignPage(selenium, base_url, experiment_url=f"{fill_overview.url}").open() design = design.wait_for_page_to_load() if request.node.get_closest_marker("use_variables"): design.input_firefox_pref_name( f"{variables[experiment_type]['branches'][0]['firefox_pref_name']}" ) design.select_firefox_pref_type( f"{variables[experiment_type]['branches'][0]['firefox_pref_type']}" ) design.select_firefox_pref_branch( f"{variables[experiment_type]['branches'][0]['firefox_pref_branch']}" ) current_branchs = design.current_branches control_branch = current_branchs[0] control_branch.set_branch_name( f"{variables[experiment_type]['branches'][0]['branch_name']}") control_branch.set_branch_description("THIS IS A TEST") control_branch.set_branch_value( f"{variables[experiment_type]['branches'][0]['branch_value']}") current_branchs[1].set_branch_name( f"{variables[experiment_type]['branches'][1]['branch_name']}") current_branchs[1].set_branch_description("THIS IS A TEST") current_branchs[1].set_branch_value( f"{variables[experiment_type]['branches'][1]['branch_value']}") else: design.input_firefox_pref_name("default_fixture") design.select_firefox_pref_type("boolean") design.select_firefox_pref_branch("default") current_branchs = design.current_branches control_branch = current_branchs[0] control_branch.set_branch_name("Fixture Branch") control_branch.set_branch_description("THIS IS A TEST") control_branch.set_branch_value("true") current_branchs[1].set_branch_name("Fixture Branch 2") current_branchs[1].set_branch_description("THIS IS A TEST") current_branchs[1].set_branch_value("false") design.save_btn() return design
def fill_design_page_multi_prefs( selenium, base_url, request, default_data, experiment_type, fill_overview ): """Fills design page according to multi pref requirements.""" design = DesignPage(selenium, base_url, experiment_url=f"{fill_overview.url}").open() design = design.wait_for_page_to_load() design.enable_multipref() branches = design.current_branches for count, branch in enumerate(default_data.branches): branches[count].branch_name = branch.branch_name branches[count].branch_description = branch.branch_description branches[count].add_pref_button.click() prefs = branches[count].prefs(count) for pref_num, item in enumerate(branch.preferences): # Fill in multi prefs prefs[pref_num].pref_branch = item.preference_branch_type prefs[pref_num].pref_type = item.preference_type prefs[pref_num].pref_name = item.preference_branch_name prefs[pref_num].pref_value = item.preference_value design.save_btn() return design