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

[Reporting] Fix screenshot pipeline for multi-page #56928

Merged
merged 2 commits into from
Feb 6, 2020
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import * as Rx from 'rxjs';
import { first, mergeMap, toArray } from 'rxjs/operators';
import { first, concatMap, take, toArray, mergeMap } from 'rxjs/operators';
import { ServerFacade, CaptureConfig, HeadlessChromiumDriverFactory } from '../../../../types';
import { ScreenshotResults, ScreenshotObservableOpts } from './types';
import { injectCustomCss } from './inject_css';
Expand Down Expand Up @@ -37,12 +37,11 @@ export function screenshotsObservableFactory(
{ viewport: layout.getBrowserViewport(), browserTimezone },
logger
);

return Rx.from(urls).pipe(
mergeMap(url => {
concatMap(url => {
return create$.pipe(
mergeMap(({ driver, exit$ }) => {
const screenshot$ = Rx.of(driver).pipe(
const screenshot$ = Rx.of(1).pipe(
mergeMap(() => openUrl(driver, url, conditionalHeaders, logger)),
mergeMap(() => skipTelemetry(driver, logger)),
mergeMap(() => scanPage(driver, layout, logger)),
Expand Down Expand Up @@ -85,10 +84,11 @@ export function screenshotsObservableFactory(
);

return Rx.race(screenshot$, exit$);
})
}),
first()
);
}),
first(),
take(urls.length),
toArray()
);
};
Expand Down