Skip to content

Commit

Permalink
[Security Solution] Unskip and enable for Serverless `shared_exceptio…
Browse files Browse the repository at this point in the history
…n_lists_management` Cypress tests (elastic#169182)

## Summary

Running flaky test runner for:
-
`x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management`

## Changes

-
`x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/list_detail_page/list_details.cy.ts`
**enabled on Serverless**
-
`x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/manage_exceptions.cy.ts`
**enabled on Serverless**
-
`x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/manage_exceptions.cy.ts`
**enabled on Serverless**
-
`x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/filter_table.cy.ts`
**enabled on Serverless**
-
`x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/import_lists.cy.ts`
**enabled on Serverless**
-
`x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/manage_lists.cy.ts`
**unskipped and enabled in Serverless**
-
`x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/read_only.cy.ts`
**removed from Serverless testing**


## Related failing-test issues
1. elastic#165874
2. elastic#165838
3. elastic#165795
4. elastic#165743 - **Closed as
duplicate of _#165640**
5. elastic#165690
6. elastic#165640

### Flaky test runner link

-
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3557#_
(Only ESS) 🟢
-
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3564#_
(ESS and Serverless)
-
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3613
(Serverless evaluated and corrected)
-
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3878
[V3]
-
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3891
[V4]
  • Loading branch information
jpdjere authored Nov 3, 2023
1 parent f284454 commit c0c7d13
Show file tree
Hide file tree
Showing 7 changed files with 202 additions and 225 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,93 +41,84 @@ const getExceptionList1 = () => ({

const EXCEPTION_LIST_NAME = 'Newly created list';

// TODO: https://github.com/elastic/kibana/issues/161539
// FLAKY: https://github.com/elastic/kibana/issues/165640
describe(
'Exception list detail page',
{ tags: ['@ess', '@serverless', '@skipInServerless'] },
() => {
before(() => {
login();

// Create exception list associated with a rule
createExceptionList(getExceptionList1(), getExceptionList1().list_id).then((response) =>
createRule(
getNewRule({
exceptions_list: [
{
id: response.body.id,
list_id: getExceptionList1().list_id,
type: getExceptionList1().type,
namespace_type: getExceptionList1().namespace_type,
},
],
})
)
);
createRule(getNewRule({ name: 'Rule to link to shared list' }));
describe('Exception list detail page', { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
login();

// Create exception list associated with a rule
createExceptionList(getExceptionList1(), getExceptionList1().list_id).then((response) =>
createRule(
getNewRule({
exceptions_list: [
{
id: response.body.id,
list_id: getExceptionList1().list_id,
type: getExceptionList1().type,
namespace_type: getExceptionList1().namespace_type,
},
],
})
)
);
createRule(getNewRule({ name: 'Rule to link to shared list' }));
visit(EXCEPTIONS_URL);
});

it('Should edit list details', () => {
visit(exceptionsListDetailsUrl(getExceptionList1().list_id));
waitForExceptionListDetailToBeLoaded();
// Check list details are loaded
cy.get(EXCEPTIONS_LIST_MANAGEMENT_NAME).should('have.text', LIST_NAME);
cy.get(EXCEPTIONS_LIST_MANAGEMENT_DESCRIPTION).should('have.text', LIST_DESCRIPTION);

// Update list details in edit modal
editExceptionLisDetails({
name: { original: LIST_NAME, updated: UPDATED_LIST_NAME },
description: { original: LIST_DESCRIPTION, updated: UPDATED_LIST_DESCRIPTION },
});

beforeEach(() => {
login();
visit(EXCEPTIONS_URL);
});
// Ensure that list details were updated
cy.get(EXCEPTIONS_LIST_MANAGEMENT_NAME).should('have.text', UPDATED_LIST_NAME);
cy.get(EXCEPTIONS_LIST_MANAGEMENT_DESCRIPTION).should('have.text', UPDATED_LIST_DESCRIPTION);

// Ensure that list details changes persisted
visit(exceptionsListDetailsUrl(getExceptionList1().list_id));
cy.get(EXCEPTIONS_LIST_MANAGEMENT_NAME).should('have.text', UPDATED_LIST_NAME);
cy.get(EXCEPTIONS_LIST_MANAGEMENT_DESCRIPTION).should('have.text', UPDATED_LIST_DESCRIPTION);

it('Should edit list details', () => {
visit(exceptionsListDetailsUrl(getExceptionList1().list_id));
waitForExceptionListDetailToBeLoaded();
// Check list details are loaded
cy.get(EXCEPTIONS_LIST_MANAGEMENT_NAME).should('have.text', LIST_NAME);
cy.get(EXCEPTIONS_LIST_MANAGEMENT_DESCRIPTION).should('have.text', LIST_DESCRIPTION);

// Update list details in edit modal
editExceptionLisDetails({
name: { original: LIST_NAME, updated: UPDATED_LIST_NAME },
description: { original: LIST_DESCRIPTION, updated: UPDATED_LIST_DESCRIPTION },
});

// Ensure that list details were updated
cy.get(EXCEPTIONS_LIST_MANAGEMENT_NAME).should('have.text', UPDATED_LIST_NAME);
cy.get(EXCEPTIONS_LIST_MANAGEMENT_DESCRIPTION).should('have.text', UPDATED_LIST_DESCRIPTION);

// Ensure that list details changes persisted
visit(exceptionsListDetailsUrl(getExceptionList1().list_id));
cy.get(EXCEPTIONS_LIST_MANAGEMENT_NAME).should('have.text', UPDATED_LIST_NAME);
cy.get(EXCEPTIONS_LIST_MANAGEMENT_DESCRIPTION).should('have.text', UPDATED_LIST_DESCRIPTION);

// Remove description
editExceptionLisDetails({
description: { original: UPDATED_LIST_DESCRIPTION, updated: null },
});
cy.get(EXCEPTIONS_LIST_MANAGEMENT_DESCRIPTION).should('have.text', 'Add a description');

// Ensure description removal persisted
visit(exceptionsListDetailsUrl(getExceptionList1().list_id));
cy.get(EXCEPTIONS_LIST_MANAGEMENT_DESCRIPTION).should('have.text', 'Add a description');
// Remove description
editExceptionLisDetails({
description: { original: UPDATED_LIST_DESCRIPTION, updated: null },
});
cy.get(EXCEPTIONS_LIST_MANAGEMENT_DESCRIPTION).should('have.text', 'Add a description');

it('Should create a new list and link it to two rules', () => {
createSharedExceptionList(
{ name: 'Newly created list', description: 'This is my list.' },
true
);
// Ensure description removal persisted
visit(exceptionsListDetailsUrl(getExceptionList1().list_id));
cy.get(EXCEPTIONS_LIST_MANAGEMENT_DESCRIPTION).should('have.text', 'Add a description');
});

// After creation - directed to list detail page
cy.get(EXCEPTIONS_LIST_MANAGEMENT_NAME).should('have.text', EXCEPTION_LIST_NAME);
// TODO: Flaky in ESS and Serverless: https://github.com/elastic/kibana/pull/169182#issuecomment-1792597980
it.skip('Should create a new list and link it to two rules', () => {
createSharedExceptionList(
{ name: 'Newly created list', description: 'This is my list.' },
true
);

// Open Link rules flyout
cy.get(EXCEPTION_LIST_DETAILS_LINK_RULES_BTN).click();
// After creation - directed to list detail page
cy.get(EXCEPTIONS_LIST_MANAGEMENT_NAME).should('have.text', EXCEPTION_LIST_NAME);

// Link the first two Rules
linkSharedListToRulesFromListDetails(2);
// Open Link rules flyout
cy.get(EXCEPTION_LIST_DETAILS_LINK_RULES_BTN).click();

// Save the 2 linked Rules
saveLinkedRules();
// Link the first two Rules
linkSharedListToRulesFromListDetails(2);

const linkedRulesNames = ['Rule to link to shared list', 'New Rule Test'];
// Save the 2 linked Rules
saveLinkedRules();

// Validate the number of linked rules as well as the Rules' names
validateSharedListLinkedRules(2, linkedRulesNames);
});
}
);
const linkedRulesNames = ['Rule to link to shared list', 'New Rule Test'];

// Validate the number of linked rules as well as the Rules' names
validateSharedListLinkedRules(2, linkedRulesNames);
});
});
Loading

0 comments on commit c0c7d13

Please sign in to comment.