@applitools/eyes-storybook 3.53.0 → 3.53.2

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,200 @@
1
1
  # Changelog
2
2
 
3
+ ## [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)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * 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))
9
+ * storybook navigation timeouts ([#2701](https://github.com/Applitools-Dev/sdk/issues/2701)) ([64e3a40](https://github.com/Applitools-Dev/sdk/commit/64e3a40a524ae76ec457ae9c2d1170fbaea5e982))
10
+
11
+
12
+ ### Dependencies
13
+
14
+ * @applitools/dom-snapshot bumped to 4.11.14
15
+ #### Bug Fixes
16
+
17
+ * 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))
18
+
19
+
20
+
21
+ * @applitools/snippets bumped to 2.6.4
22
+ #### Bug Fixes
23
+
24
+ * 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))
25
+ * @applitools/dom-capture bumped to 11.5.4
26
+ #### Bug Fixes
27
+
28
+ * 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))
29
+ * @applitools/eyes bumped to 1.31.0
30
+ #### Features
31
+
32
+ * jsonFilePath in offline mode ([#2734](https://github.com/Applitools-Dev/sdk/issues/2734)) ([2f9fbe8](https://github.com/Applitools-Dev/sdk/commit/2f9fbe8fc3c5212db6b7cc58a98b041c3ffd5572))
33
+
34
+
35
+
36
+ * @applitools/driver bumped to 1.20.3
37
+
38
+ * @applitools/spec-driver-webdriver bumped to 1.1.23
39
+
40
+ * @applitools/spec-driver-selenium bumped to 1.5.94
41
+
42
+ * @applitools/spec-driver-puppeteer bumped to 1.4.23
43
+
44
+ * @applitools/screenshoter bumped to 3.10.3
45
+
46
+ * @applitools/nml-client bumped to 1.8.22
47
+
48
+ * @applitools/ec-client bumped to 1.10.1
49
+
50
+ * @applitools/core bumped to 4.29.0
51
+ #### Features
52
+
53
+ * jsonFilePath in offline mode ([#2734](https://github.com/Applitools-Dev/sdk/issues/2734)) ([2f9fbe8](https://github.com/Applitools-Dev/sdk/commit/2f9fbe8fc3c5212db6b7cc58a98b041c3ffd5572))
54
+
55
+
56
+ #### Bug Fixes
57
+
58
+ * 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))
59
+
60
+
61
+
62
+
63
+ ## [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)
64
+
65
+
66
+ ### Bug Fixes
67
+
68
+ * code scanning issue ([#2687](https://github.com/Applitools-Dev/sdk/issues/2687)) ([f301056](https://github.com/Applitools-Dev/sdk/commit/f301056cccfc9cc0c21ceedbd521d8f4b054f058))
69
+
70
+
71
+ ### Dependencies
72
+
73
+ * @applitools/utils bumped to 1.7.7
74
+ #### Bug Fixes
75
+
76
+ * shim process execution functions for browser environment ([#2698](https://github.com/Applitools-Dev/sdk/issues/2698)) ([8d77db4](https://github.com/Applitools-Dev/sdk/commit/8d77db48e1c7fd54cad92c89a819a924255e5868))
77
+ * @applitools/logger bumped to 2.1.0
78
+ #### Features
79
+
80
+ * logger masking ([#2640](https://github.com/Applitools-Dev/sdk/issues/2640)) ([bd69d21](https://github.com/Applitools-Dev/sdk/commit/bd69d21f6341447b1acdb042f4ee1a6328d7428f))
81
+
82
+
83
+
84
+ * @applitools/dom-snapshot bumped to 4.11.13
85
+ #### Bug Fixes
86
+
87
+ * code scanning issue ([#2687](https://github.com/Applitools-Dev/sdk/issues/2687)) ([f301056](https://github.com/Applitools-Dev/sdk/commit/f301056cccfc9cc0c21ceedbd521d8f4b054f058))
88
+
89
+
90
+
91
+ * @applitools/socket bumped to 1.2.0
92
+ #### Features
93
+
94
+ * logger masking ([#2640](https://github.com/Applitools-Dev/sdk/issues/2640)) ([bd69d21](https://github.com/Applitools-Dev/sdk/commit/bd69d21f6341447b1acdb042f4ee1a6328d7428f))
95
+
96
+
97
+
98
+ * @applitools/core-base bumped to 1.22.0
99
+ #### Features
100
+
101
+ * deterministic output in offline execution ([#2711](https://github.com/Applitools-Dev/sdk/issues/2711)) ([5e8c7ca](https://github.com/Applitools-Dev/sdk/commit/5e8c7ca43c98e7ba6aed0c1a66c5a60b4001aeff))
102
+ * logger masking ([#2640](https://github.com/Applitools-Dev/sdk/issues/2640)) ([bd69d21](https://github.com/Applitools-Dev/sdk/commit/bd69d21f6341447b1acdb042f4ee1a6328d7428f))
103
+
104
+
105
+
106
+ * @applitools/req bumped to 1.7.6
107
+
108
+ * @applitools/image bumped to 1.1.16
109
+
110
+ * @applitools/dom-capture bumped to 11.5.3
111
+ #### Bug Fixes
112
+
113
+ * code scanning issue ([#2687](https://github.com/Applitools-Dev/sdk/issues/2687)) ([f301056](https://github.com/Applitools-Dev/sdk/commit/f301056cccfc9cc0c21ceedbd521d8f4b054f058))
114
+ * @applitools/eyes bumped to 1.30.0
115
+ #### Features
116
+
117
+ * ability to download side by side with highlighted diffs (2419) ([#2530](https://github.com/Applitools-Dev/sdk/issues/2530)) ([e06ce69](https://github.com/Applitools-Dev/sdk/commit/e06ce699f30e9e444ac58dafdf5989ff1c96ca1c))
118
+ * add an option to keep the navigation bar for android devices ([#2608](https://github.com/Applitools-Dev/sdk/issues/2608)) ([e7647e0](https://github.com/Applitools-Dev/sdk/commit/e7647e0105a7aa47e6bf3b20ab033f1e389ca849))
119
+ * add chrome emulation devices ([#2559](https://github.com/Applitools-Dev/sdk/issues/2559)) ([0499aaf](https://github.com/Applitools-Dev/sdk/commit/0499aaf3bb809d2ac0105b4493e6f6bb8730ea3f))
120
+ * capture status bar ([#2571](https://github.com/Applitools-Dev/sdk/issues/2571)) ([5e1c75e](https://github.com/Applitools-Dev/sdk/commit/5e1c75ef9cf34af80f08806a3bceaf06a94f2780))
121
+ * disable broker url cache ([#2428](https://github.com/Applitools-Dev/sdk/issues/2428)) ([cb8d5fe](https://github.com/Applitools-Dev/sdk/commit/cb8d5fefb13d3ab42984d2bd4d4ac3d4e10646b0))
122
+ * dynamic regions ([#2538](https://github.com/Applitools-Dev/sdk/issues/2538)) ([d8b5c48](https://github.com/Applitools-Dev/sdk/commit/d8b5c48fb35f9789c702447314dc72b4f415ade1))
123
+ * html report for playwright ([#2576](https://github.com/Applitools-Dev/sdk/issues/2576)) ([f93f164](https://github.com/Applitools-Dev/sdk/commit/f93f164a289f5676bcc9d650e5e3d90b8e6a6920))
124
+ * ios 18 devices enum ([#2584](https://github.com/Applitools-Dev/sdk/issues/2584)) ([8eab653](https://github.com/Applitools-Dev/sdk/commit/8eab653f99733839bdec43d86089edc35abcf8e8))
125
+ * logger masking ([#2640](https://github.com/Applitools-Dev/sdk/issues/2640)) ([bd69d21](https://github.com/Applitools-Dev/sdk/commit/bd69d21f6341447b1acdb042f4ee1a6328d7428f))
126
+ * offline cli with config ([#2646](https://github.com/Applitools-Dev/sdk/issues/2646)) ([0589dc4](https://github.com/Applitools-Dev/sdk/commit/0589dc429a0c94451e957932106f258dadfd88cc))
127
+ * remove Android NMG API ([#2566](https://github.com/Applitools-Dev/sdk/issues/2566)) ([750c0f0](https://github.com/Applitools-Dev/sdk/commit/750c0f0263e5ff06f86055e7ba0c3fb47cadb620))
128
+
129
+
130
+ #### Bug Fixes
131
+
132
+ * don't pass RectangleSize to core ([#2673](https://github.com/Applitools-Dev/sdk/issues/2673)) ([47653ea](https://github.com/Applitools-Dev/sdk/commit/47653eae44d4c9693cc84e9209bb08f8d070c4af))
133
+ * offline cli chalk error ([c7c659a](https://github.com/Applitools-Dev/sdk/commit/c7c659aa889080f2fc7763152db2447211fe1487))
134
+ * organize configuration alphabetically and add getters and setters ([684490d](https://github.com/Applitools-Dev/sdk/commit/684490d8d85d1dd0f07bafdcc38febfcf7c58d08))
135
+ * trigger playwright release ([1d3ea3e](https://github.com/Applitools-Dev/sdk/commit/1d3ea3e4d2059c12d8013f04c18f5facffbc5846))
136
+ * trigger release ([c97dbfc](https://github.com/Applitools-Dev/sdk/commit/c97dbfc89245f374917702a867b87f2794155e54))
137
+ * update ios devices enums ([9b4614f](https://github.com/Applitools-Dev/sdk/commit/9b4614f09bbbe42cf99824d76893f9067aab2cc4))
138
+
139
+
140
+ #### Code Refactoring
141
+
142
+ * start linting "no-floating-promises" (wip) ([#2539](https://github.com/Applitools-Dev/sdk/issues/2539)) ([51b91cb](https://github.com/Applitools-Dev/sdk/commit/51b91cb15603f7d68e4bd6a16eb0f80e3f380295))
143
+
144
+
145
+
146
+ * @applitools/driver bumped to 1.20.2
147
+
148
+ * @applitools/spec-driver-puppeteer bumped to 1.4.22
149
+
150
+ * @applitools/tunnel-client bumped to 1.6.0
151
+ #### Features
152
+
153
+ * logger masking ([#2640](https://github.com/Applitools-Dev/sdk/issues/2640)) ([bd69d21](https://github.com/Applitools-Dev/sdk/commit/bd69d21f6341447b1acdb042f4ee1a6328d7428f))
154
+
155
+
156
+
157
+ * @applitools/ec-client bumped to 1.10.0
158
+ #### Features
159
+
160
+ * logger masking ([#2640](https://github.com/Applitools-Dev/sdk/issues/2640)) ([bd69d21](https://github.com/Applitools-Dev/sdk/commit/bd69d21f6341447b1acdb042f4ee1a6328d7428f))
161
+
162
+
163
+
164
+ * @applitools/spec-driver-webdriver bumped to 1.1.22
165
+
166
+ * @applitools/spec-driver-selenium bumped to 1.5.93
167
+
168
+ * @applitools/screenshoter bumped to 3.10.2
169
+
170
+ * @applitools/nml-client bumped to 1.8.21
171
+
172
+ * @applitools/ufg-client bumped to 1.16.0
173
+ #### Features
174
+
175
+ * deterministic output in offline execution ([#2711](https://github.com/Applitools-Dev/sdk/issues/2711)) ([5e8c7ca](https://github.com/Applitools-Dev/sdk/commit/5e8c7ca43c98e7ba6aed0c1a66c5a60b4001aeff))
176
+
177
+
178
+ #### Bug Fixes
179
+
180
+ * code scanning issue ([#2687](https://github.com/Applitools-Dev/sdk/issues/2687)) ([f301056](https://github.com/Applitools-Dev/sdk/commit/f301056cccfc9cc0c21ceedbd521d8f4b054f058))
181
+
182
+
183
+
184
+ * @applitools/core bumped to 4.28.0
185
+ #### Features
186
+
187
+ * deterministic output in offline execution ([#2711](https://github.com/Applitools-Dev/sdk/issues/2711)) ([5e8c7ca](https://github.com/Applitools-Dev/sdk/commit/5e8c7ca43c98e7ba6aed0c1a66c5a60b4001aeff))
188
+ * logger masking ([#2640](https://github.com/Applitools-Dev/sdk/issues/2640)) ([bd69d21](https://github.com/Applitools-Dev/sdk/commit/bd69d21f6341447b1acdb042f4ee1a6328d7428f))
189
+
190
+
191
+ #### Bug Fixes
192
+
193
+ * take snapshots with coded regions on pages that has cross origin frames ([#2705](https://github.com/Applitools-Dev/sdk/issues/2705)) ([5972fec](https://github.com/Applitools-Dev/sdk/commit/5972fec890a1454a9f96c4eddcf17634e72111aa))
194
+
195
+
196
+
197
+
3
198
  ## [3.53.0](https://github.com/Applitools-Dev/sdk/compare/js/eyes-storybook@3.52.5...js/eyes-storybook@3.53.0) (2024-12-18)
4
199
 
5
200
 
@@ -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.0",
3
+ "version": "3.53.2",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "applitools",
@@ -54,15 +54,15 @@
54
54
  "up:framework": "cd test/fixtures/storybook-versions/${APPLITOOLS_FRAMEWORK_VERSION} && npm ci"
55
55
  },
56
56
  "dependencies": {
57
- "@applitools/core": "4.27.0",
58
- "@applitools/driver": "1.20.1",
59
- "@applitools/eyes": "1.29.3",
57
+ "@applitools/core": "4.29.0",
58
+ "@applitools/driver": "1.20.3",
59
+ "@applitools/eyes": "1.31.0",
60
60
  "@applitools/functional-commons": "1.6.0",
61
- "@applitools/logger": "2.0.20",
61
+ "@applitools/logger": "2.1.0",
62
62
  "@applitools/monitoring-commons": "1.0.19",
63
- "@applitools/spec-driver-puppeteer": "1.4.21",
64
- "@applitools/ufg-client": "1.15.1",
65
- "@applitools/utils": "1.7.6",
63
+ "@applitools/spec-driver-puppeteer": "1.4.23",
64
+ "@applitools/ufg-client": "1.16.0",
65
+ "@applitools/utils": "1.7.7",
66
66
  "boxen": "4.2.0",
67
67
  "chalk": "3.0.0",
68
68
  "detect-port": "1.3.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',