datagrok-tools 4.13.68 → 4.13.72
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 +6 -0
- package/bin/commands/test.js +5 -4
- package/bin/utils/test-utils.js +53 -22
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/bin/commands/test.js
CHANGED
|
@@ -288,16 +288,17 @@ function _runTesting() {
|
|
|
288
288
|
organized = testsLeft;
|
|
289
289
|
browserId++;
|
|
290
290
|
if (!(r.verboseFailed === 'Tests execution failed')) {
|
|
291
|
-
_context2.next =
|
|
291
|
+
_context2.next = 43;
|
|
292
292
|
break;
|
|
293
293
|
}
|
|
294
|
-
|
|
295
|
-
|
|
294
|
+
if (r.error) console.log(r.error);
|
|
295
|
+
return _context2.abrupt("break", 44);
|
|
296
|
+
case 43:
|
|
296
297
|
if (r.failed) {
|
|
297
298
|
_context2.next = 0;
|
|
298
299
|
break;
|
|
299
300
|
}
|
|
300
|
-
case
|
|
301
|
+
case 44:
|
|
301
302
|
case "end":
|
|
302
303
|
return _context2.stop();
|
|
303
304
|
}
|
package/bin/utils/test-utils.js
CHANGED
|
@@ -152,6 +152,9 @@ function _getBrowserPage() {
|
|
|
152
152
|
key,
|
|
153
153
|
token,
|
|
154
154
|
browser,
|
|
155
|
+
targets,
|
|
156
|
+
devtoolsTarget,
|
|
157
|
+
client,
|
|
155
158
|
page,
|
|
156
159
|
_args4 = arguments;
|
|
157
160
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
@@ -175,58 +178,85 @@ function _getBrowserPage() {
|
|
|
175
178
|
return puppeteer.launch(params);
|
|
176
179
|
case 14:
|
|
177
180
|
browser = _context4.sent;
|
|
178
|
-
|
|
181
|
+
if (!params.debug) {
|
|
182
|
+
_context4.next = 28;
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
_context4.next = 18;
|
|
186
|
+
return browser.targets();
|
|
187
|
+
case 18:
|
|
188
|
+
targets = _context4.sent;
|
|
189
|
+
devtoolsTarget = targets.find(function (t) {
|
|
190
|
+
return t.type() === 'other' && t.url().startsWith('devtools://');
|
|
191
|
+
});
|
|
192
|
+
if (!devtoolsTarget) {
|
|
193
|
+
_context4.next = 28;
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
_context4.next = 23;
|
|
197
|
+
return devtoolsTarget.createCDPSession();
|
|
198
|
+
case 23:
|
|
199
|
+
client = _context4.sent;
|
|
200
|
+
_context4.next = 26;
|
|
201
|
+
return client.send('Runtime.enable');
|
|
202
|
+
case 26:
|
|
203
|
+
_context4.next = 28;
|
|
204
|
+
return client.send('Runtime.evaluate', {
|
|
205
|
+
expression: "\n window.UI.viewManager.showView('network');\n window.UI.dockController.setDockSide('bottom')\n "
|
|
206
|
+
});
|
|
207
|
+
case 28:
|
|
208
|
+
_context4.next = 30;
|
|
179
209
|
return browser.newPage();
|
|
180
|
-
case
|
|
210
|
+
case 30:
|
|
181
211
|
page = _context4.sent;
|
|
182
|
-
_context4.next =
|
|
212
|
+
_context4.next = 33;
|
|
183
213
|
return page.setViewport({
|
|
184
214
|
width: 1920,
|
|
185
215
|
height: 1080
|
|
186
216
|
});
|
|
187
|
-
case
|
|
217
|
+
case 33:
|
|
188
218
|
page.setDefaultNavigationTimeout(0);
|
|
189
|
-
_context4.next =
|
|
219
|
+
_context4.next = 36;
|
|
190
220
|
return page["goto"]("".concat(url, "/oauth/"));
|
|
191
|
-
case
|
|
192
|
-
_context4.next =
|
|
221
|
+
case 36:
|
|
222
|
+
_context4.next = 38;
|
|
193
223
|
return page.setCookie({
|
|
194
224
|
name: 'auth',
|
|
195
225
|
value: token
|
|
196
226
|
});
|
|
197
|
-
case
|
|
198
|
-
_context4.next =
|
|
227
|
+
case 38:
|
|
228
|
+
_context4.next = 40;
|
|
199
229
|
return page.evaluate(function (token) {
|
|
200
230
|
window.localStorage.setItem('auth', token);
|
|
201
231
|
}, token);
|
|
202
|
-
case
|
|
203
|
-
_context4.next =
|
|
232
|
+
case 40:
|
|
233
|
+
_context4.next = 42;
|
|
204
234
|
return page["goto"](url);
|
|
205
|
-
case
|
|
206
|
-
_context4.prev =
|
|
207
|
-
_context4.next =
|
|
235
|
+
case 42:
|
|
236
|
+
_context4.prev = 42;
|
|
237
|
+
_context4.next = 45;
|
|
208
238
|
return page.waitForFunction(function () {
|
|
209
239
|
return document.querySelector('.grok-preloader') == null;
|
|
210
240
|
}, {
|
|
211
241
|
timeout: 3600000
|
|
212
242
|
});
|
|
213
|
-
case
|
|
214
|
-
_context4.next =
|
|
243
|
+
case 45:
|
|
244
|
+
_context4.next = 50;
|
|
215
245
|
break;
|
|
216
|
-
case
|
|
217
|
-
_context4.prev =
|
|
218
|
-
_context4.t0 = _context4["catch"](
|
|
246
|
+
case 47:
|
|
247
|
+
_context4.prev = 47;
|
|
248
|
+
_context4.t0 = _context4["catch"](42);
|
|
219
249
|
throw _context4.t0;
|
|
220
|
-
case
|
|
250
|
+
case 50:
|
|
221
251
|
return _context4.abrupt("return", {
|
|
222
252
|
browser: browser,
|
|
223
253
|
page: page
|
|
224
254
|
});
|
|
225
|
-
case
|
|
255
|
+
case 51:
|
|
226
256
|
case "end":
|
|
227
257
|
return _context4.stop();
|
|
228
258
|
}
|
|
229
|
-
}, _callee4, null, [[
|
|
259
|
+
}, _callee4, null, [[42, 47]]);
|
|
230
260
|
}));
|
|
231
261
|
return _getBrowserPage.apply(this, arguments);
|
|
232
262
|
}
|
|
@@ -679,6 +709,7 @@ function _runBrowser() {
|
|
|
679
709
|
verbosePassed: "",
|
|
680
710
|
verboseSkipped: "",
|
|
681
711
|
verboseFailed: "Tests execution failed",
|
|
712
|
+
error: JSON.stringify(e),
|
|
682
713
|
passedAmount: 0,
|
|
683
714
|
skippedAmount: 0,
|
|
684
715
|
failedAmount: 1,
|
package/package.json
CHANGED