Skip to content

Commit

Permalink
[Security Solution] Unskip rules bulk actions Serverless Cypress tests (
Browse files Browse the repository at this point in the history
#168307)

**Addresses:** #161540

## Summary

This PR unskips rules bulk actions Serverless Cypress tests (besides role based `bulk_edit_rules_actions.cy.ts`)

- `bulk_duplicate_rules.cy.ts`
- `bulk_edit_rules.cy.ts`
- `bulk_edit_rules_data_view.cy.ts`

## Flaky test runner


`detection_response/rule_management/rule_actions/bulk_actions` folder [150 runs](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3596) 🟢
  • Loading branch information
maximpn authored Oct 18, 2023
1 parent 8fd827f commit 4f91082
Show file tree
Hide file tree
Showing 4 changed files with 659 additions and 674 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,89 +53,83 @@ const EXPIRED_EXCEPTION_ITEM_NAME = 'Sample exception item';

const NON_EXPIRED_EXCEPTION_ITEM_NAME = 'Sample exception item with future expiration';

// TODO: https://github.com/elastic/kibana/issues/161540
// Flaky on serverless
describe(
'Detection rules, bulk duplicate',
{ tags: ['@ess', '@serverless', '@skipInServerless'] },
() => {
before(() => {
cleanKibana();
describe('Detection rules, bulk duplicate', { tags: ['@ess', '@serverless'] }, () => {
before(() => {
cleanKibana();
});

beforeEach(() => {
login();
// Make sure persisted rules table state is cleared
resetRulesTableState();
deleteAlertsAndRules();
cy.task('esArchiverResetKibana');
createRule(
getNewRule({ name: RULE_NAME, ...defaultRuleData, rule_id: '1', enabled: false })
).then((response) => {
createRuleExceptionItem(response.body.id, [
{
description: 'Exception item for rule default exception list',
entries: [
{
field: 'user.name',
operator: 'included',
type: 'match',
value: 'some value',
},
],
name: EXPIRED_EXCEPTION_ITEM_NAME,
type: 'simple',
expire_time: expiredDate,
},
{
description: 'Exception item for rule default exception list',
entries: [
{
field: 'user.name',
operator: 'included',
type: 'match',
value: 'some value',
},
],
name: NON_EXPIRED_EXCEPTION_ITEM_NAME,
type: 'simple',
expire_time: futureDate,
},
]);
});

beforeEach(() => {
login();
// Make sure persisted rules table state is cleared
resetRulesTableState();
deleteAlertsAndRules();
cy.task('esArchiverResetKibana');
createRule(
getNewRule({ name: RULE_NAME, ...defaultRuleData, rule_id: '1', enabled: false })
).then((response) => {
createRuleExceptionItem(response.body.id, [
{
description: 'Exception item for rule default exception list',
entries: [
{
field: 'user.name',
operator: 'included',
type: 'match',
value: 'some value',
},
],
name: EXPIRED_EXCEPTION_ITEM_NAME,
type: 'simple',
expire_time: expiredDate,
},
{
description: 'Exception item for rule default exception list',
entries: [
{
field: 'user.name',
operator: 'included',
type: 'match',
value: 'some value',
},
],
name: NON_EXPIRED_EXCEPTION_ITEM_NAME,
type: 'simple',
expire_time: futureDate,
},
]);
});

visitRulesManagementTable();
disableAutoRefresh();
});
visitRulesManagementTable();
disableAutoRefresh();
});

it('Duplicates rules', () => {
selectAllRules();
duplicateSelectedRulesWithoutExceptions();
expectManagementTableRules([`${RULE_NAME} [Duplicate]`]);
});

it('Duplicates rules', () => {
describe('With exceptions', () => {
it('Duplicates rules with expired exceptions', () => {
selectAllRules();
duplicateSelectedRulesWithoutExceptions();
duplicateSelectedRulesWithExceptions();
expectManagementTableRules([`${RULE_NAME} [Duplicate]`]);
goToRuleDetailsOf(`${RULE_NAME} [Duplicate]`);
goToExceptionsTab();
assertExceptionItemsExists(EXCEPTION_CARD_ITEM_NAME, [NON_EXPIRED_EXCEPTION_ITEM_NAME]);
viewExpiredExceptionItems();
assertExceptionItemsExists(EXCEPTION_CARD_ITEM_NAME, [EXPIRED_EXCEPTION_ITEM_NAME]);
});

describe('With exceptions', () => {
it('Duplicates rules with expired exceptions', () => {
selectAllRules();
duplicateSelectedRulesWithExceptions();
expectManagementTableRules([`${RULE_NAME} [Duplicate]`]);
goToRuleDetailsOf(`${RULE_NAME} [Duplicate]`);
goToExceptionsTab();
assertExceptionItemsExists(EXCEPTION_CARD_ITEM_NAME, [NON_EXPIRED_EXCEPTION_ITEM_NAME]);
viewExpiredExceptionItems();
assertExceptionItemsExists(EXCEPTION_CARD_ITEM_NAME, [EXPIRED_EXCEPTION_ITEM_NAME]);
});

it('Duplicates rules with exceptions, excluding expired exceptions', () => {
selectAllRules();
duplicateSelectedRulesWithNonExpiredExceptions();
expectManagementTableRules([`${RULE_NAME} [Duplicate]`]);
goToRuleDetailsOf(`${RULE_NAME} [Duplicate]`);
goToExceptionsTab();
assertExceptionItemsExists(EXCEPTION_CARD_ITEM_NAME, [NON_EXPIRED_EXCEPTION_ITEM_NAME]);
viewExpiredExceptionItems();
assertNumberOfExceptionItemsExists(0);
});
it('Duplicates rules with exceptions, excluding expired exceptions', () => {
selectAllRules();
duplicateSelectedRulesWithNonExpiredExceptions();
expectManagementTableRules([`${RULE_NAME} [Duplicate]`]);
goToRuleDetailsOf(`${RULE_NAME} [Duplicate]`);
goToExceptionsTab();
assertExceptionItemsExists(EXCEPTION_CARD_ITEM_NAME, [NON_EXPIRED_EXCEPTION_ITEM_NAME]);
viewExpiredExceptionItems();
assertNumberOfExceptionItemsExists(0);
});
}
);
});
});
Loading

0 comments on commit 4f91082

Please sign in to comment.