Skip to content

[Discover][Metrics] Add Scout E2E tests for metrics insights flyout and breakdown dimensions#254753

Merged
lucaslopezf merged 18 commits intoelastic:mainfrom
lucaslopezf:5194-metrics-discover-e2e-flyout-dimensions-and-security-tag
Mar 6, 2026
Merged

[Discover][Metrics] Add Scout E2E tests for metrics insights flyout and breakdown dimensions#254753
lucaslopezf merged 18 commits intoelastic:mainfrom
lucaslopezf:5194-metrics-discover-e2e-flyout-dimensions-and-security-tag

Conversation

@lucaslopezf
Copy link
Copy Markdown
Contributor

@lucaslopezf lucaslopezf commented Feb 24, 2026

Summary

This PR adds Scout UI (Playwright) e2e coverage for Metrics in Discover, focusing on the grid’s key interactions and the Insights flyout experience. It also adds minimal, stable data-test-subj hooks in the flyout components to make selectors reliable.

What’s included

  • Insights flyout e2e

    • Open flyout from a metric card via View details
    • Verify Overview tab content renders
    • Verify ES|QL Query tab renders the query code block
    • Validate Dimensions pagination (jump to last page, next/prev)
  • Metrics grid e2e

    • Grid activation compatibility across ES|QL commands (TS, WHERE, LIMIT, SORT) and non-supported commands (FROM, STATS)
    • Pagination across metric cards
    • Search filtering and empty state
    • Breakdown selector dimension changes keep grid functional
    • Metric card actions menu exposes View details and Copy to dashboard; hover actions expose Explore

Test plan

  • Run Scout UI tests locally (examples):
# Start a server (choose one)
node scripts/scout start-server --arch stateful --domain classic
node scripts/scout start-server --arch serverless --domain observability_complete

# Run the suite
npx playwright test \
  src/platform/plugins/shared/discover/test/scout/ui/parallel_tests/metrics_experience/ \
  --config src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts \
  --project local --trace on

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/flaky scoutConfig:src/platform/plugins/shared/discover/test/scout/ui/metrics_experience_parallel.playwright.config.ts:30

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner

✅ Build triggered - kibana-flaky-test-suite-runner#10854

  • src/platform/plugins/shared/discover/test/scout/ui/metrics_experience_parallel.playwright.config.ts x30

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#10854

[✅] src/platform/plugins/shared/discover/test/scout/ui/metrics_experience_parallel.playwright.config.ts: 30/30 tests passed.

see run history

@lucaslopezf lucaslopezf force-pushed the 5194-metrics-discover-e2e-flyout-dimensions-and-security-tag branch from 965813b to 9fc03b7 Compare March 3, 2026 13:54
@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/ci

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/flaky scoutConfig:src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts:1

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner

✅ Build triggered - kibana-flaky-test-suite-runner#10944

  • src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts x1

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#10944

[❌] src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts: 0/1 tests passed.

see run history

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/flaky scoutConfig:src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts:1

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner

✅ Build triggered - kibana-flaky-test-suite-runner#10945

  • src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts x1

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#10945

[✅] src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts: 1/1 tests passed.

see run history

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/flaky scoutConfig:src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts:100

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/ci

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner

✅ Build triggered - kibana-flaky-test-suite-runner#10946

  • src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts x100

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#10946

[✅] src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts: 100/100 tests passed.

see run history

@lucaslopezf lucaslopezf added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Feature:Metrics in Discover labels Mar 4, 2026
@lucaslopezf lucaslopezf marked this pull request as ready for review March 4, 2026 14:39
@lucaslopezf lucaslopezf requested a review from a team as a code owner March 4, 2026 14:39
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/obs-exploration-team (Team:obs-exploration)

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/flaky scoutConfig:src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts:30

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner

✅ Build triggered - kibana-flaky-test-suite-runner#10964

  • src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts x30

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#10964

[❌] src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts: 29/30 tests passed.

see run history

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/flaky scoutConfig:src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts:50

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner

✅ Build triggered - kibana-flaky-test-suite-runner#10966

  • src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts x50

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#10966

