@percy/core 1.31.0-alpha.2 → 1.31.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/config.js CHANGED
@@ -16,6 +16,10 @@ export const configSchema = {
16
16
  },
17
17
  labels: {
18
18
  type: 'string'
19
+ },
20
+ skipBaseBuild: {
21
+ type: 'boolean',
22
+ default: false
19
23
  }
20
24
  }
21
25
  },
package/dist/discovery.js CHANGED
@@ -107,6 +107,11 @@ function waitForDiscoveryNetworkIdle(page, options) {
107
107
  let filter = r => hostnameMatches(allowedHostnames, r.url);
108
108
  return page.network.idle(filter, networkIdleTimeout, captureResponsiveAssetsEnabled);
109
109
  }
110
+ async function waitForFontLoading(page) {
111
+ return await logger.measure('core:discovery', 'waitForFontLoading', undefined, async () => {
112
+ return await Promise.race([page.eval('await document.fonts.ready;'), new Promise(res => setTimeout(res, 5000))]);
113
+ });
114
+ }
110
115
 
111
116
  // Creates an initial resource map for a snapshot containing serialized DOM
112
117
  function parseDomResources({
@@ -264,6 +269,7 @@ async function* captureSnapshotResources(page, snapshot, options) {
264
269
  deviceScaleFactor: device.deviceScaleFactor,
265
270
  mobile: true
266
271
  });
272
+ yield waitForFontLoading(page);
267
273
  yield waitForDiscoveryNetworkIdle(page, discovery);
268
274
  }
269
275
  }
@@ -345,6 +351,7 @@ async function* captureSnapshotResources(page, snapshot, options) {
345
351
  for (let i = 0; i < widths.length - 1; i++) {
346
352
  if (captureWidths) yield* takeSnapshot(snap, width);
347
353
  yield page.evaluate(execute === null || execute === void 0 ? void 0 : execute.beforeResize);
354
+ yield waitForFontLoading(page);
348
355
  yield waitForDiscoveryNetworkIdle(page, discovery);
349
356
  yield resizePage(width = widths[i + 1]);
350
357
  if (snapshot.responsiveSnapshotCapture) {
@@ -376,6 +383,7 @@ async function* captureSnapshotResources(page, snapshot, options) {
376
383
 
377
384
  // wait for final network idle when not capturing DOM
378
385
  if (capture && snapshot.domSnapshot) {
386
+ yield waitForFontLoading(page);
379
387
  yield waitForDiscoveryNetworkIdle(page, discovery);
380
388
  yield* captureResponsiveAssets();
381
389
  capture(processSnapshotResources(snapshot));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/core",
3
- "version": "1.31.0-alpha.2",
3
+ "version": "1.31.0-alpha.3",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,11 +43,11 @@
43
43
  "test:types": "tsd"
44
44
  },
45
45
  "dependencies": {
46
- "@percy/client": "1.31.0-alpha.2",
47
- "@percy/config": "1.31.0-alpha.2",
48
- "@percy/dom": "1.31.0-alpha.2",
49
- "@percy/logger": "1.31.0-alpha.2",
50
- "@percy/webdriver-utils": "1.31.0-alpha.2",
46
+ "@percy/client": "1.31.0-alpha.3",
47
+ "@percy/config": "1.31.0-alpha.3",
48
+ "@percy/dom": "1.31.0-alpha.3",
49
+ "@percy/logger": "1.31.0-alpha.3",
50
+ "@percy/webdriver-utils": "1.31.0-alpha.3",
51
51
  "content-disposition": "^0.5.4",
52
52
  "cross-spawn": "^7.0.3",
53
53
  "extract-zip": "^2.0.1",
@@ -60,5 +60,5 @@
60
60
  "ws": "^8.17.1",
61
61
  "yaml": "^2.4.1"
62
62
  },
63
- "gitHead": "1c7711f564fd4a112e1e1490a772db757df0535d"
63
+ "gitHead": "14ae0b4319c1c2ae28729d56cba3b159e80386a8"
64
64
  }