flexysnap 0.4.1 → 0.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flexysnap",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "Flexible visual snapshot testing for Playwright, built for e-commerce.",
5
5
  "keywords": [
6
6
  "playwright",
package/src/testUtils.js CHANGED
@@ -9,10 +9,10 @@ async function callClosePopups(page) {
9
9
  async function gotoWithRetry(page, url) {
10
10
  try {
11
11
  logTimestamp('Loading ' + url);
12
- await page.goto(url, { timeout: 30_000, waitUntil: "domcontentloaded" });
12
+ await page.goto(url, { timeout: 30_000, waitUntil: "commit" });
13
13
  } catch (firstError) {
14
14
  logTimestamp('Retry loading ' + url);
15
- await page.goto(url, { timeout: 30_000, waitUntil: "domcontentloaded" });
15
+ await page.goto(url, { timeout: 30_000, waitUntil: "commit" });
16
16
  }
17
17
  await waitForCompleteLoad(page)
18
18
  }
@@ -260,7 +260,7 @@ function compareTexts(baselineTexts, currentTexts, options) {
260
260
  }
261
261
  }
262
262
 
263
- const allowExtraText = options?.allowExtra === true;
263
+ const allowExtraText = options?.extraAllowed === true;
264
264
  for (const currentIndex of unmatchedCurrent) {
265
265
  const currentText = currentTexts[currentIndex];
266
266
  currentText.differences = [{
@@ -269,7 +269,7 @@ function compareTexts(baselineTexts, currentTexts, options) {
269
269
  }];
270
270
  }
271
271
 
272
- const allowMissingText = options?.allowMissing === true;
272
+ const allowMissingText = options?.missingAllowed === true;
273
273
  for (const baselineIndex of unmatchedBaseline) {
274
274
  const baselineText = baselineTexts[baselineIndex];
275
275
  currentTexts.push(baselineText);
@@ -335,7 +335,7 @@ function compareWireframes(baselineWireframe, currentWireframe) {
335
335
  }
336
336
  }
337
337
 
338
- const allowExtraElements = currentElementGroup.options?.allowExtra === true;
338
+ const allowExtraElements = currentElementGroup.options?.extraAllowed === true;
339
339
  for (const currentIndex of unmatchedCurrent) {
340
340
  const currentElement = currentElementGroup.elements[currentIndex];
341
341
  currentElement.differences = [{
@@ -344,7 +344,7 @@ function compareWireframes(baselineWireframe, currentWireframe) {
344
344
  }];
345
345
  }
346
346
 
347
- const allowMissingElements = currentElementGroup.options?.allowMissing === true;
347
+ const allowMissingElements = currentElementGroup.options?.missingAllowed === true;
348
348
  for (const baselineIndex of unmatchedBaseline) {
349
349
  const baselineElement = baselineElementGroup.elements[baselineIndex];
350
350
  currentElementGroup.elements.push(baselineElement);
@@ -109,8 +109,8 @@ function createEmptyElementGroupResult(elementGroup) {
109
109
  strictPosition: elementGroup.options?.strictPosition !== false,
110
110
  strictSize: elementGroup.options?.strictSize !== false,
111
111
  maskDigits: elementGroup.options?.maskDigits !== false,
112
- allowExtra: elementGroup.options?.allowExtra === true,
113
- allowMissing: elementGroup.options?.allowMissing === true
112
+ extraAllowed: elementGroup.options?.extraAllowed === true,
113
+ missingAllowed: elementGroup.options?.missingAllowed === true
114
114
  },
115
115
  elements: []
116
116
  };
@@ -209,8 +209,8 @@ async function extractElementGroupData(page, elementGroup, groupIndex, elementId
209
209
  elementGroup.options.strictPosition = elementGroup.options.strictPosition !== false;
210
210
  elementGroup.options.strictSize = elementGroup.options.strictSize !== false;
211
211
  elementGroup.options.maskDigits = elementGroup.options.maskDigits !== false;
212
- elementGroup.options.allowExtra = elementGroup.options.allowExtra === true;
213
- elementGroup.options.allowMissing = elementGroup.options.allowMissing === true;
212
+ elementGroup.options.extraAllowed = elementGroup.options.extraAllowed === true;
213
+ elementGroup.options.missingAllowed = elementGroup.options.missingAllowed === true;
214
214
  elementGroup.elements = [];
215
215
 
216
216
  let index = 0;