Skip to content

Commit 5649d30

Browse files
committed
asserts the content of the exported timeline
1 parent 2bd7013 commit 5649d30

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

x-pack/plugins/security_solution/cypress/integration/timelines_export.spec.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import { loginAndWaitForPageWithoutDateRange } from '../tasks/login';
1010

1111
import { TIMELINES_URL } from '../urls/navigation';
1212

13+
const EXPECTED_EXPORTED_TIMELINE_PATH = 'cypress/test_files/expected_timelines_export.ndjson';
14+
1315
describe('Export timelines', () => {
1416
before(() => {
1517
esArchiverLoad('timeline');
@@ -23,13 +25,14 @@ describe('Export timelines', () => {
2325

2426
it('Exports a custom timeline', () => {
2527
loginAndWaitForPageWithoutDateRange(TIMELINES_URL);
26-
2728
waitForTimelinesPanelToBeLoaded();
28-
2929
exportFirstTimeline();
3030

31-
cy.wait('@export').then((xhr) => {
32-
cy.wrap(xhr.status).should('eql', 200);
31+
cy.wait('@export').then((response) => {
32+
cy.wrap(response.status).should('eql', 200);
33+
cy.readFile(EXPECTED_EXPORTED_TIMELINE_PATH).then(($expectedExportedJson) => {
34+
cy.wrap(response.xhr.responseText).should('eql', $expectedExportedJson);
35+
});
3336
});
3437
});
3538
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"savedObjectId":"0162c130-78be-11ea-9718-118a926974a4","version":"WzcsMV0=","columns":[{"columnHeaderType":"not-filtered","id":"@timestamp"},{"columnHeaderType":"not-filtered","id":"message"},{"columnHeaderType":"not-filtered","id":"event.category"},{"columnHeaderType":"not-filtered","id":"event.action"},{"columnHeaderType":"not-filtered","id":"host.name"},{"columnHeaderType":"not-filtered","id":"source.ip"},{"columnHeaderType":"not-filtered","id":"destination.ip"},{"columnHeaderType":"not-filtered","id":"user.name"}],"created":1586256805054,"createdBy":"elastic","dataProviders":[],"dateRange":{"end":1586256837669,"start":1546343624710},"description":"description","eventType":"all","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"expression":"host.name:*","kind":"kuery"},"serializedQuery":"{\"bool\":{\"should\":[{\"exists\":{\"field\":\"host.name\"}}],\"minimum_should_match\":1}}"}},"savedQueryId":null,"sort":{"columnId":"@timestamp","sortDirection":"desc"},"title":"SIEM test","updated":1586256839298,"updatedBy":"elastic","timelineType":"default","eventNotes":[],"globalNotes":[],"pinnedEventIds":[]}

0 commit comments

Comments
 (0)