diff --git a/x-pack/plugins/uptime/public/components/synthetics/executed_step.test.tsx b/x-pack/plugins/uptime/public/components/synthetics/executed_step.test.tsx
index f9876593a03db..e14b32fc8da9f 100644
--- a/x-pack/plugins/uptime/public/components/synthetics/executed_step.test.tsx
+++ b/x-pack/plugins/uptime/public/components/synthetics/executed_step.test.tsx
@@ -82,4 +82,19 @@ describe('ExecutedStep', () => {
expect(getByText('Console output'));
expect(getByText(browserConsole[0]));
});
+
+ it('renders multi-line console output', () => {
+ const browserConsole = ['line1', 'line2', 'line3'];
+
+ const { getByText } = render(
+
+ );
+
+ expect(getByText('Console output'));
+
+ const codeBlock = getByText('line1 line2', { exact: false });
+ expect(codeBlock.innerHTML).toEqual(`line1
+line2
+line3`);
+ });
});
diff --git a/x-pack/plugins/uptime/public/components/synthetics/executed_step.tsx b/x-pack/plugins/uptime/public/components/synthetics/executed_step.tsx
index 57b94544e5983..80786730505a9 100644
--- a/x-pack/plugins/uptime/public/components/synthetics/executed_step.tsx
+++ b/x-pack/plugins/uptime/public/components/synthetics/executed_step.tsx
@@ -88,14 +88,7 @@ export const ExecutedStep: FC = ({ loading, step, index, brow
language="javascript"
initialIsOpen={!isSucceeded}
>
- <>
- {browserConsoles?.map((browserConsole) => (
- <>
- {browserConsole}
-
- >
- ))}
- >
+ {browserConsoles?.join('\n')}