From 544bf805ea58c84c853732626879342829f90f7d Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Wed, 19 Feb 2020 13:26:26 +0100 Subject: [PATCH 01/17] deletes 'events viewer' lib --- .../integration/lib/events_viewer/helpers.ts | 31 ------------------- .../lib/events_viewer/selectors.ts | 31 ------------------- .../events_viewer/events_viewer.spec.ts | 15 ++++----- 3 files changed, 6 insertions(+), 71 deletions(-) delete mode 100644 x-pack/legacy/plugins/siem/cypress/integration/lib/events_viewer/helpers.ts delete mode 100644 x-pack/legacy/plugins/siem/cypress/integration/lib/events_viewer/selectors.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/lib/events_viewer/helpers.ts b/x-pack/legacy/plugins/siem/cypress/integration/lib/events_viewer/helpers.ts deleted file mode 100644 index 02a80f6c0329c..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/integration/lib/events_viewer/helpers.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { EVENTS_VIEWER_FIELDS_BUTTON, KQL_SEARCH_BAR } from './selectors'; -import { FIELDS_BROWSER_CONTAINER } from '../fields_browser/selectors'; -import { SERVER_SIDE_EVENT_COUNT } from '../timeline/selectors'; -import { DEFAULT_TIMEOUT } from '../util/helpers'; - -/** Opens the eventsViewer Field Browser */ -export const openEventsViewerFieldsBrowser = () => { - cy.get(EVENTS_VIEWER_FIELDS_BUTTON, { timeout: DEFAULT_TIMEOUT }).click({ force: true }); - - cy.get(SERVER_SIDE_EVENT_COUNT, { timeout: DEFAULT_TIMEOUT }) - .invoke('text') - .should('not.equal', '0'); - - cy.get(FIELDS_BROWSER_CONTAINER).should('exist'); -}; - -/** Clicks an arbitrary UI element that's not part of the fields browser (to dismiss it) */ -export const clickOutsideFieldsBrowser = () => { - cy.get(KQL_SEARCH_BAR, { timeout: DEFAULT_TIMEOUT }).click(); -}; - -/** Filters the search bar at the top of most pages with the specified KQL */ -export const filterSearchBar = (kql: string) => { - cy.get(KQL_SEARCH_BAR).type(`${kql} {enter}`); -}; diff --git a/x-pack/legacy/plugins/siem/cypress/integration/lib/events_viewer/selectors.ts b/x-pack/legacy/plugins/siem/cypress/integration/lib/events_viewer/selectors.ts deleted file mode 100644 index 6f7906d7fd791..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/integration/lib/events_viewer/selectors.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -/** The panel containing the events viewer */ -export const EVENTS_VIEWER_PANEL = '[data-test-subj="events-viewer-panel"]'; - -/** Clicking this button in the timeline opens the Fields browser in the Events Viewer */ -export const EVENTS_VIEWER_FIELDS_BUTTON = `${EVENTS_VIEWER_PANEL} [data-test-subj="show-field-browser-gear"]`; - -/** The KQL search bar that exists at the top of most pages */ -export const KQL_SEARCH_BAR = '[data-test-subj="queryInput"]'; - -/** The Events Viewer Showing N events header subtitle */ -export const HEADER_SUBTITLE = `${EVENTS_VIEWER_PANEL} [data-test-subj="header-panel-subtitle"]`; - -/** The inspect query modal */ -export const INSPECT_MODAL = '[data-test-subj="modal-inspect-euiModal"]'; - -export const CLOSE_MODAL = '[data-test-subj="modal-inspect-close"]'; - -/** The inspect query button that launches the inspect query modal */ -export const INSPECT_QUERY = `${EVENTS_VIEWER_PANEL} [data-test-subj="inspect-icon-button"]`; - -/** A count of the events loaded in the table */ -export const LOCAL_EVENTS_COUNT = `${EVENTS_VIEWER_PANEL} [data-test-subj="local-events-count"]`; - -/** The events viewer Load More button */ -export const LOAD_MORE = `${EVENTS_VIEWER_PANEL} [data-test-subj="TimelineMoreButton"]`; diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/events_viewer/events_viewer.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/events_viewer/events_viewer.spec.ts index 7bb7b9f4da5d1..d690573fe87c9 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/events_viewer/events_viewer.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/events_viewer/events_viewer.spec.ts @@ -4,16 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ -import { filterFieldsBrowser } from '../../lib/fields_browser/helpers'; +import { filterFieldsBrowser } from '../../../tasks/timeline/fields_browser'; import { FIELDS_BROWSER_CONTAINER, FIELDS_BROWSER_SELECTED_CATEGORY_TITLE, FIELDS_BROWSER_TITLE, FIELDS_BROWSER_CHECKBOX, } from '../../../screens/hosts/fields_browser'; -import { HOSTS_PAGE } from '../../lib/urls'; -import { loginAndWaitForPage } from '../../../tasks/login'; -import { openEventsViewerFieldsBrowser, filterSearchBar } from '../../lib/events_viewer/helpers'; +import { HOSTS_PAGE } from '../../../urls/navigation'; +import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../../../tasks/login'; import { closeFieldsBrowser } from '../../../tasks/hosts/fields_browsers'; import { openEvents } from '../../../tasks/hosts/main'; import { @@ -23,8 +22,8 @@ import { addsHostGeoCityNameToHeader, addsHostGeoCountryNameToHeader, resetFields, + openEventsViewerFieldsBrowser, } from '../../../tasks/hosts/events'; - import { HEADER_SUBTITLE, INSPECT_MODAL, @@ -33,9 +32,7 @@ import { HOST_GEO_CITY_NAME_HEADER, HOST_GEO_COUNTRY_NAME_HEADER, } from '../../../screens/hosts/events'; -import { DEFAULT_TIMEOUT } from '../../lib/util/helpers'; - -import { clearSearchBar } from '../../../tasks/header'; +import { clearSearchBar, kqlSearch } from '../../../tasks/header'; const defaultHeadersInDefaultEcsCategory = [ { id: '@timestamp' }, @@ -147,7 +144,7 @@ describe('Events Viewer', () => { cy.get(HEADER_SUBTITLE) .invoke('text') .then(initialNumberOfEvents => { - filterSearchBar(filterInput); + kqlSearch(`${filterInput}{enter}`); cy.get(HEADER_SUBTITLE) .invoke('text') .should('not.equal', initialNumberOfEvents); From 0ca688b63b43b3bc00f86b7254a826fd64fc7e69 Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Wed, 19 Feb 2020 17:07:39 +0100 Subject: [PATCH 02/17] deletes 'fields browser' lib --- .../integration/lib/fields_browser/helpers.ts | 44 ------------------- .../lib/fields_browser/selectors.ts | 40 ----------------- .../fields_browser/fields_browser.spec.ts | 2 +- 3 files changed, 1 insertion(+), 85 deletions(-) delete mode 100644 x-pack/legacy/plugins/siem/cypress/integration/lib/fields_browser/helpers.ts delete mode 100644 x-pack/legacy/plugins/siem/cypress/integration/lib/fields_browser/selectors.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/lib/fields_browser/helpers.ts b/x-pack/legacy/plugins/siem/cypress/integration/lib/fields_browser/helpers.ts deleted file mode 100644 index b02eda513cba3..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/integration/lib/fields_browser/helpers.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { FIELDS_BROWSER_CONTAINER, FIELDS_BROWSER_FILTER_INPUT } from './selectors'; -import { - assertAtLeastOneEventMatchesSearch, - executeKQL, - hostExistsQuery, - toggleTimelineVisibility, -} from '../timeline/helpers'; -import { TIMELINE_DATA_PROVIDERS, TIMELINE_FIELDS_BUTTON } from '../timeline/selectors'; - -/** Opens the timeline's Field Browser */ -export const openTimelineFieldsBrowser = () => { - cy.get(TIMELINE_FIELDS_BUTTON).click({ force: true }); - - cy.get(FIELDS_BROWSER_CONTAINER).should('exist'); -}; - -/** Populates the timeline with a host from the hosts page */ -export const populateTimeline = () => { - toggleTimelineVisibility(); - - executeKQL(hostExistsQuery); - - assertAtLeastOneEventMatchesSearch(); -}; - -/** Clicks an arbitrary UI element that's not part of the fields browser (to dismiss it) */ -export const clickOutsideFieldsBrowser = () => { - cy.get(TIMELINE_DATA_PROVIDERS).click(); -}; - -/** Filters the Field Browser by typing `fieldName` in the input */ -export const filterFieldsBrowser = (fieldName: string) => { - cy.get(FIELDS_BROWSER_FILTER_INPUT).type(fieldName); -}; - -export const clearFieldsBrowser = () => { - cy.get(FIELDS_BROWSER_FILTER_INPUT).type('{selectall}{backspace}'); -}; diff --git a/x-pack/legacy/plugins/siem/cypress/integration/lib/fields_browser/selectors.ts b/x-pack/legacy/plugins/siem/cypress/integration/lib/fields_browser/selectors.ts deleted file mode 100644 index 039e38aaf3ee7..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/integration/lib/fields_browser/selectors.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -/** Clicking this button in the timeline opens the Fields browser */ -export const TIMELINE_FIELDS_BUTTON = - '[data-test-subj="timeline"] [data-test-subj="show-field-browser"]'; - -/** The title displayed in the fields browser (i.e. Customize Columns) */ -export const FIELDS_BROWSER_TITLE = '[data-test-subj="field-browser-title"]'; - -/** Contains the body of the fields browser */ -export const FIELDS_BROWSER_CONTAINER = '[data-test-subj="fields-browser-container"]'; - -/** The title of the selected category in the right-hand side of the fields browser */ -export const FIELDS_BROWSER_SELECTED_CATEGORY_TITLE = '[data-test-subj="selected-category-title"]'; - -/** A count of the fields in the selected category in the right-hand side of the fields browser */ -export const FIELDS_BROWSER_SELECTED_CATEGORY_COUNT = - '[data-test-subj="selected-category-count-badge"]'; - -/** Typing in this input filters the Field Browser */ -export const FIELDS_BROWSER_FILTER_INPUT = '[data-test-subj="field-search"]'; - -/** - * This label displays a count of the categories containing (one or more) - * fields that match the filter criteria - */ -export const FIELDS_BROWSER_CATEGORIES_COUNT = '[data-test-subj="categories-count"]'; - -export const FIELDS_BROWSER_HOST_CATEGORIES_COUNT = '[data-test-subj="host-category-count"]'; - -export const FIELDS_BROWSER_SYSTEM_CATEGORIES_COUNT = '[data-test-subj="system-category-count"]'; - -/** - * This label displays a count of the fields that match the filter criteria - */ -export const FIELDS_BROWSER_FIELDS_COUNT = '[data-test-subj="fields-count"]'; diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/fields_browser/fields_browser.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/fields_browser/fields_browser.spec.ts index 6e8ef93a54016..c78ee366e5dff 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/fields_browser/fields_browser.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/fields_browser/fields_browser.spec.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HOSTS_PAGE } from '../../lib/urls'; +import { HOSTS_PAGE } from '../../../urls/navigation'; import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../../../tasks/login'; From 2842319d57522e1e0071e7129159e85bfab8160c Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Wed, 19 Feb 2020 17:13:01 +0100 Subject: [PATCH 03/17] deletes 'inspect' lib --- .../integration/lib/inspect/helpers.ts | 29 ------ .../integration/lib/inspect/selectors.ts | 89 ------------------- .../smoke_tests/inspect/inspect.spec.ts | 2 +- .../plugins/siem/cypress/urls/navigation.ts | 1 + 4 files changed, 2 insertions(+), 119 deletions(-) delete mode 100644 x-pack/legacy/plugins/siem/cypress/integration/lib/inspect/helpers.ts delete mode 100644 x-pack/legacy/plugins/siem/cypress/integration/lib/inspect/selectors.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/lib/inspect/helpers.ts b/x-pack/legacy/plugins/siem/cypress/integration/lib/inspect/helpers.ts deleted file mode 100644 index c431d0551b29a..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/integration/lib/inspect/helpers.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { DEFAULT_TIMEOUT } from '../util/helpers'; - -import { INSPECT_BUTTON_ICON, InspectButtonMetadata } from './selectors'; - -export const openStatsAndTables = (table: InspectButtonMetadata) => { - if (table.tabId) { - cy.get(table.tabId).click({ force: true }); - } - cy.get(table.id, { timeout: DEFAULT_TIMEOUT }); - if (table.altInspectId) { - cy.get(table.altInspectId, { timeout: DEFAULT_TIMEOUT }).trigger('click', { - force: true, - }); - } else { - cy.get(`${table.id} ${INSPECT_BUTTON_ICON}`, { - timeout: DEFAULT_TIMEOUT, - }).trigger('click', { force: true }); - } -}; - -export const closesModal = () => { - cy.get('[data-test-subj="modal-inspect-close"]', { timeout: DEFAULT_TIMEOUT }).click(); -}; diff --git a/x-pack/legacy/plugins/siem/cypress/integration/lib/inspect/selectors.ts b/x-pack/legacy/plugins/siem/cypress/integration/lib/inspect/selectors.ts deleted file mode 100644 index a6d4b37be9f00..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/integration/lib/inspect/selectors.ts +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -export const INSPECT_BUTTON_ICON = '[data-test-subj="inspect-icon-button"]'; -export const INSPECT_MODAL = '[data-test-subj="modal-inspect-euiModal"]'; -export const TIMELINE_SETTINGS_ICON = '[data-test-subj="settings-gear"]'; -export const TIMELINE_INSPECT_BUTTON = '[data-test-subj="inspect-empty-button"]'; - -export interface InspectButtonMetadata { - altInspectId?: string; - id: string; - title: string; - tabId?: string; -} - -export const INSPECT_HOSTS_BUTTONS_IN_SIEM: InspectButtonMetadata[] = [ - { - id: '[data-test-subj="stat-hosts"]', - title: 'Hosts Stat', - }, - { - id: '[data-test-subj="stat-authentication"]', - title: 'User Authentications Stat', - }, - { - id: '[data-test-subj="stat-uniqueIps"]', - title: 'Unique IPs Stat', - }, - { - id: '[data-test-subj="table-allHosts-loading-false"]', - title: 'All Hosts Table', - tabId: '[data-test-subj="navigation-allHosts"]', - }, - { - id: '[data-test-subj="table-authentications-loading-false"]', - title: 'Authentications Table', - tabId: '[data-test-subj="navigation-authentications"]', - }, - { - id: '[data-test-subj="table-uncommonProcesses-loading-false"]', - title: 'Uncommon processes Table', - tabId: '[data-test-subj="navigation-uncommonProcesses"]', - }, - { - altInspectId: `[data-test-subj="events-viewer-panel"] ${INSPECT_BUTTON_ICON}`, - id: '[data-test-subj="events-container-loading-false"]', - title: 'Events Table', - tabId: '[data-test-subj="navigation-events"]', - }, -]; - -export const INSPECT_NETWORK_BUTTONS_IN_SIEM: InspectButtonMetadata[] = [ - { - id: '[data-test-subj="stat-networkEvents"]', - title: 'Network events Stat', - }, - { - id: '[data-test-subj="stat-dnsQueries"]', - title: 'DNS queries Stat', - }, - { - id: '[data-test-subj="stat-uniqueFlowId"]', - title: 'Unique flow IDs Stat', - }, - { - id: '[data-test-subj="stat-tlsHandshakes"]', - title: 'TLS handshakes Stat', - }, - { - id: '[data-test-subj="stat-UniqueIps"]', - title: 'Unique private IPs Stat', - }, - { - id: '[data-test-subj="table-topNFlowSource-loading-false"]', - title: 'Source IPs Table', - }, - { - id: '[data-test-subj="table-topNFlowDestination-loading-false"]', - title: 'Destination IPs Table', - }, - { - id: '[data-test-subj="table-dns-loading-false"]', - title: 'Top DNS Domains Table', - tabId: '[data-test-subj="navigation-dns"]', - }, -]; diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/inspect/inspect.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/inspect/inspect.spec.ts index 1555470f5eee7..cf84b352d2273 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/inspect/inspect.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/inspect/inspect.spec.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HOSTS_PAGE, NETWORK_PAGE } from '../../lib/urls'; +import { HOSTS_PAGE, NETWORK_PAGE } from '../../../urls/navigation'; import { INSPECT_MODAL, INSPECT_NETWORK_BUTTONS_IN_SIEM, diff --git a/x-pack/legacy/plugins/siem/cypress/urls/navigation.ts b/x-pack/legacy/plugins/siem/cypress/urls/navigation.ts index 164a117b82475..62b57cf17d77f 100644 --- a/x-pack/legacy/plugins/siem/cypress/urls/navigation.ts +++ b/x-pack/legacy/plugins/siem/cypress/urls/navigation.ts @@ -7,6 +7,7 @@ export const TIMELINES_PAGE = '/app/siem#/timelines'; export const OVERVIEW_PAGE = '/app/siem#/overview'; export const HOSTS_PAGE = '/app/siem#/hosts/allHosts'; +export const NETWORK_PAGE = '/app/siem#/network'; export const HOSTS_PAGE_TAB_URLS = { allHosts: '/app/siem#/hosts/allHosts', anomalies: '/app/siem#/hosts/anomalies', From 57594b6095d04e4f7e098d0a550b1fc72ae0c328 Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Wed, 19 Feb 2020 17:15:56 +0100 Subject: [PATCH 04/17] deletes 'ml conditional links' lib --- .../lib/ml_conditional_links/index.ts | 76 ------------------- 1 file changed, 76 deletions(-) delete mode 100644 x-pack/legacy/plugins/siem/cypress/integration/lib/ml_conditional_links/index.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/lib/ml_conditional_links/index.ts b/x-pack/legacy/plugins/siem/cypress/integration/lib/ml_conditional_links/index.ts deleted file mode 100644 index 655418fc98bf8..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/integration/lib/ml_conditional_links/index.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -/* - * These links are for different test scenarios that try and capture different drill downs into - * ml-network and ml-hosts and are of the flavor of testing: - * A filter being null: (query:!n) - * A filter being set with single values: query=(query:%27process.name%20:%20%22conhost.exe%22%27,language:kuery) - * A filter being set with multiple values: query=(query:%27process.name%20:%20%22conhost.exe,sc.exe%22%27,language:kuery) - * A filter containing variables not replaced: query=(query:%27process.name%20:%20%$process.name$%22%27,language:kuery) - * - * In different combination with: - * network not being set: $ip$ - * host not being set: $host.name$ - * ...or... - * network being set normally: 127.0.0.1 - * host being set normally: suricata-iowa - * ...or... - * network having multiple values: 127.0.0.1,127.0.0.2 - * host having multiple values: suricata-iowa,siem-windows - */ - -// Single IP with a null for the Query: -export const mlNetworkSingleIpNullKqlQuery = - "/app/siem#/ml-network/ip/127.0.0.1?query=!n&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')))"; - -// Single IP with a value for the Query: -export const mlNetworkSingleIpKqlQuery = - "/app/siem#/ml-network/ip/127.0.0.1?query=(language:kuery,query:'process.name%20:%20%22conhost.exe,sc.exe%22')&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')))"; - -// Multiple IPs with a null for the Query: -export const mlNetworkMultipleIpNullKqlQuery = - "/app/siem#/ml-network/ip/127.0.0.1,127.0.0.2?query=!n&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')))"; - -// Multiple IPs with a value for the Query: -export const mlNetworkMultipleIpKqlQuery = - "/app/siem#/ml-network/ip/127.0.0.1,127.0.0.2?query=(language:kuery,query:'process.name%20:%20%22conhost.exe,sc.exe%22')&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')))"; - -// $ip$ with a null Query: -export const mlNetworkNullKqlQuery = - "/app/siem#/ml-network/ip/$ip$?query=!n&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')))"; - -// $ip$ with a value for the Query: -export const mlNetworkKqlQuery = - "/app/siem#/ml-network/ip/$ip$?query=(language:kuery,query:'process.name%20:%20%22conhost.exe,sc.exe%22')&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')))"; - -// Single host name with a null for the Query: -export const mlHostSingleHostNullKqlQuery = - "/app/siem#/ml-hosts/siem-windows?query=!n&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')))"; - -// Single host name with a variable in the Query: -export const mlHostSingleHostKqlQueryVariable = - "/app/siem#/ml-hosts/siem-windows?query=(language:kuery,query:'process.name%20:%20%22$process.name$%22')&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')))"; - -// Single host name with a value for Query: -export const mlHostSingleHostKqlQuery = - "/app/siem#/ml-hosts/siem-windows?query=(language:kuery,query:'process.name%20:%20%22conhost.exe,sc.exe%22')&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')))"; - -// Multiple host names with null for Query: -export const mlHostMultiHostNullKqlQuery = - "/app/siem#/ml-hosts/siem-windows,siem-suricata?query=!n&&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')))"; - -// Multiple host names with a value for Query: -export const mlHostMultiHostKqlQuery = - "/app/siem#/ml-hosts/siem-windows,siem-suricata?query=(language:kuery,query:'process.name%20:%20%22conhost.exe,sc.exe%22')&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')))"; - -// Undefined/null host name with a null for the KQL: -export const mlHostVariableHostNullKqlQuery = - "/app/siem#/ml-hosts/$host.name$?query=!n&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')))"; - -// Undefined/null host name but with a value for Query: -export const mlHostVariableHostKqlQuery = - "/app/siem#/ml-hosts/$host.name$?query=(language:kuery,query:'process.name%20:%20%22conhost.exe,sc.exe%22')&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')))"; From 8d0b8811496e103cbe6eefc58ecf0f104c0e22ac Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Wed, 19 Feb 2020 17:17:56 +0100 Subject: [PATCH 05/17] deletes 'navigate' lib --- .../integration/lib/navigation/selectors.ts | 25 ------------------- 1 file changed, 25 deletions(-) delete mode 100644 x-pack/legacy/plugins/siem/cypress/integration/lib/navigation/selectors.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/lib/navigation/selectors.ts b/x-pack/legacy/plugins/siem/cypress/integration/lib/navigation/selectors.ts deleted file mode 100644 index 0d5f40ae53966..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/integration/lib/navigation/selectors.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -/** Top-level (global) navigation link to the `Hosts` page */ -export const NAVIGATION_HOSTS = '[data-test-subj="navigation-hosts"]'; - -/** Top-level (global) navigation link to the `Network` page */ -export const NAVIGATION_NETWORK = '[data-test-subj="navigation-network"]'; - -/** Top-level (global) navigation link to the `Overview` page */ -export const NAVIGATION_OVERVIEW = '[data-test-subj="navigation-overview"]'; - -/** Top-level (global) navigation link to the `Timelines` page */ -export const NAVIGATION_TIMELINES = '[data-test-subj="navigation-timelines"]'; - -export const HOSTS_PAGE_TABS = { - allHosts: '[data-test-subj="navigation-allHosts"]', - anomalies: '[data-test-subj="navigation-anomalies"]', - authentications: '[data-test-subj="navigation-authentications"]', - events: '[data-test-subj="navigation-events"]', - uncommonProcesses: '[data-test-subj="navigation-uncommonProcesses"]', -}; From f5ecf22f63197efb0c855313c87d4eb7b13a130c Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Wed, 19 Feb 2020 17:20:10 +0100 Subject: [PATCH 06/17] delete 'overview' lib --- .../integration/lib/overview/selectors.ts | 144 ------------------ .../smoke_tests/overview/overview.spec.ts | 2 +- 2 files changed, 1 insertion(+), 145 deletions(-) delete mode 100644 x-pack/legacy/plugins/siem/cypress/integration/lib/overview/selectors.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/lib/overview/selectors.ts b/x-pack/legacy/plugins/siem/cypress/integration/lib/overview/selectors.ts deleted file mode 100644 index 95facc8974400..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/integration/lib/overview/selectors.ts +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -// Host Stats -export const STAT_AUDITD = { - value: '123', - domId: '[data-test-subj="host-stat-auditbeatAuditd"]', -}; -export const ENDGAME_DNS = { - value: '391', - domId: '[data-test-subj="host-stat-endgameDns"]', -}; -export const ENDGAME_FILE = { - value: '392', - domId: '[data-test-subj="host-stat-endgameFile"]', -}; -export const ENDGAME_IMAGE_LOAD = { - value: '393', - domId: '[data-test-subj="host-stat-endgameImageLoad"]', -}; -export const ENDGAME_NETWORK = { - value: '394', - domId: '[data-test-subj="host-stat-endgameNetwork"]', -}; -export const ENDGAME_PROCESS = { - value: '395', - domId: '[data-test-subj="host-stat-endgameProcess"]', -}; -export const ENDGAME_REGISTRY = { - value: '396', - domId: '[data-test-subj="host-stat-endgameRegistry"]', -}; -export const ENDGAME_SECURITY = { - value: '397', - domId: '[data-test-subj="host-stat-endgameSecurity"]', -}; -export const STAT_FILEBEAT = { - value: '890', - domId: '[data-test-subj="host-stat-filebeatSystemModule"]', -}; -export const STAT_FIM = { - value: '345', - domId: '[data-test-subj="host-stat-auditbeatFIM"]', -}; -export const STAT_LOGIN = { - value: '456', - domId: '[data-test-subj="host-stat-auditbeatLogin"]', -}; -export const STAT_PACKAGE = { - value: '567', - domId: '[data-test-subj="host-stat-auditbeatPackage"]', -}; -export const STAT_PROCESS = { - value: '678', - domId: '[data-test-subj="host-stat-auditbeatProcess"]', -}; -export const STAT_USER = { - value: '789', - domId: '[data-test-subj="host-stat-auditbeatUser"]', -}; -export const STAT_WINLOGBEAT_SECURITY = { - value: '70', - domId: '[data-test-subj="host-stat-winlogbeatSecurity"]', -}; -export const STAT_WINLOGBEAT_MWSYSMON_OPERATIONAL = { - value: '30', - domId: '[data-test-subj="host-stat-winlogbeatMWSysmonOperational"]', -}; - -export const HOST_STATS = [ - STAT_AUDITD, - ENDGAME_DNS, - ENDGAME_FILE, - ENDGAME_IMAGE_LOAD, - ENDGAME_NETWORK, - ENDGAME_PROCESS, - ENDGAME_REGISTRY, - ENDGAME_SECURITY, - STAT_FILEBEAT, - STAT_FIM, - STAT_LOGIN, - STAT_PACKAGE, - STAT_PROCESS, - STAT_USER, - STAT_WINLOGBEAT_SECURITY, - STAT_WINLOGBEAT_MWSYSMON_OPERATIONAL, -]; - -// Network Stats -export const STAT_SOCKET = { - value: '578,502', - domId: '[data-test-subj="network-stat-auditbeatSocket"]', -}; -export const STAT_CISCO = { - value: '999', - domId: '[data-test-subj="network-stat-filebeatCisco"]', -}; -export const STAT_NETFLOW = { - value: '2,544', - domId: '[data-test-subj="network-stat-filebeatNetflow"]', -}; -export const STAT_PANW = { - value: '678', - domId: '[data-test-subj="network-stat-filebeatPanw"]', -}; -export const STAT_SURICATA = { - value: '303,699', - domId: '[data-test-subj="network-stat-filebeatSuricata"]', -}; -export const STAT_ZEEK = { - value: '71,129', - domId: '[data-test-subj="network-stat-filebeatZeek"]', -}; -export const STAT_DNS = { - value: '1,090', - domId: '[data-test-subj="network-stat-packetbeatDNS"]', -}; -export const STAT_FLOW = { - value: '722,153', - domId: '[data-test-subj="network-stat-packetbeatFlow"]', -}; -export const STAT_TLS = { - value: '340', - domId: '[data-test-subj="network-stat-packetbeatTLS"]', -}; - -export const NETWORK_STATS = [ - STAT_SOCKET, - STAT_CISCO, - STAT_NETFLOW, - STAT_PANW, - STAT_SURICATA, - STAT_ZEEK, - STAT_DNS, - STAT_FLOW, - STAT_TLS, -]; - -export const OVERVIEW_HOST_STATS = '[data-test-subj="overview-hosts-stats"]'; - -export const OVERVIEW_NETWORK_STATS = '[data-test-subj="overview-network-stats"]'; diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/overview/overview.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/overview/overview.spec.ts index 64002aadc86d8..8ddc0eac3d067 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/overview/overview.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/overview/overview.spec.ts @@ -7,7 +7,7 @@ import { OVERVIEW_PAGE } from '../../../urls/navigation'; import { HOST_STATS, NETWORK_STATS } from '../../../screens/overview'; import { expandHostStats, expandNetworkStats } from '../../../tasks/overview'; -import { loginAndWaitForPage } from '../../lib/util/helpers'; +import { loginAndWaitForPage } from '../../../tasks/login'; describe('Overview Page', () => { before(() => { From e84a31ee350586c1d6467151ce5d32bb034c3ee6 Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Wed, 19 Feb 2020 17:22:39 +0100 Subject: [PATCH 07/17] deletes 'pagination' lib --- .../integration/lib/pagination/selectors.ts | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 x-pack/legacy/plugins/siem/cypress/integration/lib/pagination/selectors.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/lib/pagination/selectors.ts b/x-pack/legacy/plugins/siem/cypress/integration/lib/pagination/selectors.ts deleted file mode 100644 index 8e05f3e54568e..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/integration/lib/pagination/selectors.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -export const AUTHENTICATIONS_TABLE = '[data-test-subj="table-authentications-loading-false"]'; -export const getDraggableField = (field: string) => `[data-test-subj="draggable-content-${field}"]`; -export const getPageButtonSelector = (num: number) => `[data-test-subj="pagination-button-${num}"]`; -export const NAVIGATION_AUTHENTICATIONS = '[data-test-subj="navigation-authentications"]'; -export const NAVIGATION_UNCOMMON_PROCESSES = '[data-test-subj="navigation-uncommonProcesses"]'; -export const NUMBERED_PAGINATION = '[data-test-subj="numberedPagination"]'; -export const SUPER_DATE_PICKER_APPLY_BUTTON = '[data-test-subj="superDatePickerApplyTimeButton"]'; -export const UNCOMMON_PROCCESSES_TABLE = '[data-test-subj="table-uncommonProcesses-loading-false"]'; From 27dd30c3028194139c1375a179865b7a82a42be0 Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Wed, 19 Feb 2020 17:24:19 +0100 Subject: [PATCH 08/17] deletes 'timeline' lib --- .../integration/lib/timeline/helpers.ts | 59 ------------------- .../integration/lib/timeline/selectors.ts | 47 --------------- 2 files changed, 106 deletions(-) delete mode 100644 x-pack/legacy/plugins/siem/cypress/integration/lib/timeline/helpers.ts delete mode 100644 x-pack/legacy/plugins/siem/cypress/integration/lib/timeline/selectors.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/lib/timeline/helpers.ts b/x-pack/legacy/plugins/siem/cypress/integration/lib/timeline/helpers.ts deleted file mode 100644 index ef2c19bd7e737..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/integration/lib/timeline/helpers.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { drag, drop } from '../drag_n_drop/helpers'; -import { ALL_HOSTS_WIDGET_DRAGGABLE_HOSTS } from '../hosts/selectors'; -import { - CLOSE_TIMELINE_BTN, - CREATE_NEW_TIMELINE, - SEARCH_OR_FILTER_CONTAINER, - SERVER_SIDE_EVENT_COUNT, - TIMELINE_DATA_PROVIDERS, - TIMELINE_SETTINGS, - TIMELINE_TOGGLE_BUTTON, - TOGGLE_TIMELINE_EXPAND_EVENT, -} from './selectors'; -import { DEFAULT_TIMEOUT } from '../util/helpers'; - -/** Toggles the timeline's open / closed state by clicking the `T I M E L I N E` button */ -export const toggleTimelineVisibility = () => - cy.get(TIMELINE_TOGGLE_BUTTON, { timeout: DEFAULT_TIMEOUT }).click(); - -export const createNewTimeline = () => { - cy.get(TIMELINE_SETTINGS).click(); - cy.get(CREATE_NEW_TIMELINE).click(); - cy.get(CLOSE_TIMELINE_BTN).click({ force: true }); -}; - -/** Drags and drops a host from the `All Hosts` widget on the `Hosts` page to the timeline */ -export const dragFromAllHostsToTimeline = () => { - cy.get(ALL_HOSTS_WIDGET_DRAGGABLE_HOSTS) - .first() - .then(host => drag(host)); - cy.get(TIMELINE_DATA_PROVIDERS).then(dataProvidersDropArea => drop(dataProvidersDropArea)); -}; - -/** Executes the specified KQL query in the timeline */ -export const executeKQL = (query: string) => { - cy.get(`${SEARCH_OR_FILTER_CONTAINER} input`).type(`${query} {enter}`); -}; - -/** A sample KQL query that finds any documents where the `host.name` field exists */ -export const hostExistsQuery = 'host.name: *'; - -/** Asserts that at least one event matches the timeline's search criteria */ -export const assertAtLeastOneEventMatchesSearch = () => - cy - .get(SERVER_SIDE_EVENT_COUNT, { timeout: DEFAULT_TIMEOUT }) - .invoke('text') - .should('be.above', 0); - -/** Toggles open or closed the first event in the timeline */ -export const toggleFirstTimelineEventDetails = () => { - cy.get(TOGGLE_TIMELINE_EXPAND_EVENT, { timeout: DEFAULT_TIMEOUT }) - .first() - .click({ force: true }); -}; diff --git a/x-pack/legacy/plugins/siem/cypress/integration/lib/timeline/selectors.ts b/x-pack/legacy/plugins/siem/cypress/integration/lib/timeline/selectors.ts deleted file mode 100644 index 5515c1f7d58e2..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/integration/lib/timeline/selectors.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -/** A data provider rendered in the timeline's data providers drop area */ -export const DATA_PROVIDER = '[data-test-subj="providerContainer"]'; - -export const TIMELINE_FIELDS_BUTTON = - '[data-test-subj="timeline"] [data-test-subj="show-field-browser"]'; - -/** Data providers are dropped and rendered in this area of the timeline */ -export const TIMELINE_DATA_PROVIDERS = '[data-test-subj="dataProviders"]'; - -/** The empty data providers area when no data providers have been added to the timeline */ -export const TIMELINE_DATA_PROVIDERS_EMPTY = - '[data-test-subj="dataProviders"] [data-test-subj="empty"]'; - -/** Data providers that were dropped on a timeline */ -export const TIMELINE_DROPPED_DATA_PROVIDERS = `${TIMELINE_DATA_PROVIDERS} ${DATA_PROVIDER}`; - -/** The `Timeline ^` button that toggles visibility of the Timeline */ -export const TIMELINE_TOGGLE_BUTTON = '[data-test-subj="flyoutOverlay"]'; - -/** The flyout button shown when a data provider is not ready to be dropped on the timeline */ -export const TIMELINE_NOT_READY_TO_DROP_BUTTON = - '[data-test-subj="flyout-button-not-ready-to-drop"]'; - -/** Contains the KQL bar for searching or filtering in the timeline */ -export const SEARCH_OR_FILTER_CONTAINER = - '[data-test-subj="timeline-search-or-filter-search-container"]'; - -/** The total server-side count of the events matching the timeline's search criteria */ -export const SERVER_SIDE_EVENT_COUNT = '[data-test-subj="server-side-event-count"]'; - -/** Expands or collapses an event in the timeline */ -export const TOGGLE_TIMELINE_EXPAND_EVENT = '[data-test-subj="expand-event"]'; - -/** The body of the timeline flyout */ -export const TIMELINE_FLYOUT_BODY = '[data-test-subj="eui-flyout-body"]'; - -export const CLOSE_TIMELINE_BTN = '[data-test-subj="close-timeline"]'; - -export const TIMELINE_SETTINGS = '[data-test-subj="settings-gear"]'; - -export const CREATE_NEW_TIMELINE = '[data-test-subj="timeline-new"]'; From 334f0d26c845f50e91f68e2dc32523ecbb459296 Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Wed, 19 Feb 2020 17:27:47 +0100 Subject: [PATCH 09/17] deletes 'url state' lib --- .../integration/lib/url_state/index.ts | 47 ------------------- 1 file changed, 47 deletions(-) delete mode 100644 x-pack/legacy/plugins/siem/cypress/integration/lib/url_state/index.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/lib/url_state/index.ts b/x-pack/legacy/plugins/siem/cypress/integration/lib/url_state/index.ts deleted file mode 100644 index fa754cd4b8db4..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/integration/lib/url_state/index.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -/* - * Be Careful here by using iso date and epoch date - * because the conversion might not what you expect - * for different timezone better to calculate - * them on the fly - */ - -export const ABSOLUTE_DATE_RANGE = { - url: - '/app/siem#/network/?timerange=(global:(linkTo:!(timeline),timerange:(from:1564689809186,kind:absolute,to:1564691609186)),timeline:(linkTo:!(global),timerange:(from:1564689809186,kind:absolute,to:1564691609186)))', - - urlUnlinked: - '/app/siem#/network/?timerange=(global:(linkTo:!(),timerange:(from:1564689809186,kind:absolute,to:1564691609186)),timeline:(linkTo:!(),timerange:(from:1564776209186,kind:absolute,to:1564779809186)))', - urlKqlNetworkNetwork: `/app/siem#/network/?query=(language:kuery,query:'source.ip:%20"10.142.0.9"')&timerange=(global:(linkTo:!(timeline),timerange:(from:1564689809186,kind:absolute,to:1564691609186)),timeline:(linkTo:!(global),timerange:(from:1564689809186,kind:absolute,to:1564691609186)))`, - urlKqlNetworkHosts: `/app/siem#/network/?query=(language:kuery,query:'source.ip:%20"10.142.0.9"')&timerange=(global:(linkTo:!(timeline),timerange:(from:1564689809186,kind:absolute,to:1564691609186)),timeline:(linkTo:!(global),timerange:(from:1564689809186,kind:absolute,to:1564691609186)))`, - urlKqlHostsNetwork: `/app/siem#/hosts/allHosts?query=(language:kuery,query:'source.ip:%20"10.142.0.9"')&timerange=(global:(linkTo:!(timeline),timerange:(from:1564689809186,kind:absolute,to:1564691609186)),timeline:(linkTo:!(global),timerange:(from:1564689809186,kind:absolute,to:1564691609186)))`, - urlKqlHostsHosts: `/app/siem#/hosts/allHosts?query=(language:kuery,query:'source.ip:%20"10.142.0.9"')&timerange=(global:(linkTo:!(timeline),timerange:(from:1564689809186,kind:absolute,to:1564691609186)),timeline:(linkTo:!(global),timerange:(from:1564689809186,kind:absolute,to:1564691609186)))`, - urlHost: - '/app/siem#/hosts/authentications?timerange=(global:(linkTo:!(timeline),timerange:(from:1564689809186,kind:absolute,to:1564691609186)),timeline:(linkTo:!(global),timerange:(from:1564689809186,kind:absolute,to:1564691609186)))', - urlHostNew: - '/app/siem#/hosts/authentications?timerange=(global:(linkTo:!(timeline),timerange:(from:1564689809186,kind:absolute,to:1577914409186)),timeline:(linkTo:!(global),timerange:(from:1564689809186,kind:absolute,to:1577914409186)))', -}; -export const DATE_PICKER_START_DATE_POPOVER_BUTTON = - 'div[data-test-subj="globalDatePicker"] button[data-test-subj="superDatePickerstartDatePopoverButton"]'; -export const DATE_PICKER_END_DATE_POPOVER_BUTTON = - '[data-test-subj="globalDatePicker"] [data-test-subj="superDatePickerendDatePopoverButton"]'; -export const DATE_PICKER_START_DATE_POPOVER_BUTTON_TIMELINE = - '[data-test-subj="timeline-properties"] [data-test-subj="superDatePickerstartDatePopoverButton"]'; -export const DATE_PICKER_END_DATE_POPOVER_BUTTON_TIMELINE = - '[data-test-subj="timeline-properties"] [data-test-subj="superDatePickerendDatePopoverButton"]'; -export const DATE_PICKER_ABSOLUTE_TAB = '[data-test-subj="superDatePickerAbsoluteTab"]'; -export const DATE_PICKER_APPLY_BUTTON = - '[data-test-subj="globalDatePicker"] button[data-test-subj="querySubmitButton"]'; -export const DATE_PICKER_APPLY_BUTTON_TIMELINE = - '[data-test-subj="timeline-properties"] button[data-test-subj="superDatePickerApplyTimeButton"]'; -export const DATE_PICKER_ABSOLUTE_INPUT = '[data-test-subj="superDatePickerAbsoluteDateInput"]'; -export const KQL_INPUT = '[data-test-subj="queryInput"]'; -export const TIMELINE_TITLE = '[data-test-subj="timeline-title"]'; - -export const HOST_DETAIL_SIEM_KIBANA = '[data-test-subj="table-allHosts-loading-false"] a.euiLink'; -export const BREADCRUMBS = '[data-test-subj="breadcrumbs"] a'; From 8e77107a5717deeed656e30d15f40795e71892bf Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Wed, 19 Feb 2020 17:56:19 +0100 Subject: [PATCH 10/17] deletes the rest of lib folders --- .../integration/lib/drag_n_drop/helpers.ts | 50 -------- .../integration/lib/fixtures/helpers.ts | 19 --- .../cypress/integration/lib/hosts/helpers.ts | 16 --- .../integration/lib/hosts/selectors.ts | 21 ---- .../cypress/integration/lib/login/helpers.ts | 115 ------------------ .../integration/lib/login/selectors.ts | 14 --- .../cypress/integration/lib/urls/index.ts | 33 ----- .../cypress/integration/lib/util/helpers.ts | 27 ---- .../siem/cypress/tasks/hosts/events.ts | 2 +- .../cypress/tasks/hosts/fields_browsers.ts | 2 +- .../plugins/siem/cypress/tasks/hosts/main.ts | 2 +- .../plugins/siem/cypress/tasks/login.ts | 110 ++++++++++++++++- .../cypress/tasks/timeline/fields_browser.ts | 4 +- .../siem/cypress/tasks/timeline/main.ts | 2 +- 14 files changed, 115 insertions(+), 302 deletions(-) delete mode 100644 x-pack/legacy/plugins/siem/cypress/integration/lib/drag_n_drop/helpers.ts delete mode 100644 x-pack/legacy/plugins/siem/cypress/integration/lib/fixtures/helpers.ts delete mode 100644 x-pack/legacy/plugins/siem/cypress/integration/lib/hosts/helpers.ts delete mode 100644 x-pack/legacy/plugins/siem/cypress/integration/lib/hosts/selectors.ts delete mode 100644 x-pack/legacy/plugins/siem/cypress/integration/lib/login/helpers.ts delete mode 100644 x-pack/legacy/plugins/siem/cypress/integration/lib/login/selectors.ts delete mode 100644 x-pack/legacy/plugins/siem/cypress/integration/lib/urls/index.ts delete mode 100644 x-pack/legacy/plugins/siem/cypress/integration/lib/util/helpers.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/lib/drag_n_drop/helpers.ts b/x-pack/legacy/plugins/siem/cypress/integration/lib/drag_n_drop/helpers.ts deleted file mode 100644 index 39a61401c15b3..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/integration/lib/drag_n_drop/helpers.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -const primaryButton = 0; - -/** - * To overcome the React Beautiful DND sloppy click detection threshold: - * https://github.com/atlassian/react-beautiful-dnd/blob/67b96c8d04f64af6b63ae1315f74fc02b5db032b/docs/sensors/mouse.md#sloppy-clicks-and-click-prevention- - */ -const dndSloppyClickDetectionThreshold = 5; - -/** Starts dragging the subject */ -export const drag = (subject: JQuery) => { - const subjectLocation = subject[0].getBoundingClientRect(); - - cy.wrap(subject) - .trigger('mousedown', { - button: primaryButton, - clientX: subjectLocation.left, - clientY: subjectLocation.top, - force: true, - }) - .wait(1) - .trigger('mousemove', { - button: primaryButton, - clientX: subjectLocation.left + dndSloppyClickDetectionThreshold, - clientY: subjectLocation.top, - force: true, - }) - .wait(1); -}; - -/** "Drops" the subject being dragged on the specified drop target */ -export const drop = (dropTarget: JQuery) => { - cy.wrap(dropTarget) - .trigger('mousemove', { button: primaryButton, force: true }) - .wait(1) - .trigger('mouseup', { force: true }) - .wait(1); -}; - -/** Drags the subject being dragged on the specified drop target, but does not drop it */ -export const dragWithoutDrop = (dropTarget: JQuery) => { - cy.wrap(dropTarget).trigger('mousemove', 'center', { - button: primaryButton, - }); -}; diff --git a/x-pack/legacy/plugins/siem/cypress/integration/lib/fixtures/helpers.ts b/x-pack/legacy/plugins/siem/cypress/integration/lib/fixtures/helpers.ts deleted file mode 100644 index e66199e0419ec..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/integration/lib/fixtures/helpers.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -// Cypress workaround to hijack XHR -// https://github.com/cypress-io/cypress/issues/687 -export const clearFetch = () => - cy.on('window:before:load', win => { - // @ts-ignore no null, this is a temp hack see issue above - win.fetch = null; - }); - -export const stubApi = (dataFileName: string) => { - cy.server(); - cy.fixture(dataFileName).as(`${dataFileName}JSON`); - cy.route('POST', 'api/siem/graphql', `@${dataFileName}JSON`); -}; diff --git a/x-pack/legacy/plugins/siem/cypress/integration/lib/hosts/helpers.ts b/x-pack/legacy/plugins/siem/cypress/integration/lib/hosts/helpers.ts deleted file mode 100644 index 8f4efbe0c09c2..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/integration/lib/hosts/helpers.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { DEFAULT_TIMEOUT } from '../util/helpers'; - -import { ALL_HOSTS_WIDGET, EVENTS_TAB_BUTTON } from './selectors'; - -/** Wait for the for the `All Hosts` widget on the `Hosts` page to load */ -export const waitForAllHostsWidget = () => cy.get(ALL_HOSTS_WIDGET, { timeout: DEFAULT_TIMEOUT }); - -/** Clicks the Events tab on the hosts page */ -export const clickEventsTab = () => - cy.get(EVENTS_TAB_BUTTON, { timeout: DEFAULT_TIMEOUT }).click({ force: true }); diff --git a/x-pack/legacy/plugins/siem/cypress/integration/lib/hosts/selectors.ts b/x-pack/legacy/plugins/siem/cypress/integration/lib/hosts/selectors.ts deleted file mode 100644 index ab2502676d6f7..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/integration/lib/hosts/selectors.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -/** The `All Hosts` widget on the `Hosts` page */ -export const ALL_HOSTS_WIDGET = '[data-test-subj="table-allHosts-loading-false"]'; - -/** A single draggable host in the `All Hosts` widget on the `Hosts` page */ -export const ALL_HOSTS_WIDGET_HOST = '[data-test-subj="draggable-content-host.name"]'; - -/** All the draggable hosts in the `All Hosts` widget on the `Hosts` page */ -export const ALL_HOSTS_WIDGET_DRAGGABLE_HOSTS = `${ALL_HOSTS_WIDGET} ${ALL_HOSTS_WIDGET_HOST}`; - -/** Clicking this button displays the `Events` tab */ -export const EVENTS_TAB_BUTTON = '[data-test-subj="navigation-events"]'; - -export const NAVIGATION_HOSTS_ALL_HOSTS = '[data-test-subj="navigation-allHosts"]'; - -export const NAVIGATION_HOSTS_ANOMALIES = '[data-test-subj="navigation-anomalies"]'; diff --git a/x-pack/legacy/plugins/siem/cypress/integration/lib/login/helpers.ts b/x-pack/legacy/plugins/siem/cypress/integration/lib/login/helpers.ts deleted file mode 100644 index b2b8ce7b9c000..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/integration/lib/login/helpers.ts +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import * as yaml from 'js-yaml'; - -/** - * Credentials in the `kibana.dev.yml` config file will be used to authenticate - * with Kibana when credentials are not provided via environment variables - */ -const KIBANA_DEV_YML_PATH = '../../../../config/kibana.dev.yml'; - -/** - * The configuration path in `kibana.dev.yml` to the username to be used when - * authenticating with Kibana. - */ -const ELASTICSEARCH_USERNAME_CONFIG_PATH = 'config.elasticsearch.username'; - -/** - * The configuration path in `kibana.dev.yml` to the password to be used when - * authenticating with Kibana. - */ -const ELASTICSEARCH_PASSWORD_CONFIG_PATH = 'config.elasticsearch.password'; - -/** - * The `CYPRESS_ELASTICSEARCH_USERNAME` environment variable specifies the - * username to be used when authenticating with Kibana - */ -const ELASTICSEARCH_USERNAME = 'ELASTICSEARCH_USERNAME'; - -/** - * The `CYPRESS_ELASTICSEARCH_PASSWORD` environment variable specifies the - * username to be used when authenticating with Kibana - */ -const ELASTICSEARCH_PASSWORD = 'ELASTICSEARCH_PASSWORD'; - -/** - * The Kibana server endpoint used for authentication - */ -const LOGIN_API_ENDPOINT = '/internal/security/login'; - -/** - * Authenticates with Kibana using, if specified, credentials specified by - * environment variables. The credentials in `kibana.dev.yml` will be used - * for authentication when the environment variables are unset. - * - * To speed the execution of tests, prefer this non-interactive authentication, - * which is faster than authentication via Kibana's interactive login page. - */ -export const login = () => { - if (credentialsProvidedByEnvironment()) { - loginViaEnvironmentCredentials(); - } else { - loginViaConfig(); - } -}; - -/** - * Returns `true` if the credentials used to login to Kibana are provided - * via environment variables - */ -const credentialsProvidedByEnvironment = (): boolean => - Cypress.env(ELASTICSEARCH_USERNAME) != null && Cypress.env(ELASTICSEARCH_PASSWORD) != null; - -/** - * Authenticates with Kibana by reading credentials from the - * `CYPRESS_ELASTICSEARCH_USERNAME` and `CYPRESS_ELASTICSEARCH_PASSWORD` - * environment variables, and POSTing the username and password directly to - * Kibana's `/internal/security/login` endpoint, bypassing the login page (for speed). - */ -const loginViaEnvironmentCredentials = () => { - cy.log( - `Authenticating via environment credentials from the \`CYPRESS_${ELASTICSEARCH_USERNAME}\` and \`CYPRESS_${ELASTICSEARCH_PASSWORD}\` environment variables` - ); - - // programmatically authenticate without interacting with the Kibana login page - cy.request({ - body: { - username: Cypress.env(ELASTICSEARCH_USERNAME), - password: Cypress.env(ELASTICSEARCH_PASSWORD), - }, - headers: { 'kbn-xsrf': 'cypress-creds-via-env' }, - method: 'POST', - url: `${Cypress.config().baseUrl}${LOGIN_API_ENDPOINT}`, - }); -}; - -/** - * Authenticates with Kibana by reading credentials from the - * `kibana.dev.yml` file and POSTing the username and password directly to - * Kibana's `/internal/security/login` endpoint, bypassing the login page (for speed). - */ -const loginViaConfig = () => { - cy.log( - `Authenticating via config credentials \`${ELASTICSEARCH_USERNAME_CONFIG_PATH}\` and \`${ELASTICSEARCH_PASSWORD_CONFIG_PATH}\` from \`${KIBANA_DEV_YML_PATH}\`` - ); - - // read the login details from `kibana.dev.yaml` - cy.readFile(KIBANA_DEV_YML_PATH).then(kibanaDevYml => { - const config = yaml.safeLoad(kibanaDevYml); - - // programmatically authenticate without interacting with the Kibana login page - cy.request({ - body: { - username: config.elasticsearch.username, - password: config.elasticsearch.password, - }, - headers: { 'kbn-xsrf': 'cypress-creds-via-config' }, - method: 'POST', - url: `${Cypress.config().baseUrl}${LOGIN_API_ENDPOINT}`, - }); - }); -}; diff --git a/x-pack/legacy/plugins/siem/cypress/integration/lib/login/selectors.ts b/x-pack/legacy/plugins/siem/cypress/integration/lib/login/selectors.ts deleted file mode 100644 index ac028fa91216c..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/integration/lib/login/selectors.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -/** The Username field in the Kibana login page */ -export const USERNAME = '[data-test-subj="loginUsername"]'; - -/** The Password field in the Kibana login page */ -export const PASSWORD = '[data-test-subj="loginPassword"]'; - -/** The `Default` space button on the `Select your space` page */ -export const DEFAULT_SPACE_BUTTON = '[data-test-subj="space-card-default"]'; diff --git a/x-pack/legacy/plugins/siem/cypress/integration/lib/urls/index.ts b/x-pack/legacy/plugins/siem/cypress/integration/lib/urls/index.ts deleted file mode 100644 index 18276580289c7..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/integration/lib/urls/index.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -/** The SIEM app's Hosts page */ -export const HOSTS_PAGE = '/app/siem#/hosts/allHosts'; -export const HOSTS_PAGE_TAB_URLS = { - allHosts: '/app/siem#/hosts/allHosts', - anomalies: '/app/siem#/hosts/anomalies', - authentications: '/app/siem#/hosts/authentications', - events: '/app/siem#/hosts/events', - uncommonProcesses: '/app/siem#/hosts/uncommonProcesses', -}; - -/** Kibana's login page */ -export const LOGIN_PAGE = '/login'; - -/** The SIEM app's Network page */ -export const NETWORK_PAGE = '/app/siem#/network'; -export const NETWORK_TAB_URLS = { - dns: `${NETWORK_PAGE}/dns`, -}; - -/** The SIEM app's Overview page */ -export const OVERVIEW_PAGE = '/app/siem#/overview'; - -/** The SIEM app's Timelines page */ -export const TIMELINES_PAGE = '/app/siem#/timelines'; - -/** Visit this URL to logout of Kibana */ -export const LOGOUT = '/logout'; diff --git a/x-pack/legacy/plugins/siem/cypress/integration/lib/util/helpers.ts b/x-pack/legacy/plugins/siem/cypress/integration/lib/util/helpers.ts deleted file mode 100644 index 4f96430bb381e..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/integration/lib/util/helpers.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { login } from '../login/helpers'; - -/** The default time in ms to wait for a Cypress command to complete */ -export const DEFAULT_TIMEOUT = 30 * 1000; - -/** - * Authenticates with Kibana, visits the specified `url`, and waits for the - * Kibana logo to be displayed before continuing - */ -export const loginAndWaitForPage = (url: string) => { - login(); - - cy.visit(`${Cypress.config().baseUrl}${url}`); - - cy.viewport('macbook-15'); - - cy.contains('a', 'SIEM', { timeout: DEFAULT_TIMEOUT }); -}; - -export const waitForTableLoad = (dataTestSubj: string) => - cy.get(dataTestSubj, { timeout: DEFAULT_TIMEOUT }); diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/events.ts b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/events.ts index d84d62f82d2e6..1a027bdb43e3a 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/events.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/events.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { DEFAULT_TIMEOUT } from '../../integration/lib/util/helpers'; +import { DEFAULT_TIMEOUT } from '../../tasks/login'; import { EVENTS_VIEWER_FIELDS_BUTTON, CLOSE_MODAL, diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/fields_browsers.ts b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/fields_browsers.ts index ae3ed2010a0ae..44d9e64638bda 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/fields_browsers.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/fields_browsers.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { DEFAULT_TIMEOUT } from '../../integration/lib/util/helpers'; +import { DEFAULT_TIMEOUT } from '../../tasks/login'; import { KQL_SEARCH_BAR } from '../../screens/hosts/main'; export const closeFieldsBrowser = () => { diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/main.ts b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/main.ts index cbf410b4bc232..c1026b656aaaf 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/main.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/main.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { DEFAULT_TIMEOUT } from '../../integration/lib/util/helpers'; +import { DEFAULT_TIMEOUT } from '../../tasks/login'; import { EVENTS_TAB, diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/login.ts b/x-pack/legacy/plugins/siem/cypress/tasks/login.ts index d5bf1178d5bdd..110d5424ea251 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/login.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/login.ts @@ -4,7 +4,115 @@ * you may not use this file except in compliance with the Elastic License. */ -import { login } from '../integration/lib/login/helpers'; +import * as yaml from 'js-yaml'; + +/** + * Credentials in the `kibana.dev.yml` config file will be used to authenticate + * with Kibana when credentials are not provided via environment variables + */ +const KIBANA_DEV_YML_PATH = '../../../../config/kibana.dev.yml'; + +/** + * The configuration path in `kibana.dev.yml` to the username to be used when + * authenticating with Kibana. + */ +const ELASTICSEARCH_USERNAME_CONFIG_PATH = 'config.elasticsearch.username'; + +/** + * The configuration path in `kibana.dev.yml` to the password to be used when + * authenticating with Kibana. + */ +const ELASTICSEARCH_PASSWORD_CONFIG_PATH = 'config.elasticsearch.password'; + +/** + * The `CYPRESS_ELASTICSEARCH_USERNAME` environment variable specifies the + * username to be used when authenticating with Kibana + */ +const ELASTICSEARCH_USERNAME = 'ELASTICSEARCH_USERNAME'; + +/** + * The `CYPRESS_ELASTICSEARCH_PASSWORD` environment variable specifies the + * username to be used when authenticating with Kibana + */ +const ELASTICSEARCH_PASSWORD = 'ELASTICSEARCH_PASSWORD'; + +/** + * The Kibana server endpoint used for authentication + */ +const LOGIN_API_ENDPOINT = '/internal/security/login'; + +/** + * Authenticates with Kibana using, if specified, credentials specified by + * environment variables. The credentials in `kibana.dev.yml` will be used + * for authentication when the environment variables are unset. + * + * To speed the execution of tests, prefer this non-interactive authentication, + * which is faster than authentication via Kibana's interactive login page. + */ +export const login = () => { + if (credentialsProvidedByEnvironment()) { + loginViaEnvironmentCredentials(); + } else { + loginViaConfig(); + } +}; + +/** + * Returns `true` if the credentials used to login to Kibana are provided + * via environment variables + */ +const credentialsProvidedByEnvironment = (): boolean => + Cypress.env(ELASTICSEARCH_USERNAME) != null && Cypress.env(ELASTICSEARCH_PASSWORD) != null; + +/** + * Authenticates with Kibana by reading credentials from the + * `CYPRESS_ELASTICSEARCH_USERNAME` and `CYPRESS_ELASTICSEARCH_PASSWORD` + * environment variables, and POSTing the username and password directly to + * Kibana's `/internal/security/login` endpoint, bypassing the login page (for speed). + */ +const loginViaEnvironmentCredentials = () => { + cy.log( + `Authenticating via environment credentials from the \`CYPRESS_${ELASTICSEARCH_USERNAME}\` and \`CYPRESS_${ELASTICSEARCH_PASSWORD}\` environment variables` + ); + + // programmatically authenticate without interacting with the Kibana login page + cy.request({ + body: { + username: Cypress.env(ELASTICSEARCH_USERNAME), + password: Cypress.env(ELASTICSEARCH_PASSWORD), + }, + headers: { 'kbn-xsrf': 'cypress-creds-via-env' }, + method: 'POST', + url: `${Cypress.config().baseUrl}${LOGIN_API_ENDPOINT}`, + }); +}; + +/** + * Authenticates with Kibana by reading credentials from the + * `kibana.dev.yml` file and POSTing the username and password directly to + * Kibana's `/internal/security/login` endpoint, bypassing the login page (for speed). + */ +const loginViaConfig = () => { + cy.log( + `Authenticating via config credentials \`${ELASTICSEARCH_USERNAME_CONFIG_PATH}\` and \`${ELASTICSEARCH_PASSWORD_CONFIG_PATH}\` from \`${KIBANA_DEV_YML_PATH}\`` + ); + + // read the login details from `kibana.dev.yaml` + cy.readFile(KIBANA_DEV_YML_PATH).then(kibanaDevYml => { + const config = yaml.safeLoad(kibanaDevYml); + + // programmatically authenticate without interacting with the Kibana login page + cy.request({ + body: { + username: config.elasticsearch.username, + password: config.elasticsearch.password, + }, + headers: { 'kbn-xsrf': 'cypress-creds-via-config' }, + method: 'POST', + url: `${Cypress.config().baseUrl}${LOGIN_API_ENDPOINT}`, + }); + }); +}; /** The default time in ms to wait for a Cypress command to complete */ export const DEFAULT_TIMEOUT = 30 * 1000; diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/timeline/fields_browser.ts b/x-pack/legacy/plugins/siem/cypress/tasks/timeline/fields_browser.ts index d30e49a25bab0..64abc5a3e14ea 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/timeline/fields_browser.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/timeline/fields_browser.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { drag, drop } from '../../integration/lib/drag_n_drop/helpers'; +import { drag, drop } from '../../tasks/common'; import { FIELDS_BROWSER_FILTER_INPUT, @@ -14,7 +14,7 @@ import { FIELDS_BROWSER_HOST_GEO_CONTINENT_NAME_CHECKBOX, FIELDS_BROWSER_RESET_FIELDS, } from '../../screens/timeline/fields_browser'; -import { DEFAULT_TIMEOUT } from '../../integration/lib/util/helpers'; +import { DEFAULT_TIMEOUT } from '../../tasks/login'; import { KQL_SEARCH_BAR } from '../../screens/hosts/main'; export const clearFieldsBrowser = () => { diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/timeline/main.ts b/x-pack/legacy/plugins/siem/cypress/tasks/timeline/main.ts index 80b5e4379212c..fd863871ea2f0 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/timeline/main.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/timeline/main.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { DEFAULT_TIMEOUT } from '../../integration/lib/util/helpers'; +import { DEFAULT_TIMEOUT } from '../../tasks/login'; import { SEARCH_OR_FILTER_CONTAINER, From 1d8ef4551caac4d71f473d5c0f6da5442b3d23ed Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Thu, 20 Feb 2020 12:36:27 +0100 Subject: [PATCH 11/17] reorders tasks and screens --- .../events_viewer/events_viewer.spec.ts | 7 +++---- .../fields_browser/fields_browser.spec.ts | 6 +++--- .../smoke_tests/inspect/inspect.spec.ts | 2 +- .../ml_conditional_links.spec.ts | 2 +- .../smoke_tests/navigation/navigation.spec.ts | 4 ++-- .../smoke_tests/pagination/pagination.spec.ts | 8 ++++---- .../timeline/data_providers.spec.ts | 4 ++-- .../timeline/flyout_button.spec.ts | 7 ++----- .../timeline/search_or_filter.spec.ts | 4 ++-- .../timeline/toggle_column.spec.ts | 4 ++-- .../smoke_tests/url_state/url_state.spec.ts | 12 +++++------ .../screens/{calendar.ts => date_picker.ts} | 0 .../screens/{timeline => }/fields_browser.ts | 4 ++++ .../screens/{ => hosts}/authentications.ts | 0 .../cypress/screens/hosts/fields_browser.ts | 20 ------------------- .../screens/hosts/uncommon_processes.ts | 3 ++- .../screens/{header.ts => siem_header.ts} | 0 .../screens/{timeline/main.ts => timeline.ts} | 0 .../cypress/screens/uncommon_processes.ts | 8 -------- .../tasks/{calendar.ts => date_picker.ts} | 2 +- .../tasks/{timeline => }/fields_browser.ts | 8 ++++---- .../siem/cypress/tasks/hosts/all_hosts.ts | 5 +---- .../tasks/{ => hosts}/authentications.ts | 4 ++-- .../cypress/tasks/hosts/fields_browsers.ts | 12 ----------- .../tasks/{ => hosts}/uncommon_processes.ts | 4 ++-- .../tasks/{header.ts => siem_header.ts} | 2 +- .../tasks/{timeline/main.ts => timeline.ts} | 6 +++--- 27 files changed, 48 insertions(+), 90 deletions(-) rename x-pack/legacy/plugins/siem/cypress/screens/{calendar.ts => date_picker.ts} (100%) rename x-pack/legacy/plugins/siem/cypress/screens/{timeline => }/fields_browser.ts (95%) rename x-pack/legacy/plugins/siem/cypress/screens/{ => hosts}/authentications.ts (100%) delete mode 100644 x-pack/legacy/plugins/siem/cypress/screens/hosts/fields_browser.ts rename x-pack/legacy/plugins/siem/cypress/screens/{header.ts => siem_header.ts} (100%) rename x-pack/legacy/plugins/siem/cypress/screens/{timeline/main.ts => timeline.ts} (100%) delete mode 100644 x-pack/legacy/plugins/siem/cypress/screens/uncommon_processes.ts rename x-pack/legacy/plugins/siem/cypress/tasks/{calendar.ts => date_picker.ts} (98%) rename x-pack/legacy/plugins/siem/cypress/tasks/{timeline => }/fields_browser.ts (89%) rename x-pack/legacy/plugins/siem/cypress/tasks/{ => hosts}/authentications.ts (74%) delete mode 100644 x-pack/legacy/plugins/siem/cypress/tasks/hosts/fields_browsers.ts rename x-pack/legacy/plugins/siem/cypress/tasks/{ => hosts}/uncommon_processes.ts (73%) rename x-pack/legacy/plugins/siem/cypress/tasks/{header.ts => siem_header.ts} (92%) rename x-pack/legacy/plugins/siem/cypress/tasks/{timeline/main.ts => timeline.ts} (94%) diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/events_viewer/events_viewer.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/events_viewer/events_viewer.spec.ts index d690573fe87c9..558a8853f31aa 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/events_viewer/events_viewer.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/events_viewer/events_viewer.spec.ts @@ -4,16 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ -import { filterFieldsBrowser } from '../../../tasks/timeline/fields_browser'; +import { filterFieldsBrowser, closeFieldsBrowser } from '../../../tasks/fields_browser'; import { FIELDS_BROWSER_CONTAINER, FIELDS_BROWSER_SELECTED_CATEGORY_TITLE, FIELDS_BROWSER_TITLE, FIELDS_BROWSER_CHECKBOX, -} from '../../../screens/hosts/fields_browser'; +} from '../../../screens/fields_browser'; import { HOSTS_PAGE } from '../../../urls/navigation'; import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../../../tasks/login'; -import { closeFieldsBrowser } from '../../../tasks/hosts/fields_browsers'; import { openEvents } from '../../../tasks/hosts/main'; import { closeModal, @@ -32,7 +31,7 @@ import { HOST_GEO_CITY_NAME_HEADER, HOST_GEO_COUNTRY_NAME_HEADER, } from '../../../screens/hosts/events'; -import { clearSearchBar, kqlSearch } from '../../../tasks/header'; +import { clearSearchBar, kqlSearch } from '../../../tasks/siem_header'; const defaultHeadersInDefaultEcsCategory = [ { id: '@timestamp' }, diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/fields_browser/fields_browser.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/fields_browser/fields_browser.spec.ts index c78ee366e5dff..b83a693f1851f 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/fields_browser/fields_browser.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/fields_browser/fields_browser.spec.ts @@ -20,9 +20,9 @@ import { FIELDS_BROWSER_HOST_GEO_CITY_NAME_HEADER, FIELDS_BROWSER_HOST_GEO_COUNTRY_NAME_HEADER, FIELDS_BROWSER_HEADER_HOST_GEO_CONTINENT_NAME_HEADER, -} from '../../../screens/timeline/fields_browser'; +} from '../../../screens/fields_browser'; -import { populateTimeline, openTimelineFieldsBrowser } from '../../../tasks/timeline/main'; +import { populateTimeline, openTimelineFieldsBrowser } from '../../../tasks/timeline'; import { openTimeline } from '../../../tasks/siem_main'; @@ -35,7 +35,7 @@ import { addsHostGeoCountryNameToTimelineDraggingIt, addsHostGeoContinentNameToTimeline, resetFields, -} from '../../../tasks/timeline/fields_browser'; +} from '../../../tasks/fields_browser'; const defaultHeaders = [ { id: '@timestamp' }, diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/inspect/inspect.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/inspect/inspect.spec.ts index cf84b352d2273..174bd915f8234 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/inspect/inspect.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/inspect/inspect.spec.ts @@ -14,7 +14,7 @@ import { executeTimelineKQL, openTimelineSettings, openTimelineInspectButton, -} from '../../../tasks/timeline/main'; +} from '../../../tasks/timeline'; import { openTimeline } from '../../../tasks/siem_main'; import { DEFAULT_TIMEOUT, loginAndWaitForPage } from '../../../tasks/login'; import { closesModal, openStatsAndTables } from '../../../tasks/inspect'; diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/ml_conditional_links/ml_conditional_links.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/ml_conditional_links/ml_conditional_links.spec.ts index fabd86cf51f91..7d36d97c4f70f 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/ml_conditional_links/ml_conditional_links.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/ml_conditional_links/ml_conditional_links.spec.ts @@ -20,7 +20,7 @@ import { mlHostVariableHostKqlQuery, } from '../../../urls/ml_conditional_links'; import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../../../tasks/login'; -import { KQL_INPUT } from '../../../screens/header'; +import { KQL_INPUT } from '../../../screens/siem_header'; describe('ml conditional links', () => { it('sets the KQL from a single IP with a value for the query', () => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/navigation/navigation.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/navigation/navigation.spec.ts index 364864b395d41..493df7fe623f4 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/navigation/navigation.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/navigation/navigation.spec.ts @@ -5,9 +5,9 @@ */ import { TIMELINES_PAGE } from '../../../urls/navigation'; -import { HOSTS, NETWORK, OVERVIEW, TIMELINES } from '../../../screens/header'; +import { HOSTS, NETWORK, OVERVIEW, TIMELINES } from '../../../screens/siem_header'; import { loginAndWaitForPage } from '../../../tasks/login'; -import { navigateFromHeaderTo } from '../../../tasks/header'; +import { navigateFromHeaderTo } from '../../../tasks/siem_header'; describe('top-level navigation common to all pages in the SIEM app', () => { before(() => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/pagination/pagination.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/pagination/pagination.spec.ts index d8ad75322b889..71390778dcba8 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/pagination/pagination.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/pagination/pagination.spec.ts @@ -6,12 +6,12 @@ import { HOSTS_PAGE_TAB_URLS } from '../../../urls/navigation'; import { loginAndWaitForPage } from '../../../tasks/login'; -import { refreshPage } from '../../../tasks/header'; +import { refreshPage } from '../../../tasks/siem_header'; import { goToFirstPage, goToThirdPage } from '../../../tasks/pagination'; import { FIRST_PAGE_SELECTOR, THIRD_PAGE_SELECTOR } from '../../../screens/pagination'; -import { PROCESS_NAME_FIELD } from '../../../screens/uncommon_processes'; -import { waitForUncommonProcessesToBeLoaded } from '../../../tasks/uncommon_processes'; -import { waitForAuthenticationsToBeLoaded } from '../../../tasks/authentications'; +import { PROCESS_NAME_FIELD } from '../../../screens/hosts/uncommon_processes'; +import { waitForUncommonProcessesToBeLoaded } from '../../../tasks/hosts/uncommon_processes'; +import { waitForAuthenticationsToBeLoaded } from '../../../tasks/hosts/authentications'; import { openAuthentications, openUncommonProcesses } from '../../../tasks/hosts/main'; describe('Pagination', () => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/data_providers.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/data_providers.spec.ts index 7d1ee43b1b509..215c1fa935ef1 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/data_providers.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/data_providers.spec.ts @@ -13,13 +13,13 @@ import { } from '../../../tasks/hosts/all_hosts'; import { HOSTS_NAMES_DRAGGABLE } from '../../../screens/hosts/all_hosts'; import { DEFAULT_TIMEOUT, loginAndWaitForPage } from '../../../tasks/login'; -import { createNewTimeline } from '../../../tasks/timeline/main'; +import { createNewTimeline } from '../../../tasks/timeline'; import { openTimeline } from '../../../tasks/siem_main'; import { TIMELINE_DATA_PROVIDERS_EMPTY, TIMELINE_DATA_PROVIDERS, TIMELINE_DROPPED_DATA_PROVIDERS, -} from '../../../screens/timeline/main'; +} from '../../../screens/timeline'; describe('timeline data providers', () => { before(() => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/flyout_button.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/flyout_button.spec.ts index b7faaaac1c06c..6f1e6dcde446c 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/flyout_button.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/flyout_button.spec.ts @@ -8,11 +8,8 @@ import { HOSTS_PAGE } from '../../../urls/navigation'; import { waitForAllHostsToBeLoaded, dragFirstHostToTimeline } from '../../../tasks/hosts/all_hosts'; import { loginAndWaitForPage } from '../../../tasks/login'; import { openTimelineIfClosed, openTimeline } from '../../../tasks/siem_main'; -import { - TIMELINE_FLYOUT_BODY, - TIMELINE_NOT_READY_TO_DROP_BUTTON, -} from '../../../screens/timeline/main'; -import { createNewTimeline } from '../../../tasks/timeline/main'; +import { TIMELINE_FLYOUT_BODY, TIMELINE_NOT_READY_TO_DROP_BUTTON } from '../../../screens/timeline'; +import { createNewTimeline } from '../../../tasks/timeline'; describe('timeline flyout button', () => { before(() => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/search_or_filter.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/search_or_filter.spec.ts index 28cc4a6e8827d..50f38bb3d81d4 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/search_or_filter.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/search_or_filter.spec.ts @@ -4,11 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SERVER_SIDE_EVENT_COUNT } from '../../../screens/timeline/main'; +import { SERVER_SIDE_EVENT_COUNT } from '../../../screens/timeline'; import { HOSTS_PAGE } from '../../../urls/navigation'; import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../../../tasks/login'; import { openTimeline } from '../../../tasks/siem_main'; -import { executeTimelineKQL } from '../../../tasks/timeline/main'; +import { executeTimelineKQL } from '../../../tasks/timeline'; describe('timeline search or filter KQL bar', () => { beforeEach(() => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/toggle_column.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/toggle_column.spec.ts index ccd6ae818c6cd..a18e99d597eda 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/toggle_column.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/toggle_column.spec.ts @@ -13,14 +13,14 @@ import { uncheckTimestampToggleField, checkIdToggleField, dragAndDropIdToggleFieldToTimeline, -} from '../../../tasks/timeline/main'; +} from '../../../tasks/timeline'; import { openTimeline } from '../../../tasks/siem_main'; import { TIMESTAMP_TOGGLE_FIELD, ID_TOGGLE_FIELD, TIMESTAMP_HEADER_FIELD, ID_HEADER_FIELD, -} from '../../../screens/timeline/main'; +} from '../../../screens/timeline'; describe('toggle column in timeline', () => { before(() => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/url_state/url_state.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/url_state/url_state.spec.ts index 4345938c8867e..dbc1398ce1865 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/url_state/url_state.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/url_state/url_state.spec.ts @@ -14,7 +14,7 @@ import { setTimelineStartDate, setTimelineEndDate, updateTimelineDates, -} from '../../../tasks/calendar'; +} from '../../../tasks/date_picker'; import { waitForIpsTableToBeLoaded } from '../../../tasks/network/flows'; import { openTimeline } from '../../../tasks/siem_main'; import { @@ -22,15 +22,15 @@ import { DATE_PICKER_END_DATE_POPOVER_BUTTON_TIMELINE, DATE_PICKER_START_DATE_POPOVER_BUTTON, DATE_PICKER_END_DATE_POPOVER_BUTTON, -} from '../../../screens/calendar'; -import { kqlSearch, navigateFromHeaderTo, clearSearchBar } from '../../../tasks/header'; -import { HOSTS, NETWORK, KQL_INPUT, BREADCRUMBS } from '../../../screens/header'; +} from '../../../screens/date_picker'; +import { kqlSearch, navigateFromHeaderTo, clearSearchBar } from '../../../tasks/siem_header'; +import { HOSTS, NETWORK, KQL_INPUT, BREADCRUMBS } from '../../../screens/siem_header'; import { openAllHosts } from '../../../tasks/hosts/main'; import { ANOMALIES_TAB } from '../../../screens/hosts/main'; import { waitForAllHostsToBeLoaded, openFirstHostDetails } from '../../../tasks/hosts/all_hosts'; import { HOSTS_NAMES } from '../../../screens/hosts/all_hosts'; -import { executeTimelineKQL, addNameToTimeline } from '../../../tasks/timeline/main'; -import { SERVER_SIDE_EVENT_COUNT, TIMELINE_TITLE } from '../../../screens/timeline/main'; +import { executeTimelineKQL, addNameToTimeline } from '../../../tasks/timeline'; +import { SERVER_SIDE_EVENT_COUNT, TIMELINE_TITLE } from '../../../screens/timeline'; const ABSOLUTE_DATE = { endTime: '1564691609186', diff --git a/x-pack/legacy/plugins/siem/cypress/screens/calendar.ts b/x-pack/legacy/plugins/siem/cypress/screens/date_picker.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/calendar.ts rename to x-pack/legacy/plugins/siem/cypress/screens/date_picker.ts diff --git a/x-pack/legacy/plugins/siem/cypress/screens/timeline/fields_browser.ts b/x-pack/legacy/plugins/siem/cypress/screens/fields_browser.ts similarity index 95% rename from x-pack/legacy/plugins/siem/cypress/screens/timeline/fields_browser.ts rename to x-pack/legacy/plugins/siem/cypress/screens/fields_browser.ts index aa63aaf89f98b..fbf6afa6dae34 100644 --- a/x-pack/legacy/plugins/siem/cypress/screens/timeline/fields_browser.ts +++ b/x-pack/legacy/plugins/siem/cypress/screens/fields_browser.ts @@ -58,3 +58,7 @@ export const FIELDS_BROWSER_HOST_GEO_CONTINENT_NAME_CHECKBOX = export const FIELDS_BROWSER_RESET_FIELDS = '[data-test-subj="timeline"] [data-test-subj="reset-fields"]'; + +export const FIELDS_BROWSER_CHECKBOX = (id: string) => { + return `[data-test-subj="field-${id}-checkbox`; +}; diff --git a/x-pack/legacy/plugins/siem/cypress/screens/authentications.ts b/x-pack/legacy/plugins/siem/cypress/screens/hosts/authentications.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/authentications.ts rename to x-pack/legacy/plugins/siem/cypress/screens/hosts/authentications.ts diff --git a/x-pack/legacy/plugins/siem/cypress/screens/hosts/fields_browser.ts b/x-pack/legacy/plugins/siem/cypress/screens/hosts/fields_browser.ts deleted file mode 100644 index 252fa7d44a7c7..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/screens/hosts/fields_browser.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -/** Clicking this button in the timeline opens the Fields browser */ - -/** The title displayed in the fields browser (i.e. Customize Columns) */ -export const FIELDS_BROWSER_TITLE = '[data-test-subj="field-browser-title"]'; - -/** Contains the body of the fields browser */ -export const FIELDS_BROWSER_CONTAINER = '[data-test-subj="fields-browser-container"]'; - -/** The title of the selected category in the right-hand side of the fields browser */ -export const FIELDS_BROWSER_SELECTED_CATEGORY_TITLE = '[data-test-subj="selected-category-title"]'; - -export const FIELDS_BROWSER_CHECKBOX = (id: string) => { - return `[data-test-subj="field-${id}-checkbox`; -}; diff --git a/x-pack/legacy/plugins/siem/cypress/screens/hosts/uncommon_processes.ts b/x-pack/legacy/plugins/siem/cypress/screens/hosts/uncommon_processes.ts index 9e15bea79eae0..71abaa21bf6bd 100644 --- a/x-pack/legacy/plugins/siem/cypress/screens/hosts/uncommon_processes.ts +++ b/x-pack/legacy/plugins/siem/cypress/screens/hosts/uncommon_processes.ts @@ -4,4 +4,5 @@ * you may not use this file except in compliance with the Elastic License. */ -export const PROCESS_NAME = '[data-test-subj="draggable-content-process.name"]'; +export const PROCESS_NAME_FIELD = '[data-test-subj="draggable-content-process.name"]'; +export const UNCOMMON_PROCESSES_TABLE = '[data-test-subj="table-uncommonProcesses-loading-false"]'; diff --git a/x-pack/legacy/plugins/siem/cypress/screens/header.ts b/x-pack/legacy/plugins/siem/cypress/screens/siem_header.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/header.ts rename to x-pack/legacy/plugins/siem/cypress/screens/siem_header.ts diff --git a/x-pack/legacy/plugins/siem/cypress/screens/timeline/main.ts b/x-pack/legacy/plugins/siem/cypress/screens/timeline.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/timeline/main.ts rename to x-pack/legacy/plugins/siem/cypress/screens/timeline.ts diff --git a/x-pack/legacy/plugins/siem/cypress/screens/uncommon_processes.ts b/x-pack/legacy/plugins/siem/cypress/screens/uncommon_processes.ts deleted file mode 100644 index 71abaa21bf6bd..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/screens/uncommon_processes.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -export const PROCESS_NAME_FIELD = '[data-test-subj="draggable-content-process.name"]'; -export const UNCOMMON_PROCESSES_TABLE = '[data-test-subj="table-uncommonProcesses-loading-false"]'; diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/calendar.ts b/x-pack/legacy/plugins/siem/cypress/tasks/date_picker.ts similarity index 98% rename from x-pack/legacy/plugins/siem/cypress/tasks/calendar.ts rename to x-pack/legacy/plugins/siem/cypress/tasks/date_picker.ts index 16231317d6aef..713fbca1b5470 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/calendar.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/date_picker.ts @@ -13,7 +13,7 @@ import { DATE_PICKER_ABSOLUTE_INPUT, DATE_PICKER_APPLY_BUTTON, DATE_PICKER_END_DATE_POPOVER_BUTTON, -} from '../screens/calendar'; +} from '../screens/date_picker'; import { DEFAULT_TIMEOUT } from '../tasks/login'; diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/timeline/fields_browser.ts b/x-pack/legacy/plugins/siem/cypress/tasks/fields_browser.ts similarity index 89% rename from x-pack/legacy/plugins/siem/cypress/tasks/timeline/fields_browser.ts rename to x-pack/legacy/plugins/siem/cypress/tasks/fields_browser.ts index 64abc5a3e14ea..a874ba30fd125 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/timeline/fields_browser.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/fields_browser.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { drag, drop } from '../../tasks/common'; +import { drag, drop } from '../tasks/common'; import { FIELDS_BROWSER_FILTER_INPUT, @@ -13,9 +13,9 @@ import { FIELDS_BROWSER_HEADER_DROP_AREA, FIELDS_BROWSER_HOST_GEO_CONTINENT_NAME_CHECKBOX, FIELDS_BROWSER_RESET_FIELDS, -} from '../../screens/timeline/fields_browser'; -import { DEFAULT_TIMEOUT } from '../../tasks/login'; -import { KQL_SEARCH_BAR } from '../../screens/hosts/main'; +} from '../screens/fields_browser'; +import { DEFAULT_TIMEOUT } from '../tasks/login'; +import { KQL_SEARCH_BAR } from '../screens/hosts/main'; export const clearFieldsBrowser = () => { cy.get(FIELDS_BROWSER_FILTER_INPUT).type('{selectall}{backspace}'); diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/all_hosts.ts b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/all_hosts.ts index 7146c132db4a0..e0f7cd6654314 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/all_hosts.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/all_hosts.ts @@ -5,10 +5,7 @@ */ import { ALL_HOSTS_TABLE, HOSTS_NAMES_DRAGGABLE, HOSTS_NAMES } from '../../screens/hosts/all_hosts'; -import { - TIMELINE_DATA_PROVIDERS, - TIMELINE_DATA_PROVIDERS_EMPTY, -} from '../../screens/timeline/main'; +import { TIMELINE_DATA_PROVIDERS, TIMELINE_DATA_PROVIDERS_EMPTY } from '../../screens/timeline'; import { DEFAULT_TIMEOUT } from '../../tasks/login'; import { drag, drop, dragWithoutDrop } from '../../tasks/common'; diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/authentications.ts b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/authentications.ts similarity index 74% rename from x-pack/legacy/plugins/siem/cypress/tasks/authentications.ts rename to x-pack/legacy/plugins/siem/cypress/tasks/hosts/authentications.ts index 6fa4bf72ca2b2..12c8aecf29ad6 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/authentications.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/authentications.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATIONS_TABLE } from '../screens/authentications'; -import { DEFAULT_TIMEOUT } from '../tasks/login'; +import { AUTHENTICATIONS_TABLE } from '../../screens/hosts/authentications'; +import { DEFAULT_TIMEOUT } from '../../tasks/login'; export const waitForAuthenticationsToBeLoaded = () => { cy.get(AUTHENTICATIONS_TABLE, { timeout: DEFAULT_TIMEOUT }).should('exist'); diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/fields_browsers.ts b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/fields_browsers.ts deleted file mode 100644 index 44d9e64638bda..0000000000000 --- a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/fields_browsers.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { DEFAULT_TIMEOUT } from '../../tasks/login'; -import { KQL_SEARCH_BAR } from '../../screens/hosts/main'; - -export const closeFieldsBrowser = () => { - cy.get(KQL_SEARCH_BAR, { timeout: DEFAULT_TIMEOUT }).click(); -}; diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/uncommon_processes.ts b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/uncommon_processes.ts similarity index 73% rename from x-pack/legacy/plugins/siem/cypress/tasks/uncommon_processes.ts rename to x-pack/legacy/plugins/siem/cypress/tasks/hosts/uncommon_processes.ts index 007a20c770ca0..16eff186d66b5 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/uncommon_processes.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/uncommon_processes.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { UNCOMMON_PROCESSES_TABLE } from '../screens/uncommon_processes'; -import { DEFAULT_TIMEOUT } from '../tasks/login'; +import { UNCOMMON_PROCESSES_TABLE } from '../../screens/hosts/uncommon_processes'; +import { DEFAULT_TIMEOUT } from '../../tasks/login'; export const waitForUncommonProcessesToBeLoaded = () => { cy.get(UNCOMMON_PROCESSES_TABLE, { timeout: DEFAULT_TIMEOUT }).should('exist'); diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/header.ts b/x-pack/legacy/plugins/siem/cypress/tasks/siem_header.ts similarity index 92% rename from x-pack/legacy/plugins/siem/cypress/tasks/header.ts rename to x-pack/legacy/plugins/siem/cypress/tasks/siem_header.ts index 4067779136d9e..fb0bb2b171f8d 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/header.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/siem_header.ts @@ -5,7 +5,7 @@ */ import { DEFAULT_TIMEOUT } from '../tasks/login'; -import { KQL_INPUT, REFRESH_BUTTON } from '../screens/header'; +import { KQL_INPUT, REFRESH_BUTTON } from '../screens/siem_header'; export const navigateFromHeaderTo = (page: string) => { cy.get(page).click({ force: true }); diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/timeline/main.ts b/x-pack/legacy/plugins/siem/cypress/tasks/timeline.ts similarity index 94% rename from x-pack/legacy/plugins/siem/cypress/tasks/timeline/main.ts rename to x-pack/legacy/plugins/siem/cypress/tasks/timeline.ts index fd863871ea2f0..7dc919879f81d 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/timeline/main.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/timeline.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { DEFAULT_TIMEOUT } from '../../tasks/login'; +import { DEFAULT_TIMEOUT } from '../tasks/login'; import { SEARCH_OR_FILTER_CONTAINER, @@ -20,9 +20,9 @@ import { ID_HEADER_FIELD, ID_FIELD, TIMELINE_TITLE, -} from '../../screens/timeline/main'; +} from '../screens/timeline'; -import { drag, drop } from '../../tasks/common'; +import { drag, drop } from '../tasks/common'; export const hostExistsQuery = 'host.name: *'; From c7f582418490768bd5d7363865f58881e96f42ba Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Thu, 20 Feb 2020 13:20:13 +0100 Subject: [PATCH 12/17] reorders 'integration' folder --- .../events_viewer => }/events_viewer.spec.ts | 16 +++++----- .../fields_browser.spec.ts | 12 ++++---- .../{smoke_tests/inspect => }/inspect.spec.ts | 12 ++++---- .../ml_conditional_links.spec.ts | 6 ++-- .../navigation => }/navigation.spec.ts | 8 ++--- .../overview => }/overview.spec.ts | 8 ++--- .../pagination => }/pagination.spec.ts | 18 +++++------ ...pec.ts => timeline_data_providers.spec.ts} | 14 ++++----- ...spec.ts => timeline_flyout_button.spec.ts} | 12 ++++---- ...c.ts => timeline_search_or_filter.spec.ts} | 10 +++---- ...spec.ts => timeline_toggle_column.spec.ts} | 10 +++---- .../url_state => }/url_state.spec.ts | 30 +++++++++---------- 12 files changed, 78 insertions(+), 78 deletions(-) rename x-pack/legacy/plugins/siem/cypress/integration/{smoke_tests/events_viewer => }/events_viewer.spec.ts (90%) rename x-pack/legacy/plugins/siem/cypress/integration/{smoke_tests/fields_browser => }/fields_browser.spec.ts (95%) rename x-pack/legacy/plugins/siem/cypress/integration/{smoke_tests/inspect => }/inspect.spec.ts (82%) rename x-pack/legacy/plugins/siem/cypress/integration/{smoke_tests/ml_conditional_links => }/ml_conditional_links.spec.ts (98%) rename x-pack/legacy/plugins/siem/cypress/integration/{smoke_tests/navigation => }/navigation.spec.ts (77%) rename x-pack/legacy/plugins/siem/cypress/integration/{smoke_tests/overview => }/overview.spec.ts (75%) rename x-pack/legacy/plugins/siem/cypress/integration/{smoke_tests/pagination => }/pagination.spec.ts (78%) rename x-pack/legacy/plugins/siem/cypress/integration/{smoke_tests/timeline/data_providers.spec.ts => timeline_data_providers.spec.ts} (84%) rename x-pack/legacy/plugins/siem/cypress/integration/{smoke_tests/timeline/flyout_button.spec.ts => timeline_flyout_button.spec.ts} (77%) rename x-pack/legacy/plugins/siem/cypress/integration/{smoke_tests/timeline/search_or_filter.spec.ts => timeline_search_or_filter.spec.ts} (66%) rename x-pack/legacy/plugins/siem/cypress/integration/{smoke_tests/timeline/toggle_column.spec.ts => timeline_toggle_column.spec.ts} (87%) rename x-pack/legacy/plugins/siem/cypress/integration/{smoke_tests/url_state => }/url_state.spec.ts (90%) diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/events_viewer/events_viewer.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/events_viewer.spec.ts similarity index 90% rename from x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/events_viewer/events_viewer.spec.ts rename to x-pack/legacy/plugins/siem/cypress/integration/events_viewer.spec.ts index 558a8853f31aa..d011210cceaa0 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/events_viewer/events_viewer.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/events_viewer.spec.ts @@ -4,16 +4,16 @@ * you may not use this file except in compliance with the Elastic License. */ -import { filterFieldsBrowser, closeFieldsBrowser } from '../../../tasks/fields_browser'; +import { filterFieldsBrowser, closeFieldsBrowser } from '../tasks/fields_browser'; import { FIELDS_BROWSER_CONTAINER, FIELDS_BROWSER_SELECTED_CATEGORY_TITLE, FIELDS_BROWSER_TITLE, FIELDS_BROWSER_CHECKBOX, -} from '../../../screens/fields_browser'; -import { HOSTS_PAGE } from '../../../urls/navigation'; -import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../../../tasks/login'; -import { openEvents } from '../../../tasks/hosts/main'; +} from '../screens/fields_browser'; +import { HOSTS_PAGE } from '../urls/navigation'; +import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../tasks/login'; +import { openEvents } from '../tasks/hosts/main'; import { closeModal, opensInspectQueryModal, @@ -22,7 +22,7 @@ import { addsHostGeoCountryNameToHeader, resetFields, openEventsViewerFieldsBrowser, -} from '../../../tasks/hosts/events'; +} from '../tasks/hosts/events'; import { HEADER_SUBTITLE, INSPECT_MODAL, @@ -30,8 +30,8 @@ import { LOCAL_EVENTS_COUNT, HOST_GEO_CITY_NAME_HEADER, HOST_GEO_COUNTRY_NAME_HEADER, -} from '../../../screens/hosts/events'; -import { clearSearchBar, kqlSearch } from '../../../tasks/siem_header'; +} from '../screens/hosts/events'; +import { clearSearchBar, kqlSearch } from '../tasks/siem_header'; const defaultHeadersInDefaultEcsCategory = [ { id: '@timestamp' }, diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/fields_browser/fields_browser.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/fields_browser.spec.ts similarity index 95% rename from x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/fields_browser/fields_browser.spec.ts rename to x-pack/legacy/plugins/siem/cypress/integration/fields_browser.spec.ts index b83a693f1851f..3c22093536ba0 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/fields_browser/fields_browser.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/fields_browser.spec.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HOSTS_PAGE } from '../../../urls/navigation'; +import { HOSTS_PAGE } from '../urls/navigation'; -import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../../../tasks/login'; +import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../tasks/login'; import { FIELDS_BROWSER_TITLE, @@ -20,11 +20,11 @@ import { FIELDS_BROWSER_HOST_GEO_CITY_NAME_HEADER, FIELDS_BROWSER_HOST_GEO_COUNTRY_NAME_HEADER, FIELDS_BROWSER_HEADER_HOST_GEO_CONTINENT_NAME_HEADER, -} from '../../../screens/fields_browser'; +} from '../screens/fields_browser'; -import { populateTimeline, openTimelineFieldsBrowser } from '../../../tasks/timeline'; +import { populateTimeline, openTimelineFieldsBrowser } from '../tasks/timeline'; -import { openTimeline } from '../../../tasks/siem_main'; +import { openTimeline } from '../tasks/siem_main'; import { clearFieldsBrowser, @@ -35,7 +35,7 @@ import { addsHostGeoCountryNameToTimelineDraggingIt, addsHostGeoContinentNameToTimeline, resetFields, -} from '../../../tasks/fields_browser'; +} from '../tasks/fields_browser'; const defaultHeaders = [ { id: '@timestamp' }, diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/inspect/inspect.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/inspect.spec.ts similarity index 82% rename from x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/inspect/inspect.spec.ts rename to x-pack/legacy/plugins/siem/cypress/integration/inspect.spec.ts index 174bd915f8234..89849082e19dd 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/inspect/inspect.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/inspect.spec.ts @@ -4,20 +4,20 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HOSTS_PAGE, NETWORK_PAGE } from '../../../urls/navigation'; +import { HOSTS_PAGE, NETWORK_PAGE } from '../urls/navigation'; import { INSPECT_MODAL, INSPECT_NETWORK_BUTTONS_IN_SIEM, INSPECT_HOSTS_BUTTONS_IN_SIEM, -} from '../../../screens/inspect'; +} from '../screens/inspect'; import { executeTimelineKQL, openTimelineSettings, openTimelineInspectButton, -} from '../../../tasks/timeline'; -import { openTimeline } from '../../../tasks/siem_main'; -import { DEFAULT_TIMEOUT, loginAndWaitForPage } from '../../../tasks/login'; -import { closesModal, openStatsAndTables } from '../../../tasks/inspect'; +} from '../tasks/timeline'; +import { openTimeline } from '../tasks/siem_main'; +import { DEFAULT_TIMEOUT, loginAndWaitForPage } from '../tasks/login'; +import { closesModal, openStatsAndTables } from '../tasks/inspect'; describe('Inspect', () => { context('Hosts stats and tables', () => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/ml_conditional_links/ml_conditional_links.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/ml_conditional_links.spec.ts similarity index 98% rename from x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/ml_conditional_links/ml_conditional_links.spec.ts rename to x-pack/legacy/plugins/siem/cypress/integration/ml_conditional_links.spec.ts index 7d36d97c4f70f..e389412d0d142 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/ml_conditional_links/ml_conditional_links.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/ml_conditional_links.spec.ts @@ -18,9 +18,9 @@ import { mlHostMultiHostKqlQuery, mlHostVariableHostNullKqlQuery, mlHostVariableHostKqlQuery, -} from '../../../urls/ml_conditional_links'; -import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../../../tasks/login'; -import { KQL_INPUT } from '../../../screens/siem_header'; +} from '../urls/ml_conditional_links'; +import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../tasks/login'; +import { KQL_INPUT } from '../screens/siem_header'; describe('ml conditional links', () => { it('sets the KQL from a single IP with a value for the query', () => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/navigation/navigation.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/navigation.spec.ts similarity index 77% rename from x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/navigation/navigation.spec.ts rename to x-pack/legacy/plugins/siem/cypress/integration/navigation.spec.ts index 493df7fe623f4..cb83f31d03c35 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/navigation/navigation.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/navigation.spec.ts @@ -4,10 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { TIMELINES_PAGE } from '../../../urls/navigation'; -import { HOSTS, NETWORK, OVERVIEW, TIMELINES } from '../../../screens/siem_header'; -import { loginAndWaitForPage } from '../../../tasks/login'; -import { navigateFromHeaderTo } from '../../../tasks/siem_header'; +import { TIMELINES_PAGE } from '../urls/navigation'; +import { HOSTS, NETWORK, OVERVIEW, TIMELINES } from '../screens/siem_header'; +import { loginAndWaitForPage } from '../tasks/login'; +import { navigateFromHeaderTo } from '../tasks/siem_header'; describe('top-level navigation common to all pages in the SIEM app', () => { before(() => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/overview/overview.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/overview.spec.ts similarity index 75% rename from x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/overview/overview.spec.ts rename to x-pack/legacy/plugins/siem/cypress/integration/overview.spec.ts index 8ddc0eac3d067..6951c736e68ea 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/overview/overview.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/overview.spec.ts @@ -4,10 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { OVERVIEW_PAGE } from '../../../urls/navigation'; -import { HOST_STATS, NETWORK_STATS } from '../../../screens/overview'; -import { expandHostStats, expandNetworkStats } from '../../../tasks/overview'; -import { loginAndWaitForPage } from '../../../tasks/login'; +import { OVERVIEW_PAGE } from '../urls/navigation'; +import { HOST_STATS, NETWORK_STATS } from '../screens/overview'; +import { expandHostStats, expandNetworkStats } from '../tasks/overview'; +import { loginAndWaitForPage } from '../tasks/login'; describe('Overview Page', () => { before(() => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/pagination/pagination.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/pagination.spec.ts similarity index 78% rename from x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/pagination/pagination.spec.ts rename to x-pack/legacy/plugins/siem/cypress/integration/pagination.spec.ts index 71390778dcba8..191b7903490ea 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/pagination/pagination.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/pagination.spec.ts @@ -4,15 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HOSTS_PAGE_TAB_URLS } from '../../../urls/navigation'; -import { loginAndWaitForPage } from '../../../tasks/login'; -import { refreshPage } from '../../../tasks/siem_header'; -import { goToFirstPage, goToThirdPage } from '../../../tasks/pagination'; -import { FIRST_PAGE_SELECTOR, THIRD_PAGE_SELECTOR } from '../../../screens/pagination'; -import { PROCESS_NAME_FIELD } from '../../../screens/hosts/uncommon_processes'; -import { waitForUncommonProcessesToBeLoaded } from '../../../tasks/hosts/uncommon_processes'; -import { waitForAuthenticationsToBeLoaded } from '../../../tasks/hosts/authentications'; -import { openAuthentications, openUncommonProcesses } from '../../../tasks/hosts/main'; +import { HOSTS_PAGE_TAB_URLS } from '../urls/navigation'; +import { loginAndWaitForPage } from '../tasks/login'; +import { refreshPage } from '../tasks/siem_header'; +import { goToFirstPage, goToThirdPage } from '../tasks/pagination'; +import { FIRST_PAGE_SELECTOR, THIRD_PAGE_SELECTOR } from '../screens/pagination'; +import { PROCESS_NAME_FIELD } from '../screens/hosts/uncommon_processes'; +import { waitForUncommonProcessesToBeLoaded } from '../tasks/hosts/uncommon_processes'; +import { waitForAuthenticationsToBeLoaded } from '../tasks/hosts/authentications'; +import { openAuthentications, openUncommonProcesses } from '../tasks/hosts/main'; describe('Pagination', () => { before(() => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/data_providers.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/timeline_data_providers.spec.ts similarity index 84% rename from x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/data_providers.spec.ts rename to x-pack/legacy/plugins/siem/cypress/integration/timeline_data_providers.spec.ts index 215c1fa935ef1..8a0e94a152ce5 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/data_providers.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/timeline_data_providers.spec.ts @@ -4,22 +4,22 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HOSTS_PAGE } from '../../../urls/navigation'; +import { HOSTS_PAGE } from '../urls/navigation'; import { waitForAllHostsToBeLoaded, dragAndDropFirstHostToTimeline, dragFirstHostToTimeline, dragFirstHostToEmptyTimelineDataProviders, -} from '../../../tasks/hosts/all_hosts'; -import { HOSTS_NAMES_DRAGGABLE } from '../../../screens/hosts/all_hosts'; -import { DEFAULT_TIMEOUT, loginAndWaitForPage } from '../../../tasks/login'; -import { createNewTimeline } from '../../../tasks/timeline'; -import { openTimeline } from '../../../tasks/siem_main'; +} from '../tasks/hosts/all_hosts'; +import { HOSTS_NAMES_DRAGGABLE } from '../screens/hosts/all_hosts'; +import { DEFAULT_TIMEOUT, loginAndWaitForPage } from '../tasks/login'; +import { createNewTimeline } from '../tasks/timeline'; +import { openTimeline } from '../tasks/siem_main'; import { TIMELINE_DATA_PROVIDERS_EMPTY, TIMELINE_DATA_PROVIDERS, TIMELINE_DROPPED_DATA_PROVIDERS, -} from '../../../screens/timeline'; +} from '../screens/timeline'; describe('timeline data providers', () => { before(() => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/flyout_button.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/timeline_flyout_button.spec.ts similarity index 77% rename from x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/flyout_button.spec.ts rename to x-pack/legacy/plugins/siem/cypress/integration/timeline_flyout_button.spec.ts index 6f1e6dcde446c..72376ffd92f23 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/flyout_button.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/timeline_flyout_button.spec.ts @@ -4,12 +4,12 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HOSTS_PAGE } from '../../../urls/navigation'; -import { waitForAllHostsToBeLoaded, dragFirstHostToTimeline } from '../../../tasks/hosts/all_hosts'; -import { loginAndWaitForPage } from '../../../tasks/login'; -import { openTimelineIfClosed, openTimeline } from '../../../tasks/siem_main'; -import { TIMELINE_FLYOUT_BODY, TIMELINE_NOT_READY_TO_DROP_BUTTON } from '../../../screens/timeline'; -import { createNewTimeline } from '../../../tasks/timeline'; +import { HOSTS_PAGE } from '../urls/navigation'; +import { waitForAllHostsToBeLoaded, dragFirstHostToTimeline } from '../tasks/hosts/all_hosts'; +import { loginAndWaitForPage } from '../tasks/login'; +import { openTimelineIfClosed, openTimeline } from '../tasks/siem_main'; +import { TIMELINE_FLYOUT_BODY, TIMELINE_NOT_READY_TO_DROP_BUTTON } from '../screens/timeline'; +import { createNewTimeline } from '../tasks/timeline'; describe('timeline flyout button', () => { before(() => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/search_or_filter.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/timeline_search_or_filter.spec.ts similarity index 66% rename from x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/search_or_filter.spec.ts rename to x-pack/legacy/plugins/siem/cypress/integration/timeline_search_or_filter.spec.ts index 50f38bb3d81d4..1d0bc7eb1cad2 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/search_or_filter.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/timeline_search_or_filter.spec.ts @@ -4,11 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SERVER_SIDE_EVENT_COUNT } from '../../../screens/timeline'; -import { HOSTS_PAGE } from '../../../urls/navigation'; -import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../../../tasks/login'; -import { openTimeline } from '../../../tasks/siem_main'; -import { executeTimelineKQL } from '../../../tasks/timeline'; +import { SERVER_SIDE_EVENT_COUNT } from '../screens/timeline'; +import { HOSTS_PAGE } from '../urls/navigation'; +import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../tasks/login'; +import { openTimeline } from '../tasks/siem_main'; +import { executeTimelineKQL } from '../tasks/timeline'; describe('timeline search or filter KQL bar', () => { beforeEach(() => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/toggle_column.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/timeline_toggle_column.spec.ts similarity index 87% rename from x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/toggle_column.spec.ts rename to x-pack/legacy/plugins/siem/cypress/integration/timeline_toggle_column.spec.ts index a18e99d597eda..455bbf4bbad8e 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/timeline/toggle_column.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/timeline_toggle_column.spec.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HOSTS_PAGE } from '../../../urls/navigation'; -import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../../../tasks/login'; +import { HOSTS_PAGE } from '../urls/navigation'; +import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../tasks/login'; import { createNewTimeline, populateTimeline, @@ -13,14 +13,14 @@ import { uncheckTimestampToggleField, checkIdToggleField, dragAndDropIdToggleFieldToTimeline, -} from '../../../tasks/timeline'; -import { openTimeline } from '../../../tasks/siem_main'; +} from '../tasks/timeline'; +import { openTimeline } from '../tasks/siem_main'; import { TIMESTAMP_TOGGLE_FIELD, ID_TOGGLE_FIELD, TIMESTAMP_HEADER_FIELD, ID_HEADER_FIELD, -} from '../../../screens/timeline'; +} from '../screens/timeline'; describe('toggle column in timeline', () => { before(() => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/url_state/url_state.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/url_state.spec.ts similarity index 90% rename from x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/url_state/url_state.spec.ts rename to x-pack/legacy/plugins/siem/cypress/integration/url_state.spec.ts index dbc1398ce1865..74f8b26ccc65d 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/smoke_tests/url_state/url_state.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/url_state.spec.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ABSOLUTE_DATE_RANGE } from '../../../urls/state'; -import { DEFAULT_TIMEOUT, loginAndWaitForPage } from '../../../tasks/login'; -import { HOSTS_PAGE } from '../../../urls/navigation'; +import { ABSOLUTE_DATE_RANGE } from '../urls/state'; +import { DEFAULT_TIMEOUT, loginAndWaitForPage } from '../tasks/login'; +import { HOSTS_PAGE } from '../urls/navigation'; import { setStartDate, setEndDate, @@ -14,23 +14,23 @@ import { setTimelineStartDate, setTimelineEndDate, updateTimelineDates, -} from '../../../tasks/date_picker'; -import { waitForIpsTableToBeLoaded } from '../../../tasks/network/flows'; -import { openTimeline } from '../../../tasks/siem_main'; +} from '../tasks/date_picker'; +import { waitForIpsTableToBeLoaded } from '../tasks/network/flows'; +import { openTimeline } from '../tasks/siem_main'; import { DATE_PICKER_START_DATE_POPOVER_BUTTON_TIMELINE, DATE_PICKER_END_DATE_POPOVER_BUTTON_TIMELINE, DATE_PICKER_START_DATE_POPOVER_BUTTON, DATE_PICKER_END_DATE_POPOVER_BUTTON, -} from '../../../screens/date_picker'; -import { kqlSearch, navigateFromHeaderTo, clearSearchBar } from '../../../tasks/siem_header'; -import { HOSTS, NETWORK, KQL_INPUT, BREADCRUMBS } from '../../../screens/siem_header'; -import { openAllHosts } from '../../../tasks/hosts/main'; -import { ANOMALIES_TAB } from '../../../screens/hosts/main'; -import { waitForAllHostsToBeLoaded, openFirstHostDetails } from '../../../tasks/hosts/all_hosts'; -import { HOSTS_NAMES } from '../../../screens/hosts/all_hosts'; -import { executeTimelineKQL, addNameToTimeline } from '../../../tasks/timeline'; -import { SERVER_SIDE_EVENT_COUNT, TIMELINE_TITLE } from '../../../screens/timeline'; +} from '../screens/date_picker'; +import { kqlSearch, navigateFromHeaderTo, clearSearchBar } from '../tasks/siem_header'; +import { HOSTS, NETWORK, KQL_INPUT, BREADCRUMBS } from '../screens/siem_header'; +import { openAllHosts } from '../tasks/hosts/main'; +import { ANOMALIES_TAB } from '../screens/hosts/main'; +import { waitForAllHostsToBeLoaded, openFirstHostDetails } from '../tasks/hosts/all_hosts'; +import { HOSTS_NAMES } from '../screens/hosts/all_hosts'; +import { executeTimelineKQL, addNameToTimeline } from '../tasks/timeline'; +import { SERVER_SIDE_EVENT_COUNT, TIMELINE_TITLE } from '../screens/timeline'; const ABSOLUTE_DATE = { endTime: '1564691609186', From fdcfea247d2ab8301cb126fb25b7eefe12573acc Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Thu, 20 Feb 2020 13:53:08 +0100 Subject: [PATCH 13/17] orders integration files --- .../cypress/integration/events_viewer.spec.ts | 32 +++++++++-------- .../integration/fields_browser.spec.ts | 33 ++++++++--------- .../siem/cypress/integration/inspect.spec.ts | 14 ++++---- .../integration/ml_conditional_links.spec.ts | 28 ++++++++------- .../cypress/integration/navigation.spec.ts | 5 +-- .../siem/cypress/integration/overview.spec.ts | 4 ++- .../cypress/integration/pagination.spec.ts | 14 ++++---- .../timeline_data_providers.spec.ts | 25 +++++++------ .../timeline_flyout_button.spec.ts | 10 +++--- .../timeline_search_or_filter.spec.ts | 4 ++- .../timeline_toggle_column.spec.ts | 24 +++++++------ .../cypress/integration/url_state.spec.ts | 35 ++++++++++--------- 12 files changed, 124 insertions(+), 104 deletions(-) diff --git a/x-pack/legacy/plugins/siem/cypress/integration/events_viewer.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/events_viewer.spec.ts index d011210cceaa0..f4b4ea478a731 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/events_viewer.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/events_viewer.spec.ts @@ -4,35 +4,37 @@ * you may not use this file except in compliance with the Elastic License. */ -import { filterFieldsBrowser, closeFieldsBrowser } from '../tasks/fields_browser'; import { + FIELDS_BROWSER_CHECKBOX, FIELDS_BROWSER_CONTAINER, FIELDS_BROWSER_SELECTED_CATEGORY_TITLE, FIELDS_BROWSER_TITLE, - FIELDS_BROWSER_CHECKBOX, } from '../screens/fields_browser'; -import { HOSTS_PAGE } from '../urls/navigation'; +import { + HEADER_SUBTITLE, + HOST_GEO_CITY_NAME_HEADER, + HOST_GEO_COUNTRY_NAME_HEADER, + INSPECT_MODAL, + LOAD_MORE, + LOCAL_EVENTS_COUNT, +} from '../screens/hosts/events'; + +import { closeFieldsBrowser, filterFieldsBrowser } from '../tasks/fields_browser'; import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../tasks/login'; import { openEvents } from '../tasks/hosts/main'; import { - closeModal, - opensInspectQueryModal, - waitsForEventsToBeLoaded, addsHostGeoCityNameToHeader, addsHostGeoCountryNameToHeader, - resetFields, + closeModal, openEventsViewerFieldsBrowser, + opensInspectQueryModal, + resetFields, + waitsForEventsToBeLoaded, } from '../tasks/hosts/events'; -import { - HEADER_SUBTITLE, - INSPECT_MODAL, - LOAD_MORE, - LOCAL_EVENTS_COUNT, - HOST_GEO_CITY_NAME_HEADER, - HOST_GEO_COUNTRY_NAME_HEADER, -} from '../screens/hosts/events'; import { clearSearchBar, kqlSearch } from '../tasks/siem_header'; +import { HOSTS_PAGE } from '../urls/navigation'; + const defaultHeadersInDefaultEcsCategory = [ { id: '@timestamp' }, { id: 'message' }, diff --git a/x-pack/legacy/plugins/siem/cypress/integration/fields_browser.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/fields_browser.spec.ts index 3c22093536ba0..b4ed67150517a 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/fields_browser.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/fields_browser.spec.ts @@ -4,38 +4,35 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HOSTS_PAGE } from '../urls/navigation'; - -import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../tasks/login'; - import { - FIELDS_BROWSER_TITLE, - FIELDS_BROWSER_SELECTED_CATEGORY_TITLE, - FIELDS_BROWSER_SELECTED_CATEGORY_COUNT, FIELDS_BROWSER_CATEGORIES_COUNT, - FIELDS_BROWSER_HOST_CATEGORIES_COUNT, - FIELDS_BROWSER_SYSTEM_CATEGORIES_COUNT, FIELDS_BROWSER_FIELDS_COUNT, - FIELDS_BROWSER_MESSAGE_HEADER, + FIELDS_BROWSER_HOST_CATEGORIES_COUNT, FIELDS_BROWSER_HOST_GEO_CITY_NAME_HEADER, FIELDS_BROWSER_HOST_GEO_COUNTRY_NAME_HEADER, FIELDS_BROWSER_HEADER_HOST_GEO_CONTINENT_NAME_HEADER, + FIELDS_BROWSER_MESSAGE_HEADER, + FIELDS_BROWSER_SELECTED_CATEGORY_TITLE, + FIELDS_BROWSER_SELECTED_CATEGORY_COUNT, + FIELDS_BROWSER_SYSTEM_CATEGORIES_COUNT, + FIELDS_BROWSER_TITLE, } from '../screens/fields_browser'; -import { populateTimeline, openTimelineFieldsBrowser } from '../tasks/timeline'; - -import { openTimeline } from '../tasks/siem_main'; - import { + addsHostGeoCityNameToTimeline, + addsHostGeoContinentNameToTimeline, + addsHostGeoCountryNameToTimelineDraggingIt, clearFieldsBrowser, - filterFieldsBrowser, closeFieldsBrowser, + filterFieldsBrowser, removesMessageField, - addsHostGeoCityNameToTimeline, - addsHostGeoCountryNameToTimelineDraggingIt, - addsHostGeoContinentNameToTimeline, resetFields, } from '../tasks/fields_browser'; +import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../tasks/login'; +import { openTimeline } from '../tasks/siem_main'; +import { openTimelineFieldsBrowser, populateTimeline } from '../tasks/timeline'; + +import { HOSTS_PAGE } from '../urls/navigation'; const defaultHeaders = [ { id: '@timestamp' }, diff --git a/x-pack/legacy/plugins/siem/cypress/integration/inspect.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/inspect.spec.ts index 89849082e19dd..449c02ec9730d 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/inspect.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/inspect.spec.ts @@ -4,20 +4,22 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HOSTS_PAGE, NETWORK_PAGE } from '../urls/navigation'; import { + INSPECT_HOSTS_BUTTONS_IN_SIEM, INSPECT_MODAL, INSPECT_NETWORK_BUTTONS_IN_SIEM, - INSPECT_HOSTS_BUTTONS_IN_SIEM, } from '../screens/inspect'; + +import { closesModal, openStatsAndTables } from '../tasks/inspect'; +import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../tasks/login'; +import { openTimeline } from '../tasks/siem_main'; import { executeTimelineKQL, - openTimelineSettings, openTimelineInspectButton, + openTimelineSettings, } from '../tasks/timeline'; -import { openTimeline } from '../tasks/siem_main'; -import { DEFAULT_TIMEOUT, loginAndWaitForPage } from '../tasks/login'; -import { closesModal, openStatsAndTables } from '../tasks/inspect'; + +import { HOSTS_PAGE, NETWORK_PAGE } from '../urls/navigation'; describe('Inspect', () => { context('Hosts stats and tables', () => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/ml_conditional_links.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/ml_conditional_links.spec.ts index e389412d0d142..6984adf7b4500 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/ml_conditional_links.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/ml_conditional_links.spec.ts @@ -4,23 +4,25 @@ * you may not use this file except in compliance with the Elastic License. */ +import { KQL_INPUT } from '../screens/siem_header'; + +import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../tasks/login'; + import { - mlNetworkSingleIpNullKqlQuery, - mlNetworkSingleIpKqlQuery, - mlNetworkMultipleIpNullKqlQuery, - mlNetworkMultipleIpKqlQuery, - mlNetworkNullKqlQuery, - mlNetworkKqlQuery, - mlHostSingleHostNullKqlQuery, - mlHostSingleHostKqlQueryVariable, - mlHostSingleHostKqlQuery, - mlHostMultiHostNullKqlQuery, mlHostMultiHostKqlQuery, - mlHostVariableHostNullKqlQuery, + mlHostMultiHostNullKqlQuery, + mlHostSingleHostKqlQuery, + mlHostSingleHostKqlQueryVariable, + mlHostSingleHostNullKqlQuery, mlHostVariableHostKqlQuery, + mlHostVariableHostNullKqlQuery, + mlNetworkKqlQuery, + mlNetworkMultipleIpKqlQuery, + mlNetworkMultipleIpNullKqlQuery, + mlNetworkNullKqlQuery, + mlNetworkSingleIpKqlQuery, + mlNetworkSingleIpNullKqlQuery, } from '../urls/ml_conditional_links'; -import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../tasks/login'; -import { KQL_INPUT } from '../screens/siem_header'; describe('ml conditional links', () => { it('sets the KQL from a single IP with a value for the query', () => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/navigation.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/navigation.spec.ts index cb83f31d03c35..2c5a0e5eeea8a 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/navigation.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/navigation.spec.ts @@ -3,12 +3,13 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ - -import { TIMELINES_PAGE } from '../urls/navigation'; import { HOSTS, NETWORK, OVERVIEW, TIMELINES } from '../screens/siem_header'; + import { loginAndWaitForPage } from '../tasks/login'; import { navigateFromHeaderTo } from '../tasks/siem_header'; +import { TIMELINES_PAGE } from '../urls/navigation'; + describe('top-level navigation common to all pages in the SIEM app', () => { before(() => { loginAndWaitForPage(TIMELINES_PAGE); diff --git a/x-pack/legacy/plugins/siem/cypress/integration/overview.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/overview.spec.ts index 6951c736e68ea..cadb4beca0f9e 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/overview.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/overview.spec.ts @@ -4,11 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -import { OVERVIEW_PAGE } from '../urls/navigation'; import { HOST_STATS, NETWORK_STATS } from '../screens/overview'; + import { expandHostStats, expandNetworkStats } from '../tasks/overview'; import { loginAndWaitForPage } from '../tasks/login'; +import { OVERVIEW_PAGE } from '../urls/navigation'; + describe('Overview Page', () => { before(() => { cy.stubSIEMapi('overview'); diff --git a/x-pack/legacy/plugins/siem/cypress/integration/pagination.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/pagination.spec.ts index 191b7903490ea..482c97fe29c3b 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/pagination.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/pagination.spec.ts @@ -4,15 +4,17 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HOSTS_PAGE_TAB_URLS } from '../urls/navigation'; -import { loginAndWaitForPage } from '../tasks/login'; -import { refreshPage } from '../tasks/siem_header'; -import { goToFirstPage, goToThirdPage } from '../tasks/pagination'; -import { FIRST_PAGE_SELECTOR, THIRD_PAGE_SELECTOR } from '../screens/pagination'; import { PROCESS_NAME_FIELD } from '../screens/hosts/uncommon_processes'; -import { waitForUncommonProcessesToBeLoaded } from '../tasks/hosts/uncommon_processes'; +import { FIRST_PAGE_SELECTOR, THIRD_PAGE_SELECTOR } from '../screens/pagination'; + import { waitForAuthenticationsToBeLoaded } from '../tasks/hosts/authentications'; import { openAuthentications, openUncommonProcesses } from '../tasks/hosts/main'; +import { waitForUncommonProcessesToBeLoaded } from '../tasks/hosts/uncommon_processes'; +import { loginAndWaitForPage } from '../tasks/login'; +import { goToFirstPage, goToThirdPage } from '../tasks/pagination'; +import { refreshPage } from '../tasks/siem_header'; + +import { HOSTS_PAGE_TAB_URLS } from '../urls/navigation'; describe('Pagination', () => { before(() => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/timeline_data_providers.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/timeline_data_providers.spec.ts index 8a0e94a152ce5..db0cdeaa1e100 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/timeline_data_providers.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/timeline_data_providers.spec.ts @@ -4,22 +4,25 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HOSTS_PAGE } from '../urls/navigation'; import { - waitForAllHostsToBeLoaded, + TIMELINE_DATA_PROVIDERS, + TIMELINE_DATA_PROVIDERS_EMPTY, + TIMELINE_DROPPED_DATA_PROVIDERS, +} from '../screens/timeline'; +import { HOSTS_NAMES_DRAGGABLE } from '../screens/hosts/all_hosts'; + +import { dragAndDropFirstHostToTimeline, - dragFirstHostToTimeline, dragFirstHostToEmptyTimelineDataProviders, + dragFirstHostToTimeline, + waitForAllHostsToBeLoaded, } from '../tasks/hosts/all_hosts'; -import { HOSTS_NAMES_DRAGGABLE } from '../screens/hosts/all_hosts'; -import { DEFAULT_TIMEOUT, loginAndWaitForPage } from '../tasks/login'; -import { createNewTimeline } from '../tasks/timeline'; + +import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../tasks/login'; import { openTimeline } from '../tasks/siem_main'; -import { - TIMELINE_DATA_PROVIDERS_EMPTY, - TIMELINE_DATA_PROVIDERS, - TIMELINE_DROPPED_DATA_PROVIDERS, -} from '../screens/timeline'; +import { createNewTimeline } from '../tasks/timeline'; + +import { HOSTS_PAGE } from '../urls/navigation'; describe('timeline data providers', () => { before(() => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/timeline_flyout_button.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/timeline_flyout_button.spec.ts index 72376ffd92f23..1a94a4abbe5bf 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/timeline_flyout_button.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/timeline_flyout_button.spec.ts @@ -4,13 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HOSTS_PAGE } from '../urls/navigation'; -import { waitForAllHostsToBeLoaded, dragFirstHostToTimeline } from '../tasks/hosts/all_hosts'; -import { loginAndWaitForPage } from '../tasks/login'; -import { openTimelineIfClosed, openTimeline } from '../tasks/siem_main'; import { TIMELINE_FLYOUT_BODY, TIMELINE_NOT_READY_TO_DROP_BUTTON } from '../screens/timeline'; + +import { dragFirstHostToTimeline, waitForAllHostsToBeLoaded } from '../tasks/hosts/all_hosts'; +import { loginAndWaitForPage } from '../tasks/login'; +import { openTimeline, openTimelineIfClosed } from '../tasks/siem_main'; import { createNewTimeline } from '../tasks/timeline'; +import { HOSTS_PAGE } from '../urls/navigation'; + describe('timeline flyout button', () => { before(() => { loginAndWaitForPage(HOSTS_PAGE); diff --git a/x-pack/legacy/plugins/siem/cypress/integration/timeline_search_or_filter.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/timeline_search_or_filter.spec.ts index 1d0bc7eb1cad2..fecefd26c692c 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/timeline_search_or_filter.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/timeline_search_or_filter.spec.ts @@ -5,11 +5,13 @@ */ import { SERVER_SIDE_EVENT_COUNT } from '../screens/timeline'; -import { HOSTS_PAGE } from '../urls/navigation'; + import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../tasks/login'; import { openTimeline } from '../tasks/siem_main'; import { executeTimelineKQL } from '../tasks/timeline'; +import { HOSTS_PAGE } from '../urls/navigation'; + describe('timeline search or filter KQL bar', () => { beforeEach(() => { loginAndWaitForPage(HOSTS_PAGE); diff --git a/x-pack/legacy/plugins/siem/cypress/integration/timeline_toggle_column.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/timeline_toggle_column.spec.ts index 455bbf4bbad8e..a59784fbaa75e 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/timeline_toggle_column.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/timeline_toggle_column.spec.ts @@ -4,23 +4,25 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HOSTS_PAGE } from '../urls/navigation'; +import { + ID_HEADER_FIELD, + ID_TOGGLE_FIELD, + TIMESTAMP_HEADER_FIELD, + TIMESTAMP_TOGGLE_FIELD, +} from '../screens/timeline'; + import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../tasks/login'; +import { openTimeline } from '../tasks/siem_main'; import { + checkIdToggleField, createNewTimeline, - populateTimeline, + dragAndDropIdToggleFieldToTimeline, expandFirstTimelineEventDetails, + populateTimeline, uncheckTimestampToggleField, - checkIdToggleField, - dragAndDropIdToggleFieldToTimeline, } from '../tasks/timeline'; -import { openTimeline } from '../tasks/siem_main'; -import { - TIMESTAMP_TOGGLE_FIELD, - ID_TOGGLE_FIELD, - TIMESTAMP_HEADER_FIELD, - ID_HEADER_FIELD, -} from '../screens/timeline'; + +import { HOSTS_PAGE } from '../urls/navigation'; describe('toggle column in timeline', () => { before(() => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/url_state.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/url_state.spec.ts index 74f8b26ccc65d..11e12bf9fc2be 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/url_state.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/url_state.spec.ts @@ -4,9 +4,18 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ABSOLUTE_DATE_RANGE } from '../urls/state'; +import { + DATE_PICKER_END_DATE_POPOVER_BUTTON, + DATE_PICKER_END_DATE_POPOVER_BUTTON_TIMELINE, + DATE_PICKER_START_DATE_POPOVER_BUTTON, + DATE_PICKER_START_DATE_POPOVER_BUTTON_TIMELINE, +} from '../screens/date_picker'; +import { HOSTS_NAMES } from '../screens/hosts/all_hosts'; +import { ANOMALIES_TAB } from '../screens/hosts/main'; +import { BREADCRUMBS, HOSTS, KQL_INPUT, NETWORK } from '../screens/siem_header'; +import { SERVER_SIDE_EVENT_COUNT, TIMELINE_TITLE } from '../screens/timeline'; + import { DEFAULT_TIMEOUT, loginAndWaitForPage } from '../tasks/login'; -import { HOSTS_PAGE } from '../urls/navigation'; import { setStartDate, setEndDate, @@ -15,22 +24,16 @@ import { setTimelineEndDate, updateTimelineDates, } from '../tasks/date_picker'; +import { openFirstHostDetails, waitForAllHostsToBeLoaded } from '../tasks/hosts/all_hosts'; +import { openAllHosts } from '../tasks/hosts/main'; + import { waitForIpsTableToBeLoaded } from '../tasks/network/flows'; +import { clearSearchBar, kqlSearch, navigateFromHeaderTo } from '../tasks/siem_header'; import { openTimeline } from '../tasks/siem_main'; -import { - DATE_PICKER_START_DATE_POPOVER_BUTTON_TIMELINE, - DATE_PICKER_END_DATE_POPOVER_BUTTON_TIMELINE, - DATE_PICKER_START_DATE_POPOVER_BUTTON, - DATE_PICKER_END_DATE_POPOVER_BUTTON, -} from '../screens/date_picker'; -import { kqlSearch, navigateFromHeaderTo, clearSearchBar } from '../tasks/siem_header'; -import { HOSTS, NETWORK, KQL_INPUT, BREADCRUMBS } from '../screens/siem_header'; -import { openAllHosts } from '../tasks/hosts/main'; -import { ANOMALIES_TAB } from '../screens/hosts/main'; -import { waitForAllHostsToBeLoaded, openFirstHostDetails } from '../tasks/hosts/all_hosts'; -import { HOSTS_NAMES } from '../screens/hosts/all_hosts'; -import { executeTimelineKQL, addNameToTimeline } from '../tasks/timeline'; -import { SERVER_SIDE_EVENT_COUNT, TIMELINE_TITLE } from '../screens/timeline'; +import { addNameToTimeline, executeTimelineKQL } from '../tasks/timeline'; + +import { HOSTS_PAGE } from '../urls/navigation'; +import { ABSOLUTE_DATE_RANGE } from '../urls/state'; const ABSOLUTE_DATE = { endTime: '1564691609186', From 8bb611cae99e4588d56115d044f64bf11ca0a851 Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Thu, 20 Feb 2020 15:08:33 +0100 Subject: [PATCH 14/17] extracts defeault timeout to cypress configuration --- x-pack/legacy/plugins/siem/cypress.json | 1 + .../cypress/integration/events_viewer.spec.ts | 6 ++--- .../integration/fields_browser.spec.ts | 14 ++++------- .../siem/cypress/integration/inspect.spec.ts | 8 +++---- .../integration/ml_conditional_links.spec.ts | 18 +++++++------- .../timeline_data_providers.spec.ts | 4 ++-- .../timeline_search_or_filter.spec.ts | 4 ++-- .../timeline_toggle_column.spec.ts | 6 ++--- .../cypress/integration/url_state.spec.ts | 24 +++++-------------- .../plugins/siem/cypress/tasks/date_picker.ts | 20 ++++++---------- .../siem/cypress/tasks/fields_browser.ts | 5 ++-- .../siem/cypress/tasks/hosts/all_hosts.ts | 3 +-- .../cypress/tasks/hosts/authentications.ts | 3 +-- .../siem/cypress/tasks/hosts/events.ts | 13 +++++----- .../plugins/siem/cypress/tasks/hosts/main.ts | 14 ++++------- .../cypress/tasks/hosts/uncommon_processes.ts | 3 +-- .../plugins/siem/cypress/tasks/inspect.ts | 12 ++++------ .../plugins/siem/cypress/tasks/login.ts | 5 +--- .../siem/cypress/tasks/network/flows.ts | 3 +-- .../plugins/siem/cypress/tasks/siem_header.ts | 7 +++--- .../plugins/siem/cypress/tasks/siem_main.ts | 3 +-- .../plugins/siem/cypress/tasks/timeline.ts | 14 ++++------- 22 files changed, 71 insertions(+), 119 deletions(-) diff --git a/x-pack/legacy/plugins/siem/cypress.json b/x-pack/legacy/plugins/siem/cypress.json index ae73965f8f10f..d2397e1ec90dd 100644 --- a/x-pack/legacy/plugins/siem/cypress.json +++ b/x-pack/legacy/plugins/siem/cypress.json @@ -1,5 +1,6 @@ { "baseUrl": "http://localhost:5601", + "defaultCommandTimeout": 30000, "screenshotsFolder": "../../../../target/kibana-siem/cypress/screenshots", "trashAssetsBeforeRuns": false, "video": false, diff --git a/x-pack/legacy/plugins/siem/cypress/integration/events_viewer.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/events_viewer.spec.ts index f4b4ea478a731..e44c8f4459ba9 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/events_viewer.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/events_viewer.spec.ts @@ -20,7 +20,7 @@ import { } from '../screens/hosts/events'; import { closeFieldsBrowser, filterFieldsBrowser } from '../tasks/fields_browser'; -import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../tasks/login'; +import { loginAndWaitForPage } from '../tasks/login'; import { openEvents } from '../tasks/hosts/main'; import { addsHostGeoCityNameToHeader, @@ -88,13 +88,13 @@ describe('Events Viewer', () => { after(() => { closeModal(); - cy.get(INSPECT_MODAL, { timeout: DEFAULT_TIMEOUT }).should('not.exist'); + cy.get(INSPECT_MODAL).should('not.exist'); }); it('launches the inspect query modal when the inspect button is clicked', () => { waitsForEventsToBeLoaded(); opensInspectQueryModal(); - cy.get(INSPECT_MODAL, { timeout: DEFAULT_TIMEOUT }).should('exist'); + cy.get(INSPECT_MODAL).should('exist'); }); }); diff --git a/x-pack/legacy/plugins/siem/cypress/integration/fields_browser.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/fields_browser.spec.ts index b4ed67150517a..095fc30356fd4 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/fields_browser.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/fields_browser.spec.ts @@ -28,7 +28,7 @@ import { removesMessageField, resetFields, } from '../tasks/fields_browser'; -import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../tasks/login'; +import { loginAndWaitForPage } from '../tasks/login'; import { openTimeline } from '../tasks/siem_main'; import { openTimelineFieldsBrowser, populateTimeline } from '../tasks/timeline'; @@ -87,7 +87,7 @@ describe('Fields Browser', () => { filterFieldsBrowser(filterInput); - cy.get(FIELDS_BROWSER_CATEGORIES_COUNT, { timeout: DEFAULT_TIMEOUT }) + cy.get(FIELDS_BROWSER_CATEGORIES_COUNT) .invoke('text') .should('eq', '2 categories'); }); @@ -103,7 +103,7 @@ describe('Fields Browser', () => { cy.get(FIELDS_BROWSER_SYSTEM_CATEGORIES_COUNT) .invoke('text') .then(systemCategoriesCount => { - cy.get(FIELDS_BROWSER_FIELDS_COUNT, { timeout: DEFAULT_TIMEOUT }) + cy.get(FIELDS_BROWSER_FIELDS_COUNT) .invoke('text') .should('eq', `${+hostCategoriesCount + +systemCategoriesCount} fields`); }); @@ -160,9 +160,7 @@ describe('Fields Browser', () => { addsHostGeoCityNameToTimeline(); closeFieldsBrowser(); - cy.get(FIELDS_BROWSER_HOST_GEO_CITY_NAME_HEADER, { - timeout: DEFAULT_TIMEOUT, - }).should('exist'); + cy.get(FIELDS_BROWSER_HOST_GEO_CITY_NAME_HEADER).should('exist'); }); it('adds a field to the timeline when the user drags and drops a field', () => { @@ -174,9 +172,7 @@ describe('Fields Browser', () => { addsHostGeoCountryNameToTimelineDraggingIt(); - cy.get(FIELDS_BROWSER_HOST_GEO_COUNTRY_NAME_HEADER, { - timeout: DEFAULT_TIMEOUT, - }).should('exist'); + cy.get(FIELDS_BROWSER_HOST_GEO_COUNTRY_NAME_HEADER).should('exist'); }); it('resets all fields in the timeline when `Reset Fields` is clicked', () => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/inspect.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/inspect.spec.ts index 449c02ec9730d..b6b4e7a72b8f6 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/inspect.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/inspect.spec.ts @@ -11,7 +11,7 @@ import { } from '../screens/inspect'; import { closesModal, openStatsAndTables } from '../tasks/inspect'; -import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../tasks/login'; +import { loginAndWaitForPage } from '../tasks/login'; import { openTimeline } from '../tasks/siem_main'; import { executeTimelineKQL, @@ -33,7 +33,7 @@ describe('Inspect', () => { INSPECT_HOSTS_BUTTONS_IN_SIEM.forEach(table => it(`inspects the ${table.title}`, () => { openStatsAndTables(table); - cy.get(INSPECT_MODAL, { timeout: DEFAULT_TIMEOUT }).should('be.visible'); + cy.get(INSPECT_MODAL).should('be.visible'); }) ); }); @@ -49,7 +49,7 @@ describe('Inspect', () => { INSPECT_NETWORK_BUTTONS_IN_SIEM.forEach(table => it(`inspects the ${table.title}`, () => { openStatsAndTables(table); - cy.get(INSPECT_MODAL, { timeout: DEFAULT_TIMEOUT }).should('be.visible'); + cy.get(INSPECT_MODAL).should('be.visible'); }) ); }); @@ -62,7 +62,7 @@ describe('Inspect', () => { executeTimelineKQL(hostExistsQuery); openTimelineSettings(); openTimelineInspectButton(); - cy.get(INSPECT_MODAL, { timeout: DEFAULT_TIMEOUT }).should('be.visible'); + cy.get(INSPECT_MODAL).should('be.visible'); }); }); }); diff --git a/x-pack/legacy/plugins/siem/cypress/integration/ml_conditional_links.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/ml_conditional_links.spec.ts index 6984adf7b4500..b02ed1a5e4c94 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/ml_conditional_links.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/ml_conditional_links.spec.ts @@ -6,7 +6,7 @@ import { KQL_INPUT } from '../screens/siem_header'; -import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../tasks/login'; +import { loginAndWaitForPage } from '../tasks/login'; import { mlHostMultiHostKqlQuery, @@ -27,7 +27,7 @@ import { describe('ml conditional links', () => { it('sets the KQL from a single IP with a value for the query', () => { loginAndWaitForPage(mlNetworkSingleIpKqlQuery); - cy.get(KQL_INPUT, { timeout: DEFAULT_TIMEOUT }).should( + cy.get(KQL_INPUT).should( 'have.attr', 'value', '(process.name: "conhost.exe" or process.name: "sc.exe")' @@ -36,7 +36,7 @@ describe('ml conditional links', () => { it('sets the KQL from a multiple IPs with a null for the query', () => { loginAndWaitForPage(mlNetworkMultipleIpNullKqlQuery); - cy.get(KQL_INPUT, { timeout: DEFAULT_TIMEOUT }).should( + cy.get(KQL_INPUT).should( 'have.attr', 'value', '((source.ip: "127.0.0.1" or destination.ip: "127.0.0.1") or (source.ip: "127.0.0.2" or destination.ip: "127.0.0.2"))' @@ -45,7 +45,7 @@ describe('ml conditional links', () => { it('sets the KQL from a multiple IPs with a value for the query', () => { loginAndWaitForPage(mlNetworkMultipleIpKqlQuery); - cy.get(KQL_INPUT, { timeout: DEFAULT_TIMEOUT }).should( + cy.get(KQL_INPUT).should( 'have.attr', 'value', '((source.ip: "127.0.0.1" or destination.ip: "127.0.0.1") or (source.ip: "127.0.0.2" or destination.ip: "127.0.0.2")) and ((process.name: "conhost.exe" or process.name: "sc.exe"))' @@ -54,7 +54,7 @@ describe('ml conditional links', () => { it('sets the KQL from a $ip$ with a value for the query', () => { loginAndWaitForPage(mlNetworkKqlQuery); - cy.get(KQL_INPUT, { timeout: DEFAULT_TIMEOUT }).should( + cy.get(KQL_INPUT).should( 'have.attr', 'value', '(process.name: "conhost.exe" or process.name: "sc.exe")' @@ -63,7 +63,7 @@ describe('ml conditional links', () => { it('sets the KQL from a single host name with a value for query', () => { loginAndWaitForPage(mlHostSingleHostKqlQuery); - cy.get(KQL_INPUT, { timeout: DEFAULT_TIMEOUT }).should( + cy.get(KQL_INPUT).should( 'have.attr', 'value', '(process.name: "conhost.exe" or process.name: "sc.exe")' @@ -72,7 +72,7 @@ describe('ml conditional links', () => { it('sets the KQL from a multiple host names with null for query', () => { loginAndWaitForPage(mlHostMultiHostNullKqlQuery); - cy.get(KQL_INPUT, { timeout: DEFAULT_TIMEOUT }).should( + cy.get(KQL_INPUT).should( 'have.attr', 'value', '(host.name: "siem-windows" or host.name: "siem-suricata")' @@ -81,7 +81,7 @@ describe('ml conditional links', () => { it('sets the KQL from a multiple host names with a value for query', () => { loginAndWaitForPage(mlHostMultiHostKqlQuery); - cy.get(KQL_INPUT, { timeout: DEFAULT_TIMEOUT }).should( + cy.get(KQL_INPUT).should( 'have.attr', 'value', '(host.name: "siem-windows" or host.name: "siem-suricata") and ((process.name: "conhost.exe" or process.name: "sc.exe"))' @@ -90,7 +90,7 @@ describe('ml conditional links', () => { it('sets the KQL from a undefined/null host name but with a value for query', () => { loginAndWaitForPage(mlHostVariableHostKqlQuery); - cy.get(KQL_INPUT, { timeout: DEFAULT_TIMEOUT }).should( + cy.get(KQL_INPUT).should( 'have.attr', 'value', '(process.name: "conhost.exe" or process.name: "sc.exe")' diff --git a/x-pack/legacy/plugins/siem/cypress/integration/timeline_data_providers.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/timeline_data_providers.spec.ts index db0cdeaa1e100..4889d40ae7d39 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/timeline_data_providers.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/timeline_data_providers.spec.ts @@ -18,7 +18,7 @@ import { waitForAllHostsToBeLoaded, } from '../tasks/hosts/all_hosts'; -import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../tasks/login'; +import { loginAndWaitForPage } from '../tasks/login'; import { openTimeline } from '../tasks/siem_main'; import { createNewTimeline } from '../tasks/timeline'; @@ -41,7 +41,7 @@ describe('timeline data providers', () => { it('renders the data provider of a host dragged from the All Hosts widget on the hosts page', () => { dragAndDropFirstHostToTimeline(); - cy.get(TIMELINE_DROPPED_DATA_PROVIDERS, { timeout: DEFAULT_TIMEOUT }) + cy.get(TIMELINE_DROPPED_DATA_PROVIDERS) .first() .invoke('text') .then(dataProviderText => { diff --git a/x-pack/legacy/plugins/siem/cypress/integration/timeline_search_or_filter.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/timeline_search_or_filter.spec.ts index fecefd26c692c..c06fd69a558a4 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/timeline_search_or_filter.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/timeline_search_or_filter.spec.ts @@ -6,7 +6,7 @@ import { SERVER_SIDE_EVENT_COUNT } from '../screens/timeline'; -import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../tasks/login'; +import { loginAndWaitForPage } from '../tasks/login'; import { openTimeline } from '../tasks/siem_main'; import { executeTimelineKQL } from '../tasks/timeline'; @@ -22,7 +22,7 @@ describe('timeline search or filter KQL bar', () => { openTimeline(); executeTimelineKQL(hostExistsQuery); - cy.get(SERVER_SIDE_EVENT_COUNT, { timeout: DEFAULT_TIMEOUT }) + cy.get(SERVER_SIDE_EVENT_COUNT) .invoke('text') .should('be.above', 0); }); diff --git a/x-pack/legacy/plugins/siem/cypress/integration/timeline_toggle_column.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/timeline_toggle_column.spec.ts index a59784fbaa75e..7b2c6f3b55b2e 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/timeline_toggle_column.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/timeline_toggle_column.spec.ts @@ -11,7 +11,7 @@ import { TIMESTAMP_TOGGLE_FIELD, } from '../screens/timeline'; -import { loginAndWaitForPage, DEFAULT_TIMEOUT } from '../tasks/login'; +import { loginAndWaitForPage } from '../tasks/login'; import { openTimeline } from '../tasks/siem_main'; import { checkIdToggleField, @@ -65,8 +65,6 @@ describe('toggle column in timeline', () => { expandFirstTimelineEventDetails(); dragAndDropIdToggleFieldToTimeline(); - cy.get(ID_HEADER_FIELD, { - timeout: DEFAULT_TIMEOUT, - }).should('exist'); + cy.get(ID_HEADER_FIELD).should('exist'); }); }); diff --git a/x-pack/legacy/plugins/siem/cypress/integration/url_state.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/url_state.spec.ts index 11e12bf9fc2be..cabdb98fa5b67 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/url_state.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/url_state.spec.ts @@ -15,7 +15,7 @@ import { ANOMALIES_TAB } from '../screens/hosts/main'; import { BREADCRUMBS, HOSTS, KQL_INPUT, NETWORK } from '../screens/siem_header'; import { SERVER_SIDE_EVENT_COUNT, TIMELINE_TITLE } from '../screens/timeline'; -import { DEFAULT_TIMEOUT, loginAndWaitForPage } from '../tasks/login'; +import { loginAndWaitForPage } from '../tasks/login'; import { setStartDate, setEndDate, @@ -149,20 +149,12 @@ describe('url state', () => { it('sets kql on network page', () => { loginAndWaitForPage(ABSOLUTE_DATE_RANGE.urlKqlNetworkNetwork); - cy.get(KQL_INPUT, { timeout: DEFAULT_TIMEOUT }).should( - 'have.attr', - 'value', - 'source.ip: "10.142.0.9"' - ); + cy.get(KQL_INPUT).should('have.attr', 'value', 'source.ip: "10.142.0.9"'); }); it('sets kql on hosts page', () => { loginAndWaitForPage(ABSOLUTE_DATE_RANGE.urlKqlHostsHosts); - cy.get(KQL_INPUT, { timeout: DEFAULT_TIMEOUT }).should( - 'have.attr', - 'value', - 'source.ip: "10.142.0.9"' - ); + cy.get(KQL_INPUT).should('have.attr', 'value', 'source.ip: "10.142.0.9"'); }); it('sets the url state when kql is set', () => { @@ -200,7 +192,7 @@ describe('url state', () => { 'href', "#/link-to/network?query=(language:kuery,query:'host.name:%20%22siem-kibana%22%20')&timerange=(global:(linkTo:!(timeline),timerange:(from:1564689809186,kind:absolute,to:1577914409186)),timeline:(linkTo:!(global),timerange:(from:1564689809186,kind:absolute,to:1577914409186)))" ); - cy.get(HOSTS_NAMES, { timeout: DEFAULT_TIMEOUT }) + cy.get(HOSTS_NAMES) .first() .invoke('text') .should('eq', 'siem-kibana'); @@ -234,11 +226,7 @@ describe('url state', () => { loginAndWaitForPage(ABSOLUTE_DATE_RANGE.urlKqlHostsHosts); navigateFromHeaderTo(NETWORK); - cy.get(KQL_INPUT, { timeout: DEFAULT_TIMEOUT }).should( - 'have.attr', - 'value', - 'source.ip: "10.142.0.9"' - ); + cy.get(KQL_INPUT).should('have.attr', 'value', 'source.ip: "10.142.0.9"'); }); it('sets and reads the url state for timeline by id', () => { @@ -246,7 +234,7 @@ describe('url state', () => { openTimeline(); executeTimelineKQL('host.name: *'); - cy.get(SERVER_SIDE_EVENT_COUNT, { timeout: DEFAULT_TIMEOUT }) + cy.get(SERVER_SIDE_EVENT_COUNT) .invoke('text') .should('be.above', 0); diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/date_picker.ts b/x-pack/legacy/plugins/siem/cypress/tasks/date_picker.ts index 713fbca1b5470..fd410d698adf9 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/date_picker.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/date_picker.ts @@ -15,8 +15,6 @@ import { DATE_PICKER_END_DATE_POPOVER_BUTTON, } from '../screens/date_picker'; -import { DEFAULT_TIMEOUT } from '../tasks/login'; - export const setStartDate = (date: string) => { cy.get(DATE_PICKER_START_DATE_POPOVER_BUTTON).click({ force: true }); @@ -24,7 +22,7 @@ export const setStartDate = (date: string) => { .first() .click({ force: true }); - cy.get(DATE_PICKER_ABSOLUTE_INPUT, { timeout: DEFAULT_TIMEOUT }) + cy.get(DATE_PICKER_ABSOLUTE_INPUT) .clear() .type(date); }; @@ -36,20 +34,20 @@ export const setEndDate = (date: string) => { .first() .click({ force: true }); - cy.get(DATE_PICKER_ABSOLUTE_INPUT, { timeout: DEFAULT_TIMEOUT }) + cy.get(DATE_PICKER_ABSOLUTE_INPUT) .clear() .type(date); }; export const updateDates = () => { - cy.get(DATE_PICKER_APPLY_BUTTON, { timeout: DEFAULT_TIMEOUT }) + cy.get(DATE_PICKER_APPLY_BUTTON) .click({ force: true }) - .invoke('text', { timeout: DEFAULT_TIMEOUT }) + .invoke('text') .should('not.equal', 'Updating'); }; export const setTimelineStartDate = (date: string) => { - cy.get(DATE_PICKER_START_DATE_POPOVER_BUTTON_TIMELINE, { timeout: DEFAULT_TIMEOUT }).click({ + cy.get(DATE_PICKER_START_DATE_POPOVER_BUTTON_TIMELINE).click({ force: true, }); @@ -57,9 +55,7 @@ export const setTimelineStartDate = (date: string) => { .first() .click({ force: true }); - cy.get(DATE_PICKER_ABSOLUTE_INPUT, { timeout: DEFAULT_TIMEOUT }).type( - `{selectall}{backspace}${date}{enter}` - ); + cy.get(DATE_PICKER_ABSOLUTE_INPUT).type(`{selectall}{backspace}${date}{enter}`); }; export const setTimelineEndDate = (date: string) => { @@ -69,9 +65,7 @@ export const setTimelineEndDate = (date: string) => { .first() .click({ force: true }); - cy.get(DATE_PICKER_ABSOLUTE_INPUT, { timeout: DEFAULT_TIMEOUT }).type( - `{selectall}{backspace}${date}{enter}` - ); + cy.get(DATE_PICKER_ABSOLUTE_INPUT).type(`{selectall}{backspace}${date}{enter}`); }; export const updateTimelineDates = () => { diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/fields_browser.ts b/x-pack/legacy/plugins/siem/cypress/tasks/fields_browser.ts index a874ba30fd125..6896f51f3900b 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/fields_browser.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/fields_browser.ts @@ -14,7 +14,6 @@ import { FIELDS_BROWSER_HOST_GEO_CONTINENT_NAME_CHECKBOX, FIELDS_BROWSER_RESET_FIELDS, } from '../screens/fields_browser'; -import { DEFAULT_TIMEOUT } from '../tasks/login'; import { KQL_SEARCH_BAR } from '../screens/hosts/main'; export const clearFieldsBrowser = () => { @@ -22,13 +21,13 @@ export const clearFieldsBrowser = () => { }; export const filterFieldsBrowser = (fieldName: string) => { - cy.get(FIELDS_BROWSER_FILTER_INPUT, { timeout: DEFAULT_TIMEOUT }) + cy.get(FIELDS_BROWSER_FILTER_INPUT) .type(fieldName) .should('not.have.class', 'euiFieldSearch-isLoading'); }; export const closeFieldsBrowser = () => { - cy.get(KQL_SEARCH_BAR, { timeout: DEFAULT_TIMEOUT }).click({ force: true }); + cy.get(KQL_SEARCH_BAR).click({ force: true }); }; export const removesMessageField = () => { diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/all_hosts.ts b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/all_hosts.ts index e0f7cd6654314..90f7633666533 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/all_hosts.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/all_hosts.ts @@ -6,11 +6,10 @@ import { ALL_HOSTS_TABLE, HOSTS_NAMES_DRAGGABLE, HOSTS_NAMES } from '../../screens/hosts/all_hosts'; import { TIMELINE_DATA_PROVIDERS, TIMELINE_DATA_PROVIDERS_EMPTY } from '../../screens/timeline'; -import { DEFAULT_TIMEOUT } from '../../tasks/login'; import { drag, drop, dragWithoutDrop } from '../../tasks/common'; export const waitForAllHostsToBeLoaded = () => { - cy.get(ALL_HOSTS_TABLE, { timeout: DEFAULT_TIMEOUT }).should('exist'); + cy.get(ALL_HOSTS_TABLE).should('exist'); }; export const dragAndDropFirstHostToTimeline = () => { diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/authentications.ts b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/authentications.ts index 12c8aecf29ad6..f5f15150e8ac3 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/authentications.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/authentications.ts @@ -5,8 +5,7 @@ */ import { AUTHENTICATIONS_TABLE } from '../../screens/hosts/authentications'; -import { DEFAULT_TIMEOUT } from '../../tasks/login'; export const waitForAuthenticationsToBeLoaded = () => { - cy.get(AUTHENTICATIONS_TABLE, { timeout: DEFAULT_TIMEOUT }).should('exist'); + cy.get(AUTHENTICATIONS_TABLE).should('exist'); }; diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/events.ts b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/events.ts index 1a027bdb43e3a..f21dc22e3482c 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/events.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/events.ts @@ -4,7 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -import { DEFAULT_TIMEOUT } from '../../tasks/login'; import { EVENTS_VIEWER_FIELDS_BUTTON, CLOSE_MODAL, @@ -18,20 +17,20 @@ import { } from '../../screens/hosts/events'; export const closeModal = () => { - cy.get(CLOSE_MODAL, { timeout: DEFAULT_TIMEOUT }).click(); + cy.get(CLOSE_MODAL).click(); }; export const opensInspectQueryModal = () => { - cy.get(INSPECT_QUERY, { timeout: DEFAULT_TIMEOUT }) + cy.get(INSPECT_QUERY) .should('exist') .trigger('mousemove', { force: true }) .click({ force: true }); }; export const waitsForEventsToBeLoaded = () => { - cy.get(SERVER_SIDE_EVENT_COUNT, { timeout: DEFAULT_TIMEOUT }) + cy.get(SERVER_SIDE_EVENT_COUNT) .should('exist') - .invoke('text', { timeout: DEFAULT_TIMEOUT }) + .invoke('text') .should('not.equal', '0'); }; @@ -52,9 +51,9 @@ export const resetFields = () => { }; export const openEventsViewerFieldsBrowser = () => { - cy.get(EVENTS_VIEWER_FIELDS_BUTTON, { timeout: DEFAULT_TIMEOUT }).click({ force: true }); + cy.get(EVENTS_VIEWER_FIELDS_BUTTON).click({ force: true }); - cy.get(SERVER_SIDE_EVENT_COUNT, { timeout: DEFAULT_TIMEOUT }) + cy.get(SERVER_SIDE_EVENT_COUNT) .invoke('text') .should('not.equal', '0'); diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/main.ts b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/main.ts index c1026b656aaaf..4db6046e63690 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/main.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/main.ts @@ -4,8 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -import { DEFAULT_TIMEOUT } from '../../tasks/login'; - import { EVENTS_TAB, AUTHENTICATIONS_TAB, @@ -14,14 +12,10 @@ import { } from '../../screens/hosts/main'; /** Clicks the Events tab on the hosts page */ -export const openEvents = () => - cy.get(EVENTS_TAB, { timeout: DEFAULT_TIMEOUT }).click({ force: true }); +export const openEvents = () => cy.get(EVENTS_TAB).click({ force: true }); -export const openAuthentications = () => - cy.get(AUTHENTICATIONS_TAB, { timeout: DEFAULT_TIMEOUT }).click({ force: true }); +export const openAuthentications = () => cy.get(AUTHENTICATIONS_TAB).click({ force: true }); -export const openUncommonProcesses = () => - cy.get(UNCOMMON_PROCESSES_TAB, { timeout: DEFAULT_TIMEOUT }).click({ force: true }); +export const openUncommonProcesses = () => cy.get(UNCOMMON_PROCESSES_TAB).click({ force: true }); -export const openAllHosts = () => - cy.get(ALL_HOSTS_TAB, { timeout: DEFAULT_TIMEOUT }).click({ force: true }); +export const openAllHosts = () => cy.get(ALL_HOSTS_TAB).click({ force: true }); diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/uncommon_processes.ts b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/uncommon_processes.ts index 16eff186d66b5..c44249acdd964 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/uncommon_processes.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/uncommon_processes.ts @@ -5,8 +5,7 @@ */ import { UNCOMMON_PROCESSES_TABLE } from '../../screens/hosts/uncommon_processes'; -import { DEFAULT_TIMEOUT } from '../../tasks/login'; export const waitForUncommonProcessesToBeLoaded = () => { - cy.get(UNCOMMON_PROCESSES_TABLE, { timeout: DEFAULT_TIMEOUT }).should('exist'); + cy.get(UNCOMMON_PROCESSES_TABLE).should('exist'); }; diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/inspect.ts b/x-pack/legacy/plugins/siem/cypress/tasks/inspect.ts index 26b1c0f7e4e39..109cd9c477968 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/inspect.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/inspect.ts @@ -6,24 +6,20 @@ import { INSPECT_BUTTON_ICON, InspectButtonMetadata } from '../screens/inspect'; -import { DEFAULT_TIMEOUT } from '../tasks/login'; - export const closesModal = () => { - cy.get('[data-test-subj="modal-inspect-close"]', { timeout: DEFAULT_TIMEOUT }).click(); + cy.get('[data-test-subj="modal-inspect-close"]').click(); }; export const openStatsAndTables = (table: InspectButtonMetadata) => { if (table.tabId) { cy.get(table.tabId).click({ force: true }); } - cy.get(table.id, { timeout: DEFAULT_TIMEOUT }); + cy.get(table.id); if (table.altInspectId) { - cy.get(table.altInspectId, { timeout: DEFAULT_TIMEOUT }).trigger('click', { + cy.get(table.altInspectId).trigger('click', { force: true, }); } else { - cy.get(`${table.id} ${INSPECT_BUTTON_ICON}`, { - timeout: DEFAULT_TIMEOUT, - }).trigger('click', { force: true }); + cy.get(`${table.id} ${INSPECT_BUTTON_ICON}`).trigger('click', { force: true }); } }; diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/login.ts b/x-pack/legacy/plugins/siem/cypress/tasks/login.ts index 110d5424ea251..1b982d56d79a4 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/login.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/login.ts @@ -114,9 +114,6 @@ const loginViaConfig = () => { }); }; -/** The default time in ms to wait for a Cypress command to complete */ -export const DEFAULT_TIMEOUT = 30 * 1000; - /** * Authenticates with Kibana, visits the specified `url`, and waits for the * Kibana logo to be displayed before continuing @@ -128,5 +125,5 @@ export const loginAndWaitForPage = (url: string) => { cy.viewport('macbook-15'); - cy.contains('a', 'SIEM', { timeout: DEFAULT_TIMEOUT }); + cy.contains('a', 'SIEM'); }; diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/network/flows.ts b/x-pack/legacy/plugins/siem/cypress/tasks/network/flows.ts index c7b031aabc8cd..c7255f3925d9e 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/network/flows.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/network/flows.ts @@ -5,8 +5,7 @@ */ import { IPS_TABLE_LOADED } from '../../screens/network/flows'; -import { DEFAULT_TIMEOUT } from '../../tasks/login'; export const waitForIpsTableToBeLoaded = () => { - cy.get(IPS_TABLE_LOADED, { timeout: DEFAULT_TIMEOUT }).should('exist'); + cy.get(IPS_TABLE_LOADED).should('exist'); }; diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/siem_header.ts b/x-pack/legacy/plugins/siem/cypress/tasks/siem_header.ts index fb0bb2b171f8d..f178ef4c8280e 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/siem_header.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/siem_header.ts @@ -4,7 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -import { DEFAULT_TIMEOUT } from '../tasks/login'; import { KQL_INPUT, REFRESH_BUTTON } from '../screens/siem_header'; export const navigateFromHeaderTo = (page: string) => { @@ -12,7 +11,7 @@ export const navigateFromHeaderTo = (page: string) => { }; export const clearSearchBar = () => { - cy.get(KQL_INPUT, { timeout: DEFAULT_TIMEOUT }) + cy.get(KQL_INPUT) .clear() .type('{enter}'); }; @@ -20,10 +19,10 @@ export const clearSearchBar = () => { export const refreshPage = () => { cy.get(REFRESH_BUTTON) .click({ force: true }) - .invoke('text', { timeout: DEFAULT_TIMEOUT }) + .invoke('text') .should('not.equal', 'Updating'); }; export const kqlSearch = (search: string) => { - cy.get(KQL_INPUT, { timeout: DEFAULT_TIMEOUT }).type(search); + cy.get(KQL_INPUT).type(search); }; diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/siem_main.ts b/x-pack/legacy/plugins/siem/cypress/tasks/siem_main.ts index 8501bb3d94e26..bb733e976b360 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/siem_main.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/siem_main.ts @@ -5,7 +5,6 @@ */ import { MAIN_PAGE, TIMELINE_TOGGLE_BUTTON } from '../screens/siem_main'; -import { DEFAULT_TIMEOUT } from '../tasks/login'; export const openTimelineIfClosed = () => { cy.get(MAIN_PAGE).then($page => { @@ -16,5 +15,5 @@ export const openTimelineIfClosed = () => { }; export const openTimeline = () => { - cy.get(TIMELINE_TOGGLE_BUTTON, { timeout: DEFAULT_TIMEOUT }).click(); + cy.get(TIMELINE_TOGGLE_BUTTON).click(); }; diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/timeline.ts b/x-pack/legacy/plugins/siem/cypress/tasks/timeline.ts index 7dc919879f81d..f67ff60e4d7bd 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/timeline.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/timeline.ts @@ -4,8 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -import { DEFAULT_TIMEOUT } from '../tasks/login'; - import { SEARCH_OR_FILTER_CONTAINER, TIMELINE_FIELDS_BUTTON, @@ -28,7 +26,7 @@ export const hostExistsQuery = 'host.name: *'; export const populateTimeline = () => { executeTimelineKQL(hostExistsQuery); - cy.get(SERVER_SIDE_EVENT_COUNT, { timeout: DEFAULT_TIMEOUT }) + cy.get(SERVER_SIDE_EVENT_COUNT) .invoke('text') .should('be.above', 0); }; @@ -46,7 +44,7 @@ export const openTimelineSettings = () => { }; export const openTimelineInspectButton = () => { - cy.get(TIMELINE_INSPECT_BUTTON, { timeout: DEFAULT_TIMEOUT }).should('not.be.disabled'); + cy.get(TIMELINE_INSPECT_BUTTON).should('not.be.disabled'); cy.get(TIMELINE_INSPECT_BUTTON).trigger('click', { force: true }); }; @@ -57,7 +55,7 @@ export const createNewTimeline = () => { }; export const expandFirstTimelineEventDetails = () => { - cy.get(TOGGLE_TIMELINE_EXPAND_EVENT, { timeout: DEFAULT_TIMEOUT }) + cy.get(TOGGLE_TIMELINE_EXPAND_EVENT) .first() .click({ force: true }); }; @@ -65,9 +63,7 @@ export const expandFirstTimelineEventDetails = () => { export const uncheckTimestampToggleField = () => { cy.get(TIMESTAMP_TOGGLE_FIELD).should('exist'); - cy.get(TIMESTAMP_TOGGLE_FIELD, { - timeout: DEFAULT_TIMEOUT, - }).uncheck({ force: true }); + cy.get(TIMESTAMP_TOGGLE_FIELD).uncheck({ force: true }); }; export const checkIdToggleField = () => { @@ -89,5 +85,5 @@ export const dragAndDropIdToggleFieldToTimeline = () => { }; export const addNameToTimeline = (name: string) => { - cy.get(TIMELINE_TITLE, { timeout: DEFAULT_TIMEOUT }).type(name); + cy.get(TIMELINE_TITLE).type(name); }; From 0351290845162bbf6e0ebeb141dfdfbf4c286d24 Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Thu, 20 Feb 2020 15:24:17 +0100 Subject: [PATCH 15/17] orders screens files --- .../siem/cypress/screens/date_picker.ts | 22 +++--- .../siem/cypress/screens/fields_browser.ts | 69 +++++++++---------- .../siem/cypress/screens/hosts/all_hosts.ts | 4 +- .../siem/cypress/screens/hosts/events.ts | 28 ++++---- .../siem/cypress/screens/hosts/main.ts | 12 ++-- .../screens/hosts/uncommon_processes.ts | 1 + .../siem/cypress/screens/siem_header.ts | 8 +-- .../plugins/siem/cypress/screens/timeline.ts | 39 +++++------ 8 files changed, 92 insertions(+), 91 deletions(-) diff --git a/x-pack/legacy/plugins/siem/cypress/screens/date_picker.ts b/x-pack/legacy/plugins/siem/cypress/screens/date_picker.ts index caff721c683e9..e49f5afa7bd0c 100644 --- a/x-pack/legacy/plugins/siem/cypress/screens/date_picker.ts +++ b/x-pack/legacy/plugins/siem/cypress/screens/date_picker.ts @@ -4,18 +4,24 @@ * you may not use this file except in compliance with the Elastic License. */ -export const DATE_PICKER_START_DATE_POPOVER_BUTTON = - 'div[data-test-subj="globalDatePicker"] button[data-test-subj="superDatePickerstartDatePopoverButton"]'; -export const DATE_PICKER_END_DATE_POPOVER_BUTTON = - '[data-test-subj="globalDatePicker"] [data-test-subj="superDatePickerendDatePopoverButton"]'; -export const DATE_PICKER_ABSOLUTE_TAB = '[data-test-subj="superDatePickerAbsoluteTab"]'; +export const DATE_PICKER_ABSOLUTE_INPUT = '[data-test-subj="superDatePickerAbsoluteDateInput"]'; + export const DATE_PICKER_APPLY_BUTTON = '[data-test-subj="globalDatePicker"] button[data-test-subj="querySubmitButton"]'; + export const DATE_PICKER_APPLY_BUTTON_TIMELINE = '[data-test-subj="timeline-properties"] button[data-test-subj="superDatePickerApplyTimeButton"]'; -export const DATE_PICKER_ABSOLUTE_INPUT = '[data-test-subj="superDatePickerAbsoluteDateInput"]'; -export const DATE_PICKER_START_DATE_POPOVER_BUTTON_TIMELINE = - '[data-test-subj="timeline-properties"] [data-test-subj="superDatePickerstartDatePopoverButton"]'; + +export const DATE_PICKER_ABSOLUTE_TAB = '[data-test-subj="superDatePickerAbsoluteTab"]'; + +export const DATE_PICKER_END_DATE_POPOVER_BUTTON = + '[data-test-subj="globalDatePicker"] [data-test-subj="superDatePickerendDatePopoverButton"]'; export const DATE_PICKER_END_DATE_POPOVER_BUTTON_TIMELINE = '[data-test-subj="timeline-properties"] [data-test-subj="superDatePickerendDatePopoverButton"]'; + +export const DATE_PICKER_START_DATE_POPOVER_BUTTON = + 'div[data-test-subj="globalDatePicker"] button[data-test-subj="superDatePickerstartDatePopoverButton"]'; + +export const DATE_PICKER_START_DATE_POPOVER_BUTTON_TIMELINE = + '[data-test-subj="timeline-properties"] [data-test-subj="superDatePickerstartDatePopoverButton"]'; diff --git a/x-pack/legacy/plugins/siem/cypress/screens/fields_browser.ts b/x-pack/legacy/plugins/siem/cypress/screens/fields_browser.ts index fbf6afa6dae34..f15096bd874bc 100644 --- a/x-pack/legacy/plugins/siem/cypress/screens/fields_browser.ts +++ b/x-pack/legacy/plugins/siem/cypress/screens/fields_browser.ts @@ -4,61 +4,58 @@ * you may not use this file except in compliance with the Elastic License. */ -export const FIELDS_BROWSER_TITLE = '[data-test-subj="field-browser-title"]'; +export const FIELDS_BROWSER_CATEGORIES_COUNT = '[data-test-subj="categories-count"]'; -/** Typing in this input filters the Field Browser */ -export const FIELDS_BROWSER_FILTER_INPUT = '[data-test-subj="field-search"]'; +export const FIELDS_BROWSER_CHECKBOX = (id: string) => { + return `[data-test-subj="field-${id}-checkbox`; +}; -/** The title of the selected category in the right-hand side of the fields browser */ -export const FIELDS_BROWSER_SELECTED_CATEGORY_TITLE = '[data-test-subj="selected-category-title"]'; +export const FIELDS_BROWSER_CONTAINER = '[data-test-subj="fields-browser-container"]'; -export const FIELDS_BROWSER_SELECTED_CATEGORY_COUNT = - '[data-test-subj="selected-category-count-badge"]'; +export const FIELDS_BROWSER_DRAGGABLE_HOST_GEO_COUNTRY_NAME_HEADER = + '[data-test-subj="timeline"] [data-test-subj="field-name-host.geo.country_name"]'; -export const FIELDS_BROWSER_CATEGORIES_COUNT = '[data-test-subj="categories-count"]'; +export const FIELDS_BROWSER_FIELDS_COUNT = '[data-test-subj="fields-count"]'; -export const FIELDS_BROWSER_HOST_CATEGORIES_COUNT = '[data-test-subj="host-category-count"]'; +export const FIELDS_BROWSER_FILTER_INPUT = '[data-test-subj="field-search"]'; -export const FIELDS_BROWSER_SYSTEM_CATEGORIES_COUNT = '[data-test-subj="system-category-count"]'; +export const FIELDS_BROWSER_HEADER_DROP_AREA = + '[data-test-subj="timeline"] [data-test-subj="headers-group"]'; -export const FIELDS_BROWSER_FIELDS_COUNT = '[data-test-subj="fields-count"]'; +export const FIELDS_BROWSER_HOST_CATEGORIES_COUNT = '[data-test-subj="host-category-count"]'; -/** Contains the body of the fields browser */ -export const FIELDS_BROWSER_CONTAINER = '[data-test-subj="fields-browser-container"]'; +export const FIELDS_BROWSER_HOST_GEO_CITY_NAME_CHECKBOX = + '[data-test-subj="field-host.geo.city_name-checkbox"]'; -export const FIELDS_BROWSER_MESSAGE_HEADER = - '[data-test-subj="timeline"] [data-test-subj="header-text-message"]'; +export const FIELDS_BROWSER_HOST_GEO_CITY_NAME_HEADER = + '[data-test-subj="header-text-host.geo.city_name"]'; -export const FIELDS_BROWSER_MESSAGE_CHECKBOX = - '[data-test-subj="timeline"] [data-test-subj="field-message-checkbox"]'; +export const FIELDS_BROWSER_HOST_GEO_CONTINENT_NAME_CHECKBOX = + '[data-test-subj="field-host.geo.continent_name-checkbox"]'; -export const FIELDS_BROWSER_HOST_GEO_COUNTRY_NAME_HEADER = - '[data-test-subj="header-text-host.geo.country_name"]'; +export const FIELDS_BROWSER_HEADER_HOST_GEO_CONTINENT_NAME_HEADER = + '[data-test-subj="header-text-host.geo.continent_name"]'; export const FIELDS_BROWSER_HOST_GEO_COUNTRY_NAME_CHECKBOX = '[data-test-subj="field-host.geo.country_name-checkbox"]'; -export const FIELDS_BROWSER_DRAGGABLE_HOST_GEO_COUNTRY_NAME_HEADER = - '[data-test-subj="timeline"] [data-test-subj="field-name-host.geo.country_name"]'; +export const FIELDS_BROWSER_HOST_GEO_COUNTRY_NAME_HEADER = + '[data-test-subj="header-text-host.geo.country_name"]'; -export const FIELDS_BROWSER_HOST_GEO_CITY_NAME_HEADER = - '[data-test-subj="header-text-host.geo.city_name"]'; +export const FIELDS_BROWSER_MESSAGE_CHECKBOX = + '[data-test-subj="timeline"] [data-test-subj="field-message-checkbox"]'; -export const FIELDS_BROWSER_HOST_GEO_CITY_NAME_CHECKBOX = - '[data-test-subj="field-host.geo.city_name-checkbox"]'; +export const FIELDS_BROWSER_MESSAGE_HEADER = + '[data-test-subj="timeline"] [data-test-subj="header-text-message"]'; -export const FIELDS_BROWSER_HEADER_DROP_AREA = - '[data-test-subj="timeline"] [data-test-subj="headers-group"]'; +export const FIELDS_BROWSER_RESET_FIELDS = + '[data-test-subj="timeline"] [data-test-subj="reset-fields"]'; -export const FIELDS_BROWSER_HEADER_HOST_GEO_CONTINENT_NAME_HEADER = - '[data-test-subj="header-text-host.geo.continent_name"]'; +export const FIELDS_BROWSER_TITLE = '[data-test-subj="field-browser-title"]'; -export const FIELDS_BROWSER_HOST_GEO_CONTINENT_NAME_CHECKBOX = - '[data-test-subj="field-host.geo.continent_name-checkbox"]'; +export const FIELDS_BROWSER_SELECTED_CATEGORY_COUNT = + '[data-test-subj="selected-category-count-badge"]'; -export const FIELDS_BROWSER_RESET_FIELDS = - '[data-test-subj="timeline"] [data-test-subj="reset-fields"]'; +export const FIELDS_BROWSER_SELECTED_CATEGORY_TITLE = '[data-test-subj="selected-category-title"]'; -export const FIELDS_BROWSER_CHECKBOX = (id: string) => { - return `[data-test-subj="field-${id}-checkbox`; -}; +export const FIELDS_BROWSER_SYSTEM_CATEGORIES_COUNT = '[data-test-subj="system-category-count"]'; diff --git a/x-pack/legacy/plugins/siem/cypress/screens/hosts/all_hosts.ts b/x-pack/legacy/plugins/siem/cypress/screens/hosts/all_hosts.ts index 61f39ca7a8b0c..ca123a8afc6c9 100644 --- a/x-pack/legacy/plugins/siem/cypress/screens/hosts/all_hosts.ts +++ b/x-pack/legacy/plugins/siem/cypress/screens/hosts/all_hosts.ts @@ -6,6 +6,6 @@ export const ALL_HOSTS_TABLE = '[data-test-subj="table-allHosts-loading-false"]'; -export const HOSTS_NAMES_DRAGGABLE = '[data-test-subj="draggable-content-host.name"]'; - export const HOSTS_NAMES = '[data-test-subj="draggable-content-host.name"] a.euiLink'; + +export const HOSTS_NAMES_DRAGGABLE = '[data-test-subj="draggable-content-host.name"]'; diff --git a/x-pack/legacy/plugins/siem/cypress/screens/hosts/events.ts b/x-pack/legacy/plugins/siem/cypress/screens/hosts/events.ts index 034c1453fc979..705da7a9c0d4c 100644 --- a/x-pack/legacy/plugins/siem/cypress/screens/hosts/events.ts +++ b/x-pack/legacy/plugins/siem/cypress/screens/hosts/events.ts @@ -4,33 +4,33 @@ * you may not use this file except in compliance with the Elastic License. */ -export const EVENTS_VIEWER_PANEL = '[data-test-subj="events-viewer-panel"]'; - export const CLOSE_MODAL = '[data-test-subj="modal-inspect-close"]'; -export const HEADER_SUBTITLE = `${EVENTS_VIEWER_PANEL} [data-test-subj="header-panel-subtitle"]`; - -export const INSPECT_MODAL = '[data-test-subj="modal-inspect-euiModal"]'; +export const EVENTS_VIEWER_FIELDS_BUTTON = `${EVENTS_VIEWER_PANEL} [data-test-subj="show-field-browser-gear"]`; -export const INSPECT_QUERY = `${EVENTS_VIEWER_PANEL} [data-test-subj="inspect-icon-button"]`; +export const EVENTS_VIEWER_PANEL = '[data-test-subj="events-viewer-panel"]'; -export const LOAD_MORE = `${EVENTS_VIEWER_PANEL} [data-test-subj="TimelineMoreButton"]`; +export const FIELDS_BROWSER_CONTAINER = '[data-test-subj="fields-browser-container"]'; -export const LOCAL_EVENTS_COUNT = `${EVENTS_VIEWER_PANEL} [data-test-subj="local-events-count"]`; +export const HEADER_SUBTITLE = `${EVENTS_VIEWER_PANEL} [data-test-subj="header-panel-subtitle"]`; -export const SERVER_SIDE_EVENT_COUNT = '[data-test-subj="server-side-event-count"]'; +export const HOST_GEO_CITY_NAME_CHECKBOX = '[data-test-subj="field-host.geo.city_name-checkbox"]'; export const HOST_GEO_CITY_NAME_HEADER = '[data-test-subj="header-text-host.geo.city_name"]'; -export const HOST_GEO_CITY_NAME_CHECKBOX = '[data-test-subj="field-host.geo.city_name-checkbox"]'; +export const HOST_GEO_COUNTRY_NAME_CHECKBOX = + '[data-test-subj="field-host.geo.country_name-checkbox"]'; export const HOST_GEO_COUNTRY_NAME_HEADER = '[data-test-subj="header-text-host.geo.country_name"]'; -export const HOST_GEO_COUNTRY_NAME_CHECKBOX = - '[data-test-subj="field-host.geo.country_name-checkbox"]'; +export const INSPECT_MODAL = '[data-test-subj="modal-inspect-euiModal"]'; -export const FIELDS_BROWSER_CONTAINER = '[data-test-subj="fields-browser-container"]'; +export const INSPECT_QUERY = `${EVENTS_VIEWER_PANEL} [data-test-subj="inspect-icon-button"]`; -export const EVENTS_VIEWER_FIELDS_BUTTON = `${EVENTS_VIEWER_PANEL} [data-test-subj="show-field-browser-gear"]`; +export const LOCAL_EVENTS_COUNT = `${EVENTS_VIEWER_PANEL} [data-test-subj="local-events-count"]`; + +export const LOAD_MORE = `${EVENTS_VIEWER_PANEL} [data-test-subj="TimelineMoreButton"]`; export const RESET_FIELDS = `${EVENTS_VIEWER_PANEL} [data-test-subj="reset-fields"]`; + +export const SERVER_SIDE_EVENT_COUNT = '[data-test-subj="server-side-event-count"]'; diff --git a/x-pack/legacy/plugins/siem/cypress/screens/hosts/main.ts b/x-pack/legacy/plugins/siem/cypress/screens/hosts/main.ts index 25696be526e5f..3c30562680e86 100644 --- a/x-pack/legacy/plugins/siem/cypress/screens/hosts/main.ts +++ b/x-pack/legacy/plugins/siem/cypress/screens/hosts/main.ts @@ -4,14 +4,14 @@ * you may not use this file except in compliance with the Elastic License. */ -export const EVENTS_TAB = '[data-test-subj="navigation-events"]'; - -export const AUTHENTICATIONS_TAB = '[data-test-subj="navigation-authentications"]'; - -export const UNCOMMON_PROCESSES_TAB = '[data-test-subj="navigation-uncommonProcesses"]'; - export const ALL_HOSTS_TAB = '[data-test-subj="navigation-allHosts'; export const ANOMALIES_TAB = '[data-test-subj="navigation-anomalies"]'; +export const AUTHENTICATIONS_TAB = '[data-test-subj="navigation-authentications"]'; + +export const EVENTS_TAB = '[data-test-subj="navigation-events"]'; + export const KQL_SEARCH_BAR = '[data-test-subj="queryInput"]'; + +export const UNCOMMON_PROCESSES_TAB = '[data-test-subj="navigation-uncommonProcesses"]'; diff --git a/x-pack/legacy/plugins/siem/cypress/screens/hosts/uncommon_processes.ts b/x-pack/legacy/plugins/siem/cypress/screens/hosts/uncommon_processes.ts index 71abaa21bf6bd..68ea8e008bfd3 100644 --- a/x-pack/legacy/plugins/siem/cypress/screens/hosts/uncommon_processes.ts +++ b/x-pack/legacy/plugins/siem/cypress/screens/hosts/uncommon_processes.ts @@ -5,4 +5,5 @@ */ export const PROCESS_NAME_FIELD = '[data-test-subj="draggable-content-process.name"]'; + export const UNCOMMON_PROCESSES_TABLE = '[data-test-subj="table-uncommonProcesses-loading-false"]'; diff --git a/x-pack/legacy/plugins/siem/cypress/screens/siem_header.ts b/x-pack/legacy/plugins/siem/cypress/screens/siem_header.ts index 4ffb497a62432..cf1059269393a 100644 --- a/x-pack/legacy/plugins/siem/cypress/screens/siem_header.ts +++ b/x-pack/legacy/plugins/siem/cypress/screens/siem_header.ts @@ -4,16 +4,16 @@ * you may not use this file except in compliance with the Elastic License. */ -export const KQL_INPUT = '[data-test-subj="queryInput"]'; +export const BREADCRUMBS = '[data-test-subj="breadcrumbs"] a'; export const HOSTS = '[data-test-subj="navigation-hosts"]'; +export const KQL_INPUT = '[data-test-subj="queryInput"]'; + export const NETWORK = '[data-test-subj="navigation-network"]'; export const OVERVIEW = '[data-test-subj="navigation-overview"]'; -export const TIMELINES = '[data-test-subj="navigation-timelines"]'; - export const REFRESH_BUTTON = '[data-test-subj="querySubmitButton"]'; -export const BREADCRUMBS = '[data-test-subj="breadcrumbs"] a'; +export const TIMELINES = '[data-test-subj="navigation-timelines"]'; diff --git a/x-pack/legacy/plugins/siem/cypress/screens/timeline.ts b/x-pack/legacy/plugins/siem/cypress/screens/timeline.ts index 6df269b7691a8..1640647b45427 100644 --- a/x-pack/legacy/plugins/siem/cypress/screens/timeline.ts +++ b/x-pack/legacy/plugins/siem/cypress/screens/timeline.ts @@ -4,26 +4,20 @@ * you may not use this file except in compliance with the Elastic License. */ -/** The `Timeline ^` button that toggles visibility of the Timeline */ -export const TIMELINE_TOGGLE_BUTTON = '[data-test-subj="flyoutOverlay"]'; - -/** Contains the KQL bar for searching or filtering in the timeline */ -export const SEARCH_OR_FILTER_CONTAINER = - '[data-test-subj="timeline-search-or-filter-search-container"]'; +export const CLOSE_TIMELINE_BTN = '[data-test-subj="close-timeline"]'; -export const TIMELINE_FIELDS_BUTTON = - '[data-test-subj="timeline"] [data-test-subj="show-field-browser"]'; +export const CREATE_NEW_TIMELINE = '[data-test-subj="timeline-new"]'; -/** The total server-side count of the events matching the timeline's search criteria */ -export const SERVER_SIDE_EVENT_COUNT = '[data-test-subj="server-side-event-count"]'; +export const ID_HEADER_FIELD = '[data-test-subj="timeline"] [data-test-subj="header-text-_id"]'; -export const TIMELINE_SETTINGS_ICON = '[data-test-subj="settings-gear"]'; +export const ID_FIELD = '[data-test-subj="timeline"] [data-test-subj="field-name-_id"]'; -export const TIMELINE_INSPECT_BUTTON = '[data-test-subj="inspect-empty-button"]'; +export const ID_TOGGLE_FIELD = '[data-test-subj="toggle-field-_id"]'; -export const CLOSE_TIMELINE_BTN = '[data-test-subj="close-timeline"]'; +export const SEARCH_OR_FILTER_CONTAINER = + '[data-test-subj="timeline-search-or-filter-search-container"]'; -export const CREATE_NEW_TIMELINE = '[data-test-subj="timeline-new"]'; +export const SERVER_SIDE_EVENT_COUNT = '[data-test-subj="server-side-event-count"]'; export const TIMELINE_DATA_PROVIDERS = '[data-test-subj="dataProviders"]'; @@ -33,21 +27,24 @@ export const TIMELINE_DATA_PROVIDERS_EMPTY = export const TIMELINE_DROPPED_DATA_PROVIDERS = '[data-test-subj="dataProviders"] [data-test-subj="providerContainer"]'; +export const TIMELINE_FIELDS_BUTTON = + '[data-test-subj="timeline"] [data-test-subj="show-field-browser"]'; + export const TIMELINE_FLYOUT_BODY = '[data-test-subj="eui-flyout-body"]'; +export const TIMELINE_INSPECT_BUTTON = '[data-test-subj="inspect-empty-button"]'; + export const TIMELINE_NOT_READY_TO_DROP_BUTTON = '[data-test-subj="flyout-button-not-ready-to-drop"]'; -export const TOGGLE_TIMELINE_EXPAND_EVENT = '[data-test-subj="expand-event"]'; - -export const TIMESTAMP_TOGGLE_FIELD = '[data-test-subj="toggle-field-@timestamp"]'; +export const TIMELINE_SETTINGS_ICON = '[data-test-subj="settings-gear"]'; -export const ID_TOGGLE_FIELD = '[data-test-subj="toggle-field-_id"]'; +export const TIMELINE_TITLE = '[data-test-subj="timeline-title"]'; export const TIMESTAMP_HEADER_FIELD = '[data-test-subj="header-text-@timestamp"]'; -export const ID_HEADER_FIELD = '[data-test-subj="timeline"] [data-test-subj="header-text-_id"]'; +export const TIMELINE_TOGGLE_BUTTON = '[data-test-subj="flyoutOverlay"]'; -export const ID_FIELD = '[data-test-subj="timeline"] [data-test-subj="field-name-_id"]'; +export const TIMESTAMP_TOGGLE_FIELD = '[data-test-subj="toggle-field-@timestamp"]'; -export const TIMELINE_TITLE = '[data-test-subj="timeline-title"]'; +export const TOGGLE_TIMELINE_EXPAND_EVENT = '[data-test-subj="expand-event"]'; From c20caed30f9698a86912d8b07521ed4b11ec7c84 Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Thu, 20 Feb 2020 16:33:26 +0100 Subject: [PATCH 16/17] cleans tasks files --- .../plugins/siem/cypress/tasks/common.ts | 14 ++-- .../plugins/siem/cypress/tasks/date_picker.ts | 42 ++++++------ .../siem/cypress/tasks/fields_browser.ts | 44 ++++++------ .../siem/cypress/tasks/hosts/all_hosts.ts | 20 +++--- .../siem/cypress/tasks/hosts/events.ts | 54 +++++++-------- .../plugins/siem/cypress/tasks/hosts/main.ts | 11 ++- .../plugins/siem/cypress/tasks/siem_header.ts | 16 ++--- .../plugins/siem/cypress/tasks/siem_main.ts | 8 +-- .../plugins/siem/cypress/tasks/timeline.ts | 68 +++++++++---------- .../plugins/siem/cypress/urls/navigation.ts | 6 +- 10 files changed, 141 insertions(+), 142 deletions(-) diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/common.ts b/x-pack/legacy/plugins/siem/cypress/tasks/common.ts index 39a61401c15b3..e02d3506b33bc 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/common.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/common.ts @@ -33,6 +33,13 @@ export const drag = (subject: JQuery) => { .wait(1); }; +/** Drags the subject being dragged on the specified drop target, but does not drop it */ +export const dragWithoutDrop = (dropTarget: JQuery) => { + cy.wrap(dropTarget).trigger('mousemove', 'center', { + button: primaryButton, + }); +}; + /** "Drops" the subject being dragged on the specified drop target */ export const drop = (dropTarget: JQuery) => { cy.wrap(dropTarget) @@ -41,10 +48,3 @@ export const drop = (dropTarget: JQuery) => { .trigger('mouseup', { force: true }) .wait(1); }; - -/** Drags the subject being dragged on the specified drop target, but does not drop it */ -export const dragWithoutDrop = (dropTarget: JQuery) => { - cy.wrap(dropTarget).trigger('mousemove', 'center', { - button: primaryButton, - }); -}; diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/date_picker.ts b/x-pack/legacy/plugins/siem/cypress/tasks/date_picker.ts index fd410d698adf9..9d79b73a52b08 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/date_picker.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/date_picker.ts @@ -5,18 +5,18 @@ */ import { - DATE_PICKER_START_DATE_POPOVER_BUTTON_TIMELINE, - DATE_PICKER_END_DATE_POPOVER_BUTTON_TIMELINE, - DATE_PICKER_APPLY_BUTTON_TIMELINE, - DATE_PICKER_START_DATE_POPOVER_BUTTON, DATE_PICKER_ABSOLUTE_TAB, DATE_PICKER_ABSOLUTE_INPUT, DATE_PICKER_APPLY_BUTTON, + DATE_PICKER_APPLY_BUTTON_TIMELINE, DATE_PICKER_END_DATE_POPOVER_BUTTON, + DATE_PICKER_END_DATE_POPOVER_BUTTON_TIMELINE, + DATE_PICKER_START_DATE_POPOVER_BUTTON, + DATE_PICKER_START_DATE_POPOVER_BUTTON_TIMELINE, } from '../screens/date_picker'; -export const setStartDate = (date: string) => { - cy.get(DATE_PICKER_START_DATE_POPOVER_BUTTON).click({ force: true }); +export const setEndDate = (date: string) => { + cy.get(DATE_PICKER_END_DATE_POPOVER_BUTTON).click({ force: true }); cy.get(DATE_PICKER_ABSOLUTE_TAB) .first() @@ -27,8 +27,8 @@ export const setStartDate = (date: string) => { .type(date); }; -export const setEndDate = (date: string) => { - cy.get(DATE_PICKER_END_DATE_POPOVER_BUTTON).click({ force: true }); +export const setStartDate = (date: string) => { + cy.get(DATE_PICKER_START_DATE_POPOVER_BUTTON).click({ force: true }); cy.get(DATE_PICKER_ABSOLUTE_TAB) .first() @@ -39,17 +39,8 @@ export const setEndDate = (date: string) => { .type(date); }; -export const updateDates = () => { - cy.get(DATE_PICKER_APPLY_BUTTON) - .click({ force: true }) - .invoke('text') - .should('not.equal', 'Updating'); -}; - -export const setTimelineStartDate = (date: string) => { - cy.get(DATE_PICKER_START_DATE_POPOVER_BUTTON_TIMELINE).click({ - force: true, - }); +export const setTimelineEndDate = (date: string) => { + cy.get(DATE_PICKER_END_DATE_POPOVER_BUTTON_TIMELINE).click({ force: true }); cy.get(DATE_PICKER_ABSOLUTE_TAB) .first() @@ -58,8 +49,10 @@ export const setTimelineStartDate = (date: string) => { cy.get(DATE_PICKER_ABSOLUTE_INPUT).type(`{selectall}{backspace}${date}{enter}`); }; -export const setTimelineEndDate = (date: string) => { - cy.get(DATE_PICKER_END_DATE_POPOVER_BUTTON_TIMELINE).click({ force: true }); +export const setTimelineStartDate = (date: string) => { + cy.get(DATE_PICKER_START_DATE_POPOVER_BUTTON_TIMELINE).click({ + force: true, + }); cy.get(DATE_PICKER_ABSOLUTE_TAB) .first() @@ -68,6 +61,13 @@ export const setTimelineEndDate = (date: string) => { cy.get(DATE_PICKER_ABSOLUTE_INPUT).type(`{selectall}{backspace}${date}{enter}`); }; +export const updateDates = () => { + cy.get(DATE_PICKER_APPLY_BUTTON) + .click({ force: true }) + .invoke('text') + .should('not.equal', 'Updating'); +}; + export const updateTimelineDates = () => { cy.get(DATE_PICKER_APPLY_BUTTON_TIMELINE).click({ force: true }); }; diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/fields_browser.ts b/x-pack/legacy/plugins/siem/cypress/tasks/fields_browser.ts index 6896f51f3900b..e1d2f24da424c 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/fields_browser.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/fields_browser.ts @@ -7,37 +7,23 @@ import { drag, drop } from '../tasks/common'; import { FIELDS_BROWSER_FILTER_INPUT, - FIELDS_BROWSER_MESSAGE_CHECKBOX, - FIELDS_BROWSER_HOST_GEO_CITY_NAME_CHECKBOX, FIELDS_BROWSER_DRAGGABLE_HOST_GEO_COUNTRY_NAME_HEADER, FIELDS_BROWSER_HEADER_DROP_AREA, + FIELDS_BROWSER_HOST_GEO_CITY_NAME_CHECKBOX, FIELDS_BROWSER_HOST_GEO_CONTINENT_NAME_CHECKBOX, + FIELDS_BROWSER_MESSAGE_CHECKBOX, FIELDS_BROWSER_RESET_FIELDS, } from '../screens/fields_browser'; import { KQL_SEARCH_BAR } from '../screens/hosts/main'; -export const clearFieldsBrowser = () => { - cy.get(FIELDS_BROWSER_FILTER_INPUT).type('{selectall}{backspace}'); -}; - -export const filterFieldsBrowser = (fieldName: string) => { - cy.get(FIELDS_BROWSER_FILTER_INPUT) - .type(fieldName) - .should('not.have.class', 'euiFieldSearch-isLoading'); -}; - -export const closeFieldsBrowser = () => { - cy.get(KQL_SEARCH_BAR).click({ force: true }); -}; - -export const removesMessageField = () => { - cy.get(FIELDS_BROWSER_MESSAGE_CHECKBOX).uncheck({ +export const addsHostGeoCityNameToTimeline = () => { + cy.get(FIELDS_BROWSER_HOST_GEO_CITY_NAME_CHECKBOX).check({ force: true, }); }; -export const addsHostGeoCityNameToTimeline = () => { - cy.get(FIELDS_BROWSER_HOST_GEO_CITY_NAME_CHECKBOX).check({ +export const addsHostGeoContinentNameToTimeline = () => { + cy.get(FIELDS_BROWSER_HOST_GEO_CONTINENT_NAME_CHECKBOX).check({ force: true, }); }; @@ -49,8 +35,22 @@ export const addsHostGeoCountryNameToTimelineDraggingIt = () => { cy.get(FIELDS_BROWSER_HEADER_DROP_AREA).then(headersDropArea => drop(headersDropArea)); }; -export const addsHostGeoContinentNameToTimeline = () => { - cy.get(FIELDS_BROWSER_HOST_GEO_CONTINENT_NAME_CHECKBOX).check({ +export const clearFieldsBrowser = () => { + cy.get(FIELDS_BROWSER_FILTER_INPUT).type('{selectall}{backspace}'); +}; + +export const closeFieldsBrowser = () => { + cy.get(KQL_SEARCH_BAR).click({ force: true }); +}; + +export const filterFieldsBrowser = (fieldName: string) => { + cy.get(FIELDS_BROWSER_FILTER_INPUT) + .type(fieldName) + .should('not.have.class', 'euiFieldSearch-isLoading'); +}; + +export const removesMessageField = () => { + cy.get(FIELDS_BROWSER_MESSAGE_CHECKBOX).uncheck({ force: true, }); }; diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/all_hosts.ts b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/all_hosts.ts index 90f7633666533..312df96df1ddf 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/all_hosts.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/all_hosts.ts @@ -6,11 +6,8 @@ import { ALL_HOSTS_TABLE, HOSTS_NAMES_DRAGGABLE, HOSTS_NAMES } from '../../screens/hosts/all_hosts'; import { TIMELINE_DATA_PROVIDERS, TIMELINE_DATA_PROVIDERS_EMPTY } from '../../screens/timeline'; -import { drag, drop, dragWithoutDrop } from '../../tasks/common'; -export const waitForAllHostsToBeLoaded = () => { - cy.get(ALL_HOSTS_TABLE).should('exist'); -}; +import { drag, dragWithoutDrop, drop } from '../../tasks/common'; export const dragAndDropFirstHostToTimeline = () => { cy.get(HOSTS_NAMES_DRAGGABLE) @@ -19,12 +16,6 @@ export const dragAndDropFirstHostToTimeline = () => { cy.get(TIMELINE_DATA_PROVIDERS).then(dataProvidersDropArea => drop(dataProvidersDropArea)); }; -export const dragFirstHostToTimeline = () => { - cy.get(HOSTS_NAMES_DRAGGABLE) - .first() - .then(host => drag(host)); -}; - export const dragFirstHostToEmptyTimelineDataProviders = () => { cy.get(HOSTS_NAMES_DRAGGABLE) .first() @@ -35,8 +26,17 @@ export const dragFirstHostToEmptyTimelineDataProviders = () => { ); }; +export const dragFirstHostToTimeline = () => { + cy.get(HOSTS_NAMES_DRAGGABLE) + .first() + .then(host => drag(host)); +}; export const openFirstHostDetails = () => { cy.get(HOSTS_NAMES) .first() .click({ force: true }); }; + +export const waitForAllHostsToBeLoaded = () => { + cy.get(ALL_HOSTS_TABLE).should('exist'); +}; diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/events.ts b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/events.ts index f21dc22e3482c..de0c99bd31dff 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/events.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/events.ts @@ -5,35 +5,17 @@ */ import { - EVENTS_VIEWER_FIELDS_BUTTON, CLOSE_MODAL, - INSPECT_QUERY, - SERVER_SIDE_EVENT_COUNT, + EVENTS_VIEWER_FIELDS_BUTTON, + FIELDS_BROWSER_CONTAINER, HOST_GEO_CITY_NAME_CHECKBOX, HOST_GEO_COUNTRY_NAME_CHECKBOX, - FIELDS_BROWSER_CONTAINER, - RESET_FIELDS, + INSPECT_QUERY, LOAD_MORE, + RESET_FIELDS, + SERVER_SIDE_EVENT_COUNT, } from '../../screens/hosts/events'; -export const closeModal = () => { - cy.get(CLOSE_MODAL).click(); -}; - -export const opensInspectQueryModal = () => { - cy.get(INSPECT_QUERY) - .should('exist') - .trigger('mousemove', { force: true }) - .click({ force: true }); -}; - -export const waitsForEventsToBeLoaded = () => { - cy.get(SERVER_SIDE_EVENT_COUNT) - .should('exist') - .invoke('text') - .should('not.equal', '0'); -}; - export const addsHostGeoCityNameToHeader = () => { cy.get(HOST_GEO_CITY_NAME_CHECKBOX).check({ force: true, @@ -46,8 +28,12 @@ export const addsHostGeoCountryNameToHeader = () => { }); }; -export const resetFields = () => { - cy.get(RESET_FIELDS).click({ force: true }); +export const closeModal = () => { + cy.get(CLOSE_MODAL).click(); +}; + +export const loadMoreEvents = () => { + cy.get(LOAD_MORE).click({ force: true }); }; export const openEventsViewerFieldsBrowser = () => { @@ -60,6 +46,20 @@ export const openEventsViewerFieldsBrowser = () => { cy.get(FIELDS_BROWSER_CONTAINER).should('exist'); }; -export const loadMoreEvents = () => { - cy.get(LOAD_MORE).click({ force: true }); +export const opensInspectQueryModal = () => { + cy.get(INSPECT_QUERY) + .should('exist') + .trigger('mousemove', { force: true }) + .click({ force: true }); +}; + +export const resetFields = () => { + cy.get(RESET_FIELDS).click({ force: true }); +}; + +export const waitsForEventsToBeLoaded = () => { + cy.get(SERVER_SIDE_EVENT_COUNT) + .should('exist') + .invoke('text') + .should('not.equal', '0'); }; diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/main.ts b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/main.ts index 4db6046e63690..eba0c353fbf37 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/main.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/hosts/main.ts @@ -5,17 +5,16 @@ */ import { - EVENTS_TAB, + ALL_HOSTS_TAB, AUTHENTICATIONS_TAB, + EVENTS_TAB, UNCOMMON_PROCESSES_TAB, - ALL_HOSTS_TAB, } from '../../screens/hosts/main'; -/** Clicks the Events tab on the hosts page */ -export const openEvents = () => cy.get(EVENTS_TAB).click({ force: true }); +export const openAllHosts = () => cy.get(ALL_HOSTS_TAB).click({ force: true }); export const openAuthentications = () => cy.get(AUTHENTICATIONS_TAB).click({ force: true }); -export const openUncommonProcesses = () => cy.get(UNCOMMON_PROCESSES_TAB).click({ force: true }); +export const openEvents = () => cy.get(EVENTS_TAB).click({ force: true }); -export const openAllHosts = () => cy.get(ALL_HOSTS_TAB).click({ force: true }); +export const openUncommonProcesses = () => cy.get(UNCOMMON_PROCESSES_TAB).click({ force: true }); diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/siem_header.ts b/x-pack/legacy/plugins/siem/cypress/tasks/siem_header.ts index f178ef4c8280e..4c43948445c58 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/siem_header.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/siem_header.ts @@ -6,23 +6,23 @@ import { KQL_INPUT, REFRESH_BUTTON } from '../screens/siem_header'; -export const navigateFromHeaderTo = (page: string) => { - cy.get(page).click({ force: true }); -}; - export const clearSearchBar = () => { cy.get(KQL_INPUT) .clear() .type('{enter}'); }; +export const kqlSearch = (search: string) => { + cy.get(KQL_INPUT).type(search); +}; + +export const navigateFromHeaderTo = (page: string) => { + cy.get(page).click({ force: true }); +}; + export const refreshPage = () => { cy.get(REFRESH_BUTTON) .click({ force: true }) .invoke('text') .should('not.equal', 'Updating'); }; - -export const kqlSearch = (search: string) => { - cy.get(KQL_INPUT).type(search); -}; diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/siem_main.ts b/x-pack/legacy/plugins/siem/cypress/tasks/siem_main.ts index bb733e976b360..2bdc62ecbdc03 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/siem_main.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/siem_main.ts @@ -6,6 +6,10 @@ import { MAIN_PAGE, TIMELINE_TOGGLE_BUTTON } from '../screens/siem_main'; +export const openTimeline = () => { + cy.get(TIMELINE_TOGGLE_BUTTON).click(); +}; + export const openTimelineIfClosed = () => { cy.get(MAIN_PAGE).then($page => { if ($page.find(TIMELINE_TOGGLE_BUTTON).length === 1) { @@ -13,7 +17,3 @@ export const openTimelineIfClosed = () => { } }); }; - -export const openTimeline = () => { - cy.get(TIMELINE_TOGGLE_BUTTON).click(); -}; diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/timeline.ts b/x-pack/legacy/plugins/siem/cypress/tasks/timeline.ts index f67ff60e4d7bd..76acdad990a7e 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/timeline.ts +++ b/x-pack/legacy/plugins/siem/cypress/tasks/timeline.ts @@ -5,42 +5,51 @@ */ import { + CLOSE_TIMELINE_BTN, + CREATE_NEW_TIMELINE, + ID_FIELD, + ID_HEADER_FIELD, + ID_TOGGLE_FIELD, SEARCH_OR_FILTER_CONTAINER, - TIMELINE_FIELDS_BUTTON, SERVER_SIDE_EVENT_COUNT, - TIMELINE_SETTINGS_ICON, + TIMELINE_FIELDS_BUTTON, TIMELINE_INSPECT_BUTTON, - CREATE_NEW_TIMELINE, - CLOSE_TIMELINE_BTN, - TOGGLE_TIMELINE_EXPAND_EVENT, - TIMESTAMP_TOGGLE_FIELD, - ID_TOGGLE_FIELD, - ID_HEADER_FIELD, - ID_FIELD, + TIMELINE_SETTINGS_ICON, TIMELINE_TITLE, + TIMESTAMP_TOGGLE_FIELD, + TOGGLE_TIMELINE_EXPAND_EVENT, } from '../screens/timeline'; import { drag, drop } from '../tasks/common'; export const hostExistsQuery = 'host.name: *'; -export const populateTimeline = () => { - executeTimelineKQL(hostExistsQuery); - cy.get(SERVER_SIDE_EVENT_COUNT) - .invoke('text') - .should('be.above', 0); +export const checkIdToggleField = () => { + cy.get(ID_TOGGLE_FIELD).should('not.exist'); + + cy.get(ID_TOGGLE_FIELD).check({ + force: true, + }); }; -export const openTimelineFieldsBrowser = () => { - cy.get(TIMELINE_FIELDS_BUTTON).click({ force: true }); +export const createNewTimeline = () => { + cy.get(TIMELINE_SETTINGS_ICON).click({ force: true }); + cy.get(CREATE_NEW_TIMELINE).click(); + cy.get(CLOSE_TIMELINE_BTN).click({ force: true }); }; export const executeTimelineKQL = (query: string) => { cy.get(`${SEARCH_OR_FILTER_CONTAINER} input`).type(`${query} {enter}`); }; -export const openTimelineSettings = () => { - cy.get(TIMELINE_SETTINGS_ICON).trigger('click', { force: true }); +export const expandFirstTimelineEventDetails = () => { + cy.get(TOGGLE_TIMELINE_EXPAND_EVENT) + .first() + .click({ force: true }); +}; + +export const openTimelineFieldsBrowser = () => { + cy.get(TIMELINE_FIELDS_BUTTON).click({ force: true }); }; export const openTimelineInspectButton = () => { @@ -48,16 +57,15 @@ export const openTimelineInspectButton = () => { cy.get(TIMELINE_INSPECT_BUTTON).trigger('click', { force: true }); }; -export const createNewTimeline = () => { - cy.get(TIMELINE_SETTINGS_ICON).click({ force: true }); - cy.get(CREATE_NEW_TIMELINE).click(); - cy.get(CLOSE_TIMELINE_BTN).click({ force: true }); +export const openTimelineSettings = () => { + cy.get(TIMELINE_SETTINGS_ICON).trigger('click', { force: true }); }; -export const expandFirstTimelineEventDetails = () => { - cy.get(TOGGLE_TIMELINE_EXPAND_EVENT) - .first() - .click({ force: true }); +export const populateTimeline = () => { + executeTimelineKQL(hostExistsQuery); + cy.get(SERVER_SIDE_EVENT_COUNT) + .invoke('text') + .should('be.above', 0); }; export const uncheckTimestampToggleField = () => { @@ -66,14 +74,6 @@ export const uncheckTimestampToggleField = () => { cy.get(TIMESTAMP_TOGGLE_FIELD).uncheck({ force: true }); }; -export const checkIdToggleField = () => { - cy.get(ID_TOGGLE_FIELD).should('not.exist'); - - cy.get(ID_TOGGLE_FIELD).check({ - force: true, - }); -}; - export const dragAndDropIdToggleFieldToTimeline = () => { cy.get(ID_HEADER_FIELD).should('not.exist'); diff --git a/x-pack/legacy/plugins/siem/cypress/urls/navigation.ts b/x-pack/legacy/plugins/siem/cypress/urls/navigation.ts index 62b57cf17d77f..8fdc939e7ee51 100644 --- a/x-pack/legacy/plugins/siem/cypress/urls/navigation.ts +++ b/x-pack/legacy/plugins/siem/cypress/urls/navigation.ts @@ -4,10 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -export const TIMELINES_PAGE = '/app/siem#/timelines'; -export const OVERVIEW_PAGE = '/app/siem#/overview'; export const HOSTS_PAGE = '/app/siem#/hosts/allHosts'; -export const NETWORK_PAGE = '/app/siem#/network'; export const HOSTS_PAGE_TAB_URLS = { allHosts: '/app/siem#/hosts/allHosts', anomalies: '/app/siem#/hosts/anomalies', @@ -15,3 +12,6 @@ export const HOSTS_PAGE_TAB_URLS = { events: '/app/siem#/hosts/events', uncommonProcesses: '/app/siem#/hosts/uncommonProcesses', }; +export const NETWORK_PAGE = '/app/siem#/network'; +export const OVERVIEW_PAGE = '/app/siem#/overview'; +export const TIMELINES_PAGE = '/app/siem#/timelines'; From 40e92d787907eb12c76ce21000e3f0b3ef41ecea Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Thu, 20 Feb 2020 20:41:54 +0100 Subject: [PATCH 17/17] fixes type check --- .../siem/cypress/screens/hosts/events.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/x-pack/legacy/plugins/siem/cypress/screens/hosts/events.ts b/x-pack/legacy/plugins/siem/cypress/screens/hosts/events.ts index 705da7a9c0d4c..ed46a90c872c8 100644 --- a/x-pack/legacy/plugins/siem/cypress/screens/hosts/events.ts +++ b/x-pack/legacy/plugins/siem/cypress/screens/hosts/events.ts @@ -6,13 +6,15 @@ export const CLOSE_MODAL = '[data-test-subj="modal-inspect-close"]'; -export const EVENTS_VIEWER_FIELDS_BUTTON = `${EVENTS_VIEWER_PANEL} [data-test-subj="show-field-browser-gear"]`; +export const EVENTS_VIEWER_FIELDS_BUTTON = + '[data-test-subj="events-viewer-panel"] [data-test-subj="show-field-browser-gear"]'; export const EVENTS_VIEWER_PANEL = '[data-test-subj="events-viewer-panel"]'; export const FIELDS_BROWSER_CONTAINER = '[data-test-subj="fields-browser-container"]'; -export const HEADER_SUBTITLE = `${EVENTS_VIEWER_PANEL} [data-test-subj="header-panel-subtitle"]`; +export const HEADER_SUBTITLE = + '[data-test-subj="events-viewer-panel"] [data-test-subj="header-panel-subtitle"]'; export const HOST_GEO_CITY_NAME_CHECKBOX = '[data-test-subj="field-host.geo.city_name-checkbox"]'; @@ -25,12 +27,16 @@ export const HOST_GEO_COUNTRY_NAME_HEADER = '[data-test-subj="header-text-host.g export const INSPECT_MODAL = '[data-test-subj="modal-inspect-euiModal"]'; -export const INSPECT_QUERY = `${EVENTS_VIEWER_PANEL} [data-test-subj="inspect-icon-button"]`; +export const INSPECT_QUERY = + '[data-test-subj="events-viewer-panel"] [data-test-subj="inspect-icon-button"]'; -export const LOCAL_EVENTS_COUNT = `${EVENTS_VIEWER_PANEL} [data-test-subj="local-events-count"]`; +export const LOCAL_EVENTS_COUNT = + '[data-test-subj="events-viewer-panel"] [data-test-subj="local-events-count"'; -export const LOAD_MORE = `${EVENTS_VIEWER_PANEL} [data-test-subj="TimelineMoreButton"]`; +export const LOAD_MORE = + '[data-test-subj="events-viewer-panel"] [data-test-subj="TimelineMoreButton"'; -export const RESET_FIELDS = `${EVENTS_VIEWER_PANEL} [data-test-subj="reset-fields"]`; +export const RESET_FIELDS = + '[data-test-subj="events-viewer-panel"] [data-test-subj="reset-fields"]'; export const SERVER_SIDE_EVENT_COUNT = '[data-test-subj="server-side-event-count"]';