Skip to content

Commit 190b755

Browse files
[ux] migrate synthetics journeys to scout (elastic#253366)
Closes elastic/appex-qa-team#716 ## Summary This PR migrates all running `@elastic/synthetics` journeys in the ux plugin into Scout test specs. Since Scout tests are always run, the opt-in pipeline step has been removed. ### Journeys migrated | Original journey | Scout spec | |---|---| | `core_web_vitals.ts` | `core_web_vitals.spec.ts ` | | `inp.journey.ts` | `inp.spec.ts` | | `page_views.ts` | `page_views.spec.ts` | | `url_ux_query.journey.ts` | `ux_url_query.spec.ts` | | `ux_client_metrics.journey.ts` | `ux_client_metrics.spec.ts` | | `ux_js_errors.journey.ts` | `ux_js_errors.spec.ts` | | `ux_long_task_metric_journey.ts` | `ux_long_task_metrics.spec.ts` | | `ux_visitor_breakdown.journey.ts` | `ux_visitor_breakdown.spec.ts` | Re-enabled (was commented out in original index.ts): page_views.ts ### New Scout directory structure ``` x/test/scout/ui/ ├── playwright.config.ts ├── fixtures/ │ ├── index.ts (extends ObltTestFixtures with UX page objects) │ ├── constants.ts (ES archive paths, default query params) │ └── page_objects/ │ ├── index.ts │ └── ux_dashboard.ts (navigation, loading waits, chart locators) └── tests/ ├── global.setup.ts (loads ES archives + INP test data) └── *.spec.ts (8 test specs) ``` ES archive fixtures remain at `ux/e2e/fixtures/` (rum_8.0.0, rum_test_data). ### Key fixes during migration - Updated Core Web Vitals labels: replaced deprecated `"First input delay"` with `"Interaction to next paint"` (INP replaced FID) - Fixed brittle selectors: replaced text-concatenation locators with `data-test-subj` selectors (e.g., `pvBreakdownFilter` for breakdown dropdown) - Fixed lazy-loaded sections: `LoadWhenInView` components (JS Errors, Visitor Breakdown) require scrolling the placeholder into the viewport to trigger the intersection observer - Fixed ambiguous text matching: used `{ exact: true }` for browser legend labels that match multiple elements (e.g., `"Chrome"` vs `"Chrome Mobile"`) - Removed buggy date picker override: original journeys set date range via URL params (2020–2021) then overrode to 2022 via date picker — fixture data only exists in 2020–2021, so the override was a latent bug - Guarded INP data against duplicates: added idempotency check before indexing INP test transactions ### CI changes - Added ux to `.buildkite/scout_ci_config.yml` - Removed `ux_plugin_e2e.yml` pipeline and `ux_synthetics_e2e.sh` script - Removed `ux/.buildkite/` flaky test pipeline - Cleaned up `ftr_oblt_stateful_configs.yml` Made with [Cursor](https://cursor.com) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 45aebb3)
1 parent c032f32 commit 190b755

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+625
-1209
lines changed

.buildkite/ftr_oblt_stateful_configs.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ disabled:
1515
- x-pack/solutions/observability/plugins/uptime/e2e/uptime/synthetics_run.ts
1616
- x-pack/solutions/observability/plugins/synthetics/e2e/config.ts
1717
- x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/synthetics_run.ts
18-
- x-pack/solutions/observability/plugins/exploratory_view/e2e/synthetics_run.ts
19-
- x-pack/solutions/observability/plugins/ux/e2e/synthetics_run.ts
2018
- x-pack/solutions/observability/plugins/slo/e2e/synthetics_run.ts
2119

2220
# Configs that exist but weren't running in CI when this file was introduced

.buildkite/pipelines/pull_request/ux_plugin_e2e.yml

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

.buildkite/scout_ci_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ plugins:
2020
- spaces
2121
- streams_app
2222
- transform
23+
- ux
2324
- workflows_extensions
2425
disabled:
2526

.buildkite/scripts/pipelines/pull_request/pipeline.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ const SKIPPABLE_PR_MATCHERS = prConfig.skip_ci_on_only_changed!.map((r) => new R
121121
) {
122122
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/synthetics_plugin.yml'));
123123
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/uptime_plugin.yml'));
124-
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/ux_plugin_e2e.yml'));
125124
}
126125

127126
const aiInfraPaths = [

.buildkite/scripts/steps/functional/ux_synthetics_e2e.sh

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

x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/web_core_vitals_title.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export function WebCoreVitalsTitle({
8181
{loading ? (
8282
<EuiLoadingSpinner />
8383
) : (
84-
<EuiText size="s">
84+
<EuiText size="s" data-test-subj="uxCoreVitalsTrafficSummary">
8585
<FormattedMessage
8686
id="xpack.observability.ux.dashboard.webCoreVitals.traffic"
8787
defaultMessage="{trafficPerc} of the traffic represented"

x-pack/solutions/observability/plugins/synthetics/e2e/page_objects/login.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* 2.0.
66
*/
77
import type { Page } from '@elastic/synthetics';
8-
import { waitForLoadingToFinish } from '@kbn/ux-plugin/e2e/journeys/utils';
8+
import { waitForLoadingToFinish } from './utils';
99

1010
export function loginPageProvider({
1111
page,

x-pack/solutions/observability/plugins/synthetics/e2e/page_objects/utils.tsx

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,39 @@
55
* 2.0.
66
*/
77
import type { Page } from '@elastic/synthetics';
8-
import { waitForLoadingToFinish } from '@kbn/ux-plugin/e2e/journeys/utils';
8+
9+
export const byTestId = (testId: string) => {
10+
return `[data-test-subj="${testId}"]`;
11+
};
12+
13+
export async function waitForLoadingToFinish({ page }: { page: Page }) {
14+
let retries = 50;
15+
while (retries) {
16+
retries--;
17+
if ((await page.$(byTestId('kbnLoadingMessage'))) === null) break;
18+
await page.waitForTimeout(2 * 1000);
19+
}
20+
retries = 50;
21+
while (retries) {
22+
if ((await page.$(byTestId('globalLoadingIndicator'))) === null) break;
23+
await page.waitForTimeout(2 * 1000);
24+
}
25+
}
26+
27+
export async function loginToKibana({
28+
page,
29+
user,
30+
}: {
31+
page: Page;
32+
user?: { username: string; password: string };
33+
}) {
34+
await page.fill('[data-test-subj=loginUsername]', user?.username ?? 'elastic', {
35+
timeout: 60 * 1000,
36+
});
37+
await page.fill('[data-test-subj=loginPassword]', user?.password ?? 'changeme');
38+
await page.click('[data-test-subj=loginSubmit]');
39+
await waitForLoadingToFinish({ page });
40+
}
941

1042
export function utilsPageProvider({ page }: { page: Page }) {
1143
return {

x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/alert_rules/default_status_alert.journey.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
*/
77

88
import { journey, step, before, after, expect } from '@elastic/synthetics';
9-
import { byTestId } from '@kbn/ux-plugin/e2e/journeys/utils';
109
import type { RetryService } from '@kbn/ftr-common-functional-services';
1110
import { v4 as uuidv4 } from 'uuid';
1211
import { getReasonMessage } from '@kbn/synthetics-plugin/server/alert_rules/status_rule/message_utils';
12+
import { byTestId } from '../../../page_objects/utils';
1313
import { syntheticsAppPageProvider } from '../../page_objects/synthetics_app';
1414
import { SyntheticsServices } from '../services/synthetics_services';
1515

x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/monitor_details_page/monitor_summary.journey.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
*/
77

88
import { journey, step, before, after, expect } from '@elastic/synthetics';
9-
import { byTestId } from '@kbn/ux-plugin/e2e/journeys/utils';
109
import type { RetryService } from '@kbn/ftr-common-functional-services';
1110
import moment from 'moment';
11+
import { byTestId } from '../../../page_objects/utils';
1212
import { syntheticsAppPageProvider } from '../../page_objects/synthetics_app';
1313
import { SyntheticsServices } from '../services/synthetics_services';
1414

0 commit comments

Comments
 (0)