Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution] - Update exceptions item UI #135255

Merged
merged 24 commits into from
Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3b4a9e6
added unit tests
yctercero Jun 27, 2022
9215966
edited unit tests
yctercero Jun 27, 2022
4fc70e3
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Jun 27, 2022
95cc843
some cleanup
yctercero Jun 27, 2022
0e2bae2
Merge branch 'entry_ux' of github.com:yctercero/kibana into entry_ux
yctercero Jun 27, 2022
7e98bfe
Merge branch 'main' of github.com:yctercero/kibana into entry_ux
yctercero Jun 27, 2022
fb1f464
update comments color
yctercero Jun 27, 2022
a6b1070
Remove console log
yctercero Jun 27, 2022
187278a
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Jun 27, 2022
7718b62
fixing up lint and tests
yctercero Jun 28, 2022
c50d9de
Merge branch 'main' of github.com:elastic/kibana into entry_ux
yctercero Jun 28, 2022
4509c75
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Jun 28, 2022
ef7f86b
fixing cypress tests
yctercero Jun 29, 2022
6861fd6
Merge branch 'main' of github.com:elastic/kibana into entry_ux
yctercero Jun 29, 2022
6b9f609
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Jun 29, 2022
ea7d533
Merge branch 'main' of github.com:elastic/kibana into entry_ux
yctercero Jul 7, 2022
611cc25
updating per PR feedback
yctercero Jul 7, 2022
2cc3460
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Jul 7, 2022
be769ed
fix bug rendering initial item exception after creation
yctercero Jul 7, 2022
1dffbc9
Merge branch 'entry_ux' of github.com:yctercero/kibana into entry_ux
yctercero Jul 7, 2022
f325a07
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Jul 7, 2022
6e8959a
Merge branch 'main' of github.com:elastic/kibana into entry_ux
yctercero Jul 8, 2022
9922839
fix cypress tests
yctercero Jul 8, 2022
4bd5b5f
Merge branch 'entry_ux' of github.com:yctercero/kibana into entry_ux
yctercero Jul 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { addExceptionFromFirstAlert, goToClosedAlerts, goToOpenedAlerts } from '
import { createCustomRuleEnabled } from '../../tasks/api_calls/rules';
import { goToRuleDetails } from '../../tasks/alerts_detection_rules';
import { waitForAlertsToPopulate } from '../../tasks/create_new_rule';
import { esArchiverLoad, esArchiverUnload } from '../../tasks/es_archiver';
import { esArchiverLoad, esArchiverUnload, esArchiverResetKibana } from '../../tasks/es_archiver';
import { login, visitWithoutDateRange } from '../../tasks/login';
import {
addsException,
Expand All @@ -26,15 +26,15 @@ import {
} from '../../tasks/rule_details';

import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation';
import { cleanKibana, deleteAlertsAndRules } from '../../tasks/common';
import { deleteAlertsAndRules } from '../../tasks/common';

describe('Adds rule exception', () => {
const NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS = '1 alert';

before(() => {
cleanKibana();
login();
esArchiverResetKibana();
esArchiverLoad('exceptions');
login();
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ import { createCustomRule } from '../../tasks/api_calls/rules';
import { goToRuleDetails } from '../../tasks/alerts_detection_rules';
import { esArchiverLoad, esArchiverResetKibana, esArchiverUnload } from '../../tasks/es_archiver';
import { login, visitWithoutDateRange } from '../../tasks/login';
import { openExceptionFlyoutFromRuleSettings, goToExceptionsTab } from '../../tasks/rule_details';
import {
openExceptionFlyoutFromRuleSettings,
goToExceptionsTab,
editException,
} from '../../tasks/rule_details';
import {
addExceptionEntryFieldMatchAnyValue,
addExceptionEntryFieldValue,
Expand All @@ -32,7 +36,6 @@ import {
EXCEPTION_ITEM_CONTAINER,
ADD_EXCEPTIONS_BTN,
EXCEPTION_FIELD_LIST,
EDIT_EXCEPTIONS_BTN,
EXCEPTION_EDIT_FLYOUT_SAVE_BTN,
EXCEPTION_FLYOUT_VERSION_CONFLICT,
EXCEPTION_FLYOUT_LIST_DELETED_ERROR,
Expand Down Expand Up @@ -302,8 +305,7 @@ describe('Exceptions flyout', () => {

context('When updating an item with version conflict', () => {
it('Displays version conflict error', () => {
cy.get(EDIT_EXCEPTIONS_BTN).should('be.visible');
cy.get(EDIT_EXCEPTIONS_BTN).click({ force: true });
editException();

// update exception item via api
updateExceptionListItem('simple_list_item', {
Expand Down Expand Up @@ -334,8 +336,7 @@ describe('Exceptions flyout', () => {

context('When updating an item for a list that has since been deleted', () => {
it('Displays missing exception list error', () => {
cy.get(EDIT_EXCEPTIONS_BTN).should('be.visible');
cy.get(EDIT_EXCEPTIONS_BTN).click({ force: true });
editException();

// delete exception list via api
deleteExceptionList(getExceptionList().list_id, getExceptionList().namespace_type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* 2.0.
*/

export const EDIT_EXCEPTIONS_BTN = '[data-test-subj="exceptionsViewerEditBtn"]';

export const ADD_EXCEPTIONS_BTN = '[data-test-subj="exceptionsHeaderAddExceptionBtn"]';

export const CLOSE_ALERTS_CHECKBOX =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ export const RISK_SCORE_OVERRIDE_DETAILS = 'Risk score override';

export const REFERENCE_URLS_DETAILS = 'Reference URLs';

export const REMOVE_EXCEPTION_BTN = '[data-test-subj="exceptionsViewerDeleteBtn"]';
export const EXCEPTION_ITEM_ACTIONS_BUTTON =
'button[data-test-subj="exceptionItemCardHeader-actionButton"]';

export const REMOVE_EXCEPTION_BTN = '[data-test-subj="exceptionItemCardHeader-actionItem-delete"]';

export const EDIT_EXCEPTION_BTN = '[data-test-subj="exceptionItemCardHeader-actionItem-edit"]';

export const RULE_SWITCH = '[data-test-subj="ruleSwitch"]';

Expand Down
10 changes: 10 additions & 0 deletions x-pack/plugins/security_solution/cypress/tasks/rule_details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import {
INDEX_PATTERNS_DETAILS,
DETAILS_TITLE,
DETAILS_DESCRIPTION,
EXCEPTION_ITEM_ACTIONS_BUTTON,
EDIT_EXCEPTION_BTN,
} from '../screens/rule_details';
import { addsFields, closeFieldsBrowser, filterFieldsBrowser } from './fields_browser';

Expand Down Expand Up @@ -96,7 +98,15 @@ export const goToExceptionsTab = () => {
.should('be.visible');
};

export const editException = () => {
cy.get(EXCEPTION_ITEM_ACTIONS_BUTTON).click();

cy.get(EDIT_EXCEPTION_BTN).click();
};

export const removeException = () => {
cy.get(EXCEPTION_ITEM_ACTIONS_BUTTON).click();

cy.get(REMOVE_EXCEPTION_BTN).click();
};

Expand Down

This file was deleted.

Loading