@applitools/eyes-storybook 3.37.4 → 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 +7 -0
- package/README.md +15 -2
- package/dist/getClientAPI.js +1 -0
- package/dist/getStories.js +1 -0
- package/dist/renderStoryWithClientAPI.js +1 -0
- package/dist/runRunAfterScript.js +1 -0
- package/dist/runRunBeforeScript.js +1 -0
- package/package.json +2 -2
- package/src/browser/getClientAPI.js +1 -0
- package/src/storybookConnector.js +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,13 @@
|
|
|
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
|
+
|
|
7
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)
|
|
8
15
|
|
|
9
16
|
|
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
|
package/dist/getClientAPI.js
CHANGED
|
@@ -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();
|
package/dist/getStories.js
CHANGED
|
@@ -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
|
+
"version": "3.37.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"applitools",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"yargs": "17.7.2"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@applitools/bongo": "^5.
|
|
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
|
-
}${
|
|
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
|
}
|