Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Synthetics UI] Correct link in the integration deprecation callout #150879

Merged
merged 6 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
update edit link text
  • Loading branch information
shahzad31 committed Feb 21, 2023
commit 303ad26a4c12b1559a36be493b5b22562b92722d
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,34 @@
import { journey, step, expect, before } from '@elastic/synthetics';
import { assertText, byTestId, TIMEOUT_60_SEC } from '@kbn/observability-plugin/e2e/utils';
import { recordVideo } from '@kbn/observability-plugin/e2e/record_video';
import { cleanTestMonitors } from '../../synthetics/services/add_monitor';
import { monitorManagementPageProvider } from '../../../page_objects/uptime/monitor_management';

journey('AddPrivateLocationMonitor', async ({ page, params: { kibanaUrl } }) => {
journey('AddPrivateLocationMonitor', async ({ page, params }) => {
recordVideo(page);

page.setDefaultTimeout(TIMEOUT_60_SEC.timeout);
const kibanaUrl = params.kibanaUrl;

const uptime = monitorManagementPageProvider({ page, kibanaUrl });

let monitorId: string;

before(async () => {
await uptime.waitForLoadingToFinish();
await cleanTestMonitors(params);
page.on('request', (evt) => {
if (
evt.resourceType() === 'fetch' &&
evt.url().includes('/internal/uptime/service/monitors?preserve_namespace=true')
) {
evt
.response()
?.then((res) => res?.json())
.then((res) => {
monitorId = res.id;
});
}
});
});

step('Go to monitor-management', async () => {
Expand All @@ -39,7 +58,7 @@ journey('AddPrivateLocationMonitor', async ({ page, params: { kibanaUrl } }) =>

await page.click('input[name="name"]');
await page.fill('input[name="name"]', 'Private location monitor');
await page.click('label:has-text("Test private location Private")', TIMEOUT_60_SEC);
await page.click('label:has-text("Test private location Private")');
await page.selectOption('select', 'http');
await page.click(byTestId('syntheticsUrlField'));
await page.fill(byTestId('syntheticsUrlField'), 'https://www.google.com');
Expand All @@ -66,7 +85,9 @@ journey('AddPrivateLocationMonitor', async ({ page, params: { kibanaUrl } }) =>
step('Click text=Edit Elastic Synthetics integration', async () => {
await assertText({ page, text: 'This table contains 1 rows out of 1 rows; Page 1 of 1.' });
await page.click('[data-test-subj="integrationNameLink"]');
await page.click('text=Edit in uptime');
const btn = await page.locator(byTestId('syntheticsEditMonitorButton'));
expect(await btn.getAttribute('href')).toBe(`/app/synthetics/edit-monitor/${monitorId}`);
await btn.click();
await page.click('text=Private location monitor');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export const SyntheticsPolicyEditExtensionWrapper = memo<PackagePolicyEditExtens
<p>{EDIT_IN_SYNTHETICS_DESC}</p>
{/* TODO Add a link to exact monitor*/}
<EuiButton
data-test-subj="syntheticsEditMonitorButton"
href={`${http?.basePath.get()}/app/synthetics/edit-monitor/${
defaultConfig[ConfigKey.CONFIG_ID]
}`}
Expand Down