diff --git a/packages/kbn-journeys/journey/journey_ftr_harness.ts b/packages/kbn-journeys/journey/journey_ftr_harness.ts index a1e9843c6b1d0..7becb99f3970b 100644 --- a/packages/kbn-journeys/journey/journey_ftr_harness.ts +++ b/packages/kbn-journeys/journey/journey_ftr_harness.ts @@ -333,8 +333,11 @@ export class JourneyFtrHarness { private telemetryTrackerCount = 0; private trackTelemetryRequests(page: Page) { - const requestSuccess$ = Rx.fromEvent(page, 'requestfinished'); - const request$ = Rx.fromEvent(page, 'request').pipe( + const requestSuccess$ = Rx.fromEvent( + page, + 'requestfinished' + ) as Rx.Observable; + const request$ = (Rx.fromEvent(page, 'request') as Rx.Observable).pipe( Rx.takeUntil( this.pageTeardown$.pipe( Rx.first((p) => p === page),