@applitools/eyes-storybook 3.37.1 → 3.37.3

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,25 @@
4
4
 
5
5
 
6
6
 
7
+ ## [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
+
9
+
10
+ ### Code Refactoring
11
+
12
+ * ufg client ([#1780](https://github.com/applitools/eyes.sdk.javascript1/issues/1780)) ([d60cf16](https://github.com/applitools/eyes.sdk.javascript1/commit/d60cf1616741a96b152a1548760bb98116e5c3f9))
13
+
14
+
15
+ ### Dependencies
16
+
17
+
18
+
19
+ ## [3.37.2](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-storybook@3.37.1...js/eyes-storybook@3.37.2) (2023-07-18)
20
+
21
+
22
+ ### Performance Improvements
23
+
24
+ * additional runtime improvements ([8a33a83](https://github.com/applitools/eyes.sdk.javascript1/commit/8a33a83d4911bdd3bebff646c983d5a2de512763))
25
+
7
26
  ## [3.37.1](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-storybook@3.37.0...js/eyes-storybook@3.37.1) (2023-07-18)
8
27
 
9
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-storybook",
3
- "version": "3.37.1",
3
+ "version": "3.37.3",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "applitools",
@@ -28,7 +28,7 @@
28
28
  "lint": "run --top-level eslint '**/*.js'",
29
29
  "build": "rollup -c rollup.config.js",
30
30
  "build:heavy": "node scripts/bitmap.js",
31
- "test": "yarn build && yarn test:mocha && yarn lint",
31
+ "test": "yarn build && yarn test:mocha",
32
32
  "test:mocha": "run --top-level mocha --no-timeouts --trace-warnings 'test/{unit,it,e2e}/*.test.js'",
33
33
  "test:unit": "run --top-level mocha --no-timeouts --trace-warnings 'test/unit/*.test.js'",
34
34
  "test:it": "run --top-level mocha --no-timeouts --trace-warnings 'test/it/*.test.js'",
@@ -57,27 +57,27 @@
57
57
  "postinstall": "node src/postinstall"
58
58
  },
59
59
  "dependencies": {
60
- "@applitools/core": "^3.6.2",
61
- "@applitools/driver": "^1.13.1",
60
+ "@applitools/core": "3.6.3",
61
+ "@applitools/driver": "1.13.2",
62
62
  "@applitools/functional-commons": "1.6.0",
63
- "@applitools/logger": "^2.0.5",
63
+ "@applitools/logger": "2.0.6",
64
64
  "@applitools/monitoring-commons": "1.0.19",
65
- "@applitools/spec-driver-puppeteer": "^1.1.69",
66
- "@applitools/ufg-client": "^1.5.0",
67
- "@applitools/utils": "^1.5.0",
65
+ "@applitools/spec-driver-puppeteer": "1.1.70",
66
+ "@applitools/ufg-client": "1.5.1",
67
+ "@applitools/utils": "",
68
68
  "boxen": "4.2.0",
69
69
  "chalk": "3.0.0",
70
70
  "detect-port": "1.3.0",
71
71
  "lodash.flatten": "4.4.0",
72
72
  "lodash.pick": "4.4.0",
73
73
  "ora": "3.4.0",
74
- "puppeteer": "19.8.0",
74
+ "puppeteer": "20.8.3",
75
75
  "strip-ansi": "6.0.0",
76
- "throat": "6.0.1",
76
+ "throat": "6.0.2",
77
77
  "yargs": "17.7.2"
78
78
  },
79
79
  "devDependencies": {
80
- "@applitools/bongo": "^5.0.4",
80
+ "@applitools/bongo": "^5.1.4",
81
81
  "@applitools/sdk-shared": "0.9.15",
82
82
  "@applitools/snaptdout": "^1.0.1",
83
83
  "@applitools/test-server": "^1.2.2",
@@ -99,7 +99,7 @@
99
99
  "ua-parser-js": "^0.7.21"
100
100
  },
101
101
  "engines": {
102
- "node": ">=14.15.0"
102
+ "node": ">=16.16.0"
103
103
  },
104
104
  "publishConfig": {
105
105
  "access": "public"
@@ -34,7 +34,8 @@ ${chalk.green(
34
34
  `;
35
35
 
36
36
  function refineErrorMessage({prefix, error}) {
37
- return `${prefix} ${error.message.replace('Evaluation failed: ', '')}`;
37
+ const message = error && error.message ? error.message : error;
38
+ return `${prefix} ${message.replace('Evaluation failed: ', '')}`;
38
39
  }
39
40
 
40
41
  function deprecationWarning({deprecatedThing, newThing, isDead}) {
@@ -47,14 +47,7 @@ async function eyesStorybook({
47
47
  : Number(process.env.APPLITOOLS_CONCURRENT_TABS);
48
48
  logger.log(`Running with ${CONCURRENT_TABS} concurrent tabs`);
49
49
 
50
- const {
51
- storybookUrl,
52
- readStoriesTimeout,
53
- reloadPagePerStory,
54
- proxy,
55
- testConcurrency,
56
- useDnsCache,
57
- } = config;
50
+ const {storybookUrl, readStoriesTimeout, reloadPagePerStory} = config;
58
51
 
59
52
  let iframeUrl;
60
53
  try {
@@ -75,40 +68,33 @@ async function eyesStorybook({
75
68
  const core = await makeCore({spec, agentId, logger});
76
69
  const manager = await core.makeManager({
77
70
  type: 'ufg',
78
- settings: {
79
- concurrency: testConcurrency,
80
- },
81
- logger,
71
+ settings: {concurrency: config.testConcurrency},
82
72
  });
83
73
 
84
- const settings = {
85
- proxy: config.proxy,
86
- serverUrl: config.serverUrl,
87
- apiKey: config.apiKey,
88
- agentId,
89
- useDnsCache,
90
- };
91
- const [error, account] = await presult(core.getAccountInfo({settings, logger}));
74
+ const account = await core
75
+ .getAccountInfo({
76
+ settings: {
77
+ eyesServerUrl: config.eyesServerUrl,
78
+ apiKey: config.apiKey,
79
+ agentId,
80
+ proxy: config.proxy,
81
+ useDnsCache: config.useDnsCache,
82
+ },
83
+ })
84
+ .catch(async error => {
85
+ if (error && error.message && error.message.includes('Unauthorized(401)')) {
86
+ const failMsg = 'Incorrect API Key';
87
+ logger.log(failMsg);
88
+ await browser.close();
89
+ clearTimeout(memoryTimeout);
90
+ throw new Error(failMsg);
91
+ } else {
92
+ throw error;
93
+ }
94
+ });
92
95
 
93
96
  const getStoriesWithConfig = makeGetStoriesWithConfig({config});
94
-
95
- if (error && error.message && error.message.includes('Unauthorized(401)')) {
96
- const failMsg = 'Incorrect API Key';
97
- logger.log(failMsg);
98
- await browser.close();
99
- clearTimeout(memoryTimeout);
100
- throw new Error(failMsg);
101
- }
102
- const client = await makeUFGClient({
103
- config: {
104
- ...account.ufgServer,
105
- ...account,
106
- proxy,
107
- concurrency: testConcurrency,
108
- useDnsCache,
109
- },
110
- logger,
111
- });
97
+ const client = await makeUFGClient({settings: {...account.ufgServer, ...account}, logger});
112
98
 
113
99
  const initPage = makeInitPage({
114
100
  iframeUrl,
@@ -191,11 +177,6 @@ async function eyesStorybook({
191
177
  logger,
192
178
  takeDomSnapshots: doTakeDomSnapshots,
193
179
  });
194
- const closeSettings = {
195
- ...settings,
196
- updateBaselineIfNew: config.saveNewTests,
197
- updateBaselineIfDifferent: config.saveFailedTests,
198
- };
199
180
  const renderStory = makeRenderStory({
200
181
  logger: logger.extend({label: 'renderStory'}),
201
182
  openEyes: manager.openEyes,
@@ -203,10 +184,13 @@ async function eyesStorybook({
203
184
  timeItAsync,
204
185
  reloadPagePerStory,
205
186
  storyDataGap: config.storyDataGap,
206
- concurrency: testConcurrency,
187
+ concurrency: config.testConcurrency,
207
188
  appName: config.appName,
208
- closeSettings,
209
- serverSettings: settings,
189
+ closeSettings: {
190
+ updateBaselineIfNew: config.saveNewTests,
191
+ updateBaselineIfDifferent: config.saveFailedTests,
192
+ },
193
+ serverSettings: account.eyesServer,
210
194
  });
211
195
 
212
196
  const renderStories = makeRenderStories({
@@ -50,11 +50,7 @@ function generateConfig({argv = {}, defaultConfig = {}, externalConfigParams = [
50
50
  ? result.concurrency * 5
51
51
  : 5;
52
52
 
53
- result.serverUrl = result.serverUrl
54
- ? result.serverUrl
55
- : utils.general.getEnvValue('SERVER_URL')
56
- ? utils.general.getEnvValue('SERVER_URL')
57
- : 'https://eyesapi.applitools.com';
53
+ result.eyesServerUrl = result.serverUrl;
58
54
 
59
55
  result.viewportSize = result.viewportSize ? result.viewportSize : {width: 1024, height: 600};
60
56
 
@@ -125,17 +125,18 @@ function makeRenderStory({
125
125
  };
126
126
 
127
127
  return timeItAsync(baselineName, async () => {
128
- const {checkAndClose} = await openEyes({settings: openParams});
128
+ const eyes = await openEyes({settings: openParams});
129
129
  return new Promise((resolve, reject) => {
130
130
  throttle(async () => {
131
131
  try {
132
- const checkResults = await checkAndClose({
133
- settings: {...checkParams, ...closeSettings, throwEx: false},
132
+ await eyes.checkAndClose({
134
133
  target: snapshots,
134
+ settings: {...checkParams, ...closeSettings},
135
135
  });
136
- resolve(checkResults);
137
- } catch (ex) {
138
- reject(ex);
136
+ const results = await eyes.getResults();
137
+ resolve(results);
138
+ } catch (err) {
139
+ reject(err);
139
140
  }
140
141
  });
141
142
  });