@percy/core 1.30.5-beta.2 → 1.30.6-beta.0

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
  },
@@ -280,6 +284,10 @@ export const configSchema = {
280
284
  type: 'integer',
281
285
  minimum: 1
282
286
  },
287
+ snapshotConcurrency: {
288
+ type: 'integer',
289
+ minimum: 1
290
+ },
283
291
  retry: {
284
292
  type: 'boolean',
285
293
  default: false
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));
@@ -491,7 +499,9 @@ export function createDiscoveryQueue(percy) {
491
499
  },
492
500
  saveResource: r => {
493
501
  snapshot.resources.set(r.url, r);
494
- cache.set(r.url, r);
502
+ if (!snapshot.discovery.disableCache) {
503
+ cache.set(r.url, r);
504
+ }
495
505
  }
496
506
  }
497
507
  });
package/dist/percy.js CHANGED
@@ -151,16 +151,13 @@ export class Percy {
151
151
  // replace arrays instead of merging
152
152
  return Array.isArray(next) && [path, next];
153
153
  });
154
-
155
- // adjust queue concurrency
156
- let {
157
- concurrency
158
- } = this.config.discovery;
154
+ const concurrency = this.config.discovery.concurrency;
155
+ const snapshotConcurrency = parseInt(process.env.PERCY_SNAPSHOT_UPLOAD_CONCURRENCY) || concurrency;
159
156
  _classPrivateFieldGet(_discovery, this).set({
160
157
  concurrency
161
158
  });
162
159
  _classPrivateFieldGet(_snapshots, this).set({
163
- concurrency
160
+ concurrency: snapshotConcurrency
164
161
  });
165
162
  return this.config;
166
163
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/core",
3
- "version": "1.30.5-beta.2",
3
+ "version": "1.30.6-beta.0",
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.30.5-beta.2",
47
- "@percy/config": "1.30.5-beta.2",
48
- "@percy/dom": "1.30.5-beta.2",
49
- "@percy/logger": "1.30.5-beta.2",
50
- "@percy/webdriver-utils": "1.30.5-beta.2",
46
+ "@percy/client": "1.30.6-beta.0",
47
+ "@percy/config": "1.30.6-beta.0",
48
+ "@percy/dom": "1.30.6-beta.0",
49
+ "@percy/logger": "1.30.6-beta.0",
50
+ "@percy/webdriver-utils": "1.30.6-beta.0",
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": "841d07f5be5258e5783e601f65165385352474b2"
63
+ "gitHead": "31c3cd95c0edcba3a3dcc04154481f6fc2e5787c"
64
64
  }