@applitools/eyes-cypress 3.22.8 → 3.23.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/CHANGELOG.md CHANGED
@@ -3,6 +3,11 @@
3
3
  ## Unreleased
4
4
 
5
5
 
6
+ ## 3.23.0 - 2021/11/11
7
+
8
+ - support waitBeforeCapture
9
+ - updated to @applitools/visual-grid-client@15.8.44 (from 15.8.43)
10
+
6
11
  ## 3.22.8 - 2021/11/9
7
12
 
8
13
  - fix not calling the global hooks before:run and after:run at all, unless the user also called them in his plugins file.
package/README.md CHANGED
@@ -192,6 +192,7 @@ Applitools will take screenshots and perform the visual comparisons in the backg
192
192
  - [layoutBreakpoints](#layoutBreakpoints)
193
193
  - [sendDom](#sendDom)
194
194
  - [variationGroupId](#variationGroupId)
195
+ - [waitBeforeCapture](#waitBeforeCapture)
195
196
  - [Close](#Close)
196
197
  - [Concurrency](#Concurrency)
197
198
  - [Advanced configuration](#Advanced-configuration)
@@ -449,6 +450,20 @@ cy.eyesCheckWindow({variationGroupId: 'Login screen variation #1'})
449
450
 
450
451
  For more information, visit our documentation page: https://applitools.com/docs/features/baseline-variations-groups.html
451
452
 
453
+ ##### `waitBeforeCapture`
454
+
455
+ A parameter that is set to wait a certain amount of milliseconds before capturing the pages snapshot. This will also apply between page resizes when using `layoutBreakpoints`.
456
+
457
+ ```
458
+ cy.eyesOpen({
459
+ waitBeforeCapture: 1000
460
+ // ...
461
+ })
462
+
463
+ cy.eyesCheckWindow({
464
+ waitBeforeCapture: 1000
465
+ })
466
+ ```
452
467
 
453
468
  ##### `useDom`
454
469
 
@@ -544,6 +559,7 @@ The list above is also the order of precedence, which means that if you pass a p
544
559
  | `accessibilityValidation` | undefined | An object that specifies the accessibility level and guidelines version to use for the screenshots. Possible values for **level** are `None`, `AA` and `AAA`, and possible values for **guidelinesVersion** are `WCAG_2_0` and `WCAG_2_1`. For example: `{level: 'AA', guidelinesVersion: 'WCAG_2_0'}`|
545
560
  | `visualGridOptions` | undefined | An object that specifies options to configure renderings on the Ultrafast grid. See more information [here](#visualgridoptions) |
546
561
  |`layoutBreakpoints`| undefined | When set to `true`, a snapshot of the DOM will be taken once for each browser/device size in the `browser` configuration. For optimization purposes, an array of numbers can be passed. The DOM snapshot will be taken once for every **width** in the array. For more information, see [layoutBreakpoints](#layoutBreakpoints)|
562
+ |`waitBeforeCapture`| 100 | A parameter that is set to wait a certain amount of milliseconds before capturing the pages snapshot. This will also apply between page resizes when using `layoutBreakpoints`.
547
563
 
548
564
  ### Global configuration properties:
549
565
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-cypress",
3
- "version": "3.22.8",
3
+ "version": "3.23.0",
4
4
  "main": "index.js",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "bin": {
@@ -42,7 +42,7 @@
42
42
  "@applitools/dom-snapshot": "4.5.10",
43
43
  "@applitools/functional-commons": "1.6.0",
44
44
  "@applitools/logger": "1.0.5",
45
- "@applitools/visual-grid-client": "15.8.43",
45
+ "@applitools/visual-grid-client": "15.8.44",
46
46
  "body-parser": "1.19.0",
47
47
  "chalk": "3.0.0",
48
48
  "cors": "2.8.5",
@@ -52,9 +52,9 @@
52
52
  "devDependencies": {
53
53
  "@applitools/scripts": "^1.0.1",
54
54
  "@applitools/sdk-release-kit": "0.13.4",
55
- "@applitools/sdk-shared": "0.9.7",
55
+ "@applitools/sdk-shared": "0.9.9",
56
56
  "@applitools/snaptdout": "1.0.1",
57
- "@applitools/test-server": "1.0.6",
57
+ "@applitools/test-server": "1.0.7",
58
58
  "chai": "^4.2.0",
59
59
  "chai-spies": "^1.0.0",
60
60
  "cookie-parser": "^1.4.4",
@@ -100,6 +100,7 @@ Cypress.Commands.add('eyesCheckWindow', args => {
100
100
  const globalArgs = {
101
101
  browser: getGlobalConfigProperty('eyesBrowser'),
102
102
  layoutBreakpoints: getGlobalConfigProperty('eyesLayoutBreakpoints'),
103
+ waitBeforeCapture: getGlobalConfigProperty('eyesWaitBeforeCapture'),
103
104
  };
104
105
 
105
106
  const browser = eyesOpenArgs.browser || globalArgs.browser || defaultBrowser;
@@ -108,7 +109,12 @@ Cypress.Commands.add('eyesCheckWindow', args => {
108
109
  (eyesOpenArgs && eyesOpenArgs.layoutBreakpoints) ||
109
110
  globalArgs.layoutBreakpoints;
110
111
 
111
- const checkArgs = {layoutBreakpoints, browser};
112
+ const waitBeforeCapture =
113
+ (args && args.waitBeforeCapture) ||
114
+ (eyesOpenArgs && eyesOpenArgs.waitBeforeCapture) ||
115
+ globalArgs.waitBeforeCapture;
116
+
117
+ const checkArgs = {layoutBreakpoints, browser, waitBeforeCapture};
112
118
  if (typeof args === 'object') {
113
119
  Object.assign(checkArgs, args);
114
120
  } else {
@@ -21,11 +21,17 @@ function makeEyesCheckWindow({sendRequest, processPage, domSnapshotOptions, cypr
21
21
  function takeDomSnapshots(options) {
22
22
  const browser = args.browser;
23
23
  const breakpoints = args.layoutBreakpoints;
24
+ const waitBeforeCapture = args.waitBeforeCapture ? args.waitBeforeCapture : 100;
24
25
  const browsers = Array.isArray(browser) ? browser : [browser];
25
26
 
26
27
  if (!breakpoints) {
27
28
  //console.log('no breakpoints, taking single dom snapshot');
28
- return takeDomSnapshot(options);
29
+ return cypress
30
+ .wrap({}, {log: false})
31
+ .wait(waitBeforeCapture)
32
+ .then(() => {
33
+ return takeDomSnapshot(options);
34
+ });
29
35
  }
30
36
 
31
37
  return browsers
@@ -52,7 +58,7 @@ function makeEyesCheckWindow({sendRequest, processPage, domSnapshotOptions, cypr
52
58
  // console.log(`taking dom snapshot for width ${requiredWidth}`);
53
59
  cypress
54
60
  .viewport(Number(requiredWidth), height, {log: false})
55
- .wait(300, {log: false})
61
+ .wait(waitBeforeCapture, {log: false})
56
62
  .then({log: false, timeout: 900000}, () => {
57
63
  return takeDomSnapshot(options).then(snapshot => {
58
64
  browsersInfo.forEach(({index}) => (snapshots[index] = snapshot));
@@ -43,6 +43,7 @@ function makeConfig() {
43
43
  config.failCypressOnDiff === undefined ? true : !!config.failCypressOnDiff,
44
44
  eyesDisableBrowserFetching: !!config.disableBrowserFetching,
45
45
  eyesTestConcurrency: config.testConcurrency || DEFAULT_TEST_CONCURRENCY,
46
+ eyesWaitBeforeCapture: config.waitBeforeCapture,
46
47
  };
47
48
 
48
49
  return {config, eyesConfig};