creevey 0.7.39 → 0.9.0-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/CHANGELOG.md +12 -2
- package/README.md +1 -1
- package/docs/config.md +37 -5
- package/docs/grid.md +2 -1
- package/lib/cjs/client/addon/Manager.js +3 -2
- package/lib/cjs/client/addon/preset.js +1 -0
- package/lib/cjs/client/addon/readyForCapture.js +12 -0
- package/lib/cjs/client/addon/utils.js +1 -41
- package/lib/cjs/client/addon/withCreevey.js +313 -41
- package/lib/cjs/client/shared/components/ImagesView/BlendView.js +3 -3
- package/lib/cjs/client/shared/components/ImagesView/SideBySideView.js +3 -3
- package/lib/cjs/client/shared/components/ImagesView/SlideView.js +4 -3
- package/lib/cjs/client/shared/components/ImagesView/SwapView.js +3 -3
- package/lib/cjs/client/shared/helpers.js +1 -1
- package/lib/cjs/client/web/1.js +2 -2
- package/lib/cjs/client/web/2.js +1 -1
- package/lib/cjs/client/web/main.js +6 -6
- package/lib/cjs/index.js +27 -9
- package/lib/cjs/server/config.js +7 -3
- package/lib/cjs/server/extract.js +11 -4
- package/lib/cjs/server/index.js +2 -4
- package/lib/cjs/server/loaders/babel/register.js +2 -1
- package/lib/cjs/server/master/index.js +3 -9
- package/lib/cjs/server/master/master.js +1 -0
- package/lib/cjs/server/master/pool.js +29 -29
- package/lib/cjs/server/master/server.js +75 -3
- package/lib/cjs/server/messages.js +124 -12
- package/lib/cjs/server/parser.js +85 -0
- package/lib/cjs/server/selenium/browser.js +119 -21
- package/lib/cjs/server/selenium/selenoid.js +1 -1
- package/lib/cjs/server/stories.js +49 -58
- package/lib/cjs/server/storybook/entry.js +5 -4
- package/lib/cjs/server/storybook/helpers.js +11 -3
- package/lib/cjs/server/storybook/providers/browser.js +78 -0
- package/lib/cjs/server/storybook/providers/hybrid.js +79 -0
- package/lib/cjs/server/storybook/{nodejs-provider.js → providers/nodejs.js} +42 -18
- package/lib/cjs/server/utils.js +32 -2
- package/lib/cjs/server/worker/helpers.js +2 -6
- package/lib/cjs/server/worker/worker.js +15 -3
- package/lib/cjs/shared.js +107 -0
- package/lib/cjs/types.js +5 -0
- package/lib/esm/client/addon/Manager.js +3 -3
- package/lib/esm/client/addon/preset.js +1 -0
- package/lib/esm/client/addon/readyForCapture.js +5 -0
- package/lib/esm/client/addon/utils.js +1 -33
- package/lib/esm/client/addon/withCreevey.js +303 -41
- package/lib/esm/client/shared/components/ImagesView/BlendView.js +2 -3
- package/lib/esm/client/shared/components/ImagesView/SideBySideView.js +2 -3
- package/lib/esm/client/shared/components/ImagesView/SlideView.js +3 -3
- package/lib/esm/client/shared/components/ImagesView/SwapView.js +2 -3
- package/lib/esm/client/shared/helpers.js +1 -1
- package/lib/esm/index.js +6 -3
- package/lib/esm/server/config.js +7 -5
- package/lib/esm/server/extract.js +8 -4
- package/lib/esm/server/index.js +2 -3
- package/lib/esm/server/loaders/babel/register.js +3 -2
- package/lib/esm/server/master/index.js +4 -10
- package/lib/esm/server/master/master.js +1 -0
- package/lib/esm/server/master/pool.js +31 -31
- package/lib/esm/server/master/server.js +73 -5
- package/lib/esm/server/messages.js +118 -12
- package/lib/esm/server/parser.js +63 -0
- package/lib/esm/server/selenium/browser.js +116 -23
- package/lib/esm/server/selenium/selenoid.js +1 -1
- package/lib/esm/server/stories.js +51 -58
- package/lib/esm/server/storybook/entry.js +4 -4
- package/lib/esm/server/storybook/helpers.js +9 -3
- package/lib/esm/server/storybook/providers/browser.js +61 -0
- package/lib/esm/server/storybook/providers/hybrid.js +63 -0
- package/lib/esm/server/storybook/{nodejs-provider.js → providers/nodejs.js} +40 -18
- package/lib/esm/server/utils.js +29 -2
- package/lib/esm/server/worker/helpers.js +2 -6
- package/lib/esm/server/worker/worker.js +16 -4
- package/lib/esm/shared.js +76 -0
- package/lib/esm/types.js +3 -0
- package/lib/types/client/addon/preset.d.ts +2 -0
- package/lib/types/client/addon/readyForCapture.d.ts +6 -0
- package/lib/types/client/addon/utils.d.ts +1 -5
- package/lib/types/client/addon/withCreevey.d.ts +13 -2
- package/lib/types/client/web/CreeveyView/SideBar/SuiteLink.d.ts +2 -2
- package/lib/types/index.d.ts +2 -1
- package/lib/types/server/config.d.ts +1 -1
- package/lib/types/server/master/master.d.ts +1 -0
- package/lib/types/server/master/pool.d.ts +1 -0
- package/lib/types/server/master/server.d.ts +1 -1
- package/lib/types/server/messages.d.ts +12 -2
- package/lib/types/server/parser.d.ts +12 -0
- package/lib/types/server/selenium/browser.d.ts +5 -2
- package/lib/types/server/stories.d.ts +1 -2
- package/lib/types/server/storybook/entry.d.ts +13 -9
- package/lib/types/server/storybook/helpers.d.ts +1 -0
- package/lib/types/server/storybook/providers/browser.d.ts +4 -0
- package/lib/types/server/storybook/providers/hybrid.d.ts +4 -0
- package/lib/types/server/storybook/providers/nodejs.d.ts +9 -0
- package/lib/types/server/utils.d.ts +2 -0
- package/lib/types/server/worker/helpers.d.ts +2 -1
- package/lib/types/shared.d.ts +16 -0
- package/lib/types/types.d.ts +33 -4
- package/package.json +28 -18
- package/storybook-static/stories.json +4 -513
- package/types/mocha.d.ts +1 -0
- package/lib/types/server/storybook/nodejs-provider.d.ts +0 -5
package/CHANGELOG.md
CHANGED
@@ -1,11 +1,21 @@
|
|
1
|
-
|
1
|
+
# [0.8.0-beta.0](https://github.com/wKich/creevey/compare/v0.7.39...v0.8.0-beta.0) (2022-03-17)
|
2
|
+
|
3
|
+
### Bug Fixes
|
2
4
|
|
5
|
+
- 🐛 revert cross-env scripts, as they not work in unix ([92b04a5](https://github.com/wKich/creevey/commit/92b04a5bed56191b7ee6bd169f5327e30a1c2232))
|
3
6
|
|
4
7
|
### Features
|
5
8
|
|
6
|
-
|
9
|
+
- 🎸 change format for `skip` parameter ([f244b7c](https://github.com/wKich/creevey/commit/f244b7cd344b276762408a1df841e5afc3853fad))
|
10
|
+
- 🎸 Improve skip options ([2fcc624](https://github.com/wKich/creevey/commit/2fcc624a9b2ab1dcdce3927779c8f58bb0a0d02c))
|
11
|
+
- new creevey params: "global" and "kind" ([7d7c885](https://github.com/wKich/creevey/commit/7d7c88521a28c91586bfdd663500bea576845292))
|
12
|
+
- support storybook 6.4 ([74010e5](https://github.com/wKich/creevey/commit/74010e53d93ff1815427cd7ee818481ce6e21288))
|
7
13
|
|
14
|
+
## [0.7.39](https://github.com/wKich/creevey/compare/v0.7.38...v0.7.39) (2021-11-04)
|
15
|
+
|
16
|
+
### Features
|
8
17
|
|
18
|
+
- 🎸 add ability to update story arguments from test cases ([18d8ecb](https://github.com/wKich/creevey/commit/18d8ecb909097b585282a04bfb0b0c721ad45e22))
|
9
19
|
|
10
20
|
## [0.7.38](https://github.com/wKich/creevey/compare/v0.7.37...v0.7.38) (2021-09-28)
|
11
21
|
|
package/README.md
CHANGED
@@ -29,7 +29,7 @@ It named after [Colin Creevey](https://harrypotter.fandom.com/wiki/Colin_Creevey
|
|
29
29
|
- [Examples](https://github.com/wKich/creevey-examples)
|
30
30
|
- Advanced usage
|
31
31
|
- [Write tests](docs/tests.md)
|
32
|
-
- [Use your Selenium Grid (BrowserStack/SauceLabs/etc)](docs/grid.md)
|
32
|
+
- [Use your Selenium Grid (LambdaTest/BrowserStack/SauceLabs/etc)](docs/grid.md)
|
33
33
|
- [Future plans](#future-plans)
|
34
34
|
- [Known issues](#known-issues)
|
35
35
|
- [Used by](#used-by)
|
package/docs/config.md
CHANGED
@@ -112,7 +112,19 @@ module.exports = {
|
|
112
112
|
|
113
113
|
### Storybook parameters
|
114
114
|
|
115
|
-
Also you could define parameters on `kind` or `story` levels. All these parameters are deeply merged by
|
115
|
+
Also you could define parameters on `global`, `kind` or `story` levels. All these parameters are deeply merged by Storybook for each story. But bear in mind when you define skip option as an array Storybook treats it as primitive value and doesn't merge with other skip options.
|
116
|
+
|
117
|
+
```tsx
|
118
|
+
// .storybook/preview.tsx
|
119
|
+
export const parameters = {
|
120
|
+
creevey: {
|
121
|
+
// Skip all *hover tests in IE11 on the global level
|
122
|
+
skip: {
|
123
|
+
ie11: { in: 'ie11', tests: /.*hover$/ },
|
124
|
+
},
|
125
|
+
},
|
126
|
+
};
|
127
|
+
```
|
116
128
|
|
117
129
|
```tsx
|
118
130
|
import React from 'react';
|
@@ -126,12 +138,12 @@ export default {
|
|
126
138
|
creevey: {
|
127
139
|
// You could skip some browsers/stories or even specific tests
|
128
140
|
skip: [
|
129
|
-
{ in: 'ie11', reason:
|
130
|
-
{ in: 'firefox', stories: 'Loading' },
|
141
|
+
{ in: 'ie11', reason: "`MyComponent` doesn't support ie11" },
|
142
|
+
{ in: 'firefox', stories: 'Loading', reason: "Loading stories are flaky in firefox" },
|
131
143
|
{
|
132
144
|
in: ['firefox', 'chrome'],
|
133
145
|
tests: /.*hover$/,
|
134
|
-
reason:
|
146
|
+
reason: "For some reason `MyComponent` hovering doesn't work correctly",
|
135
147
|
},
|
136
148
|
],
|
137
149
|
},
|
@@ -155,6 +167,18 @@ Basic.parameters = {
|
|
155
167
|
|
156
168
|
### `skip` option examples:
|
157
169
|
|
170
|
+
```ts
|
171
|
+
interface SkipOption {
|
172
|
+
reason?: string;
|
173
|
+
in?: string | string[] | RegExp;
|
174
|
+
kinds?: string | string[] | RegExp;
|
175
|
+
stories?: string | string[] | RegExp;
|
176
|
+
tests?: string | string[] | RegExp;
|
177
|
+
}
|
178
|
+
|
179
|
+
type SkipOptions = SkipOption | SkipOption[] | Record<string, SkipOption | SkipOption[]>;
|
180
|
+
```
|
181
|
+
|
158
182
|
- Skip all stories for all browsers:
|
159
183
|
- `skip: true`
|
160
184
|
- `skip: 'Skip reason message'`
|
@@ -175,6 +199,14 @@ Basic.parameters = {
|
|
175
199
|
- `skip: { tests: 'click' }`
|
176
200
|
- `skip: { tests: ['hover', 'click'] }`
|
177
201
|
- `skip: { tests: /^press.*$/ }`
|
178
|
-
- Multiple skip options:
|
202
|
+
- Multiple skip options:
|
203
|
+
- as an array `skip: [{ /* ... */ }]`
|
204
|
+
- as an object
|
205
|
+
```
|
206
|
+
skip: {
|
207
|
+
foo: { /* ... */ },
|
208
|
+
bar: { /* ... */ },
|
209
|
+
}
|
210
|
+
```
|
179
211
|
|
180
212
|
NOTE: If you try to skip stories by story name, the storybook name format will be used (For more info see [storybook-export-vs-name-handling](https://storybook.js.org/docs/formats/component-story-format/#storybook-export-vs-name-handling))
|
package/docs/grid.md
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
## Use your Selenium Grid (BrowserStack/SauceLabs/etc)
|
2
2
|
|
3
|
-
Sometimes you already have Selenium Grid on one of many different e2e testing services, like BrowserStack or SauceLabs , or use self-hosted one. You could use these services. If your Selenium Grid located in same network where you going to start Creevey, you will need to define `gridUrl` parameter in Creevey config. Overwise you need to start tunneling tool
|
3
|
+
Sometimes you already have Selenium Grid on one of many different e2e testing services, like LambdaTest, BrowserStack, or SauceLabs , or use a self-hosted one. You could use these services. If your Selenium Grid is located in the same network where you going to start Creevey, you will need to define `gridUrl` parameter in Creevey config. Overwise you need to start tunneling tool depending on what Grid you use:
|
4
4
|
|
5
|
+
- [LambdaTest] (https://www.npmjs.com/package/@lambdatest/node-tunnel)
|
5
6
|
- [browserstack-local](https://www.npmjs.com/package/browserstack-local)
|
6
7
|
- [sauce-connect-launcher](https://www.npmjs.com/package/sauce-connect-launcher)
|
7
8
|
- [open-ssh-tunnel](https://www.npmjs.com/package/open-ssh-tunnel)
|
@@ -7,6 +7,8 @@ exports.CreeveyManager = void 0;
|
|
7
7
|
|
8
8
|
var _coreEvents = require("@storybook/core-events");
|
9
9
|
|
10
|
+
var _shared = require("../../shared");
|
11
|
+
|
10
12
|
var _types = require("../../types");
|
11
13
|
|
12
14
|
var _creeveyClientApi = require("../shared/creeveyClientApi");
|
@@ -242,8 +244,7 @@ var CreeveyManager = /*#__PURE__*/function () {
|
|
242
244
|
});
|
243
245
|
|
244
246
|
_defineProperty(this, "onSetStories", function (data) {
|
245
|
-
|
246
|
-
var stories = data.v ? (0, _utils.denormalizeStoryParameters)(data) : data;
|
247
|
+
var stories = data.v ? (0, _shared.denormalizeStoryParameters)(data) : data.stories;
|
247
248
|
_this.stories = stories;
|
248
249
|
});
|
249
250
|
|
@@ -72,6 +72,7 @@ function managerWebpack(config, options) {
|
|
72
72
|
DefinePlugin = _ref$DefinePlugin === void 0 ? _webpack.DefinePlugin : _ref$DefinePlugin;
|
73
73
|
|
74
74
|
(_config$plugins = config.plugins) === null || _config$plugins === void 0 ? void 0 : _config$plugins.push(new DefinePlugin({
|
75
|
+
__CREEVEY_SERVER_HOST__: options.creeveyHost,
|
75
76
|
__CREEVEY_SERVER_PORT__: (_options$creeveyPort = options.creeveyPort) !== null && _options$creeveyPort !== void 0 ? _options$creeveyPort : 3000,
|
76
77
|
__CREEVEY_CLIENT_PORT__: options.clientPort
|
77
78
|
}));
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.readyForCapture = readyForCapture;
|
7
|
+
|
8
|
+
function readyForCapture() {
|
9
|
+
var _window$__CREEVEY_SET, _window;
|
10
|
+
|
11
|
+
(_window$__CREEVEY_SET = (_window = window).__CREEVEY_SET_READY_FOR_CAPTURE__) === null || _window$__CREEVEY_SET === void 0 ? void 0 : _window$__CREEVEY_SET.call(_window);
|
12
|
+
}
|
@@ -4,15 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.getEmojiByTestStatus = getEmojiByTestStatus;
|
7
|
-
exports.denormalizeStoryParameters = exports.combineParameters = void 0;
|
8
|
-
|
9
|
-
var _lodash = require("lodash");
|
10
|
-
|
11
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
12
|
-
|
13
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
14
|
-
|
15
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
16
7
|
|
17
8
|
function getEmojiByTestStatus(status) {
|
18
9
|
var skip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
@@ -44,35 +35,4 @@ function getEmojiByTestStatus(status) {
|
|
44
35
|
return '';
|
45
36
|
}
|
46
37
|
}
|
47
|
-
}
|
48
|
-
|
49
|
-
|
50
|
-
var combineParameters = function combineParameters() {
|
51
|
-
for (var _len = arguments.length, parameterSets = new Array(_len), _key = 0; _key < _len; _key++) {
|
52
|
-
parameterSets[_key] = arguments[_key];
|
53
|
-
}
|
54
|
-
|
55
|
-
return (// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
56
|
-
_lodash.mergeWith.apply(void 0, [{}].concat(parameterSets, [function (_, srcValue) {
|
57
|
-
// Treat arrays as scalars:
|
58
|
-
if (Array.isArray(srcValue)) return srcValue;
|
59
|
-
return undefined;
|
60
|
-
}]))
|
61
|
-
);
|
62
|
-
}; // NOTE: Copy-paste from storybook/api
|
63
|
-
|
64
|
-
|
65
|
-
exports.combineParameters = combineParameters;
|
66
|
-
|
67
|
-
var denormalizeStoryParameters = function denormalizeStoryParameters(_ref) {
|
68
|
-
var globalParameters = _ref.globalParameters,
|
69
|
-
kindParameters = _ref.kindParameters,
|
70
|
-
stories = _ref.stories;
|
71
|
-
return (0, _lodash.mapValues)(stories, function (storyData) {
|
72
|
-
return _objectSpread(_objectSpread({}, storyData), {}, {
|
73
|
-
parameters: combineParameters(globalParameters, kindParameters[storyData.kind], storyData.parameters)
|
74
|
-
});
|
75
|
-
});
|
76
|
-
};
|
77
|
-
|
78
|
-
exports.denormalizeStoryParameters = denormalizeStoryParameters;
|
38
|
+
}
|