Skip to content

Commit fdf4a8d

Browse files
[8.x] [Synthetics] e2e tests - adjust navigating to pages and add video to help diagnose flaky test (#205420) (#205972)
# Backport This will backport the following commits from `main` to `8.x`: - [[Synthetics] e2e tests - adjust navigating to pages and add video to help diagnose flaky test (#205420)](#205420) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Dominique Clarke","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-08T21:36:31Z","message":"[Synthetics] e2e tests - adjust navigating to pages and add video to help diagnose flaky test (#205420)\n\n## Summary\r\n\r\nAdjusts navigating to pages. Directly navigates to some pages instead of\r\nclicking on a button to navigate. Also adds video for certain tests to\r\nhelp with debugging any flakiness.","sha":"c398818d7246934517d32c589ba5a83f6ec6181d","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","release_note:skip","v9.0.0","backport:prev-minor","Team:obs-ux-management"],"title":"[Synthetics] e2e tests - adjust navigating to pages and add video to help diagnose flaky test","number":205420,"url":"https://github.com/elastic/kibana/pull/205420","mergeCommit":{"message":"[Synthetics] e2e tests - adjust navigating to pages and add video to help diagnose flaky test (#205420)\n\n## Summary\r\n\r\nAdjusts navigating to pages. Directly navigates to some pages instead of\r\nclicking on a button to navigate. Also adds video for certain tests to\r\nhelp with debugging any flakiness.","sha":"c398818d7246934517d32c589ba5a83f6ec6181d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/205420","number":205420,"mergeCommit":{"message":"[Synthetics] e2e tests - adjust navigating to pages and add video to help diagnose flaky test (#205420)\n\n## Summary\r\n\r\nAdjusts navigating to pages. Directly navigates to some pages instead of\r\nclicking on a button to navigate. Also adds video for certain tests to\r\nhelp with debugging any flakiness.","sha":"c398818d7246934517d32c589ba5a83f6ec6181d"}}]}] BACKPORT--> Co-authored-by: Dominique Clarke <[email protected]>
1 parent 6395d9d commit fdf4a8d

File tree

3 files changed

+11
-21
lines changed

3 files changed

+11
-21
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
*/
77

88
import { journey, step, before, after } from '@elastic/synthetics';
9+
import { recordVideo } from '@kbn/observability-synthetics-test-data';
910
import { byTestId } from '../../helpers/utils';
1011
import { syntheticsAppPageProvider } from '../page_objects/synthetics_app';
1112
import { cleanSettings } from './services/settings';
1213

1314
journey('AlertingDefaults', async ({ page, params }) => {
15+
recordVideo(page);
1416
const syntheticsApp = syntheticsAppPageProvider({ page, kibanaUrl: params.kibanaUrl, params });
1517

1618
before(async () => {
@@ -39,6 +41,7 @@ journey('AlertingDefaults', async ({ page, params }) => {
3941
await page.fill('input[type="text"]', 'Test slack');
4042
await page.press('input[type="text"]', 'Tab');
4143
});
44+
4245
step(
4346
'Fill text=Webhook URLCreate a Slack Webhook URL(external, opens in a new tab or window) >> input[type="text"]',
4447
async () => {

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

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77

88
import { journey, step, before, after, expect } from '@elastic/synthetics';
9-
import { byTestId } from '../../helpers/utils';
109
import { cleanTestParams } from './services/add_monitor';
1110
import { syntheticsAppPageProvider } from '../page_objects/synthetics_app';
1211

@@ -25,16 +24,10 @@ journey(`GlobalParameters`, async ({ page, params }) => {
2524
await syntheticsApp.navigateToSettings(true);
2625
});
2726

28-
step('go to params tab', async () => {
29-
await page.click('text=Global Parameters');
30-
});
31-
32-
step('Click text=Settings', async () => {
33-
await page.click(byTestId('settings-page-link'));
34-
expect(page.url()).toBe('http://localhost:5620/app/synthetics/settings/alerting');
35-
});
36-
step('Click text=Global Parameters', async () => {
37-
await page.click('text=Global Parameters');
27+
step('Add params', async () => {
28+
await page.goto('http://localhost:5620/app/synthetics/settings/params', {
29+
waitUntil: 'networkidle',
30+
});
3831
expect(page.url()).toBe('http://localhost:5620/app/synthetics/settings/params');
3932
await page.click('text=No items found');
4033
await page.click('button:has-text("Create Parameter")');

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
import { journey, step, expect, before } from '@elastic/synthetics';
99
import { SYNTHETICS_API_URLS } from '@kbn/synthetics-plugin/common/constants';
1010
import { recordVideo } from '@kbn/observability-synthetics-test-data';
11+
import { syntheticsAppPageProvider } from '../page_objects/synthetics_app';
1112

12-
journey('ProjectAPIKeys', async ({ page }) => {
13+
journey('ProjectAPIKeys', async ({ page, params }) => {
1314
recordVideo(page);
15+
const syntheticsApp = syntheticsAppPageProvider({ page, kibanaUrl: params.kibanaUrl, params });
1416

1517
let apiKey = '';
1618

@@ -33,15 +35,7 @@ journey('ProjectAPIKeys', async ({ page }) => {
3335
});
3436

3537
step('Go to http://localhost:5620/login?next=%2Fapp%2Fsynthetics%2Fsettings', async () => {
36-
await page.goto('http://localhost:5620/login?next=%2Fapp%2Fsynthetics%2Fsettings');
37-
await page.click('input[name="username"]');
38-
await page.fill('input[name="username"]', 'elastic');
39-
await page.press('input[name="username"]', 'Tab');
40-
await page.fill('input[name="password"]', 'changeme');
41-
await Promise.all([
42-
page.waitForNavigation({ url: 'http://localhost:5620/app/synthetics/settings/alerting' }),
43-
page.click('button:has-text("Log in")'),
44-
]);
38+
await syntheticsApp.navigateToSettings(true);
4539
});
4640
step('Click text=Project API Keys', async () => {
4741
await page.click('text=Project API Keys');

0 commit comments

Comments
 (0)