Skip to content

Commit

Permalink
pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
christineweng committed Dec 14, 2023
1 parent 144d40a commit a8121c6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,20 @@ describe('Ransomware Detection Alerts', { tags: ['@ess', '@serverless'] }, () =>
cy.task('esArchiverUnload', 'ransomware_detection');
});

describe('Ransomware display on Alerts Page', () => {
describe('Ransomware in Alerts Page', () => {
beforeEach(() => {
login();
visitWithTimeRange(ALERTS_URL);
waitForAlertsToPopulate();
});

it('should show Ransomware Alerts in alerts table', () => {
it('should show ransomware alerts on alerts page', () => {
cy.log('should show ransomware alerts in alerts table');

cy.get(ALERT_RULE_NAME).should('have.text', 'Ransomware Detection Alert');
});

it('should show Ransomware Prevention Alert in the trend chart', () => {
cy.log('should show ransomware prevention alert in the trend chart');

selectAlertsHistogram();
cy.get(ALERTS_HISTOGRAM_SERIES).should('have.text', 'Ransomware Detection Alert');
});
Expand All @@ -54,7 +56,7 @@ describe('Ransomware Detection Alerts', { tags: ['@ess', '@serverless'] }, () =>
createTimeline();
});

it('Renders ransomware entries in timelines table', () => {
it('should show ransomware entries in timelines table', () => {
cy.get(TIMELINE_QUERY).type('event.code: "ransomware"{enter}');

// Wait for grid to load, it should have an analyzer icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@ describe('Ransomware Prevention Alerts', { tags: ['@ess', '@serverless'] }, () =
cy.task('esArchiverUnload', 'ransomware_prevention');
});

describe('Ransomware display on Alerts Page', () => {
describe('Ransomware in Alerts Page', () => {
beforeEach(() => {
login();
visitWithTimeRange(ALERTS_URL);
});

it('should show Ransomware Alerts in alerts table', () => {
it('should show ransomware alerts on alerts page', () => {
cy.log('should show ransomware alerts in alert table');

cy.get(ALERT_RULE_NAME).should('have.text', 'Ransomware Prevention Alert');
});

it('should show Ransomware Prevention Alert in the trend chart', () => {
cy.log('should show ransomware prevention alert in the trend chart');

selectAlertsHistogram();
cy.get(ALERTS_HISTOGRAM_SERIES).should('have.text', 'Ransomware Prevention Alert');
});
Expand All @@ -48,13 +50,13 @@ describe('Ransomware Prevention Alerts', { tags: ['@ess', '@serverless'] }, () =
describe('Ransomware in Timelines', function () {
beforeEach(() => {
deleteTimelines();
login();
createTimeline({ ...getTimeline(), query: 'event.code: "ransomware"' }).then((response) => {
cy.wrap(response.body.data.persistTimeline.timeline.savedObjectId).as('timelineId');
});
});

it('Renders ransomware entries in timelines table', function () {
login();
it('should render ransomware entries in timelines table', function () {
const timeline = this.timelineId;
visitTimeline(timeline);
// Wait for grid to load, it should have an analyzer icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export const selectCountTable = () => {
};

export const selectAlertsHistogram = () => {
cy.get(SELECT_HISTOGRAM).click({ force: true });
cy.get(SELECT_HISTOGRAM).click();
};

export const goToAcknowledgedAlerts = () => {
Expand Down

0 comments on commit a8121c6

Please sign in to comment.