[Synthetics] fix browser type as default in monitor management (#132572)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Dominique Clarke 2022-05-23 04:56:34 -04:00 committed by GitHub
parent ae8b6c8beb
commit 37d40d7343
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 8 deletions

View file

@ -40,12 +40,12 @@ journey('MonitorDetails', async ({ page, params }: { page: Page; params: any })
step('create basic monitor', async () => {
await uptime.enableMonitorManagement();
await uptime.clickAddMonitor();
await uptime.createBasicMonitorDetails({
await uptime.createBasicHTTPMonitorDetails({
name,
locations: ['US Central'],
apmServiceName: 'synthetics',
url: 'https://www.google.com',
});
await uptime.fillByTestSubj('syntheticsUrlField', 'https://www.google.com');
await uptime.confirmAndSave();
});

View file

@ -21,12 +21,12 @@ journey(`MonitorName`, async ({ page, params }: { page: Page; params: any }) =>
const uptime = monitorManagementPageProvider({ page, kibanaUrl: params.kibanaUrl });
const createBasicMonitor = async () => {
await uptime.createBasicMonitorDetails({
await uptime.createBasicHTTPMonitorDetails({
name,
locations: ['US Central'],
apmServiceName: 'synthetics',
url: 'https://www.google.com',
});
await uptime.fillByTestSubj('syntheticsUrlField', 'https://www.google.com');
};
before(async () => {
@ -52,12 +52,12 @@ journey(`MonitorName`, async ({ page, params }: { page: Page; params: any }) =>
step(`shows error if name already exists`, async () => {
await uptime.navigateToAddMonitor();
await uptime.createBasicMonitorDetails({
await uptime.createBasicHTTPMonitorDetails({
name,
locations: ['US Central'],
apmServiceName: 'synthetics',
url: 'https://www.google.com',
});
await uptime.fillByTestSubj('syntheticsUrlField', 'https://www.google.com');
await uptime.assertText({ text: 'Monitor name already exists.' });

View file

@ -189,6 +189,7 @@ export function monitorManagementPageProvider({
apmServiceName: string;
locations: string[];
}) {
await this.selectMonitorType('http');
await this.createBasicMonitorDetails({ name, apmServiceName, locations });
await this.fillByTestSubj('syntheticsUrlField', url);
},

View file

@ -121,10 +121,10 @@ export function PolicyConfigContextProvider<ExtraFields = unknown>({
const isAddMonitorRoute = useRouteMatch(MONITOR_ADD_ROUTE);
useEffect(() => {
if (isAddMonitorRoute) {
if (isAddMonitorRoute?.isExact) {
setMonitorType(DataStream.BROWSER);
}
}, [isAddMonitorRoute]);
}, [isAddMonitorRoute?.isExact]);
const value = useMemo(() => {
return {