From 6f1fbce97cae8238e5b0d8fb385a1140c3904c41 Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Mon, 6 Nov 2023 20:30:47 +0100 Subject: [PATCH] [Security Solution] Unskips `detection_page_filters` tests (#170163) --- .../alerts/detection_page_filters.cy.ts | 25 ++++++------------- .../cypress/tasks/alerts.ts | 2 +- .../cypress/tasks/date_picker.ts | 12 ++++----- 3 files changed, 15 insertions(+), 24 deletions(-) diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/detection_page_filters.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/detection_page_filters.cy.ts index 9231b73843b1c4..44b6f688b3474e 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/detection_page_filters.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/detection_page_filters.cy.ts @@ -26,7 +26,7 @@ import { createRule } from '../../../tasks/api_calls/rules'; import { cleanKibana } from '../../../tasks/common'; import { login } from '../../../tasks/login'; import { visitWithTimeRange } from '../../../tasks/navigation'; -import { ALERTS_URL } from '../../../urls/navigation'; +import { ALERTS_URL, CASES_URL } from '../../../urls/navigation'; import { closePageFilterPopover, markAcknowledgedFirstAlert, @@ -39,8 +39,7 @@ import { waitForPageFilters, } from '../../../tasks/alerts'; import { ALERTS_COUNT, ALERTS_REFRESH_BTN, EMPTY_ALERT_TABLE } from '../../../screens/alerts'; -import { kqlSearch, navigateFromHeaderTo } from '../../../tasks/security_header'; -import { ALERTS, CASES } from '../../../screens/security_header'; +import { kqlSearch } from '../../../tasks/security_header'; import { addNewFilterGroupControlValues, cancelFieldEditing, @@ -108,10 +107,7 @@ const assertFilterControlsWithFilterObject = ( }); }; -// Failing: See https://github.com/elastic/kibana/issues/167914 -// Failing: See https://github.com/elastic/kibana/issues/167915 -// Failing: See https://github.com/elastic/kibana/issues/167914 -describe.skip(`Detections : Page Filters`, { tags: ['@ess', '@brokenInServerless'] }, () => { +describe(`Detections : Page Filters`, { tags: ['@ess', '@serverless'] }, () => { before(() => { cleanKibana(); createRule(getNewRule({ rule_id: 'custom_rule_filters' })); @@ -238,7 +234,7 @@ describe.skip(`Detections : Page Filters`, { tags: ['@ess', '@brokenInServerless cy.get(FILTER_GROUP_CHANGED_BANNER).should('be.visible'); }); - context.skip('with data modificiation', () => { + context('with data modificiation', () => { after(() => { cleanKibana(); createRule(getNewRule({ rule_id: 'custom_rule_filters' })); @@ -267,7 +263,7 @@ describe.skip(`Detections : Page Filters`, { tags: ['@ess', '@brokenInServerless it(`URL is updated when filters are updated`, () => { openPageFilterPopover(1); cy.get(OPTION_SELECTABLE(1, 'high')).should('be.visible'); - cy.get(OPTION_SELECTABLE(1, 'high')).click({}); + cy.get(OPTION_SELECTABLE(1, 'high')).click(); closePageFilterPopover(1); const NEW_FILTERS = DEFAULT_DETECTION_PAGE_FILTERS.map((filter) => { @@ -289,9 +285,8 @@ describe.skip(`Detections : Page Filters`, { tags: ['@ess', '@brokenInServerless cy.get(OPTION_LIST_VALUES(1)).contains('high'); waitForPageFilters(); - navigateFromHeaderTo(CASES); // navigate away from alert page - - navigateFromHeaderTo(ALERTS); // navigate back to alert page + visitWithTimeRange(CASES_URL); // navigate away from alert page + visitWithTimeRange(ALERTS_URL); // navigate back to alert page waitForPageFilters(); @@ -332,14 +327,11 @@ describe.skip(`Detections : Page Filters`, { tags: ['@ess', '@brokenInServerless }); context('Impact of inputs', () => { - afterEach(() => { - resetFilters(); - }); it('should recover from invalid kql Query result', () => { // do an invalid search // kqlSearch('\\'); - cy.get(ALERTS_REFRESH_BTN).trigger('click'); + cy.get(ALERTS_REFRESH_BTN).click(); waitForPageFilters(); cy.get(TOASTER).should('contain.text', 'KQLSyntaxError'); togglePageFilterPopover(0); @@ -372,7 +364,6 @@ describe.skip(`Detections : Page Filters`, { tags: ['@ess', '@brokenInServerless it('should take timeRange into account', () => { const startDateWithZeroAlerts = 'Jan 1, 2002 @ 00:00:00.000'; const endDateWithZeroAlerts = 'Jan 1, 2010 @ 00:00:00.000'; - setStartDate(startDateWithZeroAlerts); setEndDate(endDateWithZeroAlerts); diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/alerts.ts b/x-pack/test/security_solution_cypress/cypress/tasks/alerts.ts index a81cc24ae9653d..23b5d106cb6cf0 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/alerts.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/alerts.ts @@ -171,7 +171,7 @@ export const refreshAlertPageFilter = () => { }; export const togglePageFilterPopover = (filterIndex: number) => { - cy.get(OPTION_LIST_VALUES(filterIndex)).click({ force: true }); + cy.get(OPTION_LIST_VALUES(filterIndex)).click(); }; export const openPageFilterPopover = (filterIndex: number) => { diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/date_picker.ts b/x-pack/test/security_solution_cypress/cypress/tasks/date_picker.ts index 7ae1fa8c30b733..00d5a892593b6e 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/date_picker.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/date_picker.ts @@ -31,12 +31,12 @@ export const setEndDateNow = (container: string = GLOBAL_FILTERS_CONTAINER) => { export const setEndDate = (date: string, container: string = GLOBAL_FILTERS_CONTAINER) => { cy.get(GET_LOCAL_DATE_PICKER_END_DATE_POPOVER_BUTTON(container)).first().click(); - cy.get(DATE_PICKER_ABSOLUTE_TAB).first().click({ force: true }); + cy.get(DATE_PICKER_ABSOLUTE_TAB).first().click(); - cy.get(DATE_PICKER_ABSOLUTE_INPUT).click({ force: true }); + cy.get(DATE_PICKER_ABSOLUTE_INPUT).click(); cy.get(DATE_PICKER_ABSOLUTE_INPUT).then(($el) => { if (Cypress.dom.isAttached($el)) { - cy.wrap($el).click({ force: true }); + cy.wrap($el).click(); } cy.wrap($el).type(`{selectall}{backspace}${date}{enter}`); }); @@ -45,12 +45,12 @@ export const setEndDate = (date: string, container: string = GLOBAL_FILTERS_CONT export const setStartDate = (date: string, container: string = GLOBAL_FILTERS_CONTAINER) => { cy.get(GET_LOCAL_DATE_PICKER_START_DATE_POPOVER_BUTTON(container)).first().click({}); - cy.get(DATE_PICKER_ABSOLUTE_TAB).first().click({ force: true }); + cy.get(DATE_PICKER_ABSOLUTE_TAB).first().click(); - cy.get(DATE_PICKER_ABSOLUTE_INPUT).click({ force: true }); + cy.get(DATE_PICKER_ABSOLUTE_INPUT).click(); cy.get(DATE_PICKER_ABSOLUTE_INPUT).then(($el) => { if (Cypress.dom.isAttached($el)) { - cy.wrap($el).click({ force: true }); + cy.wrap($el).click(); } cy.wrap($el).type(`{selectall}{backspace}${date}{enter}`); });