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] Adds more cypress tests on serverless for investigations team #169379

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 @@ -89,7 +89,7 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 60
parallelism: 4
parallelism: 8
retry:
automatic:
- exit_status: '*'
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/pipelines/on_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 60
parallelism: 4
parallelism: 8
retry:
automatic:
- exit_status: '*'
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/pipelines/pull_request/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 60
parallelism: 4
parallelism: 8
retry:
automatic:
- exit_status: '*'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

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();
}
);
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();
});
});

describe('Timelines', (): void => {
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down