コード例 #1
0
ファイル: webui_facade.py プロジェクト: javz1/ggrc-core
def create_control_in_program_scope(selenium, program):
    """Create control via UI."""
    controls_service = webui_service.ControlsService(selenium)
    controls_service.open_widget_of_mapped_objs(
        program).tree_view.open_map().click_create_and_map_obj()
    control = entities_factory.ControlsFactory().create()
    controls_service.submit_obj_modal(control)
    return control
コード例 #2
0
 def test_create_and_map_control(self, program, selenium):
     """Test that control can be created and mapped using Unified mapper."""
     controls_service = webui_service.ControlsService(selenium)
     controls_service.open_widget_of_mapped_objs(
         program).tree_view.open_map().click_create_and_map_obj()
     control = entities_factory.ControlsFactory().create()
     controls_service.submit_obj_modal(control)
     tree_view_control = controls_service.get_list_objs_from_tree_view(
         program)[0]
     actual_control = controls_service.get_obj_from_info_page(
         tree_view_control)
     rest_control = rest_facade.get_obj(actual_control)
     control.update_attrs(created_at=rest_control.created_at,
                          updated_at=rest_control.updated_at,
                          modified_by=users.current_user(),
                          slug=rest_control.slug).repr_ui()
     self.general_equal_assert(control, actual_control, "custom_attributes")