[Security Solution] Adds more cypress tests on serverless for investigations team (#169379)

This commit is contained in:
Gloria Hornero 2023-10-23 19:44:21 +02:00 committed by GitHub
parent 6a6b83e60c
commit 0eb5925228
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 57 additions and 64 deletions

View file

@ -89,7 +89,7 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 60
parallelism: 4
parallelism: 8
retry:
automatic:
- exit_status: '*'

View file

@ -109,7 +109,7 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 60
parallelism: 4
parallelism: 8
retry:
automatic:
- exit_status: '*'

View file

@ -87,7 +87,7 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 60
parallelism: 4
parallelism: 8
retry:
automatic:
- exit_status: '*'

View file

@ -25,51 +25,46 @@ import {
} from '../../../screens/search_bar';
import { TOASTER } from '../../../screens/alerts_detection_rules';
// TODO: https://github.com/elastic/kibana/issues/161539
describe(
'Histogram legend hover actions',
{ tags: ['@ess', '@serverless', '@brokenInServerless'] },
() => {
const ruleConfigs = getNewRule();
describe('Histogram legend hover actions', { tags: ['@ess', '@serverless'] }, () => {
const ruleConfigs = getNewRule();
before(() => {
cleanKibana();
});
before(() => {
cleanKibana();
});
beforeEach(() => {
login();
createRule(getNewRule({ rule_id: 'new custom rule' }));
visitWithTimeRange(ALERTS_URL);
selectAlertsHistogram();
});
beforeEach(() => {
login();
createRule(getNewRule({ rule_id: 'new custom rule' }));
visitWithTimeRange(ALERTS_URL);
selectAlertsHistogram();
});
it('Filter in/out should add a filter to KQL bar', function () {
const expectedNumberOfAlerts = 2;
clickAlertsHistogramLegend();
clickAlertsHistogramLegendFilterFor(ruleConfigs.name);
cy.get(GLOBAL_SEARCH_BAR_FILTER_ITEM).should(
'have.text',
`kibana.alert.rule.name: ${ruleConfigs.name}`
);
cy.get(ALERTS_COUNT).should('have.text', `${expectedNumberOfAlerts} alerts`);
it('Filter in/out should add a filter to KQL bar', function () {
const expectedNumberOfAlerts = 2;
clickAlertsHistogramLegend();
clickAlertsHistogramLegendFilterFor(ruleConfigs.name);
cy.get(GLOBAL_SEARCH_BAR_FILTER_ITEM).should(
'have.text',
`kibana.alert.rule.name: ${ruleConfigs.name}`
);
cy.get(ALERTS_COUNT).should('have.text', `${expectedNumberOfAlerts} alerts`);
clickAlertsHistogramLegend();
clickAlertsHistogramLegendFilterOut(ruleConfigs.name);
cy.get(GLOBAL_SEARCH_BAR_FILTER_ITEM).should(
'have.text',
`NOT kibana.alert.rule.name: ${ruleConfigs.name}`
);
cy.get(ALERTS_COUNT).should('not.exist');
clickAlertsHistogramLegend();
clickAlertsHistogramLegendFilterOut(ruleConfigs.name);
cy.get(GLOBAL_SEARCH_BAR_FILTER_ITEM).should(
'have.text',
`NOT kibana.alert.rule.name: ${ruleConfigs.name}`
);
cy.get(ALERTS_COUNT).should('not.exist');
cy.get(GLOBAL_SEARCH_BAR_FILTER_ITEM_DELETE).click();
cy.get(GLOBAL_SEARCH_BAR_FILTER_ITEM).should('not.exist');
});
cy.get(GLOBAL_SEARCH_BAR_FILTER_ITEM_DELETE).click();
cy.get(GLOBAL_SEARCH_BAR_FILTER_ITEM).should('not.exist');
});
it('Add To Timeline', function () {
clickAlertsHistogramLegend();
clickAlertsHistogramLegendAddToTimeline(ruleConfigs.name);
it('Add To Timeline', function () {
clickAlertsHistogramLegend();
clickAlertsHistogramLegendAddToTimeline(ruleConfigs.name);
cy.get(TOASTER).should('have.text', `Added ${ruleConfigs.name} to timeline`);
});
}
);
cy.get(TOASTER).should('have.text', `Added ${ruleConfigs.name} to timeline`);
});
});

View file

@ -34,7 +34,7 @@ describe('Bulk Investigate in Timeline', { tags: ['@ess', '@serverless'] }, () =
cy.task('esArchiverUnload', 'bulk_process');
});
context('Alerts', { tags: ['@brokenInServerless'] }, () => {
context('Alerts', () => {
before(() => {
createRule(getNewRule());
});

View file

@ -55,20 +55,16 @@ describe('Create a timeline from a template', { tags: ['@ess', '@serverless'] },
visit(TIMELINE_TEMPLATES_URL);
});
it(
'Should have the same query and open the timeline modal',
{ tags: '@brokenInServerless' },
() => {
selectCustomTemplates();
expandEventAction();
clickingOnCreateTimelineFormTemplateBtn();
it('Should have the same query and open the timeline modal', () => {
selectCustomTemplates();
expandEventAction();
clickingOnCreateTimelineFormTemplateBtn();
cy.get(TIMELINE_FLYOUT_WRAPPER).should('have.css', 'visibility', 'visible');
cy.get(TIMELINE_DESCRIPTION).should('have.text', getTimeline().description);
cy.get(TIMELINE_QUERY).should('have.text', getTimeline().query);
closeTimeline();
}
);
cy.get(TIMELINE_FLYOUT_WRAPPER).should('have.css', 'visibility', 'visible');
cy.get(TIMELINE_DESCRIPTION).should('have.text', getTimeline().description);
cy.get(TIMELINE_QUERY).should('have.text', getTimeline().query);
closeTimeline();
});
});
describe('Timelines', (): void => {
@ -112,7 +108,7 @@ describe('Timelines', (): void => {
describe(
'Creates a timeline by clicking untitled timeline from bottom bar',
{ tags: ['@ess', '@brokenInServerless'] },
{ tags: ['@ess', '@serverless'] },
() => {
beforeEach(() => {
login();

View file

@ -46,15 +46,15 @@ describe('Pagination', { tags: ['@ess', '@serverless'] }, () => {
cy.get(TIMELINE_EVENT).should('have.length', defaultPageSize);
});
it(`should select ${defaultPageSize} items per page by default`, () => {
cy.get(TIMELINE_EVENTS_COUNT_PER_PAGE).should('contain.text', defaultPageSize);
});
it('should be able to go to next / previous page', { tags: '@brokenInServerless' }, () => {
it('should be able to go to next / previous page', () => {
cy.get(`${TIMELINE_FLYOUT} ${TIMELINE_EVENTS_COUNT_NEXT_PAGE}`).first().click();
cy.get(`${TIMELINE_FLYOUT} ${TIMELINE_EVENTS_COUNT_PREV_PAGE}`).first().click();
});
it(`should select ${defaultPageSize} items per page by default`, () => {
cy.get(TIMELINE_EVENTS_COUNT_PER_PAGE).should('contain.text', defaultPageSize);
});
it('should be able to change items count per page with the dropdown', () => {
const itemsPerPage = 100;
cy.get(TIMELINE_EVENTS_COUNT_PER_PAGE_BTN).first().click({ force: true });

View file

@ -34,6 +34,8 @@ import {
} from '../../../tasks/timeline';
import { hostsUrl, MANAGE_URL } from '../../../urls/navigation';
// https://github.com/elastic/kibana/issues/169021
describe('Save Timeline Prompts', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => {
before(() => {
cleanKibana();