def test_filter_of_snapshotable_control( self, create_audit_with_control_and_update_control, selenium, version_of_ctrl, is_found ): """Check via UI that filtering work for snapshoted version of Control only, filtering by actual values returns no items in scope of Audit page. """ audit_with_one_control = create_audit_with_control_and_update_control audit = audit_with_one_control["new_audit_rest"][0] expected_control = audit_with_one_control[version_of_ctrl][0] filter_exp = FilterUtils.get_filter_exp_by_title(expected_control.title) actual_controls = (webui_service.ControlsService(selenium). filter_list_objs_from_tree_view( src_obj=audit, filter_exp=filter_exp)) assert (expected_control in [ctrls for ctrls in actual_controls if len(actual_controls) != 0] ) == is_found, messages.ERR_MSG_FORMAT.format( [expected_control], actual_controls)
def test_filter_of_snapshotable_control( self, create_audit_with_control_and_update_control, selenium, version_of_ctrl, is_found ): """Check via UI that filtering work for snapshoted version of Control only, filtering by actual values returns no items in scope of Audit page. """ audit_with_one_control = create_audit_with_control_and_update_control audit = audit_with_one_control["new_audit_rest"][0] # due to 'actual_control.custom_attributes = {None: None}' expected_control = (audit_with_one_control[version_of_ctrl][0].repr_ui(). update_attrs(custom_attributes={None: None})) filter_exp = FilterUtils.get_filter_exp_by_title(expected_control.title) actual_controls = ( webui_service.ControlsService(selenium). filter_list_objs_from_tree_view(src_obj=audit, filter_exp=filter_exp)) assert (expected_control in [ctrls for ctrls in actual_controls] ) == is_found, messages.ERR_MSG_FORMAT.format( [expected_control], actual_controls)
def test_filter_of_snapshotable_control( self, create_audit_with_control_and_update_control, selenium, version_of_ctrl, is_found): """Check via UI that filtering work for snapshoted version of Control only, filtering by actual values returns no items in scope of Audit page. """ audit_with_one_control = create_audit_with_control_and_update_control audit = audit_with_one_control["new_audit_rest"][0] # due to 'actual_control.custom_attributes = {None: None}' expected_control = ( audit_with_one_control[version_of_ctrl][0].repr_ui().update_attrs( custom_attributes={None: None})) filter_exp = FilterUtils.get_filter_exp_by_title( expected_control.title) actual_controls = (webui_service.ControlsService( selenium).filter_list_objs_from_tree_view(src_obj=audit, filter_exp=filter_exp)) assert (expected_control in [ ctrls for ctrls in actual_controls ]) == is_found, (messages.AssertionMessages.format_err_msg_contains( expected_control, [ctrls for ctrls in actual_controls]))
def test_filter_of_snapshotable_control( self, create_audit_with_control_and_update_control, version_of_ctrl, is_found, selenium): """Check via UI that filtering work for snapshoted version of Control only, filtering by actual values returns no items in scope of Audit page. """ audit_with_one_control = create_audit_with_control_and_update_control audit = audit_with_one_control["new_audit_rest"][0] expected_control = audit_with_one_control[version_of_ctrl][0].repr_ui() filter_exp = FilterUtils.get_filter_exp_by_title( expected_control.title) actual_controls = (webui_service.ControlsService( selenium).filter_and_get_list_objs_from_tree_view( src_obj=audit, filter_exp=filter_exp)) # 'actual_controls': created_at, updated_at, custom_attributes (None) expected_controls, actual_controls = entity.Entity.extract_objs( [expected_control], actual_controls, *Representation.tree_view_attrs_to_exclude) expected_control = expected_controls[0] assert is_found is (expected_control in actual_controls), ( messages.AssertionMessages.format_err_msg_contains( expected_control, actual_controls))
def test_filter_of_snapshotable_control( self, create_audit_with_control_and_update_control, version_of_ctrl, is_found, selenium ): """Check via UI that filtering work for snapshoted version of Control only, filtering by actual values returns no items in scope of Audit page. """ audit_with_one_control = create_audit_with_control_and_update_control audit = audit_with_one_control["new_audit_rest"][0] expected_control = audit_with_one_control[version_of_ctrl][0].repr_ui() filter_exp = FilterUtils.get_filter_exp_by_title(expected_control.title) actual_controls = (webui_service.ControlsService(selenium). filter_and_get_list_objs_from_tree_view( src_obj=audit, filter_exp=filter_exp)) # 'actual_controls': created_at, updated_at, custom_attributes (None) expected_controls, actual_controls = Representation.extract_objs( [expected_control], actual_controls, *Representation.tree_view_attrs_to_exclude) expected_control = expected_controls[0] assert is_found is (expected_control in actual_controls), ( messages.AssertionMessages.format_err_msg_contains( expected_control, actual_controls))