@applitools/eyes-storybook 3.53.1 → 3.53.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
@@ -1,5 +1,115 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.53.3](https://github.com/Applitools-Dev/sdk/compare/js/eyes-storybook@3.53.2...js/eyes-storybook@3.53.3) (2025-01-19)
4
+
5
+
6
+ ### Dependencies
7
+
8
+ * @applitools/socket bumped to 1.2.1
9
+ #### Bug Fixes
10
+
11
+ * mask from config property ([#2739](https://github.com/Applitools-Dev/sdk/issues/2739)) ([6840624](https://github.com/Applitools-Dev/sdk/commit/6840624f5f3f56512dce96547815904adec94704))
12
+ * @applitools/req bumped to 1.7.7
13
+ #### Bug Fixes
14
+
15
+ * memory usage going high when resource is uint8array ([#2743](https://github.com/Applitools-Dev/sdk/issues/2743)) ([d06deeb](https://github.com/Applitools-Dev/sdk/commit/d06deeb845de62e96ec623efefa90ae65a703736))
16
+ * @applitools/spec-driver-webdriver bumped to 1.1.24
17
+ #### Bug Fixes
18
+
19
+ * universal core on windows ([#2736](https://github.com/Applitools-Dev/sdk/issues/2736)) ([9bd0744](https://github.com/Applitools-Dev/sdk/commit/9bd0744ca816a020973f20645aeb2460af76f44c))
20
+ * @applitools/tunnel-client bumped to 1.6.1
21
+ #### Bug Fixes
22
+
23
+ * memory usage going high when resource is uint8array ([#2743](https://github.com/Applitools-Dev/sdk/issues/2743)) ([d06deeb](https://github.com/Applitools-Dev/sdk/commit/d06deeb845de62e96ec623efefa90ae65a703736))
24
+
25
+
26
+
27
+ * @applitools/screenshoter bumped to 3.10.4
28
+
29
+ * @applitools/nml-client bumped to 1.8.23
30
+
31
+ * @applitools/ufg-client bumped to 1.16.1
32
+ #### Bug Fixes
33
+
34
+ * memory usage going high when resource is uint8array ([#2743](https://github.com/Applitools-Dev/sdk/issues/2743)) ([d06deeb](https://github.com/Applitools-Dev/sdk/commit/d06deeb845de62e96ec623efefa90ae65a703736))
35
+
36
+
37
+
38
+ * @applitools/core-base bumped to 1.22.1
39
+
40
+ * @applitools/ec-client bumped to 1.10.2
41
+
42
+ * @applitools/core bumped to 4.29.1
43
+ #### Bug Fixes
44
+
45
+ * mask from config property ([#2739](https://github.com/Applitools-Dev/sdk/issues/2739)) ([6840624](https://github.com/Applitools-Dev/sdk/commit/6840624f5f3f56512dce96547815904adec94704))
46
+ * universal core on windows ([#2736](https://github.com/Applitools-Dev/sdk/issues/2736)) ([9bd0744](https://github.com/Applitools-Dev/sdk/commit/9bd0744ca816a020973f20645aeb2460af76f44c))
47
+
48
+
49
+
50
+ * @applitools/eyes bumped to 1.31.1
51
+
52
+
53
+ ## [3.53.2](https://github.com/Applitools-Dev/sdk/compare/js/eyes-storybook@3.53.1...js/eyes-storybook@3.53.2) (2025-01-13)
54
+
55
+
56
+ ### Bug Fixes
57
+
58
+ * remove side-eyes and fix code scanning issues ([#2712](https://github.com/Applitools-Dev/sdk/issues/2712)) ([cda98e4](https://github.com/Applitools-Dev/sdk/commit/cda98e4748c73cd97c11f646a2b5e26ff9416892))
59
+ * storybook navigation timeouts ([#2701](https://github.com/Applitools-Dev/sdk/issues/2701)) ([64e3a40](https://github.com/Applitools-Dev/sdk/commit/64e3a40a524ae76ec457ae9c2d1170fbaea5e982))
60
+
61
+
62
+ ### Dependencies
63
+
64
+ * @applitools/dom-snapshot bumped to 4.11.14
65
+ #### Bug Fixes
66
+
67
+ * remove side-eyes and fix code scanning issues ([#2712](https://github.com/Applitools-Dev/sdk/issues/2712)) ([cda98e4](https://github.com/Applitools-Dev/sdk/commit/cda98e4748c73cd97c11f646a2b5e26ff9416892))
68
+
69
+
70
+
71
+ * @applitools/snippets bumped to 2.6.4
72
+ #### Bug Fixes
73
+
74
+ * remove side-eyes and fix code scanning issues ([#2712](https://github.com/Applitools-Dev/sdk/issues/2712)) ([cda98e4](https://github.com/Applitools-Dev/sdk/commit/cda98e4748c73cd97c11f646a2b5e26ff9416892))
75
+ * @applitools/dom-capture bumped to 11.5.4
76
+ #### Bug Fixes
77
+
78
+ * remove side-eyes and fix code scanning issues ([#2712](https://github.com/Applitools-Dev/sdk/issues/2712)) ([cda98e4](https://github.com/Applitools-Dev/sdk/commit/cda98e4748c73cd97c11f646a2b5e26ff9416892))
79
+ * @applitools/eyes bumped to 1.31.0
80
+ #### Features
81
+
82
+ * jsonFilePath in offline mode ([#2734](https://github.com/Applitools-Dev/sdk/issues/2734)) ([2f9fbe8](https://github.com/Applitools-Dev/sdk/commit/2f9fbe8fc3c5212db6b7cc58a98b041c3ffd5572))
83
+
84
+
85
+
86
+ * @applitools/driver bumped to 1.20.3
87
+
88
+ * @applitools/spec-driver-webdriver bumped to 1.1.23
89
+
90
+ * @applitools/spec-driver-selenium bumped to 1.5.94
91
+
92
+ * @applitools/spec-driver-puppeteer bumped to 1.4.23
93
+
94
+ * @applitools/screenshoter bumped to 3.10.3
95
+
96
+ * @applitools/nml-client bumped to 1.8.22
97
+
98
+ * @applitools/ec-client bumped to 1.10.1
99
+
100
+ * @applitools/core bumped to 4.29.0
101
+ #### Features
102
+
103
+ * jsonFilePath in offline mode ([#2734](https://github.com/Applitools-Dev/sdk/issues/2734)) ([2f9fbe8](https://github.com/Applitools-Dev/sdk/commit/2f9fbe8fc3c5212db6b7cc58a98b041c3ffd5572))
104
+
105
+
106
+ #### Bug Fixes
107
+
108
+ * support batching tests in distributed env - close batch only when required ([#2733](https://github.com/Applitools-Dev/sdk/issues/2733)) ([2e59e4a](https://github.com/Applitools-Dev/sdk/commit/2e59e4a76edcc02b8888dfc78a42749bae76f79c))
109
+
110
+
111
+
112
+
3
113
  ## [3.53.1](https://github.com/Applitools-Dev/sdk/compare/js/eyes-storybook@3.53.0...js/eyes-storybook@3.53.1) (2024-12-31)
4
114
 
5
115
 
@@ -181,7 +181,20 @@ function __getClientAPI(...args) {
181
181
  throw new Error('Cannot get client API: no frameWindow');
182
182
  }
183
183
 
184
- var getClientAPI_1 = getClientAPI;
184
+ async function getClientAPIWithRetries() {
185
+ let error = 'Unknown error';
186
+ for (let attempt = 1; attempt <= 100; attempt++) {
187
+ await new Promise(resolve => setTimeout(resolve, 100));
188
+ try {
189
+ return getClientAPI();
190
+ } catch (e) {
191
+ error = e;
192
+ }
193
+ }
194
+ throw error;
195
+ }
196
+
197
+ var getClientAPI_1 = getClientAPIWithRetries;
185
198
 
186
199
  return getClientAPI_1;
187
200
 
@@ -181,7 +181,20 @@ function __getStories(...args) {
181
181
  throw new Error('Cannot get client API: no frameWindow');
182
182
  }
183
183
 
184
- var getClientAPI_1 = getClientAPI;
184
+ async function getClientAPIWithRetries() {
185
+ let error = 'Unknown error';
186
+ for (let attempt = 1; attempt <= 100; attempt++) {
187
+ await new Promise(resolve => setTimeout(resolve, 100));
188
+ try {
189
+ return getClientAPI();
190
+ } catch (e) {
191
+ error = e;
192
+ }
193
+ }
194
+ throw error;
195
+ }
196
+
197
+ var getClientAPI_1 = getClientAPIWithRetries;
185
198
 
186
199
  const DEFAULT_TIMEOUT = 60000;
187
200
 
@@ -181,13 +181,26 @@ function __renderStoryWithClientAPI(...args) {
181
181
  throw new Error('Cannot get client API: no frameWindow');
182
182
  }
183
183
 
184
- var getClientAPI_1 = getClientAPI;
184
+ async function getClientAPIWithRetries() {
185
+ let error = 'Unknown error';
186
+ for (let attempt = 1; attempt <= 100; attempt++) {
187
+ await new Promise(resolve => setTimeout(resolve, 100));
188
+ try {
189
+ return getClientAPI();
190
+ } catch (e) {
191
+ error = e;
192
+ }
193
+ }
194
+ throw error;
195
+ }
196
+
197
+ var getClientAPI_1 = getClientAPIWithRetries;
185
198
 
186
199
  function renderStoryWithClientAPI(index, id) {
187
200
  return new Promise(async resolve => {
188
201
  let api;
189
202
  try {
190
- api = getClientAPI_1();
203
+ api = await getClientAPI_1();
191
204
  await api.selectStory(index, id);
192
205
  api.onStoryRendered(resolve);
193
206
  } catch (ex) {
@@ -181,12 +181,25 @@ function __runRunAfterScript(...args) {
181
181
  throw new Error('Cannot get client API: no frameWindow');
182
182
  }
183
183
 
184
- var getClientAPI_1 = getClientAPI;
184
+ async function getClientAPIWithRetries() {
185
+ let error = 'Unknown error';
186
+ for (let attempt = 1; attempt <= 100; attempt++) {
187
+ await new Promise(resolve => setTimeout(resolve, 100));
188
+ try {
189
+ return getClientAPI();
190
+ } catch (e) {
191
+ error = e;
192
+ }
193
+ }
194
+ throw error;
195
+ }
196
+
197
+ var getClientAPI_1 = getClientAPIWithRetries;
185
198
 
186
199
  async function getStoryByIndex(index) {
187
200
  let api;
188
201
  try {
189
- api = getClientAPI_1();
202
+ api = await getClientAPI_1();
190
203
  const stories = await api.getStories();
191
204
  if (!stories[index]) {
192
205
  console.log('error cannot get story', index);
@@ -181,12 +181,25 @@ function __runRunBeforeScript(...args) {
181
181
  throw new Error('Cannot get client API: no frameWindow');
182
182
  }
183
183
 
184
- var getClientAPI_1 = getClientAPI;
184
+ async function getClientAPIWithRetries() {
185
+ let error = 'Unknown error';
186
+ for (let attempt = 1; attempt <= 100; attempt++) {
187
+ await new Promise(resolve => setTimeout(resolve, 100));
188
+ try {
189
+ return getClientAPI();
190
+ } catch (e) {
191
+ error = e;
192
+ }
193
+ }
194
+ throw error;
195
+ }
196
+
197
+ var getClientAPI_1 = getClientAPIWithRetries;
185
198
 
186
199
  async function getStoryByIndex(index) {
187
200
  let api;
188
201
  try {
189
- api = getClientAPI_1();
202
+ api = await getClientAPI_1();
190
203
  const stories = await api.getStories();
191
204
  if (!stories[index]) {
192
205
  console.log('error cannot get story', index);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-storybook",
3
- "version": "3.53.1",
3
+ "version": "3.53.3",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "applitools",
@@ -54,14 +54,14 @@
54
54
  "up:framework": "cd test/fixtures/storybook-versions/${APPLITOOLS_FRAMEWORK_VERSION} && npm ci"
55
55
  },
56
56
  "dependencies": {
57
- "@applitools/core": "4.28.0",
58
- "@applitools/driver": "1.20.2",
59
- "@applitools/eyes": "1.30.0",
57
+ "@applitools/core": "4.29.1",
58
+ "@applitools/driver": "1.20.3",
59
+ "@applitools/eyes": "1.31.1",
60
60
  "@applitools/functional-commons": "1.6.0",
61
61
  "@applitools/logger": "2.1.0",
62
62
  "@applitools/monitoring-commons": "1.0.19",
63
- "@applitools/spec-driver-puppeteer": "1.4.22",
64
- "@applitools/ufg-client": "1.16.0",
63
+ "@applitools/spec-driver-puppeteer": "1.4.23",
64
+ "@applitools/ufg-client": "1.16.1",
65
65
  "@applitools/utils": "1.7.7",
66
66
  "boxen": "4.2.0",
67
67
  "chalk": "3.0.0",
@@ -178,4 +178,17 @@ function getFrameWindow() {
178
178
  throw new Error('Cannot get client API: no frameWindow');
179
179
  }
180
180
 
181
- module.exports = getClientAPI;
181
+ async function getClientAPIWithRetries() {
182
+ let error = 'Unknown error';
183
+ for (let attempt = 1; attempt <= 100; attempt++) {
184
+ await new Promise(resolve => setTimeout(resolve, 100));
185
+ try {
186
+ return getClientAPI();
187
+ } catch (e) {
188
+ error = e;
189
+ }
190
+ }
191
+ throw error;
192
+ }
193
+
194
+ module.exports = getClientAPIWithRetries;
@@ -3,7 +3,7 @@ const getClientAPI = require('./getClientAPI');
3
3
  async function getStoryByIndex(index) {
4
4
  let api;
5
5
  try {
6
- api = getClientAPI();
6
+ api = await getClientAPI();
7
7
  const stories = await api.getStories();
8
8
  if (!stories[index]) {
9
9
  console.log('error cannot get story', index);
@@ -4,7 +4,7 @@ function renderStoryWithClientAPI(index, id) {
4
4
  return new Promise(async resolve => {
5
5
  let api;
6
6
  try {
7
- api = getClientAPI();
7
+ api = await getClientAPI();
8
8
  await api.selectStory(index, id);
9
9
  api.onStoryRendered(resolve);
10
10
  } catch (ex) {
@@ -18,4 +18,5 @@ module.exports = {
18
18
  reloadPagePerStory: false,
19
19
  include: undefined,
20
20
  startStorybookServerTimeout: 300,
21
+ navigationWaitUntil: undefined,
21
22
  };
@@ -42,7 +42,7 @@ async function eyesStorybook({
42
42
  : Number(process.env.APPLITOOLS_CONCURRENT_TABS);
43
43
  logger.log(`Running with ${CONCURRENT_TABS} concurrent tabs`);
44
44
 
45
- const {storybookUrl, readStoriesTimeout, reloadPagePerStory} = config;
45
+ const {storybookUrl, readStoriesTimeout, reloadPagePerStory, navigationWaitUntil} = config;
46
46
 
47
47
  let iframeUrl;
48
48
  try {
@@ -150,6 +150,7 @@ async function eyesStorybook({
150
150
  logger,
151
151
  takeDomSnapshots: doTakeDomSnapshots,
152
152
  reloadPagePerStory,
153
+ navigationWaitUntil,
153
154
  });
154
155
  const renderStory = makeRenderStory({
155
156
  logger: logger.extend({label: 'renderStory'}),
@@ -220,7 +221,9 @@ async function eyesStorybook({
220
221
  const spinner = ora({text: 'Reading stories', stream: outputStream});
221
222
  spinner.start();
222
223
  logger.log('navigating to storybook url:', storybookUrl);
223
- const [navigateErr] = await presult(page.goto(storybookUrl, {timeout: readStoriesTimeout}));
224
+ const [navigateErr] = await presult(
225
+ page.goto(storybookUrl, {timeout: readStoriesTimeout, waitUntil: navigationWaitUntil}),
226
+ );
224
227
  if (navigateErr) {
225
228
  logger.log('Error when loading storybook', navigateErr);
226
229
  const failMsg = refineErrorMessage({
@@ -284,10 +287,14 @@ async function eyesStorybook({
284
287
  const [getStoriesErr, stories] = await presult(
285
288
  page.evaluate(getStories, {timeout: readStoriesTimeout}),
286
289
  );
287
- if (getStoriesErr || stories.length > 0 || remainingRetries == 0) {
290
+ if (stories?.length > 0 || remainingRetries == 0) {
288
291
  return [getStoriesErr, stories];
289
292
  } else {
290
- logger.log(`Got 0 stories, retrying to read stories... ${remainingRetries - 1} are left`);
293
+ if (getStoriesErr) {
294
+ logger.log('Error in getStories:', getStoriesErr);
295
+ } else {
296
+ logger.log(`Got 0 stories, retrying to read stories... ${remainingRetries - 1} are left`);
297
+ }
291
298
  await delay(RETRY_INTERVAL);
292
299
  return await readStoriesWithRetry(remainingRetries - 1);
293
300
  }
@@ -12,7 +12,7 @@ const PAGE_EVALUATE_TIMEOUT = process.env.APPLITOOLS_PAGE_EVALUATE_TIMEOUT || 12
12
12
  const DOM_SNAPSHOTS_TIMEOUT = 5 * 60 * 1000;
13
13
  const utils = require('@applitools/utils');
14
14
 
15
- function makeGetStoryData({logger, takeDomSnapshots, reloadPagePerStory}) {
15
+ function makeGetStoryData({logger, takeDomSnapshots, reloadPagePerStory, navigationWaitUntil}) {
16
16
  return async function getStoryData({story, storyUrl, page}) {
17
17
  const title = getStoryBaselineName(story);
18
18
  logger.log(`getting data from story`, title);
@@ -88,7 +88,9 @@ function makeGetStoryData({logger, takeDomSnapshots, reloadPagePerStory}) {
88
88
 
89
89
  async function renderStoryLegacy() {
90
90
  logger.log(`getting data from story ${storyUrl}`);
91
- const [err] = await presult(page.goto(storyUrl, {timeout: PAGE_EVALUATE_TIMEOUT}));
91
+ const [err] = await presult(
92
+ page.goto(storyUrl, {timeout: PAGE_EVALUATE_TIMEOUT, waitUntil: navigationWaitUntil}),
93
+ );
92
94
  if (err) {
93
95
  logger.log(`error navigating to story ${storyUrl}`, err);
94
96
  throw err;
package/src/initPage.js CHANGED
@@ -46,7 +46,12 @@ function makeInitPage({iframeUrl, config, browser, logger, getTransitiongIntoIE,
46
46
  await fakeIE({logger, page, pageId});
47
47
  }
48
48
 
49
- const [err] = await presult(page.goto(iframeUrl, {timeout: config.readStoriesTimeout}));
49
+ const [err] = await presult(
50
+ page.goto(iframeUrl, {
51
+ timeout: config.readStoriesTimeout,
52
+ waitUntil: config.navigationWaitUntil,
53
+ }),
54
+ );
50
55
  if (err) {
51
56
  logger.log(`error navigating to iframe.html`, err);
52
57
  if (pagePool.isInPool(pageId)) {
@@ -62,6 +62,13 @@ module.exports = {
62
62
  },
63
63
  },
64
64
 
65
+ navigationWaitUntil: {
66
+ alias: ['navigation-wait-until'],
67
+ description: 'When to consider navigation to be finished',
68
+ requiresArg: false,
69
+ choices: ['load', 'domcontentloaded', 'networkidle0', 'networkidle2'], // PuppeteerLifeCycleEvent values - https://pptr.dev/api/puppeteer.puppeteerlifecycleevent
70
+ },
71
+
65
72
  // general
66
73
  exitcode: {
67
74
  alias: 'e',