Skip to content

Commit

Permalink
[Synthetics] fix browser type as default in monitor management (elast…
Browse files Browse the repository at this point in the history
…ic#132572)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
2 people authored and emilioalvap committed May 23, 2022
1 parent 14eb3cc commit dcb9fc4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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.' });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit dcb9fc4

Please sign in to comment.