From 83b9302534c6200c63ab1be408ec1f59c6876027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Fern=C3=A1ndez=20Haro?= Date: Tue, 3 Oct 2023 14:20:30 +0200 Subject: [PATCH 01/11] [Serverless Tests] Use public headers for the public telemetry config endpoint (#167860) --- .../test_suites/search/telemetry/telemetry_config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/test_serverless/api_integration/test_suites/search/telemetry/telemetry_config.ts b/x-pack/test_serverless/api_integration/test_suites/search/telemetry/telemetry_config.ts index 381c2aa0f5cae..8df4bae9df5a0 100644 --- a/x-pack/test_serverless/api_integration/test_suites/search/telemetry/telemetry_config.ts +++ b/x-pack/test_serverless/api_integration/test_suites/search/telemetry/telemetry_config.ts @@ -25,7 +25,7 @@ export default function telemetryConfigTest({ getService }: FtrProviderContext) it('GET should get the default config', async () => { await supertest .get('/api/telemetry/v2/config') - .set(svlCommonApi.getInternalRequestHeader()) + .set(svlCommonApi.getCommonRequestHeader()) .expect(200, baseConfig); }); @@ -39,7 +39,7 @@ export default function telemetryConfigTest({ getService }: FtrProviderContext) await supertest .get('/api/telemetry/v2/config') - .set(svlCommonApi.getInternalRequestHeader()) + .set(svlCommonApi.getCommonRequestHeader()) .expect(200, { ...baseConfig, labels: { From 8d9e12a19bf02e2fb2ed2fda48a2b6fbcfa89be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?= Date: Tue, 3 Oct 2023 14:33:13 +0200 Subject: [PATCH 02/11] [Enterprise Search] Update connector tiles (#167656) ## Summary - Update Integration Tiles - Update Select Connector Tiles - GitHub, OneDrive, Google Drive to native connectors Screenshot 2023-09-29 at 16 38 08 Screenshot 2023-09-29 at 16 38 13 Screenshot 2023-09-29 at 16 38 25 Screenshot 2023-09-29 at 16 38 44 Screenshot 2023-09-29 at 16 38 51 ### Checklist Delete any items that are not applicable to this PR. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [x] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [x] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- packages/kbn-doc-links/src/get_doc_links.ts | 4 + packages/kbn-doc-links/src/types.ts | 4 + packages/kbn-search-connectors/connectors.ts | 50 ++- .../types/native_connectors.ts | 425 ++++++++++++++++++ .../apis/custom_integration/integrations.ts | 2 +- .../search_index/connector/constants.ts | 28 ++ .../shared/doc_links/doc_links.ts | 12 + .../shared/icons/connector_icons.ts | 8 + .../public/assets/source_icons/outlook.svg | 39 ++ .../public/assets/source_icons/teams.svg | 28 ++ .../public/assets/source_icons/zoom.svg | 16 + .../enterprise_search/server/integrations.ts | 180 +++++--- .../translations/translations/fr-FR.json | 4 - .../translations/translations/ja-JP.json | 4 - .../translations/translations/zh-CN.json | 4 - 15 files changed, 737 insertions(+), 71 deletions(-) create mode 100644 x-pack/plugins/enterprise_search/public/assets/source_icons/outlook.svg create mode 100644 x-pack/plugins/enterprise_search/public/assets/source_icons/teams.svg create mode 100644 x-pack/plugins/enterprise_search/public/assets/source_icons/zoom.svg diff --git a/packages/kbn-doc-links/src/get_doc_links.ts b/packages/kbn-doc-links/src/get_doc_links.ts index ca81f5554ded8..eb0863811ae8c 100644 --- a/packages/kbn-doc-links/src/get_doc_links.ts +++ b/packages/kbn-doc-links/src/get_doc_links.ts @@ -141,6 +141,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => { configuration: `${ENTERPRISE_SEARCH_DOCS}configuration.html`, connectors: `${ENTERPRISE_SEARCH_DOCS}connectors.html`, connectorsAzureBlobStorage: `${ENTERPRISE_SEARCH_DOCS}connectors-azure-blob.html`, + connectorsBox: `${ENTERPRISE_SEARCH_DOCS}connectors-box.html`, connectorsClients: `${ENTERPRISE_SEARCH_DOCS}connectors.html#connectors-build`, connectorsConfluence: `${ENTERPRISE_SEARCH_DOCS}connectors-confluence.html`, connectorsDropbox: `${ENTERPRISE_SEARCH_DOCS}connectors-dropbox.html`, @@ -157,6 +158,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => { connectorsNetworkDrive: `${ENTERPRISE_SEARCH_DOCS}connectors-network-drive.html`, connectorsOneDrive: `${ENTERPRISE_SEARCH_DOCS}connectors-onedrive.html`, connectorsOracle: `${ENTERPRISE_SEARCH_DOCS}connectors-oracle.html`, + connectorsOutlook: `${ENTERPRISE_SEARCH_DOCS}connectors-outlook.html`, connectorsPostgreSQL: `${ENTERPRISE_SEARCH_DOCS}connectors-postgresql.html`, connectorsS3: `${ENTERPRISE_SEARCH_DOCS}connectors-s3.html`, connectorsSalesforce: `${ENTERPRISE_SEARCH_DOCS}connectors-salesforce.html`, @@ -164,7 +166,9 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => { connectorsSharepoint: `${ENTERPRISE_SEARCH_DOCS}connectors-sharepoint.html`, connectorsSharepointOnline: `${ENTERPRISE_SEARCH_DOCS}connectors-sharepoint-online.html`, connectorsSlack: `${ENTERPRISE_SEARCH_DOCS}connectors-slack.html`, + connectorsTeams: `${ENTERPRISE_SEARCH_DOCS}connectors-teams.html`, connectorsWorkplaceSearch: `${ENTERPRISE_SEARCH_DOCS}workplace-search-connectors.html`, + connectorsZoom: `${ENTERPRISE_SEARCH_DOCS}connectors-zoom.html`, crawlerExtractionRules: `${ENTERPRISE_SEARCH_DOCS}crawler-extraction-rules.html`, crawlerManaging: `${ENTERPRISE_SEARCH_DOCS}crawler-managing.html`, crawlerOverview: `${ENTERPRISE_SEARCH_DOCS}crawler.html`, diff --git a/packages/kbn-doc-links/src/types.ts b/packages/kbn-doc-links/src/types.ts index 39209b0675e9b..8b1a8866b47d4 100644 --- a/packages/kbn-doc-links/src/types.ts +++ b/packages/kbn-doc-links/src/types.ts @@ -122,6 +122,7 @@ export interface DocLinks { readonly configuration: string; readonly connectors: string; readonly connectorsAzureBlobStorage: string; + readonly connectorsBox: string; readonly connectorsClients: string; readonly connectorsConfluence: string; readonly connectorsContentExtraction: string; @@ -138,14 +139,17 @@ export interface DocLinks { readonly connectorsNetworkDrive: string; readonly connectorsOneDrive: string; readonly connectorsOracle: string; + readonly connectorsOutlook: string; readonly connectorsPostgreSQL: string; readonly connectorsS3: string; readonly connectorsSalesforce: string; readonly connectorsServiceNow: string; readonly connectorsSharepoint: string; readonly connectorsSharepointOnline: string; + readonly connectorsTeams: string; readonly connectorsSlack: string; readonly connectorsWorkplaceSearch: string; + readonly connectorsZoom: string; readonly crawlerExtractionRules: string; readonly crawlerManaging: string; readonly crawlerOverview: string; diff --git a/packages/kbn-search-connectors/connectors.ts b/packages/kbn-search-connectors/connectors.ts index 119de69a0c5c0..9673af86e14d9 100644 --- a/packages/kbn-search-connectors/connectors.ts +++ b/packages/kbn-search-connectors/connectors.ts @@ -67,7 +67,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [ { iconPath: 'github.svg', isBeta: true, - isNative: false, + isNative: true, keywords: ['github', 'cloud', 'connector'], name: i18n.translate('searchConnectors.content.nativeConnectors.github.name', { defaultMessage: 'GitHub & GitHub Enterprise Server', @@ -87,7 +87,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [ { iconPath: 'google_drive.svg', isBeta: true, - isNative: false, + isNative: true, keywords: ['google', 'drive', 'connector'], name: i18n.translate('searchConnectors.content.nativeConnectors.googleDrive.name', { defaultMessage: 'Google Drive', @@ -201,7 +201,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [ { iconPath: 'onedrive.svg', isBeta: true, - isNative: false, + isNative: true, keywords: ['network', 'drive', 'file', 'connector'], name: i18n.translate('searchConnectors.content.nativeConnectors.oneDrive.name', { defaultMessage: 'OneDrive', @@ -240,6 +240,50 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [ }), serviceType: 'sharepoint_server', }, + { + iconPath: 'box.svg', + isBeta: false, + isNative: false, + isTechPreview: true, + keywords: ['cloud', 'box'], + name: i18n.translate('searchConnectors.content.nativeConnectors.box.name', { + defaultMessage: 'Box', + }), + serviceType: 'box', + }, + { + iconPath: 'outlook.svg', + isBeta: false, + isNative: false, + isTechPreview: true, + keywords: ['outlook', 'connector'], + name: i18n.translate('searchConnectors.content.nativeConnectors.outlook.name', { + defaultMessage: 'Outlook', + }), + serviceType: 'outlook', + }, + { + iconPath: 'teams.svg', + isBeta: false, + isNative: false, + isTechPreview: true, + keywords: ['teams', 'connector'], + name: i18n.translate('searchConnectors.content.nativeConnectors.teams.name', { + defaultMessage: 'Teams', + }), + serviceType: 'teams', + }, + { + iconPath: 'zoom.svg', + isBeta: false, + isNative: false, + isTechPreview: true, + keywords: ['zoom', 'connector'], + name: i18n.translate('searchConnectors.content.nativeConnectors.zoom.name', { + defaultMessage: 'Zoom', + }), + serviceType: 'zoom', + }, { iconPath: 'custom.svg', isBeta: true, diff --git a/packages/kbn-search-connectors/types/native_connectors.ts b/packages/kbn-search-connectors/types/native_connectors.ts index 1c4b0bb7e1694..a69036fc7c0e8 100644 --- a/packages/kbn-search-connectors/types/native_connectors.ts +++ b/packages/kbn-search-connectors/types/native_connectors.ts @@ -66,6 +66,21 @@ const USE_TEXT_EXTRACTION_SERVICE_TOOLTIP = i18n.translate( } ); +const ENABLE_DOCUMENT_LEVEL_SECURITY_LABEL = i18n.translate( + 'searchConnectors.nativeConnectors.enableDLS.label', + { + defaultMessage: 'Enable document level security', + } +); + +const ENABLE_DOCUMENT_LEVEL_SECURITY_TOOLTIP = i18n.translate( + 'searchConnectors.nativeConnectors.enableDLS.tooltip', + { + defaultMessage: + 'Document level security ensures identities and permissions set in Google Drive are maintained in Elasticsearch. This enables you to restrict and personalize read-access users and groups have to documents in this index. Access control syncs ensure this metadata is kept up to date in your Elasticsearch documents.', + } +); + const DATABASE_LABEL = i18n.translate('searchConnectors.nativeConnectors.databaseLabel', { defaultMessage: 'Database', }); @@ -576,6 +591,291 @@ export const NATIVE_CONNECTOR_DEFINITIONS: Record c.id === 'sample_data_all')).to.be.above( diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/constants.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/constants.ts index 16ec910581086..d2797ea0b2abd 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/constants.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/constants.ts @@ -22,6 +22,13 @@ export const CONNECTORS_DICT: Record = { externalDocsUrl: 'https://learn.microsoft.com/azure/storage/blobs/', icon: CONNECTOR_ICONS.azure_blob_storage, }, + box: { + docsUrl: docLinks.connectorsBox, + externalAuthDocsUrl: '', + externalDocsUrl: '', + icon: CONNECTOR_ICONS.box, + platinumOnly: true, + }, confluence: { docsUrl: docLinks.connectorsConfluence, externalAuthDocsUrl: '', @@ -114,6 +121,13 @@ export const CONNECTORS_DICT: Record = { externalDocsUrl: 'https://docs.oracle.com/database/oracle/oracle-database/', icon: CONNECTOR_ICONS.oracle, }, + outlook: { + docsUrl: docLinks.connectorsOutlook, + externalAuthDocsUrl: '', + externalDocsUrl: '', + icon: CONNECTOR_ICONS.outlook, + platinumOnly: true, + }, postgresql: { docsUrl: docLinks.connectorsPostgreSQL, externalAuthDocsUrl: 'https://www.postgresql.org/docs/15/auth-methods.html', @@ -160,6 +174,20 @@ export const CONNECTORS_DICT: Record = { icon: CONNECTOR_ICONS.slack, platinumOnly: true, }, + teams: { + docsUrl: docLinks.connectorsTeams, + externalAuthDocsUrl: '', + externalDocsUrl: '', + icon: CONNECTOR_ICONS.teams, + platinumOnly: true, + }, + zoom: { + docsUrl: docLinks.connectorsZoom, + externalAuthDocsUrl: '', + externalDocsUrl: '', + icon: CONNECTOR_ICONS.zoom, + platinumOnly: true, + }, }; export const CONNECTORS = CONNECTOR_DEFINITIONS.map((connector) => ({ diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.ts b/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.ts index 11e93c7af3a29..f84be1ad660b3 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.ts @@ -65,6 +65,7 @@ class DocLinks { public cloudIndexManagement: string; public connectors: string; public connectorsAzureBlobStorage: string; + public connectorsBox: string; public connectorsClients: string; public connectorsConfluence: string; public connectorsContentExtraction: string; @@ -81,6 +82,7 @@ class DocLinks { public connectorsNetworkDrive: string; public connectorsOneDrive: string; public connectorsOracle: string; + public connectorsOutlook: string; public connectorsPostgreSQL: string; public connectorsS3: string; public connectorsSalesforce: string; @@ -88,6 +90,8 @@ class DocLinks { public connectorsSharepoint: string; public connectorsSharepointOnline: string; public connectorsSlack: string; + public connectorsTeams: string; + public connectorsZoom: string; public connectorsWorkplaceSearch: string; public consoleGuide: string; public crawlerExtractionRules: string; @@ -229,6 +233,7 @@ class DocLinks { this.cloudIndexManagement = ''; this.connectors = ''; this.connectorsAzureBlobStorage = ''; + this.connectorsBox = ''; this.connectorsConfluence = ''; this.connectorsContentExtraction = ''; this.connectorsClients = ''; @@ -245,6 +250,7 @@ class DocLinks { this.connectorsNetworkDrive = ''; this.connectorsOneDrive = ''; this.connectorsOracle = ''; + this.connectorsOutlook = ''; this.connectorsPostgreSQL = ''; this.connectorsS3 = ''; this.connectorsSalesforce = ''; @@ -252,6 +258,8 @@ class DocLinks { this.connectorsSharepoint = ''; this.connectorsSharepointOnline = ''; this.connectorsSlack = ''; + this.connectorsTeams = ''; + this.connectorsZoom = ''; this.connectorsWorkplaceSearch = ''; this.consoleGuide = ''; this.crawlerExtractionRules = ''; @@ -394,6 +402,7 @@ class DocLinks { this.cloudIndexManagement = docLinks.links.cloud.indexManagement; this.connectors = docLinks.links.enterpriseSearch.connectors; this.connectorsAzureBlobStorage = docLinks.links.enterpriseSearch.connectorsAzureBlobStorage; + this.connectorsBox = docLinks.links.enterpriseSearch.connectorsBox; this.connectorsConfluence = docLinks.links.enterpriseSearch.connectorsConfluence; this.connectorsContentExtraction = docLinks.links.enterpriseSearch.connectorsContentExtraction; this.connectorsClients = docLinks.links.enterpriseSearch.connectorsClients; @@ -410,6 +419,7 @@ class DocLinks { this.connectorsNative = docLinks.links.enterpriseSearch.connectorsNative; this.connectorsNetworkDrive = docLinks.links.enterpriseSearch.connectorsNetworkDrive; this.connectorsOracle = docLinks.links.enterpriseSearch.connectorsOracle; + this.connectorsOutlook = docLinks.links.enterpriseSearch.connectorsOutlook; this.connectorsPostgreSQL = docLinks.links.enterpriseSearch.connectorsPostgreSQL; this.connectorsS3 = docLinks.links.enterpriseSearch.connectorsS3; this.connectorsSalesforce = docLinks.links.enterpriseSearch.connectorsSalesforce; @@ -417,6 +427,8 @@ class DocLinks { this.connectorsSharepoint = docLinks.links.enterpriseSearch.connectorsSharepoint; this.connectorsSharepointOnline = docLinks.links.enterpriseSearch.connectorsSharepointOnline; this.connectorsSlack = docLinks.links.enterpriseSearch.connectorsSlack; + this.connectorsTeams = docLinks.links.enterpriseSearch.connectorsTeams; + this.connectorsZoom = docLinks.links.enterpriseSearch.connectorsZoom; this.connectorsWorkplaceSearch = docLinks.links.enterpriseSearch.connectorsWorkplaceSearch; this.consoleGuide = docLinks.links.console.guide; this.crawlerExtractionRules = docLinks.links.enterpriseSearch.crawlerExtractionRules; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/icons/connector_icons.ts b/x-pack/plugins/enterprise_search/public/applications/shared/icons/connector_icons.ts index ab3dc7a6cfb37..357d5e7ce96ca 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/icons/connector_icons.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/icons/connector_icons.ts @@ -6,6 +6,7 @@ */ import azure_blob_storage from '../../../assets/source_icons/azure_blob_storage.svg'; +import box from '../../../assets/source_icons/box.svg'; import confluence_cloud from '../../../assets/source_icons/confluence_cloud.svg'; import custom from '../../../assets/source_icons/custom.svg'; import dropbox from '../../../assets/source_icons/dropbox.svg'; @@ -20,6 +21,7 @@ import mysql from '../../../assets/source_icons/mysql.svg'; import network_drive from '../../../assets/source_icons/network_drive.svg'; import onedrive from '../../../assets/source_icons/onedrive.svg'; import oracle from '../../../assets/source_icons/oracle.svg'; +import outlook from '../../../assets/source_icons/outlook.svg'; import postgresql from '../../../assets/source_icons/postgresql.svg'; import amazon_s3 from '../../../assets/source_icons/s3.svg'; import salesforce from '../../../assets/source_icons/salesforce.svg'; @@ -27,10 +29,13 @@ import servicenow from '../../../assets/source_icons/servicenow.svg'; import sharepoint from '../../../assets/source_icons/sharepoint.svg'; import sharepoint_online from '../../../assets/source_icons/sharepoint_online.svg'; import slack from '../../../assets/source_icons/slack.svg'; +import teams from '../../../assets/source_icons/teams.svg'; +import zoom from '../../../assets/source_icons/zoom.svg'; export const CONNECTOR_ICONS = { amazon_s3, azure_blob_storage, + box, confluence_cloud, custom, dropbox, @@ -45,10 +50,13 @@ export const CONNECTOR_ICONS = { network_drive, onedrive, oracle, + outlook, postgresql, salesforce, servicenow, sharepoint, sharepoint_online, slack, + teams, + zoom, }; diff --git a/x-pack/plugins/enterprise_search/public/assets/source_icons/outlook.svg b/x-pack/plugins/enterprise_search/public/assets/source_icons/outlook.svg new file mode 100644 index 0000000000000..74d4c44a4a820 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/source_icons/outlook.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/x-pack/plugins/enterprise_search/public/assets/source_icons/teams.svg b/x-pack/plugins/enterprise_search/public/assets/source_icons/teams.svg new file mode 100644 index 0000000000000..e70e1b297d836 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/source_icons/teams.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/x-pack/plugins/enterprise_search/public/assets/source_icons/zoom.svg b/x-pack/plugins/enterprise_search/public/assets/source_icons/zoom.svg new file mode 100644 index 0000000000000..910a0807eec8b --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/source_icons/zoom.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/x-pack/plugins/enterprise_search/server/integrations.ts b/x-pack/plugins/enterprise_search/server/integrations.ts index cedbd4215a656..22aa5a8e82375 100644 --- a/x-pack/plugins/enterprise_search/server/integrations.ts +++ b/x-pack/plugins/enterprise_search/server/integrations.ts @@ -6,49 +6,11 @@ */ import type { HttpServiceSetup } from '@kbn/core/server'; -import type { IntegrationCategory } from '@kbn/custom-integrations-plugin/common'; import type { CustomIntegrationsPluginSetup } from '@kbn/custom-integrations-plugin/server'; import { i18n } from '@kbn/i18n'; import { ConfigType } from '.'; -interface WorkplaceSearchIntegration { - id: string; - title: string; - description: string; - categories: IntegrationCategory[]; - uiInternalPath?: string; -} - -const workplaceSearchIntegrations: WorkplaceSearchIntegration[] = [ - { - id: 'box', - title: i18n.translate('xpack.enterpriseSearch.workplaceSearch.integrations.boxName', { - defaultMessage: 'Box', - }), - description: i18n.translate( - 'xpack.enterpriseSearch.workplaceSearch.integrations.boxDescription', - { - defaultMessage: 'Search over your files and folders stored on Box with Workplace Search.', - } - ), - categories: ['enterprise_search', 'workplace_search_content_source'], - }, - { - id: 'zendesk', - title: i18n.translate('xpack.enterpriseSearch.workplaceSearch.integrations.zendeskName', { - defaultMessage: 'Zendesk', - }), - description: i18n.translate( - 'xpack.enterpriseSearch.workplaceSearch.integrations.zendeskDescription', - { - defaultMessage: 'Search over your tickets on Zendesk with Workplace Search.', - } - ), - categories: ['enterprise_search', 'workplace_search_content_source'], - }, -]; - export const registerEnterpriseSearchIntegrations = ( config: ConfigType, http: HttpServiceSetup, @@ -57,23 +19,6 @@ export const registerEnterpriseSearchIntegrations = ( ) => { const nativeSearchTag = config.hasNativeConnectors && isCloud ? ['native_search'] : []; if (config.canDeployEntSearch) { - workplaceSearchIntegrations.forEach((integration) => { - customIntegrations.registerCustomIntegration({ - uiInternalPath: `/app/enterprise_search/workplace_search/sources/add/${integration.id}`, - icons: [ - { - type: 'svg', - src: http.basePath.prepend( - `/plugins/enterpriseSearch/assets/source_icons/${integration.id}.svg` - ), - }, - ], - isBeta: false, - shipper: 'enterprise_search', - ...integration, - }); - }); - customIntegrations.registerCustomIntegration({ id: 'app_search_json', title: i18n.translate('xpack.enterpriseSearch.appSearch.integrations.jsonName', { @@ -939,5 +884,130 @@ export const registerEnterpriseSearchIntegrations = ( shipper: 'enterprise_search', isBeta: false, }); + + customIntegrations.registerCustomIntegration({ + id: 'outlook', + title: i18n.translate('xpack.enterpriseSearch.integrations.connectors.outlookTitle', { + defaultMessage: 'Outlook', + }), + description: i18n.translate( + 'xpack.enterpriseSearch.integrations.connectors.outlookDescription', + { + defaultMessage: 'Search over your content on Outlook.', + } + ), + categories: [ + 'enterprise_search', + 'elastic_stack', + 'custom', + 'connector', + 'connector_client', + 'outlook', + ...nativeSearchTag, + ], + uiInternalPath: + '/app/enterprise_search/content/search_indices/new_index/connector?service_type=outlook', + icons: [ + { + type: 'svg', + src: http.basePath.prepend('/plugins/enterpriseSearch/assets/source_icons/outlook.svg'), + }, + ], + shipper: 'enterprise_search', + isBeta: false, + }); + + customIntegrations.registerCustomIntegration({ + id: 'zoom', + title: i18n.translate('xpack.enterpriseSearch.integrations.connectors.zoomTitle', { + defaultMessage: 'Zoom', + }), + description: i18n.translate( + 'xpack.enterpriseSearch.integrations.connectors.zoomDescription', + { + defaultMessage: 'Search over your content on Zoom.', + } + ), + categories: [ + 'enterprise_search', + 'elastic_stack', + 'custom', + 'connector', + 'connector_client', + 'zoom', + ...nativeSearchTag, + ], + uiInternalPath: + '/app/enterprise_search/content/search_indices/new_index/connector?service_type=zoom', + icons: [ + { + type: 'svg', + src: http.basePath.prepend('/plugins/enterpriseSearch/assets/source_icons/zoom.svg'), + }, + ], + shipper: 'enterprise_search', + isBeta: false, + }); + + customIntegrations.registerCustomIntegration({ + id: 'teams', + title: i18n.translate('xpack.enterpriseSearch.integrations.connectors.teamsTitle', { + defaultMessage: 'Teams', + }), + description: i18n.translate( + 'xpack.enterpriseSearch.integrations.connectors.teamsDescription', + { + defaultMessage: 'Search over your content on Teams.', + } + ), + categories: [ + 'enterprise_search', + 'elastic_stack', + 'custom', + 'connector', + 'connector_client', + 'teams', + ...nativeSearchTag, + ], + uiInternalPath: + '/app/enterprise_search/content/search_indices/new_index/connector?service_type=teams', + icons: [ + { + type: 'svg', + src: http.basePath.prepend('/plugins/enterpriseSearch/assets/source_icons/teams.svg'), + }, + ], + shipper: 'enterprise_search', + isBeta: false, + }); + + customIntegrations.registerCustomIntegration({ + id: 'box', + title: i18n.translate('xpack.enterpriseSearch.integrations.connectors.boxTitle', { + defaultMessage: 'Box', + }), + description: i18n.translate('xpack.enterpriseSearch.integrations.connectors.boxDescription', { + defaultMessage: 'Search over your content on Box.', + }), + categories: [ + 'enterprise_search', + 'elastic_stack', + 'custom', + 'connector', + 'connector_client', + 'box', + ...nativeSearchTag, + ], + uiInternalPath: + '/app/enterprise_search/content/search_indices/new_index/connector?service_type=box', + icons: [ + { + type: 'svg', + src: http.basePath.prepend('/plugins/enterpriseSearch/assets/source_icons/box.svg'), + }, + ], + shipper: 'enterprise_search', + isBeta: false, + }); } }; diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 4ca039b28c2a1..19c63121a62b8 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -14715,8 +14715,6 @@ "xpack.enterpriseSearch.workplaceSearch.groups.sourcesModalLabel": "sources de contenu organisationnelles", "xpack.enterpriseSearch.workplaceSearch.integrations.azureBlob": "Stockage Blob Azure", "xpack.enterpriseSearch.workplaceSearch.integrations.azureBlobDescription": "Effectuez des recherches sur votre contenu sur Stockage Blob Azure avec Enterprise Search.", - "xpack.enterpriseSearch.workplaceSearch.integrations.boxDescription": "Effectuez des recherches dans vos fichiers et dossiers stockés sur Box avec Workplace Search.", - "xpack.enterpriseSearch.workplaceSearch.integrations.boxName": "Box", "xpack.enterpriseSearch.workplaceSearch.integrations.googleCloud": "Google Cloud Storage", "xpack.enterpriseSearch.workplaceSearch.integrations.googleCloudDescription": "Effectuez des recherches sur votre contenu sur Google Cloud Storage avec Enterprise Search.", "xpack.enterpriseSearch.workplaceSearch.integrations.googleDriveDescription": "Effectuez des recherches dans vos documents sur Google Drive avec Workplace Search.", @@ -14739,8 +14737,6 @@ "xpack.enterpriseSearch.workplaceSearch.integrations.sharepointOnlineName": "SharePoint Online", "xpack.enterpriseSearch.workplaceSearch.integrations.sharepointServerDescription": "Effectuez des recherches dans vos fichiers stockés sur le serveur Microsoft SharePoint avec Workplace Search.", "xpack.enterpriseSearch.workplaceSearch.integrations.sharepointServerName": "Serveur SharePoint", - "xpack.enterpriseSearch.workplaceSearch.integrations.zendeskDescription": "Effectuez des recherches dans vos tickets sur Zendesk avec Workplace Search.", - "xpack.enterpriseSearch.workplaceSearch.integrations.zendeskName": "Zendesk", "xpack.enterpriseSearch.workplaceSearch.keepEditing.button": "Continuer la modification", "xpack.enterpriseSearch.workplaceSearch.label.label": "Étiquette", "xpack.enterpriseSearch.workplaceSearch.name.label": "Nom", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 7eab39e0ae1b2..89c3b1a590be5 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -14729,8 +14729,6 @@ "xpack.enterpriseSearch.workplaceSearch.groups.sourcesModalLabel": "組織コンテンツソース", "xpack.enterpriseSearch.workplaceSearch.integrations.azureBlob": "Azure Blob Storage", "xpack.enterpriseSearch.workplaceSearch.integrations.azureBlobDescription": "エンタープライズ サーチでAzure Blob Storageのコンテンツを検索します。", - "xpack.enterpriseSearch.workplaceSearch.integrations.boxDescription": "Workplace Searchを使用して、Boxに保存されたファイルとフォルダーを検索します。", - "xpack.enterpriseSearch.workplaceSearch.integrations.boxName": "Box", "xpack.enterpriseSearch.workplaceSearch.integrations.googleCloud": "Google Cloud Storage", "xpack.enterpriseSearch.workplaceSearch.integrations.googleCloudDescription": "エンタープライズ サーチでGoogle Cloud Storageのコンテンツを検索します。", "xpack.enterpriseSearch.workplaceSearch.integrations.googleDriveDescription": "Workplace Searchを使用して、Google Driveのドキュメントを検索します。", @@ -14753,8 +14751,6 @@ "xpack.enterpriseSearch.workplaceSearch.integrations.sharepointOnlineName": "SharePoint Online", "xpack.enterpriseSearch.workplaceSearch.integrations.sharepointServerDescription": "Workplace Searchを使用して、Microsoft SharePoint Serverに保存されたファイルを検索します。", "xpack.enterpriseSearch.workplaceSearch.integrations.sharepointServerName": "SharePoint Server", - "xpack.enterpriseSearch.workplaceSearch.integrations.zendeskDescription": "Workplace Searchを使用して、Zendeskのチケットを検索します。", - "xpack.enterpriseSearch.workplaceSearch.integrations.zendeskName": "Zendesk", "xpack.enterpriseSearch.workplaceSearch.keepEditing.button": "編集を続行", "xpack.enterpriseSearch.workplaceSearch.label.label": "ラベル", "xpack.enterpriseSearch.workplaceSearch.name.label": "名前", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index f9190f9a3c5a4..46482145dcf97 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -14729,8 +14729,6 @@ "xpack.enterpriseSearch.workplaceSearch.groups.sourcesModalLabel": "组织内容源", "xpack.enterpriseSearch.workplaceSearch.integrations.azureBlob": "Azure Blob 存储", "xpack.enterpriseSearch.workplaceSearch.integrations.azureBlobDescription": "使用 Enterprise Search 在 Azure Blob 存储上搜索您的内容。", - "xpack.enterpriseSearch.workplaceSearch.integrations.boxDescription": "通过 Workplace Search 搜索存储在 Box 上的文件和文件夹。", - "xpack.enterpriseSearch.workplaceSearch.integrations.boxName": "Box", "xpack.enterpriseSearch.workplaceSearch.integrations.googleCloud": "Google Cloud Storage", "xpack.enterpriseSearch.workplaceSearch.integrations.googleCloudDescription": "使用 Enterprise Search 在 Google Cloud Storage 上搜索您的内容。", "xpack.enterpriseSearch.workplaceSearch.integrations.googleDriveDescription": "通过 Workplace Search 搜索 Google 云端硬盘上的文档。", @@ -14753,8 +14751,6 @@ "xpack.enterpriseSearch.workplaceSearch.integrations.sharepointOnlineName": "Sharepoint", "xpack.enterpriseSearch.workplaceSearch.integrations.sharepointServerDescription": "通过 Workplace Search 搜索存储在 Microsoft SharePoint Server 上的文件。", "xpack.enterpriseSearch.workplaceSearch.integrations.sharepointServerName": "SharePoint Server", - "xpack.enterpriseSearch.workplaceSearch.integrations.zendeskDescription": "通过 Workplace Search 搜索 Zendesk 上的工单。", - "xpack.enterpriseSearch.workplaceSearch.integrations.zendeskName": "Zendesk", "xpack.enterpriseSearch.workplaceSearch.keepEditing.button": "继续编辑", "xpack.enterpriseSearch.workplaceSearch.label.label": "标签", "xpack.enterpriseSearch.workplaceSearch.name.label": "名称", From 7f1f1a8ee07a21c5cf0d945eaec19ad935582819 Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Tue, 3 Oct 2023 15:27:44 +0200 Subject: [PATCH 03/11] [Security Solution] Unskipping `x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/` working tests on serverless (#167513) --- .../alerts/alert_table_action_column.cy.ts | 54 ++++---- .../alerts/alert_table_controls.cy.ts | 14 +- .../alerts/alerts_cell_actions.cy.ts | 7 +- .../alerts/alerts_details.cy.ts | 31 +++-- .../alerts/building_block_alerts.cy.ts | 64 +++++---- .../alerts/changing_alert_status.cy.ts | 1 + .../alerts/detection_page_filters.cy.ts | 2 +- .../alerts/event_rendered_view.cy.ts | 4 +- .../alerts/investigate_in_timeline.cy.ts | 122 +++++++++--------- .../e2e/investigations/alerts/resolver.cy.ts | 50 ++++--- 10 files changed, 166 insertions(+), 183 deletions(-) diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/alert_table_action_column.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/alert_table_action_column.cy.ts index be3664c8f7812..d35cc7dd1f7c1 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/alert_table_action_column.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/alert_table_action_column.cy.ts @@ -16,37 +16,33 @@ import { login } from '../../../tasks/login'; import { visitWithTimeRange } from '../../../tasks/navigation'; import { ALERTS_URL } from '../../../urls/navigation'; -describe( - 'Alerts Table Action column', - { tags: ['@ess', '@serverless', '@brokenInServerless'] }, - () => { - before(() => { - cleanKibana(); - cy.task('esArchiverLoad', { - archiveName: 'process_ancestry', - useCreate: true, - docsOnly: true, - }); +describe('Alerts Table Action column', { tags: ['@ess', '@serverless'] }, () => { + before(() => { + cleanKibana(); + cy.task('esArchiverLoad', { + archiveName: 'process_ancestry', + useCreate: true, + docsOnly: true, }); + }); - beforeEach(() => { - login(); - visitWithTimeRange(ALERTS_URL); - waitForAlertsToPopulate(); - }); + beforeEach(() => { + login(); + visitWithTimeRange(ALERTS_URL); + waitForAlertsToPopulate(); + }); - after(() => { - cy.task('esArchiverUnload', 'process_ancestry'); - }); + after(() => { + cy.task('esArchiverUnload', 'process_ancestry'); + }); - it('should have session viewer button visible & open session viewer on click', () => { - openSessionViewerFromAlertTable(); - cy.get(OVERLAY_CONTAINER).should('be.visible'); - }); + it('should have session viewer button visible & open session viewer on click', () => { + openSessionViewerFromAlertTable(); + cy.get(OVERLAY_CONTAINER).should('be.visible'); + }); - it('should have analyzer button visible & open analyzer on click', () => { - openAnalyzerForFirstAlertInTimeline(); - cy.get(OVERLAY_CONTAINER).should('be.visible'); - }); - } -); + it('should have analyzer button visible & open analyzer on click', () => { + openAnalyzerForFirstAlertInTimeline(); + cy.get(OVERLAY_CONTAINER).should('be.visible'); + }); +}); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/alert_table_controls.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/alert_table_controls.cy.ts index 1028efc8422ba..fbdfd47249941 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/alert_table_controls.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/alert_table_controls.cy.ts @@ -10,7 +10,6 @@ import { switchAlertTableToGridView, waitForAlerts, } from '../../../tasks/alerts'; -import { navigateFromHeaderTo } from '../../../tasks/security_header'; import { FIELDS_BROWSER_BTN } from '../../../screens/rule_details'; import { addsFields, @@ -32,9 +31,8 @@ import { cleanKibana } from '../../../tasks/common'; import { waitForAlertsToPopulate } from '../../../tasks/create_new_rule'; import { login } from '../../../tasks/login'; import { visit } from '../../../tasks/navigation'; -import { ALERTS_URL } from '../../../urls/navigation'; +import { ALERTS_URL, TIMELINES_URL } from '../../../urls/navigation'; import { DATAGRID_HEADER } from '../../../screens/timeline'; -import { TIMELINES, ALERTS } from '../../../screens/security_header'; /* * @@ -43,7 +41,7 @@ import { TIMELINES, ALERTS } from '../../../screens/security_header'; * * */ -describe(`Alert Table Controls`, () => { +describe(`Alert Table Controls`, { tags: ['@ess', '@serverless'] }, () => { before(() => { cleanKibana(); }); @@ -102,8 +100,8 @@ describe(`Alert Table Controls`, () => { closeFieldsBrowser(); cy.get(DATAGRID_HEADER(fieldName)).should('not.exist'); - navigateFromHeaderTo(TIMELINES); - navigateFromHeaderTo(ALERTS); + visit(TIMELINES_URL); + visit(ALERTS_URL); waitForAlerts(); cy.get(DATAGRID_HEADER('_id')).should('not.exist'); }); @@ -115,8 +113,8 @@ describe(`Alert Table Controls`, () => { closeFieldsBrowser(); cy.get(DATAGRID_HEADER('_id')).should('be.visible'); - navigateFromHeaderTo(TIMELINES); - navigateFromHeaderTo(ALERTS); + visit(TIMELINES_URL); + visit(ALERTS_URL); waitForAlerts(); cy.get(DATAGRID_HEADER('_id')).should('be.visible'); }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/alerts_cell_actions.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/alerts_cell_actions.cy.ts index 6ac1048c0f928..c19ffc4d8ac6b 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/alerts_cell_actions.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/alerts_cell_actions.cy.ts @@ -29,7 +29,6 @@ import { waitForAlertsToPopulate } from '../../../tasks/create_new_rule'; import { login } from '../../../tasks/login'; import { visit } from '../../../tasks/navigation'; import { - clearKqlQueryBar, fillAddFilterForm, fillKqlQueryBar, openAddFilterPopover, @@ -38,7 +37,7 @@ import { openActiveTimeline } from '../../../tasks/timeline'; import { ALERTS_URL } from '../../../urls/navigation'; -describe('Alerts cell actions', { tags: ['@ess', '@brokenInServerless'] }, () => { +describe('Alerts cell actions', { tags: ['@ess', '@serverless'] }, () => { before(() => { cleanKibana(); createRule(getNewRule()); @@ -70,8 +69,6 @@ describe('Alerts cell actions', { tags: ['@ess', '@brokenInServerless'] }, () => filterForAlertProperty(ALERT_TABLE_FILE_NAME_VALUES, 0); cy.get(FILTER_BADGE).first().should('have.text', 'NOT file.name: exists'); - - clearKqlQueryBar(); }); it('should filter out a non-empty property', () => { @@ -95,8 +92,6 @@ describe('Alerts cell actions', { tags: ['@ess', '@brokenInServerless'] }, () => filterOutAlertProperty(ALERT_TABLE_FILE_NAME_VALUES, 0); cy.get(FILTER_BADGE).first().should('have.text', 'file.name: exists'); - - clearKqlQueryBar(); }); }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/alerts_details.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/alerts_details.cy.ts index 19cf0274b148b..bfa5a98921be0 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/alerts_details.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/alerts_details.cy.ts @@ -40,7 +40,7 @@ import { waitForPageToBeLoaded as waitForRuleDetailsPageToBeLoaded, } from '../../../tasks/rule_details'; -describe('Alert details flyout', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +describe('Alert details flyout', () => { describe('Basic functions', () => { beforeEach(() => { cleanKibana(); @@ -52,18 +52,23 @@ describe('Alert details flyout', { tags: ['@ess', '@serverless', '@brokenInServe expandFirstAlert(); }); - it('should update the table when status of the alert is updated', () => { - cy.get(OVERVIEW_RULE).should('be.visible'); - cy.get(ALERTS_TABLE_COUNT).should('have.text', '2 alerts'); - cy.get(ALERT_SUMMARY_SEVERITY_DONUT_CHART).should('contain.text', '2alerts'); - expandFirstAlert(); - changeAlertStatusTo('acknowledged'); - cy.get(ALERTS_TABLE_COUNT).should('have.text', '1 alert'); - cy.get(ALERT_SUMMARY_SEVERITY_DONUT_CHART).should('contain.text', '1alert'); - }); + // Issue tracked in: https://github.com/elastic/kibana/issues/167809 + it( + 'should update the table when status of the alert is updated', + { tags: ['@ess', '@brokenInServerless'] }, + () => { + cy.get(OVERVIEW_RULE).should('be.visible'); + cy.get(ALERTS_TABLE_COUNT).should('have.text', '2 alerts'); + cy.get(ALERT_SUMMARY_SEVERITY_DONUT_CHART).should('contain.text', '2alerts'); + expandFirstAlert(); + changeAlertStatusTo('acknowledged'); + cy.get(ALERTS_TABLE_COUNT).should('have.text', '1 alert'); + cy.get(ALERT_SUMMARY_SEVERITY_DONUT_CHART).should('contain.text', '1alert'); + } + ); }); - describe('With unmapped fields', () => { + describe('With unmapped fields', { tags: ['@ess', '@serverless'] }, () => { before(() => { cleanKibana(); cy.task('esArchiverLoad', { archiveName: 'unmapped_fields' }); @@ -136,7 +141,7 @@ describe('Alert details flyout', { tags: ['@ess', '@serverless', '@brokenInServe }); }); - describe('Url state management', () => { + describe('Url state management', { tags: ['@ess', '@serverless'] }, () => { before(() => { cleanKibana(); cy.task('esArchiverLoad', { archiveName: 'query_alert', useCreate: true, docsOnly: true }); @@ -182,7 +187,7 @@ describe('Alert details flyout', { tags: ['@ess', '@serverless', '@brokenInServe }); }); - describe('Localstorage management', () => { + describe('Localstorage management', { tags: ['@ess', '@serverless'] }, () => { const ARCHIVED_RULE_ID = '7015a3e2-e4ea-11ed-8c11-49608884878f'; const ARCHIVED_RULE_NAME = 'Endpoint Security'; diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/building_block_alerts.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/building_block_alerts.cy.ts index 64fbb36effebf..5efdfb7d94c8f 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/building_block_alerts.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/building_block_alerts.cy.ts @@ -18,37 +18,33 @@ import { navigateFromHeaderTo } from '../../../tasks/security_header'; const EXPECTED_NUMBER_OF_ALERTS = 5; -describe( - 'Alerts generated by building block rules', - { tags: ['@ess', '@brokenInServerless'] }, - () => { - before(() => { - cy.task('esArchiverLoad', { archiveName: 'auditbeat_big' }); - }); - - after(() => { - cy.task('esArchiverUnload', 'auditbeat_big'); - }); - - beforeEach(() => { - cleanKibana(); - login(); - createRule(getBuildingBlockRule()).then((rule) => visitRuleDetailsPage(rule.body.id)); - }); - - it('Alerts should be visible on the Rule Detail page and not visible on the Overview page', () => { - waitForTheRuleToBeExecuted(); - - // Check that generated events are visible on the Details page - waitForAlertsToPopulate(EXPECTED_NUMBER_OF_ALERTS); - - // Make sure rows are highlighted - cy.get(HIGHLIGHTED_ROWS_IN_TABLE).should('exist'); - - navigateFromHeaderTo(OVERVIEW); - - // Check that generated events are hidden on the Overview page - cy.get(OVERVIEW_ALERTS_HISTOGRAM_EMPTY).should('contain.text', 'No results found'); - }); - } -); +describe('Alerts generated by building block rules', { tags: ['@ess', '@serverless'] }, () => { + before(() => { + cy.task('esArchiverLoad', { archiveName: 'auditbeat_big' }); + }); + + after(() => { + cy.task('esArchiverUnload', 'auditbeat_big'); + }); + + beforeEach(() => { + cleanKibana(); + login(); + createRule(getBuildingBlockRule()).then((rule) => visitRuleDetailsPage(rule.body.id)); + }); + + it('Alerts should be visible on the Rule Detail page and not visible on the Overview page', () => { + waitForTheRuleToBeExecuted(); + + // Check that generated events are visible on the Details page + waitForAlertsToPopulate(EXPECTED_NUMBER_OF_ALERTS); + + // Make sure rows are highlighted + cy.get(HIGHLIGHTED_ROWS_IN_TABLE).should('exist'); + + navigateFromHeaderTo(OVERVIEW); + + // Check that generated events are hidden on the Overview page + cy.get(OVERVIEW_ALERTS_HISTOGRAM_EMPTY).should('contain.text', 'No results found'); + }); +}); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/changing_alert_status.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/changing_alert_status.cy.ts index c01cd6522c975..7a413849559bb 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/changing_alert_status.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/changing_alert_status.cy.ts @@ -39,6 +39,7 @@ import { visit } from '../../../tasks/navigation'; import { ALERTS_URL } from '../../../urls/navigation'; +// Iusse tracked in: https://github.com/elastic/kibana/issues/167809 describe('Changing alert status', { tags: ['@ess', '@brokenInServerless'] }, () => { before(() => { cy.task('esArchiverLoad', { archiveName: 'auditbeat_big' }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/detection_page_filters.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/detection_page_filters.cy.ts index 234eb4193179b..113c10cf2d910 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/detection_page_filters.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/detection_page_filters.cy.ts @@ -108,7 +108,7 @@ const assertFilterControlsWithFilterObject = ( }); }; -describe(`Detections : Page Filters`, { tags: ['@ess', '@brokenInServerless'] }, () => { +describe(`Detections : Page Filters`, { tags: ['@ess', '@serverless'] }, () => { before(() => { cleanKibana(); createRule(getNewRule({ rule_id: 'custom_rule_filters' })); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/event_rendered_view.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/event_rendered_view.cy.ts index 6bc165f26f075..66672cf66ec19 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/event_rendered_view.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/event_rendered_view.cy.ts @@ -34,7 +34,7 @@ import { XY_CHART, } from '../../../screens/shared'; -describe(`Event Rendered View`, () => { +describe(`Event Rendered View`, { tags: ['@ess', '@serverless'] }, () => { before(() => { cleanKibana(); }); @@ -60,7 +60,7 @@ describe(`Event Rendered View`, () => { cy.get(SHOW_TOP_N_HEADER).first().should('have.text', 'Top host.name'); cy.get(XY_CHART).should('be.visible'); cy.get(TOP_N_CONTAINER_CLOSE_BTN).trigger('click'); - cy.get(XY_CHART).should('not.be.visible'); + cy.get(XY_CHART).should('not.exist'); }); /* diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/investigate_in_timeline.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/investigate_in_timeline.cy.ts index ff8350f54a3c4..89bae99047759 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/investigate_in_timeline.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/investigate_in_timeline.cy.ts @@ -28,80 +28,76 @@ import { } from '../../../screens/alerts_details'; import { verifyInsightCount } from '../../../tasks/alerts_details'; -describe( - 'Investigate in timeline', - { tags: ['@ess', '@serverless', '@brokenInServerless'] }, - () => { - before(() => { - cleanKibana(); - createRule(getNewRule()); - }); +describe('Investigate in timeline', { tags: ['@ess', '@serverless'] }, () => { + before(() => { + cleanKibana(); + createRule(getNewRule()); + }); - describe('From alerts table', () => { - beforeEach(() => { - login(); - visitWithTimeRange(ALERTS_URL); - waitForAlertsToPopulate(); - }); + describe('From alerts table', () => { + beforeEach(() => { + login(); + visitWithTimeRange(ALERTS_URL); + waitForAlertsToPopulate(); + }); - it('should open new timeline from alerts table', () => { - investigateFirstAlertInTimeline(); - cy.get(PROVIDER_BADGE) - .first() - .invoke('text') - .then((eventId) => { - cy.get(PROVIDER_BADGE).filter(':visible').should('have.text', eventId); - }); - }); + it('should open new timeline from alerts table', () => { + investigateFirstAlertInTimeline(); + cy.get(PROVIDER_BADGE) + .first() + .invoke('text') + .then((eventId) => { + cy.get(PROVIDER_BADGE).filter(':visible').should('have.text', eventId); + }); }); + }); - describe('From alerts details flyout', () => { - beforeEach(() => { - login(); - disableExpandableFlyout(); - visitWithTimeRange(ALERTS_URL); - waitForAlertsToPopulate(); - expandFirstAlert(); - }); + describe('From alerts details flyout', () => { + beforeEach(() => { + login(); + disableExpandableFlyout(); + visitWithTimeRange(ALERTS_URL); + waitForAlertsToPopulate(); + expandFirstAlert(); + }); - it('should open a new timeline from a prevalence field', () => { - // Only one alert matches the exact process args in this case - const alertCount = 1; + it('should open a new timeline from a prevalence field', () => { + // Only one alert matches the exact process args in this case + const alertCount = 1; - // Click on the last button that lets us investigate in timeline. - // We expect this to be the `process.args` row. - cy.get(ALERT_FLYOUT) - .find(SUMMARY_VIEW_INVESTIGATE_IN_TIMELINE_BUTTON) - .last() - .should('have.text', alertCount) - .click(); + // Click on the last button that lets us investigate in timeline. + // We expect this to be the `process.args` row. + cy.get(ALERT_FLYOUT) + .find(SUMMARY_VIEW_INVESTIGATE_IN_TIMELINE_BUTTON) + .last() + .should('have.text', alertCount) + .click(); - // Make sure a new timeline is created and opened - cy.get(TIMELINE_TITLE).should('have.text', 'Untitled timeline'); + // Make sure a new timeline is created and opened + cy.get(TIMELINE_TITLE).should('have.text', 'Untitled timeline'); - // The alert count in this timeline should match the count shown on the alert flyout - cy.get(QUERY_TAB_BUTTON).should('contain.text', alertCount); + // The alert count in this timeline should match the count shown on the alert flyout + cy.get(QUERY_TAB_BUTTON).should('contain.text', alertCount); - // The correct filter is applied to the timeline query - cy.get(FILTER_BADGE).should( - 'have.text', - ' {"bool":{"must":[{"term":{"process.args":"-zsh"}},{"term":{"process.args":"unique"}}]}}' - ); - }); + // The correct filter is applied to the timeline query + cy.get(FILTER_BADGE).should( + 'have.text', + ' {"bool":{"must":[{"term":{"process.args":"-zsh"}},{"term":{"process.args":"unique"}}]}}' + ); + }); - it('should open a new timeline from an insights module', () => { - verifyInsightCount({ - tableSelector: INSIGHTS_RELATED_ALERTS_BY_SESSION, - investigateSelector: INSIGHTS_INVESTIGATE_IN_TIMELINE_BUTTON, - }); + it('should open a new timeline from an insights module', () => { + verifyInsightCount({ + tableSelector: INSIGHTS_RELATED_ALERTS_BY_SESSION, + investigateSelector: INSIGHTS_INVESTIGATE_IN_TIMELINE_BUTTON, }); + }); - it('should open a new timeline with alert ids from the process ancestry', () => { - verifyInsightCount({ - tableSelector: INSIGHTS_RELATED_ALERTS_BY_ANCESTRY, - investigateSelector: INSIGHTS_INVESTIGATE_ANCESTRY_ALERTS_IN_TIMELINE_BUTTON, - }); + it('should open a new timeline with alert ids from the process ancestry', () => { + verifyInsightCount({ + tableSelector: INSIGHTS_RELATED_ALERTS_BY_ANCESTRY, + investigateSelector: INSIGHTS_INVESTIGATE_ANCESTRY_ALERTS_IN_TIMELINE_BUTTON, }); }); - } -); + }); +}); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/resolver.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/resolver.cy.ts index cc62c05e5949b..ba33a9fde8902 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/resolver.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/resolver.cy.ts @@ -18,33 +18,29 @@ import { login } from '../../../tasks/login'; import { visitWithTimeRange } from '../../../tasks/navigation'; import { ALERTS_URL } from '../../../urls/navigation'; -describe( - 'Analyze events view for alerts', - { tags: ['@ess', '@serverless', '@brokenInServerless'] }, - () => { - before(() => { - cleanKibana(); - createRule(getNewRule()); - }); +describe('Analyze events view for alerts', { tags: ['@ess', '@serverless'] }, () => { + before(() => { + cleanKibana(); + createRule(getNewRule()); + }); - beforeEach(() => { - login(); - visitWithTimeRange(ALERTS_URL); - waitForAlertsToPopulate(); - }); + beforeEach(() => { + login(); + visitWithTimeRange(ALERTS_URL); + waitForAlertsToPopulate(); + }); - it('should render when button is clicked', () => { - openAnalyzerForFirstAlertInTimeline(); - cy.get(ANALYZER_NODE).first().should('be.visible'); - }); + it('should render when button is clicked', () => { + openAnalyzerForFirstAlertInTimeline(); + cy.get(ANALYZER_NODE).first().should('be.visible'); + }); - it('should display a toast indicating the date range of found events when a time range has 0 events in it', () => { - const dateContainingZeroEvents = 'Jul 27, 2022 @ 00:00:00.000'; - setStartDate(dateContainingZeroEvents); - waitForAlertsToPopulate(); - openAnalyzerForFirstAlertInTimeline(); - cy.get(TOASTER).should('be.visible'); - cy.get(ANALYZER_NODE).first().should('be.visible'); - }); - } -); + it('should display a toast indicating the date range of found events when a time range has 0 events in it', () => { + const dateContainingZeroEvents = 'Jul 27, 2022 @ 00:00:00.000'; + setStartDate(dateContainingZeroEvents); + waitForAlertsToPopulate(); + openAnalyzerForFirstAlertInTimeline(); + cy.get(TOASTER).should('be.visible'); + cy.get(ANALYZER_NODE).first().should('be.visible'); + }); +}); From 8d78de92ea54fe6ce41d02d1ed7d9604c71d3160 Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Tue, 3 Oct 2023 15:40:12 +0200 Subject: [PATCH 04/11] [Security Solution] Unskipping `x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/` working tests on serverless (#167512) --- ..._details_left_panel_correlations_tab.cy.ts | 120 ++++---- ...lert_details_left_panel_entities_tab.cy.ts | 2 +- ...details_left_panel_investigation_tab.cy.ts | 2 +- ...rt_details_left_panel_prevalence_tab.cy.ts | 98 +++---- ...lert_details_left_panel_response_tab.cy.ts | 34 ++- ..._details_left_panel_session_view_tab.cy.ts | 2 +- ...s_left_panel_threat_intelligence_tab.cy.ts | 2 +- ...s_preview_panel_alert_reason_preview.cy.ts | 2 +- ...t_details_preview_panel_rule_preview.cy.ts | 40 +-- .../alert_details_right_panel.cy.ts | 257 +++++++++--------- .../alert_details_right_panel_json_tab.cy.ts | 2 +- ...ert_details_right_panel_overview_tab.cy.ts | 2 +- .../alert_details_right_panel_table_tab.cy.ts | 2 +- .../alert_details_url_sync.cy.ts | 2 +- 14 files changed, 286 insertions(+), 281 deletions(-) diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_correlations_tab.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_correlations_tab.cy.ts index 9acd2f2a222df..7a63d5ec09e18 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_correlations_tab.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_correlations_tab.cy.ts @@ -34,77 +34,71 @@ import { login } from '../../../../tasks/login'; import { visit } from '../../../../tasks/navigation'; import { ALERTS_URL } from '../../../../urls/navigation'; -describe( - 'Expandable flyout left panel correlations', - { tags: ['@ess', '@brokenInServerless'] }, - () => { - beforeEach(() => { - cleanKibana(); - login(); - createRule(getNewRule()); - visit(ALERTS_URL); - waitForAlertsToPopulate(); - expandFirstAlertExpandableFlyout(); - expandDocumentDetailsExpandableFlyoutLeftSection(); - createNewCaseFromExpandableFlyout(); - openInsightsTab(); - openCorrelationsTab(); - }); +describe('Expandable flyout left panel correlations', { tags: ['@ess', '@serverless'] }, () => { + beforeEach(() => { + cleanKibana(); + login(); + createRule(getNewRule()); + visit(ALERTS_URL); + waitForAlertsToPopulate(); + expandFirstAlertExpandableFlyout(); + expandDocumentDetailsExpandableFlyoutLeftSection(); + createNewCaseFromExpandableFlyout(); + openInsightsTab(); + openCorrelationsTab(); + }); - it('should render correlations details correctly', () => { - cy.log('link the alert to a new case'); + it('should render correlations details correctly', () => { + cy.log('link the alert to a new case'); - cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB).scrollIntoView(); + cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB).scrollIntoView(); - cy.log('should render the Insights header'); - cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB) - .should('be.visible') - .and('have.text', 'Insights'); + cy.log('should render the Insights header'); + cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB).should('be.visible').and('have.text', 'Insights'); - cy.log('should render the inner tab switch'); - cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_BUTTON_GROUP).should('be.visible'); + cy.log('should render the inner tab switch'); + cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_BUTTON_GROUP).should('be.visible'); - cy.log('should render correlations tab activator / button'); - cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_CORRELATIONS_BUTTON) - .should('be.visible') - .and('have.text', 'Correlations'); + cy.log('should render correlations tab activator / button'); + cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_CORRELATIONS_BUTTON) + .should('be.visible') + .and('have.text', 'Correlations'); - cy.log('should render all the correlations sections'); + cy.log('should render all the correlations sections'); - cy.get(CORRELATIONS_ANCESTRY_SECTION_TITLE).scrollIntoView(); - cy.get(CORRELATIONS_ANCESTRY_SECTION_TITLE) - .should('be.visible') - .and('contain.text', '1 alert related by ancestry'); - cy.get(CORRELATIONS_ANCESTRY_SECTION_TABLE).should('be.visible'); - cy.get(CORRELATIONS_ANCESTRY_SECTION_INVESTIGATE_IN_TIMELINE_BUTTON).should('be.visible'); + cy.get(CORRELATIONS_ANCESTRY_SECTION_TITLE).scrollIntoView(); + cy.get(CORRELATIONS_ANCESTRY_SECTION_TITLE) + .should('be.visible') + .and('contain.text', '1 alert related by ancestry'); + cy.get(CORRELATIONS_ANCESTRY_SECTION_TABLE).should('be.visible'); + cy.get(CORRELATIONS_ANCESTRY_SECTION_INVESTIGATE_IN_TIMELINE_BUTTON).should('be.visible'); - // TODO get proper data to test this section - // cy.get(CORRELATIONS_SOURCE_SECTION).scrollIntoView(); - // cy.get(CORRELATIONS_SOURCE_SECTION) - // .should('be.visible') - // .and('contain.text', '0 alerts related by source event'); - // cy.get(CORRELATIONS_SOURCE_SECTION_TABLE).should('be.visible'); - // cy.get(CORRELATIONS_SESSION_SECTION_INVESTIGATE_IN_TIMELINE_BUTTON).should('be.visible'); + // TODO get proper data to test this section + // cy.get(CORRELATIONS_SOURCE_SECTION).scrollIntoView(); + // cy.get(CORRELATIONS_SOURCE_SECTION) + // .should('be.visible') + // .and('contain.text', '0 alerts related by source event'); + // cy.get(CORRELATIONS_SOURCE_SECTION_TABLE).should('be.visible'); + // cy.get(CORRELATIONS_SESSION_SECTION_INVESTIGATE_IN_TIMELINE_BUTTON).should('be.visible'); - cy.get(CORRELATIONS_SESSION_SECTION_TITLE).scrollIntoView(); - cy.get(CORRELATIONS_SESSION_SECTION_TITLE) - .should('be.visible') - .and('contain.text', '1 alert related by session'); - cy.get(CORRELATIONS_SESSION_SECTION_TABLE).should('be.visible'); - cy.get(CORRELATIONS_SESSION_SECTION_INVESTIGATE_IN_TIMELINE_BUTTON).should('be.visible'); + cy.get(CORRELATIONS_SESSION_SECTION_TITLE).scrollIntoView(); + cy.get(CORRELATIONS_SESSION_SECTION_TITLE) + .should('be.visible') + .and('contain.text', '1 alert related by session'); + cy.get(CORRELATIONS_SESSION_SECTION_TABLE).should('be.visible'); + cy.get(CORRELATIONS_SESSION_SECTION_INVESTIGATE_IN_TIMELINE_BUTTON).should('be.visible'); - cy.get(CORRELATIONS_CASES_SECTION_TITLE).scrollIntoView(); - cy.get(CORRELATIONS_CASES_SECTION_TITLE) - .should('be.visible') - .and('contain.text', '1 related case'); - cy.get(CORRELATIONS_CASES_SECTION_TABLE).should('be.visible'); + cy.get(CORRELATIONS_CASES_SECTION_TITLE).scrollIntoView(); + cy.get(CORRELATIONS_CASES_SECTION_TITLE) + .should('be.visible') + .and('contain.text', '1 related case'); + cy.get(CORRELATIONS_CASES_SECTION_TABLE).should('be.visible'); - // TODO get proper data to test suppressed alerts - // cy.get(CORRELATIONS_SUPPRESSED_ALERTS_TITLE).scrollIntoView(); - // cy.get(CORRELATIONS_SUPPRESSED_ALERTS_TITLE) - // .should('be.visible') - // .and('contain.text', '1 suppressed alert'); - // cy.get(CORRELATIONS_SUPPRESSED_ALERTS_INVESTIGATE_IN_TIMELINE_BUTTON).should('be.visible'); - }); - } -); + // TODO get proper data to test suppressed alerts + // cy.get(CORRELATIONS_SUPPRESSED_ALERTS_TITLE).scrollIntoView(); + // cy.get(CORRELATIONS_SUPPRESSED_ALERTS_TITLE) + // .should('be.visible') + // .and('contain.text', '1 suppressed alert'); + // cy.get(CORRELATIONS_SUPPRESSED_ALERTS_INVESTIGATE_IN_TIMELINE_BUTTON).should('be.visible'); + }); +}); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_entities_tab.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_entities_tab.cy.ts index ad051444d16b7..088a4c0dc87ee 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_entities_tab.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_entities_tab.cy.ts @@ -28,7 +28,7 @@ import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule'; describe( 'Alert details expandable flyout left panel entities', - { tags: ['@ess', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless'] }, () => { beforeEach(() => { cleanKibana(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_investigation_tab.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_investigation_tab.cy.ts index 137beba1dfddb..de6bfd1272fec 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_investigation_tab.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_investigation_tab.cy.ts @@ -22,7 +22,7 @@ import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule'; describe( 'Alert details expandable flyout left panel investigation', - { tags: ['@ess', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless'] }, () => { beforeEach(() => { cleanKibana(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_prevalence_tab.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_prevalence_tab.cy.ts index 5c51ef21a499c..3979a28046790 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_prevalence_tab.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_prevalence_tab.cy.ts @@ -32,54 +32,60 @@ import { getNewRule } from '../../../../objects/rule'; import { ALERTS_URL } from '../../../../urls/navigation'; import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule'; -describe('Alert details expandable flyout left panel prevalence', () => { - beforeEach(() => { - cleanKibana(); - login(); - createRule({ ...getNewRule(), investigation_fields: { field_names: ['host.os.name'] } }); - visit(ALERTS_URL); - waitForAlertsToPopulate(); - expandFirstAlertExpandableFlyout(); - expandDocumentDetailsExpandableFlyoutLeftSection(); - openInsightsTab(); - openPrevalenceTab(); - }); +describe( + 'Alert details expandable flyout left panel prevalence', + { tags: ['@ess', '@serverless'] }, + () => { + beforeEach(() => { + cleanKibana(); + login(); + createRule({ ...getNewRule(), investigation_fields: { field_names: ['host.os.name'] } }); + visit(ALERTS_URL); + waitForAlertsToPopulate(); + expandFirstAlertExpandableFlyout(); + expandDocumentDetailsExpandableFlyoutLeftSection(); + openInsightsTab(); + openPrevalenceTab(); + }); - it('should display prevalence tab', { tags: ['@ess', '@brokenInServerless'] }, () => { - cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB).should('be.visible').and('have.text', 'Insights'); + it('should display prevalence tab', () => { + cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB) + .should('be.visible') + .and('have.text', 'Insights'); - cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_BUTTON_GROUP).should('be.visible'); + cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_BUTTON_GROUP).should('be.visible'); - cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_BUTTON) - .should('be.visible') - .and('have.text', 'Prevalence'); + cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_BUTTON) + .should('be.visible') + .and('have.text', 'Prevalence'); - cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_DATE_PICKER).should('be.visible'); + cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_DATE_PICKER).should('be.visible'); - cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE).should('be.visible'); - cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_TYPE_CELL) - .should('contain.text', 'host.os.name') - .and('contain.text', 'host.name') - .and('contain.text', 'user.name'); - cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_NAME_CELL) - .should('contain.text', 'Mac OS X') - .and('contain.text', 'siem-kibana') - .and('contain.text', 'test'); - cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_ALERT_COUNT_CELL).should( - 'contain.text', - 2 - ); - cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_DOC_COUNT_CELL).should( - 'contain.text', - '—' - ); - cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_HOST_PREVALENCE_CELL).should( - 'contain.text', - 100 - ); - cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_USER_PREVALENCE_CELL).should( - 'contain.text', - 100 - ); - }); -}); + cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE).should('be.visible'); + cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_TYPE_CELL) + .should('contain.text', 'host.os.name') + .and('contain.text', 'host.name') + .and('contain.text', 'user.name'); + cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_NAME_CELL) + .should('contain.text', 'Mac OS X') + .and('contain.text', 'siem-kibana') + .and('contain.text', 'test'); + cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_ALERT_COUNT_CELL).should( + 'contain.text', + 2 + ); + cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_DOC_COUNT_CELL).should( + 'contain.text', + '—' + ); + cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_HOST_PREVALENCE_CELL).should( + 'contain.text', + 100 + ); + cy.get(DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_PREVALENCE_TABLE_USER_PREVALENCE_CELL).should( + 'contain.text', + 100 + ); + }); + } +); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_response_tab.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_response_tab.cy.ts index 4631b64220b26..7ba5def9b29b2 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_response_tab.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_response_tab.cy.ts @@ -17,19 +17,23 @@ import { getNewRule } from '../../../../objects/rule'; import { ALERTS_URL } from '../../../../urls/navigation'; import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule'; -describe('Alert details expandable flyout left panel investigation', () => { - beforeEach(() => { - cleanKibana(); - login(); - createRule(getNewRule()); - visit(ALERTS_URL); - waitForAlertsToPopulate(); - expandFirstAlertExpandableFlyout(); - expandDocumentDetailsExpandableFlyoutLeftSection(); - openResponseTab(); - }); +describe( + 'Alert details expandable flyout left panel investigation', + { tags: ['@ess', '@serverless'] }, + () => { + beforeEach(() => { + cleanKibana(); + login(); + createRule(getNewRule()); + visit(ALERTS_URL); + waitForAlertsToPopulate(); + expandFirstAlertExpandableFlyout(); + expandDocumentDetailsExpandableFlyoutLeftSection(); + openResponseTab(); + }); - it('should display empty response message', () => { - cy.get(DOCUMENT_DETAILS_FLYOUT_RESPONSE_EMPTY).should('be.visible'); - }); -}); + it('should display empty response message', () => { + cy.get(DOCUMENT_DETAILS_FLYOUT_RESPONSE_EMPTY).should('be.visible'); + }); + } +); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_session_view_tab.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_session_view_tab.cy.ts index 4636b96beaa04..dd0af1e610b2c 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_session_view_tab.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_session_view_tab.cy.ts @@ -23,7 +23,7 @@ import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule'; // TODO enable once the visualize tabs are back describe.skip( 'Alert details expandable flyout left panel session view', - { tags: ['@ess', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless'] }, () => { beforeEach(() => { cleanKibana(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_threat_intelligence_tab.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_threat_intelligence_tab.cy.ts index a0720b026c5d5..a8c97d8beb9d7 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_threat_intelligence_tab.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_left_panel_threat_intelligence_tab.cy.ts @@ -25,7 +25,7 @@ import { DOCUMENT_DETAILS_FLYOUT_INSIGHTS_TAB_THREAT_INTELLIGENCE_BUTTON } from describe( 'Expandable flyout left panel threat intelligence', - { tags: ['@ess', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless'] }, () => { beforeEach(() => { cleanKibana(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_preview_panel_alert_reason_preview.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_preview_panel_alert_reason_preview.cy.ts index cc6b2a6e8c242..27e85c0066de5 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_preview_panel_alert_reason_preview.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_preview_panel_alert_reason_preview.cy.ts @@ -18,7 +18,7 @@ import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule'; describe( 'Alert details expandable flyout rule preview panel', - { tags: ['@ess', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless'] }, () => { const rule = getNewRule(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_preview_panel_rule_preview.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_preview_panel_rule_preview.cy.ts index 7ce841595f189..b56dfbfdf6ecf 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_preview_panel_rule_preview.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_preview_panel_rule_preview.cy.ts @@ -35,24 +35,24 @@ import { getNewRule } from '../../../../objects/rule'; import { ALERTS_URL } from '../../../../urls/navigation'; import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule'; -describe('Alert details expandable flyout rule preview panel', () => { - const rule = getNewRule(); +describe( + 'Alert details expandable flyout rule preview panel', + { tags: ['@ess', '@serverless'] }, + () => { + const rule = getNewRule(); - beforeEach(() => { - cleanKibana(); - login(); - createRule(rule); - visit(ALERTS_URL); - waitForAlertsToPopulate(); - expandFirstAlertExpandableFlyout(); - clickRuleSummaryButton(); - }); + beforeEach(() => { + cleanKibana(); + login(); + createRule(rule); + visit(ALERTS_URL); + waitForAlertsToPopulate(); + expandFirstAlertExpandableFlyout(); + clickRuleSummaryButton(); + }); - describe('rule preview', () => { - it( - 'should display rule preview and its sub sections', - { tags: ['@ess', '@brokenInServerless'] }, - () => { + describe('rule preview', () => { + it('should display rule preview and its sub sections', () => { cy.log('rule preview panel'); cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_SECTION).scrollIntoView(); @@ -97,7 +97,7 @@ describe('Alert details expandable flyout rule preview panel', () => { cy.log('footer'); cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_FOOTER).scrollIntoView(); cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_FOOTER).should('be.visible'); - } - ); - }); -}); + }); + }); + } +); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel.cy.ts index 9a64bd46c1e89..4a404496cbdcf 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel.cy.ts @@ -67,132 +67,133 @@ import { getNewRule } from '../../../../objects/rule'; import { ALERTS_URL } from '../../../../urls/navigation'; import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule'; -describe( - 'Alert details expandable flyout right panel', - { tags: ['@ess', '@brokenInServerless'] }, - () => { - const rule = getNewRule(); - - beforeEach(() => { - cleanKibana(); - login(); - createRule(rule); - visit(ALERTS_URL); - waitForAlertsToPopulate(); - }); - - it('should display header and footer basics', () => { - expandFirstAlertExpandableFlyout(); - - cy.get(DOCUMENT_DETAILS_FLYOUT_HEADER_TITLE).should('be.visible').and('have.text', rule.name); - - cy.get(DOCUMENT_DETAILS_FLYOUT_HEADER_CHAT_BUTTON).should('be.visible'); - - cy.get(DOCUMENT_DETAILS_FLYOUT_HEADER_STATUS).should('be.visible'); - - cy.get(DOCUMENT_DETAILS_FLYOUT_HEADER_RISK_SCORE).should('be.visible'); - cy.get(DOCUMENT_DETAILS_FLYOUT_HEADER_RISK_SCORE_VALUE) - .should('be.visible') - .and('have.text', rule.risk_score); - - cy.get(DOCUMENT_DETAILS_FLYOUT_HEADER_SEVERITY).should('be.visible'); - cy.get(DOCUMENT_DETAILS_FLYOUT_HEADER_SEVERITY_VALUE) - .should('be.visible') - .and('have.text', upperFirst(rule.severity)); - - cy.log('Verify all 3 tabs are visible'); - - cy.get(DOCUMENT_DETAILS_FLYOUT_OVERVIEW_TAB) - .should('be.visible') - .and('have.text', 'Overview'); - cy.get(DOCUMENT_DETAILS_FLYOUT_TABLE_TAB).should('be.visible').and('have.text', 'Table'); - cy.get(DOCUMENT_DETAILS_FLYOUT_JSON_TAB).should('be.visible').and('have.text', 'JSON'); - - cy.log('Verify the expand/collapse button is visible and functionality works'); - - expandDocumentDetailsExpandableFlyoutLeftSection(); - cy.get(DOCUMENT_DETAILS_FLYOUT_COLLAPSE_DETAILS_BUTTON) - .should('be.visible') - .and('have.text', 'Collapse details'); - - collapseDocumentDetailsExpandableFlyoutLeftSection(); - cy.get(DOCUMENT_DETAILS_FLYOUT_EXPAND_DETAILS_BUTTON) - .should('be.visible') - .and('have.text', 'Expand details'); - - cy.log('Verify the take action button is visible on all tabs'); - - cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER).scrollIntoView(); - cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER).should('be.visible'); - cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER_TAKE_ACTION_BUTTON).should('be.visible'); - - openTableTab(); - cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER).scrollIntoView(); - cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER).should('be.visible'); - cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER_TAKE_ACTION_BUTTON).should('be.visible'); - - openJsonTab(); - cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER).scrollIntoView(); - cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER).should('be.visible'); - cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER_TAKE_ACTION_BUTTON).should('be.visible'); - }); - - // TODO this will change when add to existing case is improved - // https://github.com/elastic/security-team/issues/6298 - it('should add to existing case', () => { - navigateToCasesPage(); - createNewCaseFromCases(); - - cy.get(CASE_DETAILS_PAGE_TITLE).should('be.visible').and('have.text', 'case'); - navigateToAlertsPage(); - expandFirstAlertExpandableFlyout(); - openTakeActionButtonAndSelectItem(DOCUMENT_DETAILS_FLYOUT_FOOTER_ADD_TO_EXISTING_CASE); - - cy.get(EXISTING_CASE_SELECT_BUTTON).should('be.visible').contains('Select').click(); - cy.get(VIEW_CASE_TOASTER_LINK).should('be.visible').and('contain.text', 'View case'); - }); - - // TODO this will change when add to new case is improved - // https://github.com/elastic/security-team/issues/6298 - it('should add to new case', () => { - expandFirstAlertExpandableFlyout(); - openTakeActionButtonAndSelectItem(DOCUMENT_DETAILS_FLYOUT_FOOTER_ADD_TO_NEW_CASE); - - cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER_ADD_TO_NEW_CASE_NAME_INPUT).type('case'); - cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER_ADD_TO_NEW_CASE_DESCRIPTION_INPUT).type( - 'case description' - ); - cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER_ADD_TO_NEW_CASE_CREATE_BUTTON).click(); - - cy.get(VIEW_CASE_TOASTER_LINK).should('be.visible').and('contain.text', 'View case'); - }); - - it('should mark as acknowledged', () => { - cy.get(ALERT_CHECKBOX).should('have.length', 2); - - expandFirstAlertExpandableFlyout(); - openTakeActionButtonAndSelectItem(DOCUMENT_DETAILS_FLYOUT_FOOTER_ADD_MARK_AS_ACKNOWLEDGED); - - // TODO figure out how to verify the toasts pops up - // cy.get(KIBANA_TOAST) - // .should('be.visible') - // .and('have.text', 'Successfully marked 1 alert as acknowledged.'); - cy.get(ALERT_CHECKBOX).should('have.length', 1); - }); - - it('should mark as closed', () => { - cy.get(ALERT_CHECKBOX).should('have.length', 2); - - expandFirstAlertExpandableFlyout(); - openTakeActionButtonAndSelectItem(DOCUMENT_DETAILS_FLYOUT_FOOTER_MARK_AS_CLOSED); - - // TODO figure out how to verify the toasts pops up - // cy.get(KIBANA_TOAST).should('be.visible').and('have.text', 'Successfully closed 1 alert.'); - cy.get(ALERT_CHECKBOX).should('have.length', 1); - }); +describe('Alert details expandable flyout right panel', () => { + const rule = getNewRule(); - // these actions are now grouped together as we're not really testing their functionality but just the existence of the option in the dropdown - it('should test other action within take action dropdown', () => { + beforeEach(() => { + cleanKibana(); + login(); + createRule(rule); + visit(ALERTS_URL); + waitForAlertsToPopulate(); + }); + + it('should display header and footer basics', { tags: ['@ess', '@serverless'] }, () => { + expandFirstAlertExpandableFlyout(); + + cy.get(DOCUMENT_DETAILS_FLYOUT_HEADER_TITLE).should('be.visible').and('have.text', rule.name); + + cy.get(DOCUMENT_DETAILS_FLYOUT_HEADER_CHAT_BUTTON).should('be.visible'); + + cy.get(DOCUMENT_DETAILS_FLYOUT_HEADER_STATUS).should('be.visible'); + + cy.get(DOCUMENT_DETAILS_FLYOUT_HEADER_RISK_SCORE).should('be.visible'); + cy.get(DOCUMENT_DETAILS_FLYOUT_HEADER_RISK_SCORE_VALUE) + .should('be.visible') + .and('have.text', rule.risk_score); + + cy.get(DOCUMENT_DETAILS_FLYOUT_HEADER_SEVERITY).should('be.visible'); + cy.get(DOCUMENT_DETAILS_FLYOUT_HEADER_SEVERITY_VALUE) + .should('be.visible') + .and('have.text', upperFirst(rule.severity)); + + cy.log('Verify all 3 tabs are visible'); + + cy.get(DOCUMENT_DETAILS_FLYOUT_OVERVIEW_TAB).should('be.visible').and('have.text', 'Overview'); + cy.get(DOCUMENT_DETAILS_FLYOUT_TABLE_TAB).should('be.visible').and('have.text', 'Table'); + cy.get(DOCUMENT_DETAILS_FLYOUT_JSON_TAB).should('be.visible').and('have.text', 'JSON'); + + cy.log('Verify the expand/collapse button is visible and functionality works'); + + expandDocumentDetailsExpandableFlyoutLeftSection(); + cy.get(DOCUMENT_DETAILS_FLYOUT_COLLAPSE_DETAILS_BUTTON) + .should('be.visible') + .and('have.text', 'Collapse details'); + + collapseDocumentDetailsExpandableFlyoutLeftSection(); + cy.get(DOCUMENT_DETAILS_FLYOUT_EXPAND_DETAILS_BUTTON) + .should('be.visible') + .and('have.text', 'Expand details'); + + cy.log('Verify the take action button is visible on all tabs'); + + cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER).scrollIntoView(); + cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER).should('be.visible'); + cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER_TAKE_ACTION_BUTTON).should('be.visible'); + + openTableTab(); + cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER).scrollIntoView(); + cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER).should('be.visible'); + cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER_TAKE_ACTION_BUTTON).should('be.visible'); + + openJsonTab(); + cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER).scrollIntoView(); + cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER).should('be.visible'); + cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER_TAKE_ACTION_BUTTON).should('be.visible'); + }); + + // TODO this will change when add to existing case is improved + // https://github.com/elastic/security-team/issues/6298 + it('should add to existing case', { tags: ['@ess', '@serverless'] }, () => { + navigateToCasesPage(); + createNewCaseFromCases(); + + cy.get(CASE_DETAILS_PAGE_TITLE).should('be.visible').and('have.text', 'case'); + navigateToAlertsPage(); + expandFirstAlertExpandableFlyout(); + openTakeActionButtonAndSelectItem(DOCUMENT_DETAILS_FLYOUT_FOOTER_ADD_TO_EXISTING_CASE); + + cy.get(EXISTING_CASE_SELECT_BUTTON).should('be.visible').contains('Select').click(); + cy.get(VIEW_CASE_TOASTER_LINK).should('be.visible').and('contain.text', 'View case'); + }); + + // TODO this will change when add to new case is improved + // https://github.com/elastic/security-team/issues/6298 + it('should add to new case', { tags: ['@ess', '@serverless'] }, () => { + expandFirstAlertExpandableFlyout(); + openTakeActionButtonAndSelectItem(DOCUMENT_DETAILS_FLYOUT_FOOTER_ADD_TO_NEW_CASE); + + cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER_ADD_TO_NEW_CASE_NAME_INPUT).type('case'); + cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER_ADD_TO_NEW_CASE_DESCRIPTION_INPUT).type( + 'case description' + ); + cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER_ADD_TO_NEW_CASE_CREATE_BUTTON).click(); + + cy.get(VIEW_CASE_TOASTER_LINK).should('be.visible').and('contain.text', 'View case'); + }); + + // Issue reported int: https://github.com/elastic/kibana/issues/167809 + it('should mark as acknowledged', { tags: ['@ess', '@brokenInServerless'] }, () => { + cy.get(ALERT_CHECKBOX).should('have.length', 2); + + expandFirstAlertExpandableFlyout(); + openTakeActionButtonAndSelectItem(DOCUMENT_DETAILS_FLYOUT_FOOTER_ADD_MARK_AS_ACKNOWLEDGED); + + // TODO figure out how to verify the toasts pops up + // cy.get(KIBANA_TOAST) + // .should('be.visible') + // .and('have.text', 'Successfully marked 1 alert as acknowledged.'); + cy.get(ALERT_CHECKBOX).should('have.length', 1); + }); + + // Issue reported int: https://github.com/elastic/kibana/issues/167809 + it('should mark as closed', { tags: ['@ess', '@brokenInServerless'] }, () => { + cy.get(ALERT_CHECKBOX).should('have.length', 2); + + expandFirstAlertExpandableFlyout(); + openTakeActionButtonAndSelectItem(DOCUMENT_DETAILS_FLYOUT_FOOTER_MARK_AS_CLOSED); + + // TODO figure out how to verify the toasts pops up + // cy.get(KIBANA_TOAST).should('be.visible').and('have.text', 'Successfully closed 1 alert.'); + cy.get(ALERT_CHECKBOX).should('have.length', 1); + }); + + // these actions are now grouped together as we're not really testing their functionality but just the existence of the option in the dropdown + // Issue reported int: https://github.com/elastic/kibana/issues/167809 + it( + 'should test other action within take action dropdown', + { tags: ['@ess', '@brokenInServerless'] }, + () => { expandFirstAlertExpandableFlyout(); cy.log('should add endpoint exception'); @@ -234,6 +235,6 @@ describe( .within(() => cy.get(DOCUMENT_DETAILS_FLYOUT_FOOTER_INVESTIGATE_IN_TIMELINE_ENTRY).should('be.visible') ); - }); - } -); + } + ); +}); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel_json_tab.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel_json_tab.cy.ts index a00e109bfc4f4..ca2605c47a1a2 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel_json_tab.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel_json_tab.cy.ts @@ -18,7 +18,7 @@ import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule'; describe( 'Alert details expandable flyout right panel json tab', - { tags: ['@ess', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless'] }, () => { beforeEach(() => { cleanKibana(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel_overview_tab.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel_overview_tab.cy.ts index 691a1626cf174..ba0d5d984dfbe 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel_overview_tab.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel_overview_tab.cy.ts @@ -70,7 +70,7 @@ import { describe( 'Alert details expandable flyout right panel overview tab', - { tags: ['@ess', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless'] }, () => { const rule = { ...getNewRule(), investigation_fields: { field_names: ['host.os.name'] } }; diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel_table_tab.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel_table_tab.cy.ts index b5b00989df772..7b0625607d8b2 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel_table_tab.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel_table_tab.cy.ts @@ -34,7 +34,7 @@ import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule'; describe( 'Alert details expandable flyout right panel table tab', - { tags: ['@ess', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless'] }, () => { beforeEach(() => { cleanKibana(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_url_sync.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_url_sync.cy.ts index ba6f38d494c03..e4025c4679534 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_url_sync.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_url_sync.cy.ts @@ -16,7 +16,7 @@ import { closeFlyout } from '../../../../tasks/expandable_flyout/alert_details_r import { expandFirstAlertExpandableFlyout } from '../../../../tasks/expandable_flyout/common'; import { DOCUMENT_DETAILS_FLYOUT_HEADER_TITLE } from '../../../../screens/expandable_flyout/alert_details_right_panel'; -describe('Expandable flyout state sync', { tags: ['@ess', '@brokenInServerless'] }, () => { +describe('Expandable flyout state sync', { tags: ['@ess', '@serverless'] }, () => { const rule = getNewRule(); beforeEach(() => { From 5a219625651cdf08b50f94025b2119d54a0d54a1 Mon Sep 17 00:00:00 2001 From: "Joey F. Poon" Date: Tue, 3 Oct 2023 06:43:42 -0700 Subject: [PATCH 05/11] [Security Solution] fix serverless nextLastSuccessfulReport.toISOString logs (#167540) --- .../task_manager/usage_reporting_task.test.ts | 35 ++++++++++++++----- .../task_manager/usage_reporting_task.ts | 25 ++++++++----- 2 files changed, 42 insertions(+), 18 deletions(-) diff --git a/x-pack/plugins/security_solution_serverless/server/task_manager/usage_reporting_task.test.ts b/x-pack/plugins/security_solution_serverless/server/task_manager/usage_reporting_task.test.ts index abd36d9ccb8da..915f07ea283c1 100644 --- a/x-pack/plugins/security_solution_serverless/server/task_manager/usage_reporting_task.test.ts +++ b/x-pack/plugins/security_solution_serverless/server/task_manager/usage_reporting_task.test.ts @@ -47,7 +47,7 @@ describe('SecurityUsageReportingTask', () => { let usageRecord: UsageRecord; function buildMockTaskInstance(overrides?: Partial): ConcreteTaskInstance { - const timestamp = new Date(new Date().setMinutes(-15)); + const timestamp = new Date(new Date().setMinutes(-15)).toISOString(); return assign( { id: `${TYPE}:${VERSION}`, @@ -173,7 +173,7 @@ describe('SecurityUsageReportingTask', () => { cloudSetup: taskArgs.cloudSetup, taskId: TASK_ID, config: taskArgs.config, - lastSuccessfulReport: task?.state.lastSuccessfulReport, + lastSuccessfulReport: new Date(task?.state.lastSuccessfulReport as string), }) ); }); @@ -203,7 +203,16 @@ describe('SecurityUsageReportingTask', () => { const taskInstance = buildMockTaskInstance(); const task = await runTask(taskInstance); const newLastSuccessfulReport = task?.state.lastSuccessfulReport; - expect(newLastSuccessfulReport).toEqual(expect.any(Date)); + expect(newLastSuccessfulReport).toEqual(expect.any(String)); + expect(newLastSuccessfulReport).not.toEqual(taskInstance.state.lastSuccessfulReport); + }); + + it('should set lastSuccessfulReport correctly if no usage records found', async () => { + meteringCallbackMock.mockResolvedValueOnce([]); + const taskInstance = buildMockTaskInstance({ state: { lastSuccessfulReport: null } }); + const task = await runTask(taskInstance); + const newLastSuccessfulReport = task?.state.lastSuccessfulReport; + expect(newLastSuccessfulReport).toEqual(expect.any(String)); expect(newLastSuccessfulReport).not.toEqual(taskInstance.state.lastSuccessfulReport); }); @@ -213,23 +222,31 @@ describe('SecurityUsageReportingTask', () => { }); it('should set lastSuccessfulReport correctly', async () => { - const lastSuccessfulReport = new Date(new Date().setMinutes(-15)); + const lastSuccessfulReport = new Date(new Date().setMinutes(-15)).toISOString(); const taskInstance = buildMockTaskInstance({ state: { lastSuccessfulReport } }); const task = await runTask(taskInstance); - const newLastSuccessfulReport = task?.state.lastSuccessfulReport as Date; + const newLastSuccessfulReport = task?.state.lastSuccessfulReport; expect(newLastSuccessfulReport).toEqual(taskInstance.state.lastSuccessfulReport); }); + it('should set lastSuccessfulReport correctly if previously null', async () => { + const taskInstance = buildMockTaskInstance({ state: { lastSuccessfulReport: null } }); + const task = await runTask(taskInstance); + const newLastSuccessfulReport = task?.state.lastSuccessfulReport; + + expect(newLastSuccessfulReport).toEqual(expect.any(String)); + }); + describe('and lookBackLimitMinutes is set', () => { it('should limit lastSuccessfulReport if past threshold', async () => { taskArgs = buildTaskArgs({ options: { lookBackLimitMinutes: 5 } }); mockTask = new SecurityUsageReportingTask(taskArgs); - const lastSuccessfulReport = new Date(new Date().setMinutes(-30)); + const lastSuccessfulReport = new Date(new Date().setMinutes(-30)).toISOString(); const taskInstance = buildMockTaskInstance({ state: { lastSuccessfulReport } }); const task = await runTask(taskInstance, 1); - const newLastSuccessfulReport = task?.state.lastSuccessfulReport as Date; + const newLastSuccessfulReport = new Date(task?.state.lastSuccessfulReport as string); // should be ~5 minutes so asserting between 4-6 minutes ago const sixMinutesAgo = new Date().setMinutes(-6); @@ -242,10 +259,10 @@ describe('SecurityUsageReportingTask', () => { taskArgs = buildTaskArgs({ options: { lookBackLimitMinutes: 30 } }); mockTask = new SecurityUsageReportingTask(taskArgs); - const lastSuccessfulReport = new Date(new Date().setMinutes(-15)); + const lastSuccessfulReport = new Date(new Date().setMinutes(-15)).toISOString(); const taskInstance = buildMockTaskInstance({ state: { lastSuccessfulReport } }); const task = await runTask(taskInstance, 1); - const newLastSuccessfulReport = task?.state.lastSuccessfulReport as Date; + const newLastSuccessfulReport = task?.state.lastSuccessfulReport; expect(newLastSuccessfulReport).toEqual(taskInstance.state.lastSuccessfulReport); }); diff --git a/x-pack/plugins/security_solution_serverless/server/task_manager/usage_reporting_task.ts b/x-pack/plugins/security_solution_serverless/server/task_manager/usage_reporting_task.ts index f2947bef9602f..a292d7646791d 100644 --- a/x-pack/plugins/security_solution_serverless/server/task_manager/usage_reporting_task.ts +++ b/x-pack/plugins/security_solution_serverless/server/task_manager/usage_reporting_task.ts @@ -124,7 +124,8 @@ export class SecurityUsageReportingTask { const [{ elasticsearch }] = await core.getStartServices(); const esClient = elasticsearch.client.asInternalUser; - const lastSuccessfulReport = taskInstance.state.lastSuccessfulReport; + const lastSuccessfulReport = + taskInstance.state.lastSuccessfulReport && new Date(taskInstance.state.lastSuccessfulReport); let usageRecords: UsageRecord[] = []; // save usage record query time so we can use it to know where @@ -168,14 +169,13 @@ export class SecurityUsageReportingTask { } const state = { - lastSuccessfulReport: - usageReportResponse?.status === 201 - ? meteringCallbackTime - : this.getFailedLastSuccessfulReportTime( - meteringCallbackTime, - taskInstance.state.lastSuccessfulReport, - lookBackLimitMinutes - ), + lastSuccessfulReport: this.shouldUpdateLastSuccessfulReport(usageRecords, usageReportResponse) + ? meteringCallbackTime.toISOString() + : this.getFailedLastSuccessfulReportTime( + meteringCallbackTime, + lastSuccessfulReport, + lookBackLimitMinutes + ).toISOString(), }; return { state }; }; @@ -203,6 +203,13 @@ export class SecurityUsageReportingTask { return lookBackLimitTime; } + private shouldUpdateLastSuccessfulReport( + usageRecords: UsageRecord[], + usageReportResponse: Response | undefined + ): boolean { + return !usageRecords.length || usageReportResponse?.status === 201; + } + private get taskId() { return `${this.taskType}:${this.version}`; } From b53bdd6420f1b03d96e4f2a8d2b8d363343b02d2 Mon Sep 17 00:00:00 2001 From: Rickyanto Ang Date: Tue, 3 Oct 2023 07:06:23 -0700 Subject: [PATCH 06/11] [Cloud Security][BugFix] Fix for missing account_type on env created via Github action (#167690) ## Summary This PR is for Fix for issue where account_type is missing if that integration was made via Github Action (https://github.com/elastic/security-team/issues/7686) --- .../components/fleet_extensions/policy_template_form.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.tsx b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.tsx index a75f933b9bd36..a7828296dc0dd 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.tsx @@ -198,7 +198,7 @@ const AwsAccountTypeSelect = ({ ); } // eslint-disable-next-line react-hooks/exhaustive-deps - }, [input]); + }, [input, updatePolicy]); return ( <> @@ -341,7 +341,7 @@ const GcpAccountTypeSelect = ({ ); } // eslint-disable-next-line react-hooks/exhaustive-deps - }, [input]); + }, [input, updatePolicy]); return ( <> From b3b947248031633aab22087ae3377eb199042532 Mon Sep 17 00:00:00 2001 From: Melissa Alvarez Date: Tue, 3 Oct 2023 08:36:30 -0600 Subject: [PATCH 07/11] [ML] Anomaly detection results functional tests: retry forecast chart check (#167820) ## Summary Fixes https://github.com/elastic/kibana/issues/164381 Flaky test runner build: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3279 This PR ensures enough time is given for the forecast chart to show up correctly by adding retries. ### Checklist Delete any items that are not applicable to this PR. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --- .../forecasts.ts | 3 +-- .../test/functional/services/ml/forecast.ts | 21 +++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/x-pack/test/functional/apps/ml/anomaly_detection_result_views/forecasts.ts b/x-pack/test/functional/apps/ml/anomaly_detection_result_views/forecasts.ts index 63f72381d0185..93ec331230a8a 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection_result_views/forecasts.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection_result_views/forecasts.ts @@ -42,8 +42,7 @@ export default function ({ getService }: FtrProviderContext) { describe('forecasts', function () { this.tags(['ml']); - // FLAKY: https://github.com/elastic/kibana/issues/164381 - describe.skip('with single metric job', function () { + describe('with single metric job', function () { before(async () => { await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote'); await ml.testResources.createIndexPatternIfNeeded('ft_farequote', '@timestamp'); diff --git a/x-pack/test/functional/services/ml/forecast.ts b/x-pack/test/functional/services/ml/forecast.ts index c26216c97adfe..8b131578fd65f 100644 --- a/x-pack/test/functional/services/ml/forecast.ts +++ b/x-pack/test/functional/services/ml/forecast.ts @@ -11,6 +11,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export function MachineLearningForecastProvider({ getService }: FtrProviderContext) { const testSubjects = getService('testSubjects'); + const retry = getService('retry'); return { async assertForecastButtonExists() { @@ -32,14 +33,22 @@ export function MachineLearningForecastProvider({ getService }: FtrProviderConte }, async assertForecastChartElementsExists() { - await testSubjects.existOrFail(`mlForecastArea`, { - timeout: 30 * 1000, + await retry.tryForTime(3000, async () => { + await testSubjects.existOrFail(`mlForecastArea`, { + timeout: 30 * 1000, + }); }); - await testSubjects.existOrFail(`mlForecastValuesline`, { - timeout: 30 * 1000, + + await retry.tryForTime(3000, async () => { + await testSubjects.existOrFail(`mlForecastValuesline`, { + timeout: 30 * 1000, + }); }); - await testSubjects.existOrFail(`mlForecastMarkers`, { - timeout: 30 * 1000, + + await retry.tryForTime(3000, async () => { + await testSubjects.existOrFail(`mlForecastMarkers`, { + timeout: 30 * 1000, + }); }); }, From 8e7b2338ba414c58872d36973ab30813cd93cea2 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Tue, 3 Oct 2023 15:44:35 +0100 Subject: [PATCH 08/11] skip flaky suite (#167869) --- .../functional/test_suites/observability/cases/configure.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test_serverless/functional/test_suites/observability/cases/configure.ts b/x-pack/test_serverless/functional/test_suites/observability/cases/configure.ts index a19ef4ebf2e4a..ef58b18181f7b 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/cases/configure.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/cases/configure.ts @@ -49,7 +49,8 @@ export default ({ getPageObject, getService }: FtrProviderContext) => { }); }); - describe('Connectors', function () { + // FLAKY: https://github.com/elastic/kibana/issues/167869 + describe.skip('Connectors', function () { it('defaults the connector to none correctly', async () => { expect(await testSubjects.exists('dropdown-connector-no-connector')).to.be(true); }); From 43a04a4205ede340c6fba2b3b06a7a2b1ce5d855 Mon Sep 17 00:00:00 2001 From: Walter Rafelsberger Date: Tue, 3 Oct 2023 17:14:00 +0200 Subject: [PATCH 09/11] [ML] Transforms: Use `delete_dest_index` flag instead of ES call to delete destination index. (#166797) Part of #166796. Depends on https://github.com/elastic/elasticsearch/pull/99738. Uses the `delete_dest_index` flag instead of ES call to delete destination index in the transforms UI when deleting transforms. The PR also fixes some code related to destination indices for transforms and data frame analytics. A destination index can be just a single string. Before the properly typed transform APIs were available via `estypes`, we accidentally treated destination indices similar to source indices which might also be arrays of indices. --- .../common/get_destination_index.ts | 2 +- .../action_delete/use_delete_action.tsx | 4 +++- .../analytics_service/delete_analytics.ts | 4 +--- .../public/app/hooks/use_data_view_exists.ts | 2 +- .../public/app/hooks/use_delete_transform.tsx | 2 +- .../action_discover/use_action_discover.tsx | 9 ++------- .../transform_list/expanded_row.tsx | 6 ++---- .../transform/server/routes/api/transforms.ts | 20 ++++--------------- 8 files changed, 15 insertions(+), 34 deletions(-) diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/common/get_destination_index.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/common/get_destination_index.ts index 20de54fe54828..792c5d12a1923 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/common/get_destination_index.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/common/get_destination_index.ts @@ -8,4 +8,4 @@ import type { DataFrameAnalyticsConfig } from '@kbn/ml-data-frame-analytics-utils'; export const getDestinationIndex = (jobConfig: DataFrameAnalyticsConfig | undefined) => - (Array.isArray(jobConfig?.dest.index) ? jobConfig?.dest.index[0] : jobConfig?.dest.index) ?? ''; + jobConfig?.dest.index ?? ''; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx index 01b6e3a3f50ad..1a828f6b6cdf0 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx @@ -29,6 +29,8 @@ import { deleteActionNameText, DeleteActionName } from './delete_action_name'; import { JobType } from '../../../../../../../common/types/saved_objects'; +import { getDestinationIndex } from '../../../../common/get_destination_index'; + const DF_ANALYTICS_JOB_TYPE: JobType = 'data-frame-analytics'; type DataFrameAnalyticsListRowEssentials = Pick; @@ -51,7 +53,7 @@ export const useDeleteAction = (canDeleteDataFrameAnalytics: boolean) => { application: { capabilities }, } = useMlKibana().services; - const indexName = item?.config.dest.index ?? ''; + const indexName = getDestinationIndex(item?.config); const toastNotificationService = useToastNotificationService(); diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/delete_analytics.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/delete_analytics.ts index 535424650d1df..8929f39bea43c 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/delete_analytics.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/delete_analytics.ts @@ -51,9 +51,7 @@ export const deleteAnalyticsAndDestIndex = async ( deleteDestIndexPattern: boolean, toastNotificationService: ToastNotificationService ) => { - const destinationIndex = Array.isArray(analyticsConfig.dest.index) - ? analyticsConfig.dest.index[0] - : analyticsConfig.dest.index; + const destinationIndex = analyticsConfig.dest.index; try { if (isDataFrameAnalyticsFailed(analyticsStats.state)) { await ml.dataFrameAnalytics.stopDataFrameAnalytics(analyticsConfig.id, true); diff --git a/x-pack/plugins/transform/public/app/hooks/use_data_view_exists.ts b/x-pack/plugins/transform/public/app/hooks/use_data_view_exists.ts index d74fa9c909a5d..b81a5e7f9eb25 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_data_view_exists.ts +++ b/x-pack/plugins/transform/public/app/hooks/use_data_view_exists.ts @@ -26,7 +26,7 @@ export const useDataViewExists = (items: TransformListRow[]) => { return false; } const config = items[0].config; - const indexName = Array.isArray(config.dest.index) ? config.dest.index[0] : config.dest.index; + const indexName = config.dest.index; if (indexName === undefined) { return false; diff --git a/x-pack/plugins/transform/public/app/hooks/use_delete_transform.tsx b/x-pack/plugins/transform/public/app/hooks/use_delete_transform.tsx index a7ed779c47cc7..f88ef1e39d446 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_delete_transform.tsx +++ b/x-pack/plugins/transform/public/app/hooks/use_delete_transform.tsx @@ -56,7 +56,7 @@ export const useDeleteIndexAndTargetIndex = (items: TransformListRow[]) => { useEffect(() => { if (dataViewExistsError !== null && items.length === 1) { const config = items[0].config; - const indexName = Array.isArray(config.dest.index) ? config.dest.index[0] : config.dest.index; + const indexName = config.dest.index; toastNotifications.addDanger( i18n.translate( diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/action_discover/use_action_discover.tsx b/x-pack/plugins/transform/public/app/sections/transform_management/components/action_discover/use_action_discover.tsx index 24ee1f9dfe092..6d818c90ba7fc 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/action_discover/use_action_discover.tsx +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/action_discover/use_action_discover.tsx @@ -19,9 +19,6 @@ import { DiscoverActionName, } from './discover_action_name'; -const getDataViewTitleFromTargetIndex = (item: TransformListRow) => - Array.isArray(item.config.dest.index) ? item.config.dest.index.join(',') : item.config.dest.index; - export type DiscoverAction = ReturnType; export const useDiscoverAction = (forceDisable: boolean) => { const { @@ -48,8 +45,7 @@ export const useDiscoverAction = (forceDisable: boolean) => { (item: TransformListRow) => { const locator = share.url.locators.get(DISCOVER_APP_LOCATOR); if (!locator) return; - const dataViewTitle = getDataViewTitleFromTargetIndex(item); - const dataViewId = getDataViewIdByTitle(dataViewTitle); + const dataViewId = getDataViewIdByTitle(item.config.dest.index); locator.navigateSync({ indexPatternId: dataViewId, }); @@ -59,8 +55,7 @@ export const useDiscoverAction = (forceDisable: boolean) => { const dataViewExists = useCallback( (item: TransformListRow) => { - const dataViewTitle = getDataViewTitleFromTargetIndex(item); - const dataViewId = getDataViewIdByTitle(dataViewTitle); + const dataViewId = getDataViewIdByTitle(item.config.dest.index); return dataViewId !== undefined; }, [getDataViewIdByTitle] diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row.tsx b/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row.tsx index 079b3f72b59bd..0ab68c5481387 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row.tsx +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row.tsx @@ -101,7 +101,7 @@ export const ExpandedRow: FC = ({ item, onAlertEdit, transformsStatsLoadi }, { title: 'transform_version', - description: item.config.version, + description: item.config.version ?? '', }, { title: 'description', @@ -120,9 +120,7 @@ export const ExpandedRow: FC = ({ item, onAlertEdit, transformsStatsLoadi }, { title: 'destination_index', - description: Array.isArray(item.config.dest.index) - ? item.config.dest.index[0] - : item.config.dest.index, + description: item.config.dest.index, }, { title: 'authorization', diff --git a/x-pack/plugins/transform/server/routes/api/transforms.ts b/x-pack/plugins/transform/server/routes/api/transforms.ts index 822441c07812b..80d44c0e907bf 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms.ts @@ -677,9 +677,7 @@ async function deleteTransforms( transform_id: transformId, }); const transformConfig = body.transforms[0]; - destinationIndex = Array.isArray(transformConfig.dest.index) - ? transformConfig.dest.index[0] - : transformConfig.dest.index; + destinationIndex = transformConfig.dest.index; } catch (getTransformConfigError) { transformDeleted.error = getTransformConfigError.meta.body.error; results[transformId] = { @@ -692,19 +690,6 @@ async function deleteTransforms( continue; } } - // If user checks box to delete the destinationIndex associated with the job - if (destinationIndex && deleteDestIndex) { - try { - // If user does have privilege to delete the index, then delete the index - // if no permission then return 403 forbidden - await esClient.asCurrentUser.indices.delete({ - index: destinationIndex, - }); - destIndexDeleted.success = true; - } catch (deleteIndexError) { - destIndexDeleted.error = deleteIndexError.meta.body.error; - } - } // Delete the data view if there's a data view that matches the name of dest index if (destinationIndex && deleteDestDataView) { @@ -723,8 +708,11 @@ async function deleteTransforms( await esClient.asCurrentUser.transform.deleteTransform({ transform_id: transformId, force: shouldForceDelete && needToForceDelete, + // @ts-expect-error ES type needs to be updated + delete_dest_index: deleteDestIndex, }); transformDeleted.success = true; + destIndexDeleted.success = deleteDestIndex; } catch (deleteTransformJobError) { transformDeleted.error = deleteTransformJobError.meta.body.error; if (deleteTransformJobError.statusCode === 403) { From 2daa9dc3a7bb7bee19ac9936063275b94c6f1045 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Tue, 3 Oct 2023 16:20:07 +0100 Subject: [PATCH 10/11] skip flaky suite (#167175) --- test/functional/apps/dashboard/group2/dashboard_filter_bar.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/functional/apps/dashboard/group2/dashboard_filter_bar.ts b/test/functional/apps/dashboard/group2/dashboard_filter_bar.ts index da9660ac4f4cb..044339930ae16 100644 --- a/test/functional/apps/dashboard/group2/dashboard_filter_bar.ts +++ b/test/functional/apps/dashboard/group2/dashboard_filter_bar.ts @@ -193,7 +193,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('saved search filtering', function () { + // FLAKY: https://github.com/elastic/kibana/issues/167175 + describe.skip('saved search filtering', function () { before(async () => { await filterBar.ensureFieldEditorModalIsClosed(); await PageObjects.dashboard.gotoDashboardLandingPage(); From 671158973949f3ae72e9708e2991ea5ee6ecc5f6 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Tue, 3 Oct 2023 16:21:32 +0100 Subject: [PATCH 11/11] skip flaky suite (#167812) --- x-pack/test/saved_object_tagging/functional/tests/create.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/saved_object_tagging/functional/tests/create.ts b/x-pack/test/saved_object_tagging/functional/tests/create.ts index 16c8958c0fa62..a2bde4ab579dc 100644 --- a/x-pack/test/saved_object_tagging/functional/tests/create.ts +++ b/x-pack/test/saved_object_tagging/functional/tests/create.ts @@ -15,7 +15,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const tagManagementPage = PageObjects.tagManagement; - describe('create tag', () => { + // FLAKY: https://github.com/elastic/kibana/issues/167812 + describe.skip('create tag', () => { let tagModal: typeof tagManagementPage['tagModal']; before(async () => {