Skip to content

Commit f46ab0c

Browse files
authored
[SharedUX] Migrate error boundary example plugin FTRs to Scout (elastic#268647)
Relates to elastic/kibana-team#2818 ## Summary - Migrated the Error Boundary example plugin FTR tests to Scout as part of SharedUX's OnWeek initiative to migrate all SharedUX owned FTR tests to Scout, improving CI costs and execution time. - Migrated 2 FTR tests from `src/platform/test/examples/error_boundary/` to Scout at `examples/error_boundary/test/scout_examples/ui/` - Removed the FTR test file and its `loadTestFile` entry from `src/platform/test/examples/config.js` - Added `error_boundary_example` to `.buildkite/scout_ci_config.yml` for CI discovery - Updated `tsconfig.json` and regenerated `moon.yml` to include Scout test paths and `@kbn/scout` dependency - Used the `scout-migrate-from-ftr` skill to plan and execute the migration, and `scout-best-practices-reviewer` to validate parity and best practices compliance. ### Validation - Tests pass locally against Scout `examples` server config set - Ran `--repeat-each 30` to verify no flakiness <img width="1011" height="430" alt="Screenshot 2026-05-11 at 12 18 24" src="https://github.com/user-attachments/assets/21cab279-493b-4a16-8e39-ed65520d95a3" />
1 parent ae4ef9d commit f46ab0c

7 files changed

Lines changed: 67 additions & 71 deletions

File tree

.buildkite/scout_ci_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ plugins:
1818
- discover
1919
- discover_enhanced
2020
- entity_store
21+
- error_boundary_example
2122
- exploratory_view
2223
- fleet
2324
- flyoutSystemExamples

examples/error_boundary/moon.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ dependsOn:
2121
- '@kbn/developer-examples-plugin'
2222
- '@kbn/shared-ux-error-boundary'
2323
- '@kbn/shared-ux-page-kibana-template'
24+
- '@kbn/scout'
2425
tags:
2526
- plugin
2627
- prod
@@ -32,5 +33,6 @@ fileGroups:
3233
- common/**/*.ts
3334
- public/**/*.ts
3435
- public/**/*.tsx
36+
- test/scout_examples/**/*
3537
- '!target/**/*'
3638
tasks: {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
import { createPlaywrightConfig } from '@kbn/scout';
11+
12+
export default createPlaywrightConfig({
13+
testDir: './tests',
14+
});
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
import { test } from '@kbn/scout';
11+
import { expect } from '@kbn/scout/ui';
12+
13+
test.describe('Error Boundary Examples', { tag: ['@local-stateful-classic'] }, () => {
14+
test.beforeEach(async ({ browserAuth, page }) => {
15+
await browserAuth.loginAsViewer();
16+
await page.gotoApp('errorBoundaryExample');
17+
await expect(page.testSubj.locator('errorBoundaryExampleHeader')).toBeVisible();
18+
});
19+
20+
test('fatal error shows error boundary and recovers on reload', async ({ page }) => {
21+
await page.testSubj.locator('fatalErrorBtn').click();
22+
23+
await expect(page.testSubj.locator('errorBoundaryFatalHeader')).toBeVisible();
24+
await expect(page.testSubj.locator('errorBoundaryExampleHeader')).toHaveCount(0);
25+
26+
await page.testSubj.locator('errorBoundaryFatalShowDetailsBtn').click();
27+
await expect(page.testSubj.locator('errorBoundaryFatalDetailsErrorString')).toContainText(
28+
'Error: Example of unknown error type'
29+
);
30+
31+
await page.testSubj.locator('euiFlyoutCloseButton').click();
32+
await page.testSubj.locator('errorBoundaryFatalPromptReloadBtn').click();
33+
34+
await expect(page.testSubj.locator('errorBoundaryExampleHeader')).toBeVisible();
35+
});
36+
37+
test('recoverable error shows error boundary and recovers on reload', async ({ page }) => {
38+
await page.testSubj.locator('recoverableErrorBtn').click();
39+
40+
await expect(page.testSubj.locator('errorBoundaryRecoverableHeader')).toBeVisible();
41+
await expect(page.testSubj.locator('errorBoundaryExampleHeader')).toHaveCount(0);
42+
43+
await page.testSubj.locator('errorBoundaryRecoverablePromptReloadBtn').click();
44+
45+
await expect(page.testSubj.locator('errorBoundaryExampleHeader')).toBeVisible();
46+
});
47+
});

examples/error_boundary/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"common/**/*.ts",
99
"public/**/*.ts",
1010
"public/**/*.tsx",
11+
"test/scout_examples/**/*",
1112
"../../typings/**/*"
1213
],
1314
"exclude": [
@@ -17,6 +18,7 @@
1718
"@kbn/core",
1819
"@kbn/developer-examples-plugin",
1920
"@kbn/shared-ux-error-boundary",
20-
"@kbn/shared-ux-page-kibana-template"
21+
"@kbn/shared-ux-page-kibana-template",
22+
"@kbn/scout"
2123
]
2224
}

src/platform/test/examples/config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export default async function ({ readConfigFile }) {
3232
require.resolve('./unified_field_list_examples'),
3333
require.resolve('./unified_tabs_examples'),
3434
require.resolve('./discover_customization_examples'),
35-
require.resolve('./error_boundary'),
3635
require.resolve('./response_stream'),
3736
require.resolve('./esql_ux_example'),
3837
],

src/platform/test/examples/error_boundary/index.ts

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)