Ejemplo n.º 1
0
 def test_dashboard_gca(self, program, selenium):
     # pylint: disable=anomalous-backslash-in-string
     """Check Dashboard Tab is exist if 'Dashboard' GCA filled
 with right value. Possible values match to regexp r"^https?://[^\s]+$".
 Steps:
   - Create 'Dashboard' gcas for object.
   - Fill with values
   - Check if 'Dashboard' tab exist.
   - Navigate to 'Dashboard' tab.
   - Check only GCAs filled with right values displayed on the tab.
 """
     urls = [
         "https://gmail.by/", "https://www.google.com/",
         environment.app_url,
         StringMethods.random_string(), "ftp://something.com/"
     ]
     cads_rest_service = rest_service.CustomAttributeDefinitionsService()
     gca_defs = (cads_rest_service.create_dashboard_gcas(program.type,
                                                         count=len(urls)))
     program_rest_service = rest_service.ProgramsService()
     program_rest_service.update_obj(
         obj=program,
         custom_attributes=dict(
             zip([gca_def.id for gca_def in gca_defs], urls)))
     expected_dashboards_items = dict(
         zip([
             gca_def.title.replace(aliases.DASHBOARD + "_", "")
             for gca_def in gca_defs
         ], urls[:3]))
     programs_ui_service = webui_service.ProgramsService(selenium)
     is_dashboard_tab_exist = (
         programs_ui_service.is_dashboard_tab_exist(program))
     assert is_dashboard_tab_exist
     actual_dashboards_items = (
         programs_ui_service.get_items_from_dashboard_widget(program))
     assert expected_dashboards_items == actual_dashboards_items
     cads_rest_service.delete_objs(gca_defs)
Ejemplo n.º 2
0
def create_program(**attrs):
    """Create a program"""
    factory_params, attrs_remainder = _split_attrs(attrs)
    return rest_service.ProgramsService().create_obj(
        factory_params=factory_params, **attrs_remainder)
Ejemplo n.º 3
0
def create_program(**attrs):
    """Create a program"""
    return rest_service.ProgramsService().create_obj(factory_params=attrs)
Ejemplo n.º 4
0
def create_program():
    """Create a program"""
    return rest_service.ProgramsService().create_objs(count=1)[0]