From fa25c8d4e4de01367541c32fa14091f0dd7177bc Mon Sep 17 00:00:00 2001 From: Jenny Date: Wed, 5 Jun 2024 16:52:31 +0200 Subject: [PATCH] Add logs tab to container views --- .../asset_details_tabs.tsx | 6 ++--- .../test/functional/apps/infra/home_page.ts | 16 +++++++++++++ .../functional/apps/infra/node_details.ts | 23 +++++++++++++++++++ 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/observability_solution/infra/public/common/asset_details_config/asset_details_tabs.tsx b/x-pack/plugins/observability_solution/infra/public/common/asset_details_config/asset_details_tabs.tsx index c7f4b9f497a52..173d39726292f 100644 --- a/x-pack/plugins/observability_solution/infra/public/common/asset_details_config/asset_details_tabs.tsx +++ b/x-pack/plugins/observability_solution/infra/public/common/asset_details_config/asset_details_tabs.tsx @@ -110,9 +110,9 @@ export const hostDetailsTabs: Tab[] = [ ]; export const hostDetailsFlyoutTabs: Tab[] = [...hostDetailsTabs, linkToApmTab]; -// Profiling and Logs tab would be added in next iteration -export const containerDetailsTabs: Tab[] = [overviewTab, metadataTab]; -export const containerDetailsFlyoutTabs: Tab[] = [overviewTab, metadataTab, linkToApmTab]; +// The profiling tab would be added in next iteration +export const containerDetailsTabs: Tab[] = [overviewTab, metadataTab, logsTab]; +export const containerDetailsFlyoutTabs: Tab[] = [overviewTab, metadataTab, logsTab, linkToApmTab]; export const getAssetDetailsTabs = (type: string): Tab[] => { switch (type) { diff --git a/x-pack/test/functional/apps/infra/home_page.ts b/x-pack/test/functional/apps/infra/home_page.ts index f1de6350b084f..40e6d0bce4d97 100644 --- a/x-pack/test/functional/apps/infra/home_page.ts +++ b/x-pack/test/functional/apps/infra/home_page.ts @@ -328,6 +328,22 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { }); }); + describe('Logs Tab', () => { + before(async () => { + await pageObjects.assetDetails.clickLogsTab(); + }); + + after(async () => { + await retry.try(async () => { + await pageObjects.infraHome.closeFlyout(); + }); + }); + + it('should render logs tab', async () => { + await pageObjects.assetDetails.logsExists(); + }); + }); + describe('APM Link Tab', () => { before(async () => { await pageObjects.infraHome.clickOnNode(); diff --git a/x-pack/test/functional/apps/infra/node_details.ts b/x-pack/test/functional/apps/infra/node_details.ts index 47792ec4bb2ba..0b004c0f5371a 100644 --- a/x-pack/test/functional/apps/infra/node_details.ts +++ b/x-pack/test/functional/apps/infra/node_details.ts @@ -670,6 +670,29 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { expect(charts.length).to.equal(chartsCount); }); }); + describe('Logs Tab', () => { + before(async () => { + await pageObjects.assetDetails.clickLogsTab(); + }); + + it('should render logs tab', async () => { + await pageObjects.assetDetails.logsExists(); + }); + + it('preserves search term between page reloads', async () => { + const searchInput = await pageObjects.assetDetails.getLogsSearchField(); + + expect(await searchInput.getAttribute('value')).to.be(''); + + await searchInput.type('test'); + await refreshPageWithDelay(); + + await retry.try(async () => { + expect(await searchInput.getAttribute('value')).to.be('test'); + }); + await searchInput.clearValue(); + }); + }); }); }); });