Skip to content

Commit

Permalink
fix(testing): more consistent screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Oct 8, 2019
1 parent 9623efb commit ad42326
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/compiler/config/test/validate-testing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ describe('validateTesting', () => {
validateConfig(config, [], false);
expect(config.testing.browserArgs).toEqual([
'--font-render-hinting=medium',
'--enable-font-antialiasing',
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-dev-shm-usage',
Expand All @@ -73,7 +72,6 @@ describe('validateTesting', () => {
validateConfig(config, [], false);
expect(config.testing.browserArgs).toEqual([
'--font-render-hinting=medium',
'--enable-font-antialiasing',
]);
});

Expand Down
1 change: 0 additions & 1 deletion src/compiler/config/validate-testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export function validateTesting(config: d.Config, diagnostics: d.Diagnostic[]) {

testing.browserArgs = testing.browserArgs || [];
addOption(testing.browserArgs, '--font-render-hinting=medium');
addOption(testing.browserArgs, '--enable-font-antialiasing');

if (config.flags.ci) {
addOption(testing.browserArgs, '--no-sandbox');
Expand Down
10 changes: 4 additions & 6 deletions src/testing/puppeteer/puppeteer-screenshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,9 @@ export async function pageCompareScreenshot(page: pd.E2EPageInternal, env: d.E2E
await wait(screenshotBuildData.timeoutBeforeScreenshot);
await page.evaluate(() => {
return new Promise(resolve => {
(window as any).requestIdleCallback(() => {
window.requestAnimationFrame(() => {
resolve();
});
}, { timeout: 100 });
window.requestAnimationFrame(() => {
resolve();
});
});
});

Expand All @@ -109,7 +107,7 @@ function createPuppeteerScreenshopOptions(opts: d.ScreenshotOptions) {
type: 'png',
fullPage: opts.fullPage,
omitBackground: opts.omitBackground,
encoding: 'binary'
encoding: 'binary',
};

if (opts.clip) {
Expand Down

0 comments on commit ad42326

Please sign in to comment.