creevey 0.10.0-beta.35 → 0.10.0-beta.37
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/dist/client/addon/withCreevey.d.ts +1 -1
- package/dist/client/shared/components/ImagesView/BlendView.d.ts +1 -1
- package/dist/client/shared/components/ImagesView/SideBySideView.d.ts +1 -1
- package/dist/client/shared/components/ImagesView/SlideView.d.ts +1 -1
- package/dist/client/shared/components/ImagesView/SwapView.d.ts +1 -1
- package/dist/client/shared/components/PageHeader/ImagePreview.d.ts +1 -1
- package/dist/client/shared/components/ResultsPage.d.ts +1 -1
- package/dist/client/web/CreeveyView/SideBar/SuiteLink.d.ts +2 -2
- package/dist/client/web/CreeveyView/SideBar/TestStatusIcon.d.ts +1 -1
- package/dist/client/web/CreeveyView/SideBar/TestsStatus.d.ts +1 -1
- package/dist/client/web/assets/index-B0Xv0lOY.js +802 -0
- package/dist/client/web/index.html +1 -1
- package/dist/server/master/runner.js +3 -9
- package/dist/server/master/runner.js.map +1 -1
- package/dist/server/playwright/docker-file.js +4 -3
- package/dist/server/playwright/docker-file.js.map +1 -1
- package/dist/server/playwright/index-source.mjs +16 -0
- package/dist/server/playwright/internal.d.ts +1 -1
- package/dist/server/playwright/internal.js +3 -1
- package/dist/server/playwright/internal.js.map +1 -1
- package/dist/server/playwright/webdriver.d.ts +1 -1
- package/dist/server/selenium/internal.d.ts +1 -1
- package/dist/server/selenium/internal.js +0 -2
- package/dist/server/selenium/internal.js.map +1 -1
- package/dist/server/selenium/selenoid.js +1 -2
- package/dist/server/selenium/selenoid.js.map +1 -1
- package/dist/server/selenium/webdriver.d.ts +1 -1
- package/dist/server/testsFiles/parser.js +1 -3
- package/dist/server/testsFiles/parser.js.map +1 -1
- package/dist/server/webdriver.d.ts +1 -1
- package/dist/shared/index.d.ts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +47 -48
- package/src/client/addon/withCreevey.ts +1 -1
- package/src/server/master/runner.ts +3 -9
- package/src/server/playwright/docker-file.ts +7 -5
- package/src/server/playwright/internal.ts +4 -2
- package/src/server/playwright/webdriver.ts +1 -1
- package/src/server/selenium/internal.ts +1 -3
- package/src/server/selenium/selenoid.ts +1 -1
- package/src/server/selenium/webdriver.ts +1 -1
- package/src/server/testsFiles/parser.ts +1 -3
- package/src/server/webdriver.ts +1 -1
- package/src/shared/index.ts +1 -1
- package/src/types.ts +1 -1
- package/dist/client/web/assets/index-Cs8IUTQs.js +0 -595
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "creevey",
|
3
3
|
"description": "Cross-browser screenshot testing tool for Storybook with fancy UI Runner",
|
4
|
-
"version": "0.10.0-beta.
|
4
|
+
"version": "0.10.0-beta.37",
|
5
5
|
"type": "commonjs",
|
6
6
|
"bin": "dist/cli.js",
|
7
7
|
"main": "./dist/index.js",
|
@@ -64,7 +64,7 @@
|
|
64
64
|
"build": "yarn prebuild && yarn build:client && yarn build:creevey && yarn postbuild",
|
65
65
|
"build:client": "vite build",
|
66
66
|
"build:creevey": "tsc --build tsconfig.prod.json",
|
67
|
-
"postbuild": "cp \"\"scripts/dist/*.d.ts\"\" dist/",
|
67
|
+
"postbuild": "cp \"\"scripts/dist/*.d.ts\"\" dist/ && cp \"\"src/server/playwright/index-source.mjs\"\" dist/server/playwright/index-source.mjs",
|
68
68
|
"version": "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md",
|
69
69
|
"build-storybook": "storybook build",
|
70
70
|
"chromatic": "chromatic --project-token=chpt_80df83ca94e6fb4",
|
@@ -88,32 +88,32 @@
|
|
88
88
|
"dependencies": {
|
89
89
|
"@koa/cors": "^5.0.0",
|
90
90
|
"@octokit/core": "^6.1.4",
|
91
|
-
"@storybook/icons": "^1.
|
91
|
+
"@storybook/icons": "^1.4.0",
|
92
92
|
"@types/chai": "^4.3.20",
|
93
|
-
"@types/dockerode": "^3.3.
|
93
|
+
"@types/dockerode": "^3.3.37",
|
94
94
|
"@types/koa": "^2.15.0",
|
95
95
|
"@types/koa-bodyparser": "^4.3.12",
|
96
96
|
"@types/koa-mount": "^4.0.5",
|
97
97
|
"@types/koa-static": "^4.0.4",
|
98
98
|
"@types/koa__cors": "^5.0.0",
|
99
|
-
"@types/lodash": "^4.17.
|
99
|
+
"@types/lodash": "^4.17.16",
|
100
100
|
"@types/micromatch": "^4.0.9",
|
101
101
|
"@types/minimist": "^1.2.5",
|
102
102
|
"@types/pixelmatch": "^5.2.6",
|
103
103
|
"@types/pngjs": "^6.0.5",
|
104
104
|
"@types/qs": "^6.9.18",
|
105
|
-
"@types/react": "^18.3.
|
106
|
-
"@types/react-dom": "^18.3.
|
105
|
+
"@types/react": "^18.3.20",
|
106
|
+
"@types/react-dom": "^18.3.6",
|
107
107
|
"@types/selenium-webdriver": "^4.1.28",
|
108
108
|
"@types/shelljs": "^0.8.15",
|
109
|
-
"@types/ws": "^8.
|
109
|
+
"@types/ws": "^8.18.1",
|
110
110
|
"chai": "^4.5.0",
|
111
111
|
"chalk": "^4.1.2",
|
112
112
|
"chokidar": "^4.0.3",
|
113
|
-
"dockerode": "^4.0.
|
113
|
+
"dockerode": "^4.0.5",
|
114
114
|
"find-cache-dir": "^5.0.0",
|
115
115
|
"get-port": "^7.1.0",
|
116
|
-
"koa": "^2.
|
116
|
+
"koa": "^2.16.0",
|
117
117
|
"koa-bodyparser": "^4.4.1",
|
118
118
|
"koa-mount": "^4.0.0",
|
119
119
|
"koa-static": "^5.0.0",
|
@@ -123,72 +123,71 @@
|
|
123
123
|
"micromatch": "^4.0.8",
|
124
124
|
"minimist": "^1.2.8",
|
125
125
|
"odiff-bin": "^3.2.1",
|
126
|
-
"package-manager-detector": "^0.2.
|
126
|
+
"package-manager-detector": "^0.2.11",
|
127
127
|
"pidtree": "^0.6.0",
|
128
128
|
"pixelmatch": "^6.0.0",
|
129
129
|
"pngjs": "^7.0.0",
|
130
130
|
"polished": "^4.3.1",
|
131
131
|
"qs": "^6.14.0",
|
132
132
|
"semver": "^7.7.1",
|
133
|
-
"shelljs": "^0.
|
133
|
+
"shelljs": "^0.9.2",
|
134
134
|
"tar-stream": "^3.1.7",
|
135
|
-
"tsx": "^4.19.
|
136
|
-
"uuid": "^11.0
|
137
|
-
"ws": "^8.18.
|
138
|
-
"yocto-spinner": "^0.2.
|
135
|
+
"tsx": "^4.19.3",
|
136
|
+
"uuid": "^11.1.0",
|
137
|
+
"ws": "^8.18.1",
|
138
|
+
"yocto-spinner": "^0.2.1"
|
139
139
|
},
|
140
140
|
"devDependencies": {
|
141
|
-
"@chromatic-com/storybook": "^3.2.
|
142
|
-
"@eslint/js": "^9.
|
143
|
-
"@storybook/addon-essentials": "^8.
|
144
|
-
"@storybook/addon-interactions": "^8.
|
145
|
-
"@storybook/blocks": "^8.
|
146
|
-
"@storybook/channels": "^8.
|
147
|
-
"@storybook/components": "^8.
|
148
|
-
"@storybook/
|
149
|
-
"@storybook/
|
150
|
-
"@storybook/
|
151
|
-
"@storybook/react": "^8.
|
152
|
-
"@storybook/
|
153
|
-
"@storybook/
|
154
|
-
"@storybook/
|
155
|
-
"@storybook/types": "^8.5.8",
|
141
|
+
"@chromatic-com/storybook": "^3.2.6",
|
142
|
+
"@eslint/js": "^9.23.0",
|
143
|
+
"@storybook/addon-essentials": "^8.6.12",
|
144
|
+
"@storybook/addon-interactions": "^8.6.12",
|
145
|
+
"@storybook/blocks": "^8.6.12",
|
146
|
+
"@storybook/channels": "^8.6.12",
|
147
|
+
"@storybook/components": "^8.6.12",
|
148
|
+
"@storybook/manager-api": "^8.6.12",
|
149
|
+
"@storybook/preview-api": "^8.6.12",
|
150
|
+
"@storybook/react": "^8.6.12",
|
151
|
+
"@storybook/react-vite": "^8.6.12",
|
152
|
+
"@storybook/test": "^8.6.12",
|
153
|
+
"@storybook/theming": "^8.6.12",
|
154
|
+
"@storybook/types": "^8.6.12",
|
156
155
|
"@types/eslint": "^9.6.1",
|
157
156
|
"@types/eslint__js": "^8.42.3",
|
158
|
-
"@types/node": "^18.19.
|
157
|
+
"@types/node": "^18.19.86",
|
159
158
|
"@types/resize-observer-browser": "^0.1.11",
|
160
|
-
"@types/semver": "^7.
|
159
|
+
"@types/semver": "^7.7.0",
|
161
160
|
"@types/tar-stream": "^3.1.3",
|
162
161
|
"@types/tmp": "^0.2.6",
|
163
|
-
"@vitejs/plugin-react-swc": "^3.8.
|
162
|
+
"@vitejs/plugin-react-swc": "^3.8.1",
|
164
163
|
"browserstack-local": "^1.5.6",
|
165
|
-
"chromatic": "^11.
|
164
|
+
"chromatic": "^11.28.0",
|
166
165
|
"concurrently": "^9.1.2",
|
167
166
|
"conventional-changelog-cli": "^5.0.0",
|
168
167
|
"dotenv": "^16.4.7",
|
169
|
-
"eslint": "^9.
|
170
|
-
"eslint-config-prettier": "^10.
|
171
|
-
"eslint-plugin-prettier": "^5.2.
|
172
|
-
"eslint-plugin-react": "^7.37.
|
173
|
-
"eslint-plugin-react-hooks": "^5.
|
168
|
+
"eslint": "^9.23.0",
|
169
|
+
"eslint-config-prettier": "^10.1.1",
|
170
|
+
"eslint-plugin-prettier": "^5.2.6",
|
171
|
+
"eslint-plugin-react": "^7.37.5",
|
172
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
174
173
|
"git-cz": "^4.9.0",
|
175
174
|
"globals": "^16.0.0",
|
176
175
|
"husky": "^9.1.7",
|
177
176
|
"immer": "^10.1.1",
|
178
|
-
"lint-staged": "^15.
|
177
|
+
"lint-staged": "^15.5.0",
|
179
178
|
"pinst": "^3.0.0",
|
180
|
-
"playwright-core": "^1.
|
181
|
-
"prettier": "^3.5.
|
179
|
+
"playwright-core": "^1.51.1",
|
180
|
+
"prettier": "^3.5.3",
|
182
181
|
"react": "^18.3.1",
|
183
182
|
"react-dom": "^18.3.1",
|
184
183
|
"react-is": "^18.3.1",
|
185
|
-
"selenium-webdriver": "^4.
|
186
|
-
"storybook": "^8.
|
184
|
+
"selenium-webdriver": "^4.30.0",
|
185
|
+
"storybook": "^8.6.12",
|
187
186
|
"tmp": "^0.2.3",
|
188
|
-
"typescript": "^5.
|
189
|
-
"typescript-eslint": "^8.
|
187
|
+
"typescript": "^5.8.2",
|
188
|
+
"typescript-eslint": "^8.29.0",
|
190
189
|
"use-immer": "^0.11.0",
|
191
|
-
"vite": "^5.4.
|
190
|
+
"vite": "^5.4.17",
|
192
191
|
"vitest": "^2.1.9"
|
193
192
|
},
|
194
193
|
"config": {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Renderer, StoryContextForEnhancers } from '@storybook/
|
1
|
+
import type { Renderer, StoryContextForEnhancers } from '@storybook/types';
|
2
2
|
import { makeDecorator, PreviewWeb, StoryStore } from '@storybook/preview-api';
|
3
3
|
import { Channel } from '@storybook/channels';
|
4
4
|
import {
|
@@ -52,9 +52,7 @@ export default class Runner extends EventEmitter {
|
|
52
52
|
this.sendUpdate({ tests: { [id]: { id, browser, testName, storyPath, status: test.status, storyId } } });
|
53
53
|
return;
|
54
54
|
}
|
55
|
-
|
56
|
-
test.results = [];
|
57
|
-
}
|
55
|
+
test.results ??= [];
|
58
56
|
test.results.push(result);
|
59
57
|
|
60
58
|
if (status == 'failed') {
|
@@ -201,9 +199,7 @@ export default class Runner extends EventEmitter {
|
|
201
199
|
if (!image) continue;
|
202
200
|
await this.copyImage(test, name, image.actual);
|
203
201
|
|
204
|
-
|
205
|
-
test.approved = {};
|
206
|
-
}
|
202
|
+
test.approved ??= {};
|
207
203
|
test.approved[name] = retry;
|
208
204
|
test.status = 'approved';
|
209
205
|
|
@@ -227,9 +223,7 @@ export default class Runner extends EventEmitter {
|
|
227
223
|
if (!result.images) return;
|
228
224
|
const images = result.images[image];
|
229
225
|
if (!images) return;
|
230
|
-
|
231
|
-
test.approved = {};
|
232
|
-
}
|
226
|
+
test.approved ??= {};
|
233
227
|
const { browser, testName, storyPath, storyId } = test;
|
234
228
|
|
235
229
|
await this.copyImage(test, image, images.actual);
|
@@ -18,16 +18,16 @@ export async function playwrightDockerFile(browser: string, version: string): Pr
|
|
18
18
|
|
19
19
|
const indexJs = await readFile(new URL('./index-source.mjs', importMetaUrl), 'utf-8');
|
20
20
|
|
21
|
-
|
21
|
+
const dockerfile = `
|
22
22
|
FROM node:lts
|
23
23
|
|
24
24
|
WORKDIR /creevey
|
25
25
|
|
26
26
|
RUN echo "{ \\"type\\": \\"module\\" }" > package.json && \\
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
${indexJs
|
28
|
+
.split('\n')
|
29
|
+
.map((line) => ` echo "${line.replace(/"/g, '\\"')}" >> index.js && \\`)
|
30
|
+
.join('\n')}
|
31
31
|
${
|
32
32
|
npmRegistry
|
33
33
|
? `
|
@@ -41,4 +41,6 @@ EXPOSE 4444
|
|
41
41
|
|
42
42
|
ENTRYPOINT [ "node", "./index.js" ]
|
43
43
|
`;
|
44
|
+
|
45
|
+
return dockerfile.replace(/\\\n\s*\\?\n/g, '\\\n');
|
44
46
|
}
|
@@ -13,7 +13,7 @@ import chalk from 'chalk';
|
|
13
13
|
import { v4 } from 'uuid';
|
14
14
|
import Logger from 'loglevel';
|
15
15
|
import prefix from 'loglevel-plugin-prefix';
|
16
|
-
import type { Args } from '@storybook/
|
16
|
+
import type { Args } from '@storybook/types';
|
17
17
|
import {
|
18
18
|
BrowserConfigObject,
|
19
19
|
Config,
|
@@ -159,13 +159,15 @@ export class InternalBrowser {
|
|
159
159
|
const element = await this.#page.$(captureElement);
|
160
160
|
if (!element) throw new Error(`Element with selector ${captureElement} not found`);
|
161
161
|
|
162
|
+
logger().debug(`Capturing ${chalk.cyan(captureElement)} element`);
|
162
163
|
return element.screenshot({
|
163
164
|
animations: 'disabled',
|
164
165
|
mask,
|
165
166
|
style: ':root { overflow: hidden !important; }',
|
166
167
|
});
|
167
168
|
}
|
168
|
-
|
169
|
+
logger().debug('Capturing viewport screenshot');
|
170
|
+
return this.#page.screenshot({ animations: 'disabled', mask });
|
169
171
|
}
|
170
172
|
|
171
173
|
waitForComplete(callback: (isCompleted: boolean) => void): void {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/// <reference types="../../../types/playwright-context" />
|
2
|
-
import type { Args } from '@storybook/
|
2
|
+
import type { Args } from '@storybook/types';
|
3
3
|
import { Config, Options, ServerTest, StoriesRaw, StoryInput } from '../../types';
|
4
4
|
import { logger } from '../logger';
|
5
5
|
import { subscribeOn } from '../messages';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Args } from '@storybook/
|
1
|
+
import type { Args } from '@storybook/types';
|
2
2
|
import chalk from 'chalk';
|
3
3
|
import http from 'http';
|
4
4
|
import https from 'https';
|
@@ -266,9 +266,7 @@ export class InternalBrowser {
|
|
266
266
|
},
|
267
267
|
// NOTE page_Offset is used only for IE9-11
|
268
268
|
windowRect: {
|
269
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
270
269
|
top: Math.round(window.scrollY || window.pageYOffset),
|
271
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
272
270
|
left: Math.round(window.scrollX || window.pageXOffset),
|
273
271
|
width: window.innerWidth,
|
274
272
|
height: window.innerHeight,
|
@@ -34,7 +34,7 @@ async function createSelenoidConfig(
|
|
34
34
|
dockerImage = `selenoid/${browserName}:${browserVersion}`,
|
35
35
|
webdriverCommand = [],
|
36
36
|
}) => {
|
37
|
-
|
37
|
+
selenoidConfig[browserName] ??= { default: browserVersion, versions: {} };
|
38
38
|
if (!useDocker && webdriverCommand.length == 0)
|
39
39
|
throw new Error('Please specify "webdriverCommand" browser option with path to browser webdriver');
|
40
40
|
selenoidConfig[browserName].versions[browserVersion] = {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/// <reference types="../../../types/selenium-context" />
|
2
|
-
import type { Args } from '@storybook/
|
2
|
+
import type { Args } from '@storybook/types';
|
3
3
|
import { Config, StorybookGlobals, StoryInput, StoriesRaw, Options, ServerTest } from '../../types.js';
|
4
4
|
import { subscribeOn } from '../messages.js';
|
5
5
|
import { CreeveyWebdriverBase } from '../webdriver.js';
|
@@ -105,8 +105,6 @@ export const story = (
|
|
105
105
|
|
106
106
|
export const test = (title: string, testFn: CreeveyTestFunction): void => {
|
107
107
|
const storyId = getStoryId(kindTitle, storyTitle);
|
108
|
-
|
109
|
-
result[storyId] = {};
|
110
|
-
}
|
108
|
+
result[storyId] ??= {};
|
111
109
|
result[storyId].tests = Object.assign({}, result[storyId].tests, { [title]: testFn });
|
112
110
|
};
|
package/src/server/webdriver.ts
CHANGED
package/src/shared/index.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import _ from 'lodash';
|
2
|
-
import type { Parameters } from '@storybook/
|
2
|
+
import type { Parameters } from '@storybook/types';
|
3
3
|
import { SetStoriesData, StoriesRaw, CreeveyStoryParams, StoryInput } from '../types.js';
|
4
4
|
import { deserializeRegExp, isSerializedRegExp, isRegExp, serializeRegExp } from './serializeRegExp.js';
|
5
5
|
|
package/src/types.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { StoryContextForEnhancers, DecoratorFunction } from '@storybook/
|
1
|
+
import type { StoryContextForEnhancers, DecoratorFunction } from '@storybook/types';
|
2
2
|
import type { Worker as ClusterWorker } from 'cluster';
|
3
3
|
import type Pixelmatch from 'pixelmatch';
|
4
4
|
import type { ODiffOptions } from 'odiff-bin';
|