Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* 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 type { Page } from '@playwright/test';
import { DiscoverValidationPage } from '../stateful/pom/pages/discover_validation.page';
import { StreamsValidationPage } from '../stateful/pom/pages/streams_validation.page';

export async function assertDiscoverHasData(
page: Page,
{ assertHitCount = false } = {}
): Promise<void> {
const discoverValidation = new DiscoverValidationPage(page);
await discoverValidation.waitForDiscoverToLoad();
await discoverValidation.assertHasAnyLogData();
if (assertHitCount) {
await discoverValidation.assertHitCountGreaterThanZero();
}
}

export async function assertStreamHasData(page: Page, streamName: string): Promise<void> {
await page.goto(`${process.env.KIBANA_BASE_URL}/app/streams`);
const streamsValidation = new StreamsValidationPage(page);
await streamsValidation.waitForStreamsToLoad();
await streamsValidation.assertStreamDocCountGreaterThanZero(streamName);
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,32 @@ import path from 'node:path';
import { test } from './fixtures/base_page';
import { HostDetailsPage } from './pom/pages/host_details.page';
import { assertEnv } from '../lib/assert_env';
import { assertDiscoverHasData, assertStreamHasData } from '../lib/validation_helpers';

test.beforeEach(async ({ page }) => {
await page.goto(`${process.env.KIBANA_BASE_URL}/app/observabilityOnboarding`);
});

test('Auto-detect logs and metrics', async ({ page, onboardingHomePage, autoDetectFlowPage }) => {
test('Auto-detect logs and metrics', async ({
page,
onboardingHomePage,
autoDetectFlowPage,
wiredStreamsSelector,
}) => {
assertEnv(process.env.ARTIFACTS_FOLDER, 'ARTIFACTS_FOLDER is not defined.');

const isLogsEssentialsMode = process.env.LOGS_ESSENTIALS_MODE === 'true';
const useWiredStreams = process.env.USE_WIRED_STREAMS === 'true';
const fileName = 'code_snippet_logs_auto_detect.sh';
const outputPath = path.join(__dirname, '..', process.env.ARTIFACTS_FOLDER, fileName);

await onboardingHomePage.selectHostUseCase();
await onboardingHomePage.selectAutoDetectWithElasticAgent();

if (useWiredStreams) {
await wiredStreamsSelector.selectWiredStreamsMode();
}

await autoDetectFlowPage.assertVisibilityCodeBlock();
await autoDetectFlowPage.copyToClipboard();

Expand All @@ -36,7 +47,11 @@ test('Auto-detect logs and metrics', async ({ page, onboardingHomePage, autoDete
*/
fs.writeFileSync(outputPath, clipboardData);

await autoDetectFlowPage.assertReceivedDataIndicator();
if (useWiredStreams) {
await autoDetectFlowPage.assertLogsDataReceivedIndicator();
} else {
await autoDetectFlowPage.assertReceivedDataIndicator();
}

/**
* Host Details page sometime shows "No Data"
Expand All @@ -50,24 +65,36 @@ test('Auto-detect logs and metrics', async ({ page, onboardingHomePage, autoDete
*/
await page.waitForTimeout(2 * 60000);

await autoDetectFlowPage.clickAutoDetectSystemIntegrationCTA();

/**
* Host Details pages open in a new tab, so it
* needs to be captured using the `popup` event.
* Wired streams only reroutes logs (to logs.ecs); metrics are unaffected.
* So for wired streams we validate log delivery via Discover and the Streams
* page, and intentionally skip the Host Details dashboard check. Dashboard
* validation is already covered by the non-wired test variants.
*
* Both "wired streams" and "wired streams + logs essentials" fall into this
* single branch because the validation path is identical for both.
*/
const hostDetailsPage = new HostDetailsPage(await page.waitForEvent('popup'));

if (!isLogsEssentialsMode) {
await hostDetailsPage.assertCpuPercentageNotEmpty();
if (useWiredStreams) {
if (await autoDetectFlowPage.hasCustomLogsExploreButtons()) {
const popupPage = await autoDetectFlowPage.clickCustomLogsExploreInPopup();
await assertDiscoverHasData(popupPage, { assertHitCount: true });
}
await assertStreamHasData(page, 'logs.ecs');
Comment on lines +77 to +82
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Don't let wired-mode Discover coverage be skipped silently.

If hasCustomLogsExploreButtons() flips to false, this branch still passes after only checking the stream page. Please assert those buttons are present or fall back to the non-popup Explore Logs action so regressions in the user-facing Discover path are caught.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@x-pack/solutions/observability/plugins/observability_onboarding/e2e/playwright/stateful/auto_detect.spec.ts`
around lines 77 - 82, When useWiredStreams is true we currently only handle the
popup path and then silently continue when hasCustomLogsExploreButtons() is
false; update the branch so you explicitly assert or exercise the non-popup
Explore Logs path: call autoDetectFlowPage.hasCustomLogsExploreButtons(), and if
true keep the current flow (clickCustomLogsExploreInPopup() and
assertDiscoverHasData(popupPage)), otherwise call the non-popup action (e.g.
autoDetectFlowPage.clickExploreLogs() or the equivalent method on
autoDetectFlowPage) and then call assertDiscoverHasData(...) on the returned or
current page; this ensures either an explicit assertion that the custom buttons
exist or a fallback to the normal Explore Logs action instead of skipping
Discover coverage.

} else {
await autoDetectFlowPage.assertReceivedDataIndicator();
await autoDetectFlowPage.clickAutoDetectSystemIntegrationCTA();

await page.goto(`${process.env.KIBANA_BASE_URL}/app/discover`);
/**
* Host Details pages open in a new tab, so it
* needs to be captured using the `popup` event.
*/
const hostDetailsPage = new HostDetailsPage(await page.waitForEvent('popup'));
Comment on lines +84 to +90
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n x-pack/solutions/observability/plugins/observability_onboarding/e2e/playwright/stateful/auto_detect.spec.ts | sed -n '75,110p'

Repository: elastic/kibana

Length of output: 1867


🌐 Web query:

Playwright waitForEvent popup race condition timing before click

💡 Result:

In Playwright, waitForEvent('popup') can “miss” the popup if you start waiting after the user action fires window.open() (classic timing/race issue). The fix is to arm the event listener first, then trigger the click/keypress.

Recommended (Playwright “event trap” pattern)

const popupPromise = page.waitForEvent('popup'); // no await here
await page.getByText('open the popup').click();
const popup = await popupPromise;

This is the pattern shown in the official docs. [1]

Equivalent pattern with Promise.all

const [popup] = await Promise.all([
  page.waitForEvent('popup'),
  page.getByText('open the popup').click(),
]);

This prevents the popup from opening before the wait is registered. [2]

If it’s a new tab/page (not necessarily a “popup”)

Sometimes the more reliable event is on the context:

const pagePromise = context.waitForEvent('page'); // arm first
await page.getByRole('link', { name: 'Open' }).click();
const newPage = await pagePromise;

(Discussed in common Playwright guidance around “handling new pages”.) [2]

Rule of thumb: create the waitForEvent promise before the click/keypress that opens the window, and only await it afterwards. [1][2]

Sources: [1] Playwright Events docs, [2] Stack Overflow discussion of waitForEvent('popup') timing and patterns.


Register the popup waiter before clicking the CTA.

page.waitForEvent('popup') is attached after clickAutoDetectSystemIntegrationCTA(), so a fast new tab can be missed and this branch will hang intermittently. Playwright requires the event listener to be subscribed before the action that opens the popup. Move the popup waiter into the non-logs-essentials branch only, since that's where the Host Details page opens.

🛠️ Suggested fix
-    await autoDetectFlowPage.clickAutoDetectSystemIntegrationCTA();
-
-    /**
-     * Host Details pages open in a new tab, so it
-     * needs to be captured using the `popup` event.
-     */
-    const hostDetailsPage = new HostDetailsPage(await page.waitForEvent('popup'));
-
     if (!isLogsEssentialsMode) {
+      /**
+       * Host Details opens in a new tab, so subscribe before clicking.
+       */
+      const popupPromise = page.waitForEvent('popup');
+      await autoDetectFlowPage.clickAutoDetectSystemIntegrationCTA();
+      const hostDetailsPage = new HostDetailsPage(await popupPromise);
       await hostDetailsPage.assertCpuPercentageNotEmpty();
     } else {
+      await autoDetectFlowPage.clickAutoDetectSystemIntegrationCTA();
       await autoDetectFlowPage.assertReceivedDataIndicator();
       await page.goto(`${process.env.KIBANA_BASE_URL}/app/discover`);
       await assertDiscoverHasData(page);
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@x-pack/solutions/observability/plugins/observability_onboarding/e2e/playwright/stateful/auto_detect.spec.ts`
around lines 84 - 90, Move the popup waiter so it is registered before the
action that opens the new tab: in the non-logs-essentials branch, call
page.waitForEvent('popup') and store the resulting promise, then call
autoDetectFlowPage.clickAutoDetectSystemIntegrationCTA(), and finally construct
the HostDetailsPage from the awaited popup promise (HostDetailsPage(await
popupPromise)). This ensures the event listener for the popup is attached before
invoking clickAutoDetectSystemIntegrationCTA() and only exists in the branch
that opens HostDetailsPage.


const { DiscoverValidationPage } = await import('./pom/pages/discover_validation.page');
const discoverValidation = new DiscoverValidationPage(page);
await discoverValidation.waitForDiscoverToLoad();
await discoverValidation.assertHasAnyLogData();
if (!isLogsEssentialsMode) {
await hostDetailsPage.assertCpuPercentageNotEmpty();
} else {
await autoDetectFlowPage.assertReceivedDataIndicator();
await page.goto(`${process.env.KIBANA_BASE_URL}/app/discover`);
await assertDiscoverHasData(page);
}
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ import { OtelHostFlowPage } from '../pom/pages/otel_host_flow.page';
import { HostsOverviewPage } from '../pom/pages/hosts_overview.page';
import { FirehoseFlowPage } from '../pom/pages/firehose_flow.page';
import { FleetAgentsOverviewPage } from '../pom/pages/fleet_agents_overview.page';
import { WiredStreamsSelector } from '../pom/components/wired_streams_selector.component';

export const test = base.extend<{
headerBar: HeaderBar;
spaceSelector: SpaceSelector;
onboardingHomePage: OnboardingHomePage;
wiredStreamsSelector: WiredStreamsSelector;
autoDetectFlowPage: AutoDetectFlowPage;
kubernetesEAFlowPage: KubernetesEAFlowPage;
otelKubernetesFlowPage: OtelKubernetesFlowPage;
Expand All @@ -45,6 +47,10 @@ export const test = base.extend<{
await use(new OnboardingHomePage(page));
},

wiredStreamsSelector: async ({ page }, use) => {
await use(new WiredStreamsSelector(page));
},

autoDetectFlowPage: async ({ page }, use) => {
await use(new AutoDetectFlowPage(page));
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,23 @@ import os from 'node:os';
import path from 'node:path';
import { test } from './fixtures/base_page';
import { assertEnv } from '../lib/assert_env';
import { assertDiscoverHasData, assertStreamHasData } from '../lib/validation_helpers';

test.beforeEach(async ({ page }) => {
await page.goto(`${process.env.KIBANA_BASE_URL}/app/observabilityOnboarding`);
});

test('Otel Host', async ({ page, onboardingHomePage, otelHostFlowPage, hostsOverviewPage }) => {
test('Otel Host', async ({
page,
onboardingHomePage,
otelHostFlowPage,
hostsOverviewPage,
wiredStreamsSelector,
}) => {
assertEnv(process.env.ARTIFACTS_FOLDER, 'ARTIFACTS_FOLDER is not defined.');

const isLogsEssentialsMode = process.env.LOGS_ESSENTIALS_MODE === 'true';
const useWiredStreams = process.env.USE_WIRED_STREAMS === 'true';
const fileName = 'code_snippet_otel_host.sh';
const outputPath = path.join(__dirname, '..', process.env.ARTIFACTS_FOLDER, fileName);

Expand All @@ -28,6 +36,10 @@ test('Otel Host', async ({ page, onboardingHomePage, otelHostFlowPage, hostsOver
const osName = process.env.OS_NAME || os.platform();
await otelHostFlowPage.selectPlatform(osName);

if (useWiredStreams) {
await wiredStreamsSelector.selectWiredStreamsMode();
}

await otelHostFlowPage.copyCollectorDownloadSnippetToClipboard();
const collectorDownloadSnippet = (await page.evaluate(
'navigator.clipboard.readText()'
Expand All @@ -52,16 +64,26 @@ test('Otel Host', async ({ page, onboardingHomePage, otelHostFlowPage, hostsOver
*/
await page.waitForTimeout(3 * 60000);

if (!isLogsEssentialsMode) {
/**
* Wired streams only reroutes logs (to logs.otel); metrics and traces are
* unaffected. So for wired streams we validate log delivery via Discover and
* the Streams page, and intentionally skip the Hosts Overview dashboard
* check. Dashboard validation is already covered by the non-wired test
* variants.
*
* Both "wired streams" and "wired streams + logs essentials" fall into this
* single branch because the validation path is identical for both.
*/
if (useWiredStreams) {
await otelHostFlowPage.clickLogsExplorationCTA();
await assertDiscoverHasData(page, { assertHitCount: true });
await assertStreamHasData(page, 'logs.otel');
} else if (!isLogsEssentialsMode) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, actually what about logs essentials + wired streams?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, had to quadruple check that.
Actually it's correct(kind of 😄 ). In Logs Essentials we don't rely on dashboards, we just rely on logs in the discover, same as in wired streams mode ( plus we rely on streams page). So when it falls under Wired streams category it skips the dashboard checks we do in stateful/serverless.

That also means we don't check any dashboards in wired streams flows in those tests. Initially I had a thought that we don't need to do this cause we don't touch metrics when enabling wired streams but now I am thinking that maybe it's also worth checking just to be safe.
WDYT?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, let's leave a comment though since these relationships are hard to figure out later on.

await otelHostFlowPage.clickHostsOverviewCTA();
const hostname = os.hostname();
await hostsOverviewPage.assertHostCpuNotEmpty(hostname);
} else {
await otelHostFlowPage.clickLogsExplorationCTA();

const { DiscoverValidationPage } = await import('./pom/pages/discover_validation.page');
const discoverValidation = new DiscoverValidationPage(page);
await discoverValidation.waitForDiscoverToLoad();
await discoverValidation.assertHasAnyLogData();
await assertDiscoverHasData(page);
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import fs from 'node:fs';
import path from 'node:path';
import { test } from './fixtures/base_page';
import { assertEnv } from '../lib/assert_env';
import { assertDiscoverHasData, assertStreamHasData } from '../lib/validation_helpers';

test.beforeEach(async ({ page }) => {
await page.goto(`${process.env.KIBANA_BASE_URL}/app/observabilityOnboarding`);
Expand All @@ -19,16 +20,22 @@ test('Kubernetes EA', async ({
onboardingHomePage,
kubernetesEAFlowPage,
kubernetesOverviewDashboardPage,
wiredStreamsSelector,
}) => {
assertEnv(process.env.ARTIFACTS_FOLDER, 'ARTIFACTS_FOLDER is not defined.');

const isLogsEssentialsMode = process.env.LOGS_ESSENTIALS_MODE === 'true';
const useWiredStreams = process.env.USE_WIRED_STREAMS === 'true';
const fileName = 'code_snippet_kubernetes.sh';
const outputPath = path.join(__dirname, '..', process.env.ARTIFACTS_FOLDER, fileName);

await onboardingHomePage.selectKubernetesUseCase();
await onboardingHomePage.selectKubernetesQuickstart();

if (useWiredStreams) {
await wiredStreamsSelector.selectWiredStreamsMode();
}

await kubernetesEAFlowPage.assertVisibilityCodeBlock();
await kubernetesEAFlowPage.copyToClipboard();

Expand All @@ -45,9 +52,30 @@ test('Kubernetes EA', async ({
*/
fs.writeFileSync(outputPath, clipboardData);

if (!isLogsEssentialsMode) {
/**
* Wired streams only reroutes logs (to logs.ecs); metrics are unaffected.
* So for wired streams we validate log delivery via Discover and the Streams
* page, and intentionally skip the Kubernetes Overview dashboard check.
* Dashboard validation is already covered by the non-wired test variants.
*
* The logs essentials sub-case skips the data indicator and navigates to
* Discover directly because the K8s EA has-data API relies on
* fields.onboarding_id, which is unreliable when metrics are disabled in
* the logs essentials tier.
*/
if (useWiredStreams && !isLogsEssentialsMode) {
await kubernetesEAFlowPage.assertReceivedDataIndicatorKubernetes();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit worried about how big these branches are getting - can we somehow deduplicate? It's fine if not, but it seems like it's easy to forget about stuff this way

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try to extract some code into helpers

await page.waitForTimeout(2 * 60000);
await kubernetesEAFlowPage.clickExploreLogsCTA();
await assertDiscoverHasData(page, { assertHitCount: true });
await assertStreamHasData(page, 'logs.ecs');
} else if (useWiredStreams && isLogsEssentialsMode) {
await page.waitForTimeout(5 * 60000);
await page.goto(`${process.env.KIBANA_BASE_URL}/app/discover`);
await assertDiscoverHasData(page, { assertHitCount: true });
await assertStreamHasData(page, 'logs.ecs');
} else if (!isLogsEssentialsMode) {
await kubernetesEAFlowPage.assertReceivedDataIndicatorKubernetes();

/**
* There might be a case that dashboard still does not show
* the data even though it was ingested already. This usually
Expand All @@ -58,17 +86,11 @@ test('Kubernetes EA', async ({
* for the data to propagate everywhere.
*/
await page.waitForTimeout(2 * 60000);

await kubernetesEAFlowPage.clickKubernetesAgentCTA();
await kubernetesOverviewDashboardPage.assertNodesPanelNotEmpty();
} else {
await page.waitForTimeout(5 * 60000);

await page.goto(`${process.env.KIBANA_BASE_URL}/app/discover`);

const { DiscoverValidationPage } = await import('./pom/pages/discover_validation.page');
const discoverValidation = new DiscoverValidationPage(page);
await discoverValidation.waitForDiscoverToLoad();
await discoverValidation.assertHasAnyLogData();
await assertDiscoverHasData(page);
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { test } from './fixtures/base_page';
import { assertEnv } from '../lib/assert_env';
import { OtelKubernetesOverviewDashboardPage } from './pom/pages/otel_kubernetes_overview_dashboard.page';
import { ApmServiceInventoryPage } from './pom/pages/apm_service_inventory.page';
import { assertDiscoverHasData, assertStreamHasData } from '../lib/validation_helpers';

/**
* In case you need to run this test locally, you can use https://github.com/elastic/oblt-reference-stack
Expand All @@ -29,10 +30,16 @@ test.beforeEach(async ({ page }) => {
const INSTRUMENTED_APP_CONTAINER_NAMESPACE = 'java';
const INSTRUMENTED_APP_NAME = 'java-app';

test('Otel Kubernetes', async ({ page, onboardingHomePage, otelKubernetesFlowPage }) => {
test('Otel Kubernetes', async ({
page,
onboardingHomePage,
otelKubernetesFlowPage,
wiredStreamsSelector,
}) => {
assertEnv(process.env.ARTIFACTS_FOLDER, 'ARTIFACTS_FOLDER is not defined.');

const isLogsEssentialsMode = process.env.LOGS_ESSENTIALS_MODE === 'true';
const useWiredStreams = process.env.USE_WIRED_STREAMS === 'true';
const fileName = 'code_snippet_otel_kubernetes.sh';
const outputPath = path.join(__dirname, '..', process.env.ARTIFACTS_FOLDER, fileName);

Expand All @@ -42,12 +49,16 @@ test('Otel Kubernetes', async ({ page, onboardingHomePage, otelKubernetesFlowPag
await otelKubernetesFlowPage.copyHelmRepositorySnippetToClipboard();
const helmRepoSnippet = (await page.evaluate('navigator.clipboard.readText()')) as string;

if (useWiredStreams) {
await wiredStreamsSelector.selectWiredStreamsMode();
}
Comment on lines 49 to +54
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Switch to wired mode before reading the first snippet.

In wired runs, helmRepoSnippet still comes from the default path while installStackSnippet comes from wired mode. That builds a mixed script instead of the actual wired instructions.

💡 Suggested change
-  await otelKubernetesFlowPage.copyHelmRepositorySnippetToClipboard();
-  const helmRepoSnippet = (await page.evaluate('navigator.clipboard.readText()')) as string;
-
   if (useWiredStreams) {
     await wiredStreamsSelector.selectWiredStreamsMode();
   }
+
+  await otelKubernetesFlowPage.copyHelmRepositorySnippetToClipboard();
+  const helmRepoSnippet = (await page.evaluate('navigator.clipboard.readText()')) as string;
 
   await otelKubernetesFlowPage.copyInstallStackSnippetToClipboard();
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@x-pack/solutions/observability/plugins/observability_onboarding/e2e/playwright/stateful/kubernetes_otel.spec.ts`
around lines 49 - 54, The helm repository snippet is being read before switching
to wired mode, producing a mixed-script; move the wired-mode toggle so
wiredStreamsSelector.selectWiredStreamsMode() runs before calling
otelKubernetesFlowPage.copyHelmRepositorySnippetToClipboard() and reading
helmRepoSnippet (the variable), ensuring both helmRepoSnippet and
installStackSnippet are captured after useWiredStreams is applied.


await otelKubernetesFlowPage.copyInstallStackSnippetToClipboard();
const installStackSnippet = (await page.evaluate('navigator.clipboard.readText()')) as string;

let codeSnippet: string;

if (!isLogsEssentialsMode) {
if (!isLogsEssentialsMode && !useWiredStreams) {
/**
* Getting the snippets and replacing placeholder
* with the values used by Ensemble
Expand Down Expand Up @@ -85,7 +96,21 @@ test('Otel Kubernetes', async ({ page, onboardingHomePage, otelKubernetesFlowPag
*/
await page.waitForTimeout(5 * 60000);

if (!isLogsEssentialsMode) {
/**
* Wired streams only reroutes logs (to logs.otel); metrics and traces are
* unaffected. So for wired streams we validate log delivery via Discover and
* the Streams page, and intentionally skip the Cluster Overview dashboard
* and APM Service Inventory checks. Dashboard/APM validation is already
* covered by the non-wired test variants.
*
* Both "wired streams" and "wired streams + logs essentials" fall into this
* single branch because the validation path is identical for both.
*/
if (useWiredStreams) {
await otelKubernetesFlowPage.clickExploreLogsCTA();
await assertDiscoverHasData(page, { assertHitCount: true });
await assertStreamHasData(page, 'logs.otel');
} else if (!isLogsEssentialsMode) {
const otelKubernetesOverviewDashboardPage = new OtelKubernetesOverviewDashboardPage(
await otelKubernetesFlowPage.openClusterOverviewDashboardInNewTab()
);
Expand All @@ -101,9 +126,7 @@ test('Otel Kubernetes', async ({ page, onboardingHomePage, otelKubernetesFlowPag
await apmServiceInventoryPage.page.getByTestId(serviceTestId).click();
await apmServiceInventoryPage.assertTransactionExists();
} else {
const discoverValidation =
await otelKubernetesFlowPage.clickExploreLogsAndGetDiscoverValidation();
await discoverValidation.waitForDiscoverToLoad();
await discoverValidation.assertHasAnyLogData();
await otelKubernetesFlowPage.clickExploreLogsCTA();
await assertDiscoverHasData(page);
}
});
Loading
Loading