def test_active_cycles_task_tree(self, activate_workflow, app_workflow): """Test active cycles tree.""" workflow_cycles = workflow_ui_facade.get_workflow_cycles( app_workflow) expected_workflow_cycle = cycle_entity_creation.create_workflow_cycle( app_workflow) test_utils.list_obj_assert(workflow_cycles, [expected_workflow_cycle])
def test_active_cycles_task_tree(self, activate_workflow, app_workflow): """Test active cycles tree.""" workflow_cycles = workflow_ui_facade.get_workflow_cycles( app_workflow) expected_workflow_cycle = cycle_entity_population.create_workflow_cycle( app_workflow) test_utils.list_obj_assert(workflow_cycles, [expected_workflow_cycle])
def test_add_obj_to_task_group(self, app_workflow, app_task_group, app_control, selenium): """Test mapping of object to a task group.""" workflow_ui_facade.add_obj_to_task_group(obj=app_control, task_group=app_task_group) selenium.refresh() # reload page to check mapping is saved objs = workflow_ui_facade.get_objs_added_to_task_group(app_task_group) test_utils.list_obj_assert(objs, [app_control])
def test_create_task_group_task(self, app_workflow, app_task_group, app_person, selenium): """Test creation of Task Group Task.""" task = workflow_entity_factory.TaskGroupTaskFactory().create( task_group=app_task_group, assignees=[app_person]) workflow_ui_facade.create_task_group_task(task) actual_tasks = workflow_ui_facade.get_task_group_tasks_objs() test_utils.list_obj_assert(actual_tasks, [task])
def test_task_group_created_after_workflow_ui_creation( self, selenium, workflow ): """Test that creation of workflow via UI creates a task group.""" # pylint: disable=invalid-name actual_task_groups = workflow_ui_facade.task_group_objs( workflow) test_utils.list_obj_assert(actual_task_groups, workflow.task_groups)
def test_add_obj_to_task_group(self, app_workflow, app_task_group, app_control, selenium): """Test mapping of object to a task group.""" workflow_ui_facade.add_obj_to_task_group(obj=app_control, task_group=app_task_group) # open another page to check mapping is saved selenium_utils.open_url(url.Urls().dashboard) objs = workflow_ui_facade.get_objs_added_to_task_group(app_task_group) test_utils.list_obj_assert(objs, [app_control])
def test_create_task_group_task( self, app_workflow, app_task_group, app_person, selenium ): """Test creation of Task Group Task.""" task = workflow_entity_factory.TaskGroupTaskFactory().create( task_group=app_task_group, assignees=[app_person]) workflow_ui_facade.create_task_group_task(task) actual_tasks = workflow_ui_facade.get_task_group_tasks_objs() test_utils.list_obj_assert(actual_tasks, [task])
def test_map_obj_to_cycle_task(self, activated_workflow, app_control, selenium): """Test mapping of obj to a cycle task.""" cycle_task = cycle_entity_population.create_workflow_cycle( activated_workflow).cycle_task_groups[0].cycle_tasks[0] workflow_ui_facade.map_obj_to_cycle_task(obj=app_control, cycle_task=cycle_task) selenium.refresh() # reload page to check mapping is saved objs = workflow_ui_facade.get_objs_mapped_to_cycle_task(cycle_task) test_utils.list_obj_assert(objs, [app_control])
def test_add_obj_to_task_group( self, app_workflow, app_task_group, app_control, selenium ): """Test mapping of object to a task group.""" workflow_ui_facade.add_obj_to_task_group( obj=app_control, task_group=app_task_group) # open another page to check mapping is saved selenium_utils.open_url(url.Urls().dashboard) objs = workflow_ui_facade.get_objs_added_to_task_group(app_task_group) test_utils.list_obj_assert(objs, [app_control])
def test_map_obj_to_cycle_task( self, activated_workflow, app_control, selenium ): """Test mapping of obj to a cycle task.""" cycle_task = cycle_entity_population.create_workflow_cycle( activated_workflow).cycle_task_groups[0].cycle_tasks[0] workflow_ui_facade.map_obj_to_cycle_task( obj=app_control, cycle_task=cycle_task) selenium.refresh() # reload page to check mapping is saved objs = workflow_ui_facade.get_objs_mapped_to_cycle_task(cycle_task) test_utils.list_obj_assert(objs, [app_control])
def test_move_cycle_task_to_another_state(self, login_as_creator_or_reader, activated_workflow, selenium): """Test starting a cycle task.""" # pylint: disable=invalid-name workflow_cycle = cycle_entity_population.create_workflow_cycle( activated_workflow) cycle_task = workflow_cycle.cycle_task_groups[0].cycle_tasks[0] workflow_ui_facade.start_cycle_task(cycle_task) selenium.refresh() # reload page to check state is changed actual_workflow_cycles = workflow_ui_facade.get_workflow_cycles( activated_workflow) test_utils.list_obj_assert(actual_workflow_cycles, [workflow_cycle])
def test_move_cycle_task_to_another_state( self, login_as_creator_or_reader, activated_workflow, selenium ): """Test starting a cycle task.""" # pylint: disable=invalid-name workflow_cycle = cycle_entity_population.create_workflow_cycle( activated_workflow) cycle_task = workflow_cycle.cycle_task_groups[0].cycle_tasks[0] workflow_ui_facade.start_cycle_task(cycle_task) selenium.refresh() # reload page to check state is changed actual_workflow_cycles = workflow_ui_facade.get_workflow_cycles( activated_workflow) test_utils.list_obj_assert(actual_workflow_cycles, [workflow_cycle])
def test_destructive_activate_repeat_on_workflow(self, app_repeat_on_workflow, selenium): """Test activation of repeat on workflow. It should be checked separately as different requests are sent when repeat off and repeat on workflows are activated. """ task_group = workflow_rest_facade.create_task_group( workflow=app_repeat_on_workflow) workflow_rest_facade.create_task_group_task(task_group=task_group) workflow_ui_facade.activate_workflow(app_repeat_on_workflow) workflow_cycles = workflow_ui_facade.get_workflow_cycles( app_repeat_on_workflow) expected_workflow_cycle = cycle_entity_population.create_workflow_cycle( app_repeat_on_workflow) test_utils.list_obj_assert(workflow_cycles, [expected_workflow_cycle])
def test_destructive_activate_repeat_on_workflow( self, app_repeat_on_workflow, selenium ): """Test activation of repeat on workflow. It should be checked separately as different requests are sent when repeat off and repeat on workflows are activated. """ task_group = workflow_rest_facade.create_task_group( workflow=app_repeat_on_workflow) workflow_rest_facade.create_task_group_task(task_group=task_group) workflow_ui_facade.activate_workflow(app_repeat_on_workflow) workflow_cycles = workflow_ui_facade.get_workflow_cycles( app_repeat_on_workflow) expected_workflow_cycle = cycle_entity_population.create_workflow_cycle( app_repeat_on_workflow) self.check_ggrc_6491(workflow_cycles, [expected_workflow_cycle]) test_utils.list_obj_assert(workflow_cycles, [expected_workflow_cycle])