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] Unskips detection_page_filters tests #170163

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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' }));
Expand Down Expand Up @@ -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' }));
Expand Down Expand Up @@ -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) => {
Expand All @@ -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();

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
});
Expand All @@ -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}`);
});
Expand Down
Loading