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..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,69 +24,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..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, @@ -22,13 +23,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(); + waitForSavedQueryLoaded(); }); 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..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,8 +21,7 @@ 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'] }, () => { +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/users/users_tabs.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/users/users_tabs.cy.ts index 1a563156415ab..3d11cd4f05f81 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) => { 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'); +};