From ff44c3274499ce43b20b2eab30bb367c25b4250c Mon Sep 17 00:00:00 2001 From: Angela Chuang Date: Thu, 9 May 2024 19:04:11 +0100 Subject: [PATCH 1/8] add serverlessQA tags --- .../components/stat_items/stat_items.tsx | 2 +- .../cypress/e2e/explore/cases/creation.cy.ts | 2 +- .../e2e/explore/hosts/events_viewer.cy.ts | 2 +- .../e2e/explore/inspect/inspect_button.cy.ts | 98 +++++++++---------- .../e2e/explore/navigation/navigation.cy.ts | 2 +- .../e2e/explore/navigation/search_bar.cy.ts | 4 +- .../e2e/explore/network/hover_actions.cy.ts | 2 +- .../e2e/explore/overview/overview.cy.ts | 2 +- .../e2e/explore/pagination/pagination.cy.ts | 2 +- .../cypress/e2e/explore/urls/not_found.cy.ts | 2 +- .../e2e/explore/users/users_tabs.cy.ts | 2 +- .../cypress/screens/inspect.ts | 8 +- .../cypress/tasks/common.ts | 6 ++ .../cypress/tasks/inspect.ts | 23 +++-- 14 files changed, 80 insertions(+), 77 deletions(-) diff --git a/x-pack/plugins/security_solution/public/explore/components/stat_items/stat_items.tsx b/x-pack/plugins/security_solution/public/explore/components/stat_items/stat_items.tsx index 570ffadca64e7..9d6089c19b7c6 100644 --- a/x-pack/plugins/security_solution/public/explore/components/stat_items/stat_items.tsx +++ b/x-pack/plugins/security_solution/public/explore/components/stat_items/stat_items.tsx @@ -36,7 +36,7 @@ export const StatItemsComponent = React.memo(({ statItems, from, const { isToggleExpanded, onToggle } = useToggleStatus({ id }); return ( - + { +describe('Cases', { tags: ['@ess', '@serverless', '@serverlessQA'] }, () => { beforeEach(() => { deleteTimelines(); deleteCases(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/hosts/events_viewer.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/hosts/events_viewer.cy.ts index bb44394c460ff..f6046c78a028f 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/hosts/events_viewer.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/hosts/events_viewer.cy.ts @@ -47,7 +47,7 @@ const defaultHeadersInDefaultEcsCategory = [ { id: 'destination.ip' }, ]; -describe('Events Viewer', { tags: ['@ess', '@serverless'] }, () => { +describe('Events Viewer', { tags: ['@ess', '@serverless', '@serverlessQA'] }, () => { before(() => { cy.task('esArchiverLoad', { archiveName: 'auditbeat_multiple' }); }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/inspect/inspect_button.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/inspect/inspect_button.cy.ts index 484ef1e9ed475..fb6f8c6af19f7 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/inspect/inspect_button.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/inspect/inspect_button.cy.ts @@ -25,68 +25,64 @@ import { postDataView } from '../../../tasks/api_calls/common'; const DATA_VIEW = 'auditbeat-*'; // FLAKY: https://github.com/elastic/kibana/issues/178367 -describe.skip( - 'Inspect Explore pages', - { tags: ['@ess', '@serverless', '@skipInServerlessMKI'] }, - () => { - before(() => { - // illegal_argument_exception: unknown setting [index.lifecycle.name] - cy.task('esArchiverLoad', { archiveName: 'risk_users' }); - cy.task('esArchiverLoad', { archiveName: 'risk_hosts' }); +describe('Inspect Explore pages', { tags: ['@ess', '@serverless'] }, () => { + before(() => { + // illegal_argument_exception: unknown setting [index.lifecycle.name] + cy.task('esArchiverLoad', { archiveName: 'risk_users' }); + cy.task('esArchiverLoad', { archiveName: 'risk_hosts' }); - login(); - // Create and select data view - postDataView(DATA_VIEW); - }); + login(); + // Create and select data view + postDataView(DATA_VIEW); + }); - after(() => { - cy.task('esArchiverUnload', { archiveName: 'risk_users' }); - cy.task('esArchiverUnload', { archiveName: 'risk_hosts' }); - }); + after(() => { + cy.task('esArchiverUnload', { archiveName: 'risk_users' }); + cy.task('esArchiverUnload', { archiveName: 'risk_hosts' }); + }); - INSPECT_BUTTONS_IN_SECURITY.forEach(({ pageName, url, lensVisualizations, tables }) => { - /** - * Group all tests of a page into one "it" call to improve speed - */ - it(`inspect ${pageName} page`, () => { - login(); + INSPECT_BUTTONS_IN_SECURITY.forEach(({ pageName, url, lensVisualizations, tables }) => { + /** + * Group all tests of a page into one "it" call to improve speed + */ + it(`inspect ${pageName} page`, () => { + login(); - visitWithTimeRange(url, { - visitOptions: { - onLoad: () => { - waitForWelcomePanelToBeLoaded(); - selectDataView(DATA_VIEW); - }, + visitWithTimeRange(url, { + visitOptions: { + onLoad: () => { + waitForWelcomePanelToBeLoaded(); + selectDataView(DATA_VIEW); }, - }); - - lensVisualizations.forEach((lens) => { - cy.log(`inspects the ${lens.title} visualization`); - openTab(lens.tab); - - openLensVisualizationsInspectModal(lens, () => { - cy.get(INSPECT_MODAL).should('be.visible'); - cy.get(INSPECT_MODAL_INDEX_PATTERN).should( - 'contain.text', - lens.customIndexPattern ? lens.customIndexPattern : DATA_VIEW - ); - }); - }); + }, + }); - tables.forEach((table) => { - cy.log(`inspects the ${table.title}`); - openTab(table.tab); + lensVisualizations.forEach((lens) => { + cy.log(`inspects the ${lens.title} visualization`); + openTab(lens.tab); - openTableInspectModal(table); + openLensVisualizationsInspectModal(lens, () => { cy.get(INSPECT_MODAL).should('be.visible'); cy.get(INSPECT_MODAL_INDEX_PATTERN).should( 'contain.text', - table.customIndexPattern ? table.customIndexPattern : DATA_VIEW + lens.customIndexPattern ? lens.customIndexPattern : DATA_VIEW ); - - closesModal(); }); }); + + tables.forEach((table) => { + cy.log(`inspects the ${table.title}`); + openTab(table.tab); + + openTableInspectModal(table); + cy.get(INSPECT_MODAL).should('be.visible'); + cy.get(INSPECT_MODAL_INDEX_PATTERN).should( + 'contain.text', + table.customIndexPattern ? table.customIndexPattern : DATA_VIEW + ); + + closesModal(); + }); }); - } -); + }); +}); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/navigation.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/navigation.cy.ts index 70ecbc771eb3a..e29c2f63205bc 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/navigation.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/navigation.cy.ts @@ -265,7 +265,7 @@ describe('Kibana navigation to all pages in the Security app ', { tags: '@ess' } }); }); -describe('Serverless side navigation links', { tags: '@serverless' }, () => { +describe('Serverless side navigation links', { tags: ['@serverless', '@serverlessQA'] }, () => { beforeEach(() => { login(); visitGetStartedPage(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/search_bar.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/search_bar.cy.ts index c11878fcc4916..9637071a91310 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/search_bar.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/search_bar.cy.ts @@ -22,13 +22,15 @@ import { getHostIpFilter } from '../../../objects/filter'; import { hostsUrl } from '../../../urls/navigation'; import { waitForAllHostsToBeLoaded } from '../../../tasks/hosts/all_hosts'; +import { waitForPageToBeLoaded } from '../../../tasks/common'; // Failing: See https://github.com/elastic/kibana/issues/182932 -describe.skip('SearchBar', { tags: ['@ess', '@serverless'] }, () => { +describe('SearchBar', { tags: ['@ess', '@serverless'] }, () => { beforeEach(() => { login(); visitWithTimeRange(hostsUrl('allHosts')); waitForAllHostsToBeLoaded(); + waitForPageToBeLoaded(); }); it('adds correctly a filter to the global search bar', () => { diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/network/hover_actions.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/network/hover_actions.cy.ts index 7d6ab6abdb8be..d055b73046645 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/network/hover_actions.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/network/hover_actions.cy.ts @@ -25,7 +25,7 @@ import { openTimelineUsingToggle } from '../../../tasks/security_main'; const testDomain = 'myTest'; -describe('Hover actions', { tags: ['@ess', '@serverless'] }, () => { +describe('Hover actions', { tags: ['@ess', '@serverless', '@serverlessQA'] }, () => { const onBeforeLoadCallback = (win: Cypress.AUTWindow) => { // avoid cypress being held by windows prompt and timeout cy.stub(win, 'prompt').returns(true); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/overview/overview.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/overview/overview.cy.ts index 78135fbd77235..2846be1c71032 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/overview/overview.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/overview/overview.cy.ts @@ -18,7 +18,7 @@ import { getTimeline } from '../../../objects/timeline'; const mockTimeline = getTimeline(); -describe('Overview Page', { tags: ['@ess', '@serverless'] }, () => { +describe('Overview Page', { tags: ['@ess', '@serverless', '@serverlessQA'] }, () => { before(() => { cy.task('esArchiverLoad', { archiveName: 'overview' }); }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/pagination/pagination.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/pagination/pagination.cy.ts index 37da9553b02a0..2371081c8c449 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/pagination/pagination.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/pagination/pagination.cy.ts @@ -22,7 +22,7 @@ import { ALL_USERS_TABLE } from '../../../screens/users/all_users'; import { goToTablePage, sortFirstTableColumn } from '../../../tasks/table_pagination'; // FLAKY: https://github.com/elastic/kibana/issues/165968 -describe('Pagination', { tags: ['@ess', '@serverless'] }, () => { +describe('Pagination', { tags: ['@ess', '@serverless', '@serverlessQA'] }, () => { describe('Host uncommon processes table)', () => { before(() => { cy.task('esArchiverLoad', { archiveName: 'host_uncommon_processes' }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/urls/not_found.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/urls/not_found.cy.ts index 205832fd0eaf7..a74bf833242cb 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/urls/not_found.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/urls/not_found.cy.ts @@ -25,7 +25,7 @@ import { editRuleUrl } from '../../../urls/edit_rule'; const mockRuleId = '5a4a0460-d822-11eb-8962-bfd4aff0a9b3'; -describe('Display not found page', { tags: ['@ess', '@serverless'] }, () => { +describe('Display not found page', { tags: ['@ess', '@serverless', '@serverlessQA'] }, () => { beforeEach(() => { login(); visitWithTimeRange(TIMELINES_URL); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/users/users_tabs.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/users/users_tabs.cy.ts index 83321290917cd..a1ed3e3f62038 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/users/users_tabs.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/users/users_tabs.cy.ts @@ -20,7 +20,7 @@ import { visitUserDetailsPage, visitWithTimeRange } from '../../../tasks/navigat import { usersUrl } from '../../../urls/navigation'; import { waitForTabToBeLoaded } from '../../../tasks/common'; -describe('Users stats and tables', { tags: ['@ess', '@serverless'] }, () => { +describe('Users stats and tables', { tags: ['@ess', '@serverless', '@serverlessQA'] }, () => { before(() => { cy.task('esArchiverLoad', { archiveName: 'users' }); diff --git a/x-pack/test/security_solution_cypress/cypress/screens/inspect.ts b/x-pack/test/security_solution_cypress/cypress/screens/inspect.ts index 083e9d2dd2517..d24a086a93201 100644 --- a/x-pack/test/security_solution_cypress/cypress/screens/inspect.ts +++ b/x-pack/test/security_solution_cypress/cypress/screens/inspect.ts @@ -238,25 +238,25 @@ export const INSPECT_BUTTONS_IN_SECURITY: InspectButtonMetadata[] = [ { title: 'User authentications', panelSelector: AUTHENTICATION_VISUALIZATION, - embeddableId: 'usersKpiAuthenticationsQuery-authenticationsSuccess-metric-embeddable', + embeddableId: 'usersKpiAuthentications-authenticationsSuccess-metric-embeddable', tab: ALL_USERS_TAB, }, { title: 'User authentications', panelSelector: AUTHENTICATION_VISUALIZATION, - embeddableId: 'usersKpiAuthenticationsQuery-authenticationsFailure-metric-embeddable', + embeddableId: 'usersKpiAuthentications-authenticationsFailure-metric-embeddable', tab: ALL_USERS_TAB, }, { title: 'User authentications', panelSelector: AUTHENTICATION_VISUALIZATION, - embeddableId: 'usersKpiAuthenticationsQuery-bar-embeddable', + embeddableId: 'usersKpiAuthentications-bar-embeddable', tab: ALL_USERS_TAB, }, { title: 'User authentications', panelSelector: AUTHENTICATION_VISUALIZATION, - embeddableId: 'usersKpiAuthenticationsQuery-area-embeddable', + embeddableId: 'usersKpiAuthentications-area-embeddable', tab: ALL_USERS_TAB, }, { diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/common.ts b/x-pack/test/security_solution_cypress/cypress/tasks/common.ts index ff0bbac6866cd..cfa2f875b3362 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/common.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/common.ts @@ -8,6 +8,7 @@ import { recurse } from 'cypress-recurse'; import { KIBANA_LOADING_ICON } from '../screens/security_header'; import { EUI_BASIC_TABLE_LOADING } from '../screens/common/controls'; +import { PAGE_CONTENT_SPINNER } from '../screens/common/page'; const primaryButton = 0; @@ -92,3 +93,8 @@ export const waitForTabToBeLoaded = (tabId: string) => { } ); }; + +export const waitForPageToBeLoaded = () => { + cy.get(PAGE_CONTENT_SPINNER).should('be.visible'); + cy.get(PAGE_CONTENT_SPINNER).should('not.exist'); +}; diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/inspect.ts b/x-pack/test/security_solution_cypress/cypress/tasks/inspect.ts index c100de3112606..94c0b12909961 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/inspect.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/inspect.ts @@ -39,21 +39,20 @@ export const openLensVisualizationsInspectModal = ( { panelSelector, embeddableId, tab }: InspectLensVisualizationsMetadata, onOpen: () => void ) => { - cy.get(panelSelector) - .get(`[data-test-embeddable-id="${embeddableId}"]`) - .each(($el) => { - // wait for visualization to load - if ($el.find(LOADER_ARIA).length > 0) { - cy.get(LOADER_ARIA).should('not.exist'); - } + cy.get(`${panelSelector} [data-test-embeddable-id="${embeddableId}"]`).within(($el) => { + // wait for visualization to load + if ($el.find(LOADER_ARIA).length > 0) { + cy.get(LOADER_ARIA).should('not.exist'); + } + + cy.wrap($el).get(EMBEDDABLE_PANEL_TOGGLE_ICON).click(); + }); - cy.wrap($el).find(EMBEDDABLE_PANEL_TOGGLE_ICON).click(); - cy.get(EMBEDDABLE_PANEL_INSPECT).click(); + cy.get(EMBEDDABLE_PANEL_INSPECT).click(); - onOpen(); + onOpen(); - closesModal(); - }); + closesModal(); }; export const openTab = (tab: string) => { From 99dedc9fe75a5b4037d4c15d3190a5a3b568162c Mon Sep 17 00:00:00 2001 From: Angela Chuang Date: Fri, 10 May 2024 15:25:25 +0100 Subject: [PATCH 2/8] wait for saved query loaded --- .../cypress/e2e/explore/navigation/search_bar.cy.ts | 2 ++ .../security_solution_cypress/cypress/tasks/search_bar.ts | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/search_bar.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/search_bar.cy.ts index 9637071a91310..3f804710f66e2 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/search_bar.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/search_bar.cy.ts @@ -12,6 +12,7 @@ import { fillAddFilterForm, openKqlQueryBar, fillKqlQueryBar, + waitForSavedQueryLoaded, } from '../../../tasks/search_bar'; import { AUTO_SUGGEST_AGENT_NAME, @@ -31,6 +32,7 @@ describe('SearchBar', { tags: ['@ess', '@serverless'] }, () => { visitWithTimeRange(hostsUrl('allHosts')); waitForAllHostsToBeLoaded(); waitForPageToBeLoaded(); + waitForSavedQueryLoaded(); }); it('adds correctly a filter to the global search bar', () => { diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/search_bar.ts b/x-pack/test/security_solution_cypress/cypress/tasks/search_bar.ts index b1849738677a6..3949aaf9a62f0 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/search_bar.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/search_bar.ts @@ -21,6 +21,10 @@ import { EDIT_AS_QUERY_DSL, KIBANA_CODE_EDITOR, } from '../screens/search_bar'; +export const waitForSavedQueryLoaded = () => { + cy.intercept({ method: 'GET', url: '/internal/saved_query/_count' }).as('savedQuery'); + cy.wait(['@savedQuery']); +}; export const openAddFilterPopover = () => { cy.get(GLOBAL_SEARCH_BAR_SUBMIT_BUTTON).should('be.enabled'); From 89be722375f097afb52c8ae39fa11d6aa75e1611 Mon Sep 17 00:00:00 2001 From: Angela Chuang Date: Wed, 15 May 2024 14:52:23 +0100 Subject: [PATCH 3/8] search_bar --- .../cypress/e2e/explore/navigation/search_bar.cy.ts | 4 ++-- .../security_solution_cypress/cypress/tasks/search_bar.ts | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/search_bar.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/search_bar.cy.ts index 3f804710f66e2..412f5b1b32b93 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/search_bar.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/search_bar.cy.ts @@ -12,7 +12,6 @@ import { fillAddFilterForm, openKqlQueryBar, fillKqlQueryBar, - waitForSavedQueryLoaded, } from '../../../tasks/search_bar'; import { AUTO_SUGGEST_AGENT_NAME, @@ -24,6 +23,7 @@ import { getHostIpFilter } from '../../../objects/filter'; import { hostsUrl } from '../../../urls/navigation'; import { waitForAllHostsToBeLoaded } from '../../../tasks/hosts/all_hosts'; import { waitForPageToBeLoaded } from '../../../tasks/common'; +import { LOADING_INDICATOR } from '../../../screens/security_header'; // Failing: See https://github.com/elastic/kibana/issues/182932 describe('SearchBar', { tags: ['@ess', '@serverless'] }, () => { @@ -32,7 +32,7 @@ describe('SearchBar', { tags: ['@ess', '@serverless'] }, () => { visitWithTimeRange(hostsUrl('allHosts')); waitForAllHostsToBeLoaded(); waitForPageToBeLoaded(); - waitForSavedQueryLoaded(); + cy.get(LOADING_INDICATOR).should('not.exist'); }); it('adds correctly a filter to the global search bar', () => { diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/search_bar.ts b/x-pack/test/security_solution_cypress/cypress/tasks/search_bar.ts index 28a17ad0199e5..2ac369e61b68d 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/search_bar.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/search_bar.ts @@ -21,10 +21,6 @@ import { EDIT_AS_QUERY_DSL, KIBANA_CODE_EDITOR, } from '../screens/search_bar'; -export const waitForSavedQueryLoaded = () => { - cy.intercept({ method: 'GET', url: '/internal/saved_query/_count' }).as('savedQuery'); - cy.wait(['@savedQuery']); -}; export const openAddFilterPopover = () => { cy.get(GLOBAL_SEARCH_BAR_SUBMIT_BUTTON).should('be.enabled'); From 63fa25773f5ab39586be3bda815c492760b43074 Mon Sep 17 00:00:00 2001 From: Angela Chuang Date: Thu, 16 May 2024 10:12:44 +0100 Subject: [PATCH 4/8] update serverless mki test cases --- .../cypress/e2e/explore/urls/not_found.cy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/urls/not_found.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/urls/not_found.cy.ts index a74bf833242cb..205832fd0eaf7 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/urls/not_found.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/urls/not_found.cy.ts @@ -25,7 +25,7 @@ import { editRuleUrl } from '../../../urls/edit_rule'; const mockRuleId = '5a4a0460-d822-11eb-8962-bfd4aff0a9b3'; -describe('Display not found page', { tags: ['@ess', '@serverless', '@serverlessQA'] }, () => { +describe('Display not found page', { tags: ['@ess', '@serverless'] }, () => { beforeEach(() => { login(); visitWithTimeRange(TIMELINES_URL); From d40f7eced8d4ea097b47640892417fa2a6b40114 Mon Sep 17 00:00:00 2001 From: Angela Chuang Date: Tue, 21 May 2024 11:58:38 +0100 Subject: [PATCH 5/8] code review --- .../cypress/e2e/explore/inspect/inspect_button.cy.ts | 1 - .../cypress/e2e/explore/navigation/search_bar.cy.ts | 3 --- .../cypress/e2e/explore/pagination/pagination.cy.ts | 1 - x-pack/test/security_solution_cypress/cypress/tasks/common.ts | 4 +++- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/inspect/inspect_button.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/inspect/inspect_button.cy.ts index fb6f8c6af19f7..ce8ffa2cc8447 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/inspect/inspect_button.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/inspect/inspect_button.cy.ts @@ -24,7 +24,6 @@ import { postDataView } from '../../../tasks/api_calls/common'; const DATA_VIEW = 'auditbeat-*'; -// FLAKY: https://github.com/elastic/kibana/issues/178367 describe('Inspect Explore pages', { tags: ['@ess', '@serverless'] }, () => { before(() => { // illegal_argument_exception: unknown setting [index.lifecycle.name] diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/search_bar.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/search_bar.cy.ts index 412f5b1b32b93..eb38fd2c759a5 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/search_bar.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/search_bar.cy.ts @@ -23,16 +23,13 @@ import { getHostIpFilter } from '../../../objects/filter'; import { hostsUrl } from '../../../urls/navigation'; import { waitForAllHostsToBeLoaded } from '../../../tasks/hosts/all_hosts'; import { waitForPageToBeLoaded } from '../../../tasks/common'; -import { LOADING_INDICATOR } from '../../../screens/security_header'; -// Failing: See https://github.com/elastic/kibana/issues/182932 describe('SearchBar', { tags: ['@ess', '@serverless'] }, () => { beforeEach(() => { login(); visitWithTimeRange(hostsUrl('allHosts')); waitForAllHostsToBeLoaded(); waitForPageToBeLoaded(); - cy.get(LOADING_INDICATOR).should('not.exist'); }); it('adds correctly a filter to the global search bar', () => { diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/pagination/pagination.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/pagination/pagination.cy.ts index 2371081c8c449..be7bf91251de9 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/pagination/pagination.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/pagination/pagination.cy.ts @@ -21,7 +21,6 @@ import { ALL_HOSTS_TABLE } from '../../../screens/hosts/all_hosts'; import { ALL_USERS_TABLE } from '../../../screens/users/all_users'; import { goToTablePage, sortFirstTableColumn } from '../../../tasks/table_pagination'; -// FLAKY: https://github.com/elastic/kibana/issues/165968 describe('Pagination', { tags: ['@ess', '@serverless', '@serverlessQA'] }, () => { describe('Host uncommon processes table)', () => { before(() => { diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/common.ts b/x-pack/test/security_solution_cypress/cypress/tasks/common.ts index cfa2f875b3362..2ce77e823d846 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/common.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/common.ts @@ -6,7 +6,7 @@ */ import { recurse } from 'cypress-recurse'; -import { KIBANA_LOADING_ICON } from '../screens/security_header'; +import { KIBANA_LOADING_ICON, LOADING_INDICATOR } from '../screens/security_header'; import { EUI_BASIC_TABLE_LOADING } from '../screens/common/controls'; import { PAGE_CONTENT_SPINNER } from '../screens/common/page'; @@ -97,4 +97,6 @@ export const waitForTabToBeLoaded = (tabId: string) => { export const waitForPageToBeLoaded = () => { cy.get(PAGE_CONTENT_SPINNER).should('be.visible'); cy.get(PAGE_CONTENT_SPINNER).should('not.exist'); + cy.get(LOADING_INDICATOR).should('be.visible'); + cy.get(LOADING_INDICATOR).should('not.exist'); }; From fd8a05649d2aa5ffed7d96826f343624cef2093d Mon Sep 17 00:00:00 2001 From: Angela Chuang <6295984+angorayc@users.noreply.github.com> Date: Tue, 21 May 2024 14:33:53 +0100 Subject: [PATCH 6/8] Update x-pack/test/security_solution_cypress/cypress/tasks/common.ts Co-authored-by: Sergi Massaneda --- x-pack/test/security_solution_cypress/cypress/tasks/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/common.ts b/x-pack/test/security_solution_cypress/cypress/tasks/common.ts index 2ce77e823d846..21f10a9f35431 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/common.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/common.ts @@ -96,7 +96,7 @@ export const waitForTabToBeLoaded = (tabId: string) => { export const waitForPageToBeLoaded = () => { cy.get(PAGE_CONTENT_SPINNER).should('be.visible'); - cy.get(PAGE_CONTENT_SPINNER).should('not.exist'); cy.get(LOADING_INDICATOR).should('be.visible'); + cy.get(PAGE_CONTENT_SPINNER).should('not.exist'); cy.get(LOADING_INDICATOR).should('not.exist'); }; From 3327c309c1a1a4809e49eb83093899cf51f320ab Mon Sep 17 00:00:00 2001 From: Angela Chuang Date: Wed, 22 May 2024 09:45:47 +0100 Subject: [PATCH 7/8] waitForSavedQueryLoaded --- .../cypress/e2e/explore/navigation/search_bar.cy.ts | 2 ++ .../test/security_solution_cypress/cypress/tasks/common.ts | 2 -- .../security_solution_cypress/cypress/tasks/search_bar.ts | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/search_bar.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/search_bar.cy.ts index eb38fd2c759a5..06aa2974d9528 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/search_bar.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/navigation/search_bar.cy.ts @@ -12,6 +12,7 @@ import { fillAddFilterForm, openKqlQueryBar, fillKqlQueryBar, + waitForSavedQueryLoaded, } from '../../../tasks/search_bar'; import { AUTO_SUGGEST_AGENT_NAME, @@ -30,6 +31,7 @@ describe('SearchBar', { tags: ['@ess', '@serverless'] }, () => { visitWithTimeRange(hostsUrl('allHosts')); waitForAllHostsToBeLoaded(); waitForPageToBeLoaded(); + waitForSavedQueryLoaded(); }); it('adds correctly a filter to the global search bar', () => { diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/common.ts b/x-pack/test/security_solution_cypress/cypress/tasks/common.ts index 21f10a9f35431..5ebf137c51ad9 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/common.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/common.ts @@ -96,7 +96,5 @@ export const waitForTabToBeLoaded = (tabId: string) => { export const waitForPageToBeLoaded = () => { cy.get(PAGE_CONTENT_SPINNER).should('be.visible'); - cy.get(LOADING_INDICATOR).should('be.visible'); cy.get(PAGE_CONTENT_SPINNER).should('not.exist'); - cy.get(LOADING_INDICATOR).should('not.exist'); }; diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/search_bar.ts b/x-pack/test/security_solution_cypress/cypress/tasks/search_bar.ts index 2ac369e61b68d..ce0a4a992423f 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/search_bar.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/search_bar.ts @@ -21,6 +21,7 @@ import { EDIT_AS_QUERY_DSL, KIBANA_CODE_EDITOR, } from '../screens/search_bar'; +import { LOADING_INDICATOR } from '../screens/security_header'; export const openAddFilterPopover = () => { cy.get(GLOBAL_SEARCH_BAR_SUBMIT_BUTTON).should('be.enabled'); @@ -86,3 +87,7 @@ export const fillAddFilterFormAsQueryDSL = (query: string) => { cy.get(ADD_FILTER_FORM_SAVE_BUTTON).click(); cy.get(ADD_FILTER_FORM_SAVE_BUTTON).should('not.exist'); }; + +export const waitForSavedQueryLoaded = () => { + cy.get(LOADING_INDICATOR).should('not.exist'); +}; From 40e3fd19cfc6ac2f15feec37a05e650a9012a1bf Mon Sep 17 00:00:00 2001 From: Angela Chuang Date: Wed, 22 May 2024 09:51:45 +0100 Subject: [PATCH 8/8] rm unused import --- x-pack/test/security_solution_cypress/cypress/tasks/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/common.ts b/x-pack/test/security_solution_cypress/cypress/tasks/common.ts index 5ebf137c51ad9..cfa2f875b3362 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/common.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/common.ts @@ -6,7 +6,7 @@ */ import { recurse } from 'cypress-recurse'; -import { KIBANA_LOADING_ICON, LOADING_INDICATOR } from '../screens/security_header'; +import { KIBANA_LOADING_ICON } from '../screens/security_header'; import { EUI_BASIC_TABLE_LOADING } from '../screens/common/controls'; import { PAGE_CONTENT_SPINNER } from '../screens/common/page';