datagrok-tools 4.13.77 → 4.13.78
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/bin/utils/test-utils.js +22 -5
- package/package.json +2 -2
package/bin/utils/test-utils.js
CHANGED
|
@@ -90,6 +90,22 @@ async function getBrowserPage(puppeteer, params = defaultLaunchParameters) {
|
|
|
90
90
|
url = await getWebUrl(url, token);
|
|
91
91
|
console.log(`Using web root: ${url}`);
|
|
92
92
|
const browser = await puppeteer.launch(params);
|
|
93
|
+
if (params.debug) {
|
|
94
|
+
const targets = await browser.targets();
|
|
95
|
+
const devtoolsTarget = targets.find(t => {
|
|
96
|
+
return t.type() === 'other' && t.url().startsWith('devtools://');
|
|
97
|
+
});
|
|
98
|
+
if (devtoolsTarget) {
|
|
99
|
+
const client = await devtoolsTarget.createCDPSession();
|
|
100
|
+
await client.send('Runtime.enable');
|
|
101
|
+
await client.send('Runtime.evaluate', {
|
|
102
|
+
expression: `
|
|
103
|
+
window.UI.viewManager.showView('network');
|
|
104
|
+
window.UI.dockController.setDockSide('bottom')
|
|
105
|
+
`
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
93
109
|
const page = await browser.newPage();
|
|
94
110
|
await page.setViewport({
|
|
95
111
|
width: 1920,
|
|
@@ -304,7 +320,7 @@ function saveCsvResults(stringToSave, csvReportDir) {
|
|
|
304
320
|
_fs.default.writeFileSync(csvReportDir, modifiedStrings.join('\n'), 'utf8');
|
|
305
321
|
color.info('Saved `test-report.csv`\n');
|
|
306
322
|
}
|
|
307
|
-
async function
|
|
323
|
+
async function runTests(testsParams, stopOnFail) {
|
|
308
324
|
let failed = false;
|
|
309
325
|
let verbosePassed = "";
|
|
310
326
|
let verboseSkipped = "";
|
|
@@ -348,7 +364,8 @@ async function helloTests(testsParams, stopOnFail) {
|
|
|
348
364
|
row["flaking"] = success && window.DG.Test.isReproducing;
|
|
349
365
|
df.changeColumnType('result', window.DG.COLUMN_TYPE.STRING);
|
|
350
366
|
df.changeColumnType('logs', window.DG.COLUMN_TYPE.STRING);
|
|
351
|
-
df.changeColumnType('memoryDelta', window.DG.COLUMN_TYPE.BIG_INT);
|
|
367
|
+
// df.changeColumnType('memoryDelta', (<any>window).DG.COLUMN_TYPE.BIG_INT);
|
|
368
|
+
|
|
352
369
|
if (resultDF === undefined) resultDF = df;else resultDF = resultDF.append(df);
|
|
353
370
|
if (row["skipped"]) {
|
|
354
371
|
verboseSkipped += `Test result : Skipped : ${time} : ${category}: ${testName} : ${result}\n`;
|
|
@@ -398,7 +415,7 @@ async function helloTests(testsParams, stopOnFail) {
|
|
|
398
415
|
}
|
|
399
416
|
async function runBrowser(testExecutionData, browserOptions, browsersId, testInvocationTimeout = 3600000) {
|
|
400
417
|
let testsToRun = {
|
|
401
|
-
func:
|
|
418
|
+
func: runTests.toString(),
|
|
402
419
|
tests: testExecutionData
|
|
403
420
|
};
|
|
404
421
|
return await timeout(async () => {
|
|
@@ -433,8 +450,8 @@ async function runBrowser(testExecutionData, browserOptions, browsersId, testInv
|
|
|
433
450
|
if (options.ciCd) window.DG.Test.isCiCd = true;
|
|
434
451
|
if (options.debug) window.DG.Test.isInDebug = true;
|
|
435
452
|
return new Promise((resolve, reject) => {
|
|
436
|
-
window.
|
|
437
|
-
window.
|
|
453
|
+
window.runTests = eval('(' + testData.func + ')');
|
|
454
|
+
window.runTests(testData.tests, options.stopOnTimeout).then(results => {
|
|
438
455
|
resolve(results);
|
|
439
456
|
}).catch(e => {
|
|
440
457
|
resolve({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "datagrok-tools",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.78",
|
|
4
4
|
"description": "Utility to upload and publish packages to Datagrok",
|
|
5
5
|
"homepage": "https://github.com/datagrok-ai/public/tree/master/tools#readme",
|
|
6
6
|
"dependencies": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"os": "^0.1.2",
|
|
20
20
|
"papaparse": "^5.4.1",
|
|
21
21
|
"path": "^0.12.7",
|
|
22
|
-
"puppeteer": "
|
|
22
|
+
"puppeteer": "22.10.0",
|
|
23
23
|
"puppeteer-screen-recorder": "3.0.3"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|