[✅] src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts: 50/50 tests passed.

see run history

Copy link
Copy Markdown
Contributor

@justinkambic justinkambic left a comment

Choose a reason for hiding this comment

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

LGTM!

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/flaky scoutConfig:src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts:30

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner

✅ Build triggered - kibana-flaky-test-suite-runner#10993

  • src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts x30

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#10993

[✅] src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts: 30/30 tests passed.

see run history

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/flaky scoutConfig:src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts:30

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner

✅ Build triggered - kibana-flaky-test-suite-runner#10996

  • src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts x30

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#10996

[✅] src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts: 30/30 tests passed.

see run history

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Scout: [ platform / lens ] plugin / local-stateful-classic - Lens Convert to ES|QL - should update and reflect the visualization configuration after the conversion

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
discover 1.6MB 1.6MB +284.0B

History

@lucaslopezf lucaslopezf merged commit fc0b7ce into elastic:main Mar 6, 2026
18 checks passed
kapral18 pushed a commit to kapral18/kibana that referenced this pull request Mar 9, 2026
…nd breakdown dimensions (elastic#254753)

## Summary

This PR adds Scout UI (Playwright) e2e coverage for **Metrics in
Discover**, focusing on the grid’s key interactions and the Insights
flyout experience. It also adds minimal, stable `data-test-subj` hooks
in the flyout components to make selectors reliable.

## What’s included
- **Insights flyout e2e**
  - Open flyout from a metric card via **View details**
  - Verify **Overview** tab content renders
  - Verify **ES|QL Query** tab renders the query code block
  - Validate **Dimensions pagination** (jump to last page, next/prev)

- **Metrics grid e2e**
- Grid activation compatibility across ES|QL commands (`TS`, `WHERE`,
`LIMIT`, `SORT`) and non-supported commands (`FROM`, `STATS`)
  - **Pagination** across metric cards
  - **Search** filtering and empty state
  - **Breakdown selector** dimension changes keep grid functional
- Metric card actions menu exposes **View details** and **Copy to
dashboard**; hover actions expose **Explore**

## Test plan
- Run Scout UI tests locally (examples):

```bash
# Start a server (choose one)
node scripts/scout start-server --arch stateful --domain classic
node scripts/scout start-server --arch serverless --domain observability_complete

# Run the suite
npx playwright test \
  src/platform/plugins/shared/discover/test/scout/ui/parallel_tests/metrics_experience/ \
  --config src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts \
  --project local --trace on
```

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] 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/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
qn895 pushed a commit to qn895/kibana that referenced this pull request Mar 11, 2026
…nd breakdown dimensions (elastic#254753)

## Summary

This PR adds Scout UI (Playwright) e2e coverage for **Metrics in
Discover**, focusing on the grid’s key interactions and the Insights
flyout experience. It also adds minimal, stable `data-test-subj` hooks
in the flyout components to make selectors reliable.

## What’s included
- **Insights flyout e2e**
  - Open flyout from a metric card via **View details**
  - Verify **Overview** tab content renders
  - Verify **ES|QL Query** tab renders the query code block
  - Validate **Dimensions pagination** (jump to last page, next/prev)

- **Metrics grid e2e**
- Grid activation compatibility across ES|QL commands (`TS`, `WHERE`,
`LIMIT`, `SORT`) and non-supported commands (`FROM`, `STATS`)
  - **Pagination** across metric cards
  - **Search** filtering and empty state
  - **Breakdown selector** dimension changes keep grid functional
- Metric card actions menu exposes **View details** and **Copy to
dashboard**; hover actions expose **Explore**

## Test plan
- Run Scout UI tests locally (examples):

```bash
# Start a server (choose one)
node scripts/scout start-server --arch stateful --domain classic
node scripts/scout start-server --arch serverless --domain observability_complete

# Run the suite
npx playwright test \
  src/platform/plugins/shared/discover/test/scout/ui/parallel_tests/metrics_experience/ \
  --config src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts \
  --project local --trace on
```

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] 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/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Metrics in Discover release_note:skip Skip the PR/issue when compiling release notes Team:obs-exploration Observability Exploration team v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants