@applitools/eyes-storybook 3.37.3 → 3.37.5

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
@@ -4,6 +4,127 @@
4
4
 
5
5
 
6
6
 
7
+ ## [3.37.5](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-storybook@3.37.4...js/eyes-storybook@3.37.5) (2023-07-24)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * wait for initializationPromise ([#1628](https://github.com/applitools/eyes.sdk.javascript1/issues/1628)) ([01c528a](https://github.com/applitools/eyes.sdk.javascript1/commit/01c528ac9379239c445018f1c12d87a7b404e214))
13
+
14
+ ## [3.37.4](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-storybook@3.37.3...js/eyes-storybook@3.37.4) (2023-07-21)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * fix workspace dependencies ([2a3856f](https://github.com/applitools/eyes.sdk.javascript1/commit/2a3856f3ce3bcf1407f59c676653b6f218556760))
20
+
21
+
22
+ ### Dependencies
23
+
24
+ * @applitools/core bumped to 3.6.4
25
+ #### Bug Fixes
26
+
27
+ * fix workspace dependencies ([2a3856f](https://github.com/applitools/eyes.sdk.javascript1/commit/2a3856f3ce3bcf1407f59c676653b6f218556760))
28
+
29
+
30
+
31
+ * @applitools/core-base bumped to 1.4.3
32
+ #### Bug Fixes
33
+
34
+ * fix workspace dependencies ([2a3856f](https://github.com/applitools/eyes.sdk.javascript1/commit/2a3856f3ce3bcf1407f59c676653b6f218556760))
35
+
36
+
37
+
38
+ * @applitools/image bumped to 1.1.2
39
+ #### Bug Fixes
40
+
41
+ * fix workspace dependencies ([2a3856f](https://github.com/applitools/eyes.sdk.javascript1/commit/2a3856f3ce3bcf1407f59c676653b6f218556760))
42
+ * @applitools/logger bumped to 2.0.7
43
+ #### Bug Fixes
44
+
45
+ * fix workspace dependencies ([2a3856f](https://github.com/applitools/eyes.sdk.javascript1/commit/2a3856f3ce3bcf1407f59c676653b6f218556760))
46
+ * @applitools/req bumped to 1.5.2
47
+ #### Bug Fixes
48
+
49
+ * fix workspace dependencies ([2a3856f](https://github.com/applitools/eyes.sdk.javascript1/commit/2a3856f3ce3bcf1407f59c676653b6f218556760))
50
+ * @applitools/driver bumped to 1.13.3
51
+ #### Bug Fixes
52
+
53
+ * fix workspace dependencies ([2a3856f](https://github.com/applitools/eyes.sdk.javascript1/commit/2a3856f3ce3bcf1407f59c676653b6f218556760))
54
+
55
+
56
+
57
+ * @applitools/ec-client bumped to 1.7.3
58
+ #### Bug Fixes
59
+
60
+ * fix workspace dependencies ([2a3856f](https://github.com/applitools/eyes.sdk.javascript1/commit/2a3856f3ce3bcf1407f59c676653b6f218556760))
61
+
62
+
63
+
64
+ * @applitools/socket bumped to 1.1.7
65
+ #### Bug Fixes
66
+
67
+ * fix workspace dependencies ([2a3856f](https://github.com/applitools/eyes.sdk.javascript1/commit/2a3856f3ce3bcf1407f59c676653b6f218556760))
68
+
69
+
70
+
71
+ * @applitools/spec-driver-webdriver bumped to 1.0.40
72
+ #### Bug Fixes
73
+
74
+ * fix workspace dependencies ([2a3856f](https://github.com/applitools/eyes.sdk.javascript1/commit/2a3856f3ce3bcf1407f59c676653b6f218556760))
75
+
76
+
77
+
78
+ * @applitools/tunnel-client bumped to 1.1.3
79
+ #### Bug Fixes
80
+
81
+ * fix workspace dependencies ([2a3856f](https://github.com/applitools/eyes.sdk.javascript1/commit/2a3856f3ce3bcf1407f59c676653b6f218556760))
82
+
83
+
84
+
85
+ * @applitools/nml-client bumped to 1.5.5
86
+ #### Bug Fixes
87
+
88
+ * fix workspace dependencies ([2a3856f](https://github.com/applitools/eyes.sdk.javascript1/commit/2a3856f3ce3bcf1407f59c676653b6f218556760))
89
+
90
+
91
+
92
+ * @applitools/spec-driver-webdriverio bumped to 1.5.9
93
+ #### Bug Fixes
94
+
95
+ * fix workspace dependencies ([2a3856f](https://github.com/applitools/eyes.sdk.javascript1/commit/2a3856f3ce3bcf1407f59c676653b6f218556760))
96
+
97
+
98
+
99
+ * @applitools/screenshoter bumped to 3.8.6
100
+ #### Bug Fixes
101
+
102
+ * fix workspace dependencies ([2a3856f](https://github.com/applitools/eyes.sdk.javascript1/commit/2a3856f3ce3bcf1407f59c676653b6f218556760))
103
+
104
+
105
+
106
+ * @applitools/ufg-client bumped to 1.5.2
107
+ #### Bug Fixes
108
+
109
+ * fix workspace dependencies ([2a3856f](https://github.com/applitools/eyes.sdk.javascript1/commit/2a3856f3ce3bcf1407f59c676653b6f218556760))
110
+
111
+
112
+
113
+ * @applitools/spec-driver-puppeteer bumped to 1.1.71
114
+ #### Bug Fixes
115
+
116
+ * fix workspace dependencies ([2a3856f](https://github.com/applitools/eyes.sdk.javascript1/commit/2a3856f3ce3bcf1407f59c676653b6f218556760))
117
+
118
+
119
+
120
+ * @applitools/spec-driver-selenium bumped to 1.5.54
121
+ #### Bug Fixes
122
+
123
+ * fix workspace dependencies ([2a3856f](https://github.com/applitools/eyes.sdk.javascript1/commit/2a3856f3ce3bcf1407f59c676653b6f218556760))
124
+
125
+
126
+
127
+
7
128
  ## [3.37.3](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-storybook@3.37.2...js/eyes-storybook@3.37.3) (2023-07-21)
8
129
 
9
130
 
package/README.md CHANGED
@@ -131,6 +131,7 @@ Options:
131
131
  --storybookStaticDir, --storybook-static-dir Path to Storybook's static files folder [string]
132
132
  --showStorybookOutput, --show-storybook-output Whether or not you want to see Storybook output [boolean]
133
133
  --readStoriesTimeout, --read-stories-timeout The time to wait until all stories are read, before starting the visual tests [number]
134
+ --startStorybookServerTimeout The time to wait until the storybook server is built and serving (in seconds) [number]
134
135
  --exitcode, -e If tests failed close with non-zero exit code [boolean]
135
136
  ```
136
137
 
@@ -183,7 +184,7 @@ In addition to command-line arguments, it's possible to define the following con
183
184
  | `tapFilePath` | undefined | Directory path of a results file. If set, then a [TAP](https://en.wikipedia.org/wiki/Test_Anything_Protocol#Specification) file is created in this directory, the file is created with the name eyes.tap and contains the Eyes test results. |
184
185
  | `xmlFilePath` | undefined | Directory path of a results file. If set, then a [XUnit XML](https://google.github.io/rich-test-results/xunitxml) file is created in this directory, the file is created with the name eyes.xml and contains the Eyes test results. |
185
186
  | `waitBeforeCapture` | undefined | Selector, function or timeout.<br/>If ```number``` then the argument is treated as time in milliseconds to wait before all screenshots.<br/>If ```string``` then the argument is treated as a selector for elements to wait for before all screenshots.<br/>If ```function```, then the argument is treated as a predicate to wait for before all screenshots.<br/><hr/>For per component configuration see [waitBeforeCapture.](#waitBeforeCapture)<br/>Note that we use Puppeteer's [page.waitForTimeout()](https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#pagewaitfortimeoutmilliseconds), [page.waitForSelector()](https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#pagewaitforselectorselector-options), [page.waitForXPath()](https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#pagewaitforxpathxpath-options) and [page.waitForFunction()](https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#pagewaitforfunctionpagefunction-options-args), checkout it's API for more details. |
186
- | `include` | true | A predicate function, a string or a regular expression specifying which stories should be visually tested.<br/>Visual baselines will be created only for the components specified.<br/>The function receives an object with ```name```, ```kind```, ```storyTitle``` and ```parameters``` properties.<br/>For example (exclude all stories with a name that start with [SKIP]):<br/>```({name, kind, storyTitle, parameters}) => !/^\[SKIP\]/.test(name)```<br/>For more information, see [per component configuration - include](#include). |
187
+ | `include` | true | A predicate function, a string or a regular expression specifying which stories should be visually tested.<br/>Visual baselines will be created only for the components specified.<br/>The function receives an object with ```name```, ```kind```, ```storyTitle```, ```index``` and ```parameters``` properties.<br/>For example (exclude all stories with a name that start with [SKIP]):<br/>```({name, kind, storyTitle, index, parameters}) => !/^\[SKIP\]/.test(name)```<br/>For more information, see [per component configuration - include](#include). |
187
188
  | `variations` | undefined | Specifies additional variations for all or some of the stories. For example, RTL. For more information, see [per component configuration - variations](#variations).|
188
189
  | `dontCloseBatches` | false | If true, batches are not closed for notifyOnCompletion.|
189
190
  | `testConcurrency` | 5 | The maximum number of tests that can run concurrently. The default value is the allowed amount for free accounts. For paid accounts, set this number to the quota set for your account. |
@@ -376,7 +377,7 @@ All these properties except `storyTitle` come from `storybook` and they represe
376
377
 
377
378
  More information can be found in the [Storybook docs - Naming components and hierarchy](https://storybook.js.org/docs/react/writing-stories/naming-components-and-hierarchy).
378
379
 
379
- You can filter by `kind`, `name`, `storyTitle`, `parameters`, a combination of them or any logic that will result in a `boolean`. For example:
380
+ You can filter by `kind`, `name`, `storyTitle`, `index`, `parameters`, a combination of them or any logic that will result in a `boolean`. For example:
380
381
  ```js
381
382
  // applitools.config.js
382
383
  module.exports = {
@@ -409,6 +410,18 @@ include: /Button: */,
409
410
  ...
410
411
  }
411
412
  ```
413
+
414
+ The `include` method can also be used for test sharding, to split the stories between multiple machines:
415
+ ```js
416
+ module.exports = {
417
+ ...
418
+ include: ({index}) => {
419
+ return index % totalShards === currShard - 1
420
+ }
421
+ ...
422
+ }
423
+ ```
424
+
412
425
  > NOTE you can use regular expressions or any other method you'd like, as long as you return a `boolean` from this function
413
426
 
414
427
  #### component
@@ -125,6 +125,7 @@ function __getClientAPI(...args) {
125
125
  });
126
126
  } else {
127
127
  // storybook v7
128
+ await clientAPI.storyStore.initializationPromise;
128
129
  frameWindow.__STORYBOOK_PREVIEW__.selectionStore.setSelection({storyId});
129
130
  }
130
131
  await frameWindow.__STORYBOOK_PREVIEW__.renderSelection();
@@ -125,6 +125,7 @@ function __getStories(...args) {
125
125
  });
126
126
  } else {
127
127
  // storybook v7
128
+ await clientAPI.storyStore.initializationPromise;
128
129
  frameWindow.__STORYBOOK_PREVIEW__.selectionStore.setSelection({storyId});
129
130
  }
130
131
  await frameWindow.__STORYBOOK_PREVIEW__.renderSelection();
@@ -125,6 +125,7 @@ function __renderStoryWithClientAPI(...args) {
125
125
  });
126
126
  } else {
127
127
  // storybook v7
128
+ await clientAPI.storyStore.initializationPromise;
128
129
  frameWindow.__STORYBOOK_PREVIEW__.selectionStore.setSelection({storyId});
129
130
  }
130
131
  await frameWindow.__STORYBOOK_PREVIEW__.renderSelection();
@@ -125,6 +125,7 @@ function __runRunAfterScript(...args) {
125
125
  });
126
126
  } else {
127
127
  // storybook v7
128
+ await clientAPI.storyStore.initializationPromise;
128
129
  frameWindow.__STORYBOOK_PREVIEW__.selectionStore.setSelection({storyId});
129
130
  }
130
131
  await frameWindow.__STORYBOOK_PREVIEW__.renderSelection();
@@ -125,6 +125,7 @@ function __runRunBeforeScript(...args) {
125
125
  });
126
126
  } else {
127
127
  // storybook v7
128
+ await clientAPI.storyStore.initializationPromise;
128
129
  frameWindow.__STORYBOOK_PREVIEW__.selectionStore.setSelection({storyId});
129
130
  }
130
131
  await frameWindow.__STORYBOOK_PREVIEW__.renderSelection();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-storybook",
3
- "version": "3.37.3",
3
+ "version": "3.37.5",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "applitools",
@@ -57,14 +57,14 @@
57
57
  "postinstall": "node src/postinstall"
58
58
  },
59
59
  "dependencies": {
60
- "@applitools/core": "3.6.3",
61
- "@applitools/driver": "1.13.2",
60
+ "@applitools/core": "3.6.4",
61
+ "@applitools/driver": "1.13.3",
62
62
  "@applitools/functional-commons": "1.6.0",
63
- "@applitools/logger": "2.0.6",
63
+ "@applitools/logger": "2.0.7",
64
64
  "@applitools/monitoring-commons": "1.0.19",
65
- "@applitools/spec-driver-puppeteer": "1.1.70",
66
- "@applitools/ufg-client": "1.5.1",
67
- "@applitools/utils": "",
65
+ "@applitools/spec-driver-puppeteer": "1.1.71",
66
+ "@applitools/ufg-client": "1.5.2",
67
+ "@applitools/utils": "1.5.0",
68
68
  "boxen": "4.2.0",
69
69
  "chalk": "3.0.0",
70
70
  "detect-port": "1.3.0",
@@ -77,7 +77,7 @@
77
77
  "yargs": "17.7.2"
78
78
  },
79
79
  "devDependencies": {
80
- "@applitools/bongo": "^5.1.4",
80
+ "@applitools/bongo": "^5.3.0",
81
81
  "@applitools/sdk-shared": "0.9.15",
82
82
  "@applitools/snaptdout": "^1.0.1",
83
83
  "@applitools/test-server": "^1.2.2",
@@ -122,6 +122,7 @@ function getClientAPI() {
122
122
  });
123
123
  } else {
124
124
  // storybook v7
125
+ await clientAPI.storyStore.initializationPromise;
125
126
  frameWindow.__STORYBOOK_PREVIEW__.selectionStore.setSelection({storyId});
126
127
  }
127
128
  await frameWindow.__STORYBOOK_PREVIEW__.renderSelection();
@@ -95,7 +95,9 @@ class StorybookConnector extends EventEmitter {
95
95
  timeout,
96
96
  `Storybook dev server didn't start after waiting ${minutes ? `${minutes} minutes` : ''}${
97
97
  minutes && seconds ? ' and ' : ''
98
- }${seconds ? `${seconds} seconds` : ''}.`,
98
+ }${
99
+ seconds ? `${seconds} seconds` : ''
100
+ }.\nPlease consider setting a higher timeout using the --startStorybookServerTimeout option (in seconds). For example: eyes-storybook --startStorybookServerTimeout 600`,
99
101
  );
100
102
  });
101
103
  }