From e2ccaf2c5305b7c3843d77a7aed20306eb0bf73f Mon Sep 17 00:00:00 2001 From: Saarika Bhasi <55930906+saarikabhasi@users.noreply.github.com> Date: Fri, 17 May 2024 21:17:17 -0400 Subject: [PATCH] [Serverless_search] Fix index overview page storage cards to show actual bytes size (#183444) ~~Adds a fix to fetch index dataset size from `_cat/indices/{indexName} ` rather than from `Get /{indexName}/_stats`. As `_stats ` doesn't exist in Serverless. We will show only Total size and removed showing primary store size as it's not populated from ES in `_cat/indices/{indexName} ` Serverless~~ **Update** Removes showing storage card from index detail page & remove fetching `Get /{indexName}/_stats` https://github.com/elastic/kibana/assets/55930906/7a1f0661-75eb-42a9-a1e0-128c1fbace6f --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../serverless_search/common/types/index.ts | 4 +- .../index_management/index_overview.tsx | 72 ------------------- .../server/lib/indices/fetch_index.test.ts | 47 +----------- .../server/lib/indices/fetch_index.ts | 20 ++---- .../translations/translations/fr-FR.json | 4 -- .../translations/translations/ja-JP.json | 4 -- .../translations/translations/zh-CN.json | 4 -- .../page_objects/index_management_page.ts | 42 +++++++++++ .../management/index_management/index.ts | 1 + .../index_management/index_detail.ts | 41 +++++++++++ .../management/index_management/indices.ts | 12 +++- 11 files changed, 102 insertions(+), 149 deletions(-) create mode 100644 x-pack/test_serverless/functional/test_suites/common/management/index_management/index_detail.ts diff --git a/x-pack/plugins/serverless_search/common/types/index.ts b/x-pack/plugins/serverless_search/common/types/index.ts index c2ea72f13c8e9..f4504bde81faf 100644 --- a/x-pack/plugins/serverless_search/common/types/index.ts +++ b/x-pack/plugins/serverless_search/common/types/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { IndicesIndexState, IndicesStatsIndicesStats } from '@elastic/elasticsearch/lib/api/types'; +import { IndicesIndexState } from '@elastic/elasticsearch/lib/api/types'; import { Connector } from '@kbn/search-connectors/types/connectors'; export interface CreateAPIKeyArgs { @@ -23,12 +23,10 @@ export interface IndexData { export interface FetchIndicesResult { indices: IndexData[]; } - export interface FetchIndexResult { index: IndicesIndexState & { connector?: Connector; count: number; - stats?: IndicesStatsIndicesStats; }; } diff --git a/x-pack/plugins/serverless_search/public/application/components/index_management/index_overview.tsx b/x-pack/plugins/serverless_search/public/application/components/index_management/index_overview.tsx index f1db8d49e038a..334eaf8326c00 100644 --- a/x-pack/plugins/serverless_search/public/application/components/index_management/index_overview.tsx +++ b/x-pack/plugins/serverless_search/public/application/components/index_management/index_overview.tsx @@ -6,7 +6,6 @@ */ import React, { FunctionComponent } from 'react'; -import numeral from '@elastic/numeral'; import { i18n } from '@kbn/i18n'; import { FormattedMessage, FormattedPlural } from '@kbn/i18n-react'; import { @@ -15,7 +14,6 @@ import { EuiFlexGrid, EuiFlexItem, EuiFlexGroup, - EuiIcon, EuiI18nNumber, EuiText, EuiBadge, @@ -185,76 +183,6 @@ export const IndexDetailOverview: FunctionComponent = - {indexData.count > 0 && ( - - - } - footer={ - - - - - - - , - deletedCount: ( - - ), - }} - /> - - - - } - > - - - - {numeral( - indexData.stats?.primaries?.store?.total_data_set_size_in_bytes ?? 0 - ).format('0 b')} - - - - -

- -

-
-
- - - {numeral( - indexData.stats?.total?.store?.total_data_set_size_in_bytes ?? 0 - ).format('0 b')} - - - - -

- -

-
-
-
-
-
- )} {indexData.count === 0 && ( <> diff --git a/x-pack/plugins/serverless_search/server/lib/indices/fetch_index.test.ts b/x-pack/plugins/serverless_search/server/lib/indices/fetch_index.test.ts index 75bc95365bb04..1197c48661b35 100644 --- a/x-pack/plugins/serverless_search/server/lib/indices/fetch_index.test.ts +++ b/x-pack/plugins/serverless_search/server/lib/indices/fetch_index.test.ts @@ -9,7 +9,6 @@ jest.mock('@kbn/search-connectors', () => ({ fetchConnectorByIndexName: jest.fn(), })); -import { ByteSizeValue } from '@kbn/config-schema'; import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { fetchConnectorByIndexName } from '@kbn/search-connectors'; @@ -19,7 +18,6 @@ describe('fetch index lib function', () => { const mockClient = { indices: { get: jest.fn(), - stats: jest.fn(), }, count: jest.fn(), }; @@ -31,25 +29,7 @@ describe('fetch index lib function', () => { aliases: {}, }, }; - const regularIndexStatsResponse = { - indices: { - 'search-regular-index': { - health: 'green', - size: new ByteSizeValue(108000).toString(), - status: 'open', - total: { - docs: { - count: 100, - deleted: 0, - }, - store: { - size_in_bytes: 108000, - }, - }, - uuid: '83a81e7e-5955-4255-b008-5d6961203f57', - }, - }, - }; + const indexCountResponse = { count: 100, }; @@ -63,7 +43,6 @@ describe('fetch index lib function', () => { it('should return index if all client calls succeed', async () => { mockClient.indices.get.mockResolvedValue({ ...regularIndexResponse }); - mockClient.indices.stats.mockResolvedValue(regularIndexStatsResponse); mockClient.count.mockResolvedValue(indexCountResponse); (fetchConnectorByIndexName as unknown as jest.Mock).mockResolvedValue(indexConnector); @@ -72,44 +51,23 @@ describe('fetch index lib function', () => { aliases: {}, count: 100, connector: indexConnector, - stats: regularIndexStatsResponse.indices[indexName], }, }); }); - it('should throw an error if get index rejects', async () => { const expectedError = new Error('Boom!'); mockClient.indices.get.mockRejectedValue(expectedError); - mockClient.indices.stats.mockResolvedValue(regularIndexStatsResponse); mockClient.count.mockResolvedValue(indexCountResponse); (fetchConnectorByIndexName as unknown as jest.Mock).mockResolvedValue(indexConnector); await expect(fetchIndex(client(), indexName)).rejects.toEqual(expectedError); }); - it('should return partial data if index stats rejects', async () => { - const expectedError = new Error('Boom!'); - - mockClient.indices.get.mockResolvedValue({ ...regularIndexResponse }); - mockClient.indices.stats.mockRejectedValue(expectedError); - mockClient.count.mockResolvedValue(indexCountResponse); - (fetchConnectorByIndexName as unknown as jest.Mock).mockResolvedValue(indexConnector); - - await expect(fetchIndex(client(), indexName)).resolves.toMatchObject({ - index: { - aliases: {}, - count: 100, - connector: indexConnector, - }, - }); - }); - it('should return partial data if index count rejects', async () => { const expectedError = new Error('Boom!'); mockClient.indices.get.mockResolvedValue({ ...regularIndexResponse }); - mockClient.indices.stats.mockResolvedValue(regularIndexStatsResponse); mockClient.count.mockRejectedValue(expectedError); (fetchConnectorByIndexName as unknown as jest.Mock).mockResolvedValue(indexConnector); @@ -118,7 +76,6 @@ describe('fetch index lib function', () => { aliases: {}, count: 0, connector: indexConnector, - stats: regularIndexStatsResponse.indices[indexName], }, }); }); @@ -127,7 +84,6 @@ describe('fetch index lib function', () => { const expectedError = new Error('Boom!'); mockClient.indices.get.mockResolvedValue({ ...regularIndexResponse }); - mockClient.indices.stats.mockResolvedValue(regularIndexStatsResponse); mockClient.count.mockResolvedValue(indexCountResponse); (fetchConnectorByIndexName as unknown as jest.Mock).mockRejectedValue(expectedError); @@ -135,7 +91,6 @@ describe('fetch index lib function', () => { index: { aliases: {}, count: 100, - stats: regularIndexStatsResponse.indices[indexName], }, }); }); diff --git a/x-pack/plugins/serverless_search/server/lib/indices/fetch_index.ts b/x-pack/plugins/serverless_search/server/lib/indices/fetch_index.ts index 000eb1c13ea0a..fec67fd8584c1 100644 --- a/x-pack/plugins/serverless_search/server/lib/indices/fetch_index.ts +++ b/x-pack/plugins/serverless_search/server/lib/indices/fetch_index.ts @@ -4,23 +4,20 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { fetchConnectorByIndexName } from '@kbn/search-connectors'; - import { FetchIndexResult } from '../../../common/types'; export async function fetchIndex( client: ElasticsearchClient, indexName: string ): Promise { - const [indexDataResult, indexStatsResult, indexCountResult, connectorResult] = - await Promise.allSettled([ - client.indices.get({ index: indexName }), - client.indices.stats({ index: indexName }), - client.count({ index: indexName }), - fetchConnectorByIndexName(client, indexName), - ]); + const [indexDataResult, indexCountResult, connectorResult] = await Promise.allSettled([ + client.indices.get({ index: indexName }), + client.count({ index: indexName }), + fetchConnectorByIndexName(client, indexName), + ]); + if (indexDataResult.status === 'rejected') { throw indexDataResult.reason; } @@ -30,16 +27,11 @@ export async function fetchIndex( const index = indexData[indexName]; const count = indexCountResult.status === 'fulfilled' ? indexCountResult.value.count : 0; const connector = connectorResult.status === 'fulfilled' ? connectorResult.value : undefined; - const stats = - indexStatsResult.status === 'fulfilled' - ? indexStatsResult.value.indices?.[indexName] - : undefined; return { index: { ...index, count, connector, - stats, }, }; } diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 48ab3c8c34bc2..103c47a238357 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -38131,7 +38131,6 @@ "xpack.serverlessSearch.indexManagement.indexDetails.overview.aliasesFlyout.title": "{indexName} Alias", "xpack.serverlessSearch.indexManagement.indexDetails.overview.emptyPrompt.api.body": "Personnalisez ces variables en fonction de votre contenu. Pour un guide d'installation complet, consultez notre guide {getStartedLink}.", "xpack.serverlessSearch.indexManagement.indexDetails.overview.emptyPrompt.body": "Alimentez votre index avec des données en utilisant {logstashLink}, {beatsLink}, {connectorsLink} ou RESTful {apiCallsLink}.", - "xpack.serverlessSearch.indexManagement.indexDetails.overview.storagePanel.documentCount": "{documentCount} documents / {deletedCount} supprimés", "xpack.serverlessSearch.searchConnectors.configurationConnector.config.documentation.description": "Ce connecteur prend en charge plusieurs méthodes d'authentification. Demandez à votre administrateur les informations d'identification correctes pour la connexion. {documentationUrl}", "xpack.serverlessSearch.apiKey.apiKeyStepDescription": "Cette clé ne s’affichera qu’une fois, conservez-la donc en lieu sûr. Nous ne conservons pas vos clés d’API, vous devrez donc générer une clé de remplacement si vous la perdez.", "xpack.serverlessSearch.apiKey.apiKeyStepTitle": "Stocker cette clé d'API", @@ -38257,9 +38256,6 @@ "xpack.serverlessSearch.indexManagement.indexDetails.overview.error.description": "Une erreur s'est produite lors du chargement de l'index.", "xpack.serverlessSearch.indexManagement.indexDetails.overview.error.title": "Impossible de charger l'index", "xpack.serverlessSearch.indexManagement.indexDetails.overview.loading.title": "Chargement de l'index", - "xpack.serverlessSearch.indexManagement.indexDetails.overview.storagePanel.primaryLabel": "Principale", - "xpack.serverlessSearch.indexManagement.indexDetails.overview.storagePanel.title": "Stockage", - "xpack.serverlessSearch.indexManagement.indexDetails.overview.storagePanel.totalLabel": "Total", "xpack.serverlessSearch.indexManagementTab.documents": "Documents", "xpack.serverlessSearch.indexManagementTab.documents.noMappings": "Aucun document trouvé pour l'index", "xpack.serverlessSearch.indexMappings.ingestPipelinesDocs.description": "Vous souhaitez ajouter des champs personnalisés ou utiliser des modèles de ML entraînés pour analyser et enrichir vos documents indexés ? Utilisez des pipelines d'ingestion spécifiques de l'index pour personnaliser les documents selon vos besoins.", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index dac5c30126d51..0c0fa7527290e 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -38099,7 +38099,6 @@ "xpack.serverlessSearch.indexManagement.indexDetails.overview.aliasesFlyout.title": "{indexName}エイリアス", "xpack.serverlessSearch.indexManagement.indexDetails.overview.emptyPrompt.api.body": "これらの変数をコンテンツに合わせてカスタマイズします。詳細なセットアップガイドについては、{getStartedLink}ガイドをご覧ください。", "xpack.serverlessSearch.indexManagement.indexDetails.overview.emptyPrompt.body": "{logstashLink}、{beatsLink}、{connectorsLink}、またはRESTful {apiCallsLink}を使用して、データにインデックスを入力します。", - "xpack.serverlessSearch.indexManagement.indexDetails.overview.storagePanel.documentCount": "{documentCount}件のドキュメント / {deletedCount}削除済み", "xpack.serverlessSearch.searchConnectors.configurationConnector.config.documentation.description": "このコネクターは複数の認証方法をサポートします。正しい接続資格情報については、管理者に確認してください。{documentationUrl}", "xpack.serverlessSearch.apiKey.apiKeyStepDescription": "このキーは一度しか表示されないため、安全な場所に保存しておいてください。当社はお客様のAPIキーを保存しません。キーを紛失した場合は、代替キーを生成する必要があります。", "xpack.serverlessSearch.apiKey.apiKeyStepTitle": "このAPIキーを保存", @@ -38225,9 +38224,6 @@ "xpack.serverlessSearch.indexManagement.indexDetails.overview.error.description": "インデックスの読み込みエラーが発生しました。", "xpack.serverlessSearch.indexManagement.indexDetails.overview.error.title": "インデックスを読み込めません", "xpack.serverlessSearch.indexManagement.indexDetails.overview.loading.title": "インデックスを読み込んでいます", - "xpack.serverlessSearch.indexManagement.indexDetails.overview.storagePanel.primaryLabel": "プライマリ", - "xpack.serverlessSearch.indexManagement.indexDetails.overview.storagePanel.title": "ストレージ", - "xpack.serverlessSearch.indexManagement.indexDetails.overview.storagePanel.totalLabel": "合計", "xpack.serverlessSearch.indexManagementTab.documents": "ドキュメント", "xpack.serverlessSearch.indexManagementTab.documents.noMappings": "インデックスドキュメントが見つかりません", "xpack.serverlessSearch.indexMappings.ingestPipelinesDocs.description": "カスタムフィールドを追加したり、学習済みのMLモデルを使用してインデックスされたドキュメントを分析したり、インデックスされたドキュメントをリッチ化したいですか?インデックス固有のインジェストパイプラインを使用して、ニーズに合わせてドキュメントをカスタマイズします。", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 7e2e9e2e28f1e..b14b4d28e33a9 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -38143,7 +38143,6 @@ "xpack.serverlessSearch.indexManagement.indexDetails.overview.aliasesFlyout.title": "{indexName} 别名", "xpack.serverlessSearch.indexManagement.indexDetails.overview.emptyPrompt.api.body": "定制这些变量以匹配您的内容。如需完整的设置指南,请访问我们的{getStartedLink}指南。", "xpack.serverlessSearch.indexManagement.indexDetails.overview.emptyPrompt.body": "使用 {logstashLink}、{beatsLink}、{connectorsLink} 或 RESTful {apiCallsLink} 为您的索引填充数据。", - "xpack.serverlessSearch.indexManagement.indexDetails.overview.storagePanel.documentCount": "{documentCount} 个文档/{deletedCount} 个已删除", "xpack.serverlessSearch.searchConnectors.configurationConnector.config.documentation.description": "此连接器支持几种身份验证方法。请联系管理员获取正确的连接凭据。{documentationUrl}", "xpack.serverlessSearch.apiKey.apiKeyStepDescription": "此密钥仅显示一次,因此请将其保存到某个安全位置。我们不存储您的 API 密钥,因此,如果您丢失了密钥,则需要生成替代密钥。", "xpack.serverlessSearch.apiKey.apiKeyStepTitle": "存储此 API 密钥", @@ -38269,9 +38268,6 @@ "xpack.serverlessSearch.indexManagement.indexDetails.overview.error.description": "加载索引时出错。", "xpack.serverlessSearch.indexManagement.indexDetails.overview.error.title": "无法加载索引", "xpack.serverlessSearch.indexManagement.indexDetails.overview.loading.title": "正在加载索引", - "xpack.serverlessSearch.indexManagement.indexDetails.overview.storagePanel.primaryLabel": "主分片", - "xpack.serverlessSearch.indexManagement.indexDetails.overview.storagePanel.title": "存储", - "xpack.serverlessSearch.indexManagement.indexDetails.overview.storagePanel.totalLabel": "合计", "xpack.serverlessSearch.indexManagementTab.documents": "文档", "xpack.serverlessSearch.indexManagementTab.documents.noMappings": "找不到索引的文档", "xpack.serverlessSearch.indexMappings.ingestPipelinesDocs.description": "想要添加定制字段,或使用已训练 ML 模型分析并扩充您的已索引文档?使用特定于索引的采集管道根据您的需求来定制文档。", diff --git a/x-pack/test/functional/page_objects/index_management_page.ts b/x-pack/test/functional/page_objects/index_management_page.ts index 718dac14221ac..4cf5e6a36e376 100644 --- a/x-pack/test/functional/page_objects/index_management_page.ts +++ b/x-pack/test/functional/page_objects/index_management_page.ts @@ -129,6 +129,11 @@ export function IndexManagementPageProvider({ getService }: FtrProviderContext) return (await testSubjects.isDisplayed('indexDetailsHeader')) === true; }); }, + async expectIndexDetailsPageIsLoaded() { + await testSubjects.existOrFail('indexDetailsTab-overview'); + await testSubjects.existOrFail('indexDetailsContent'); + await testSubjects.existOrFail('indexDetailsBackToIndicesButton'); + }, }, async clickCreateIndexButton() { await testSubjects.click('createIndexButton'); @@ -153,5 +158,42 @@ export function IndexManagementPageProvider({ getService }: FtrProviderContext) ); expect(indexNames.some((i) => i === indexName)).to.be(true); }, + + async selectIndex(indexName: string) { + const id = `checkboxSelectIndex-${indexName}`; + const checkbox = await find.byCssSelector(`input[id="${id}"]`); + if (!(await checkbox.isSelected())) { + await find.clickByCssSelector(`input[id="${id}"]`); + } + }, + async clickManageButton() { + await testSubjects.existOrFail('indexActionsContextMenuButton'); + await testSubjects.click('indexActionsContextMenuButton'); + }, + async contextMenuIsVisible() { + await testSubjects.existOrFail('indexContextMenu'); + await testSubjects.existOrFail('deleteIndexMenuButton'); + await testSubjects.click('deleteIndexMenuButton'); + }, + async confirmDeleteModalIsVisible() { + await testSubjects.existOrFail('confirmModalTitleText'); + const modalText: string = await testSubjects.getVisibleText('confirmModalTitleText'); + expect(modalText).to.be('Delete index'); + await testSubjects.existOrFail('confirmModalConfirmButton'); + await testSubjects.click('confirmModalConfirmButton'); + // wait for index to be deleted + await testSubjects.missingOrFail('confirmModalConfirmButton'); + }, + + async expectIndexIsDeleted(indexName: string) { + const table = await find.byCssSelector('table'); + const rows = await table.findAllByTestSubject('indexTableRow'); + const indexNames: string[] = await Promise.all( + rows.map(async (row) => { + return await (await row.findByTestSubject('indexTableIndexNameLink')).getVisibleText(); + }) + ); + expect(indexNames.includes(indexName)).to.be(false); + }, }; } diff --git a/x-pack/test_serverless/functional/test_suites/common/management/index_management/index.ts b/x-pack/test_serverless/functional/test_suites/common/management/index_management/index.ts index 0df628a2ba587..4d69adb9b6bed 100644 --- a/x-pack/test_serverless/functional/test_suites/common/management/index_management/index.ts +++ b/x-pack/test_serverless/functional/test_suites/common/management/index_management/index.ts @@ -15,5 +15,6 @@ export default ({ loadTestFile }: FtrProviderContext) => { loadTestFile(require.resolve('./enrich_policies')); loadTestFile(require.resolve('./index_templates')); loadTestFile(require.resolve('./indices')); + loadTestFile(require.resolve('./index_detail')); }); }; diff --git a/x-pack/test_serverless/functional/test_suites/common/management/index_management/index_detail.ts b/x-pack/test_serverless/functional/test_suites/common/management/index_management/index_detail.ts new file mode 100644 index 0000000000000..b4e9aad21d2c6 --- /dev/null +++ b/x-pack/test_serverless/functional/test_suites/common/management/index_management/index_detail.ts @@ -0,0 +1,41 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../../ftr_provider_context'; + +export default ({ getPageObjects, getService }: FtrProviderContext) => { + const pageObjects = getPageObjects(['svlCommonPage', 'common', 'indexManagement', 'header']); + const browser = getService('browser'); + const security = getService('security'); + const testIndexName = `index-ftr-test-${Math.random()}`; + describe('Index Details ', function () { + before(async () => { + await security.testUser.setRoles(['index_management_user']); + await pageObjects.svlCommonPage.loginAsAdmin(); + await pageObjects.common.navigateToApp('indexManagement'); + // Navigate to the indices tab + await pageObjects.indexManagement.changeTabs('indicesTab'); + await pageObjects.header.waitUntilLoadingHasFinished(); + }); + + it('renders the indices tab', async () => { + const url = await browser.getCurrentUrl(); + expect(url).to.contain(`/indices`); + }); + it('can create an index', async () => { + await pageObjects.indexManagement.clickCreateIndexButton(); + await pageObjects.indexManagement.setCreateIndexName(testIndexName); + await pageObjects.indexManagement.clickCreateIndexSaveButton(); + await pageObjects.indexManagement.expectIndexToExist(testIndexName); + }); + it('index with no documents', async () => { + await pageObjects.indexManagement.indexDetailsPage.openIndexDetailsPage(0); + await pageObjects.indexManagement.indexDetailsPage.expectIndexDetailsPageIsLoaded(); + }); + }); +}; diff --git a/x-pack/test_serverless/functional/test_suites/common/management/index_management/indices.ts b/x-pack/test_serverless/functional/test_suites/common/management/index_management/indices.ts index c0994de088513..fe5938109d7b8 100644 --- a/x-pack/test_serverless/functional/test_suites/common/management/index_management/indices.ts +++ b/x-pack/test_serverless/functional/test_suites/common/management/index_management/indices.ts @@ -22,17 +22,25 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.indexManagement.changeTabs('indicesTab'); await pageObjects.header.waitUntilLoadingHasFinished(); }); - + const testIndexName = `index-ftr-test-${Math.random()}`; it('renders the indices tab', async () => { const url = await browser.getCurrentUrl(); expect(url).to.contain(`/indices`); }); it('can create an index', async () => { - const testIndexName = `index-ftr-test-${Math.random()}`; await pageObjects.indexManagement.clickCreateIndexButton(); await pageObjects.indexManagement.setCreateIndexName(testIndexName); await pageObjects.indexManagement.clickCreateIndexSaveButton(); await pageObjects.indexManagement.expectIndexToExist(testIndexName); }); + it('can manage index', async () => { + await pageObjects.indexManagement.selectIndex(testIndexName); + await pageObjects.indexManagement.clickManageButton(); + await pageObjects.indexManagement.contextMenuIsVisible(); + }); + it('can delete index', async () => { + await pageObjects.indexManagement.confirmDeleteModalIsVisible(); + await pageObjects.indexManagement.expectIndexIsDeleted(testIndexName); + }); }); };