@auxcode/auxta 1.3.37 → 1.3.39
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/build/cjs/auxta/utilities/screenshot.helper.js +0 -6
- package/build/cjs/puppeteer/puppeteer.js +6 -3
- package/build/esm/auxta/utilities/screenshot.helper.js +0 -6
- package/build/esm/puppeteer/puppeteer.js +6 -3
- package/build/tsconfig-cjs.tsbuildinfo +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -20,7 +20,6 @@ function captureScreenshot() {
|
|
|
20
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
21
|
try {
|
|
22
22
|
const pages = yield puppeteer_1.default.defaultPage.browser().pages();
|
|
23
|
-
console.log(pages.length);
|
|
24
23
|
if (!pages.length)
|
|
25
24
|
return undefined;
|
|
26
25
|
const lastPage = pages[pages.length - 1] || puppeteer_1.default.defaultPage;
|
|
@@ -28,15 +27,10 @@ function captureScreenshot() {
|
|
|
28
27
|
fullPage: true,
|
|
29
28
|
encoding: 'binary'
|
|
30
29
|
});
|
|
31
|
-
console.log('screenshotBuffer');
|
|
32
|
-
console.log(screenshotBuffer);
|
|
33
30
|
if (Buffer.isBuffer(screenshotBuffer))
|
|
34
31
|
return screenshotBuffer;
|
|
35
32
|
}
|
|
36
33
|
catch (e) {
|
|
37
|
-
const pages = yield puppeteer_1.default.defaultPage.browser().pages();
|
|
38
|
-
console.log(pages.length);
|
|
39
|
-
console.log(e);
|
|
40
34
|
log_service_1.default.push('When', e.toString(), status_of_step_1.default.FAILED);
|
|
41
35
|
return undefined;
|
|
42
36
|
}
|
|
@@ -37,6 +37,7 @@ class Puppeteer {
|
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
this.browser = yield puppeteer.launch({
|
|
40
|
+
slowMo: process.env.slowMo ? Number(process.env.slowMo) : 0,
|
|
40
41
|
executablePath: puppeteer.executablePath(),
|
|
41
42
|
args,
|
|
42
43
|
env,
|
|
@@ -104,9 +105,11 @@ class Puppeteer {
|
|
|
104
105
|
errMessage = err;
|
|
105
106
|
statusCode = 500;
|
|
106
107
|
screenshotBuffer = yield (0, screenshot_helper_1.captureScreenshot)();
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
const pages = yield this.defaultPage.browser().pages();
|
|
109
|
+
consoleStack.push('pages');
|
|
110
|
+
consoleStack.push(pages.length);
|
|
111
|
+
consoleStack.push('screenshotBuffer');
|
|
112
|
+
consoleStack.push(screenshotBuffer);
|
|
110
113
|
log_service_1.default.push('When', `Finished puppeteer process`, status_of_step_1.StatusOfStep.FAILED);
|
|
111
114
|
yield (0, report_service_1.postNotificationsOnFail)(uploadModel);
|
|
112
115
|
}
|
|
@@ -14,7 +14,6 @@ export function captureScreenshot() {
|
|
|
14
14
|
return __awaiter(this, void 0, void 0, function* () {
|
|
15
15
|
try {
|
|
16
16
|
const pages = yield puppeteer.defaultPage.browser().pages();
|
|
17
|
-
console.log(pages.length);
|
|
18
17
|
if (!pages.length)
|
|
19
18
|
return undefined;
|
|
20
19
|
const lastPage = pages[pages.length - 1] || puppeteer.defaultPage;
|
|
@@ -22,15 +21,10 @@ export function captureScreenshot() {
|
|
|
22
21
|
fullPage: true,
|
|
23
22
|
encoding: 'binary'
|
|
24
23
|
});
|
|
25
|
-
console.log('screenshotBuffer');
|
|
26
|
-
console.log(screenshotBuffer);
|
|
27
24
|
if (Buffer.isBuffer(screenshotBuffer))
|
|
28
25
|
return screenshotBuffer;
|
|
29
26
|
}
|
|
30
27
|
catch (e) {
|
|
31
|
-
const pages = yield puppeteer.defaultPage.browser().pages();
|
|
32
|
-
console.log(pages.length);
|
|
33
|
-
console.log(e);
|
|
34
28
|
log.push('When', e.toString(), StatusOfStep.FAILED);
|
|
35
29
|
return undefined;
|
|
36
30
|
}
|
|
@@ -30,6 +30,7 @@ export class Puppeteer {
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
this.browser = yield puppeteer.launch({
|
|
33
|
+
slowMo: process.env.slowMo ? Number(process.env.slowMo) : 0,
|
|
33
34
|
executablePath: puppeteer.executablePath(),
|
|
34
35
|
args,
|
|
35
36
|
env,
|
|
@@ -97,9 +98,11 @@ export class Puppeteer {
|
|
|
97
98
|
errMessage = err;
|
|
98
99
|
statusCode = 500;
|
|
99
100
|
screenshotBuffer = yield captureScreenshot();
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
const pages = yield this.defaultPage.browser().pages();
|
|
102
|
+
consoleStack.push('pages');
|
|
103
|
+
consoleStack.push(pages.length);
|
|
104
|
+
consoleStack.push('screenshotBuffer');
|
|
105
|
+
consoleStack.push(screenshotBuffer);
|
|
103
106
|
log.push('When', `Finished puppeteer process`, StatusOfStep.FAILED);
|
|
104
107
|
yield postNotificationsOnFail(uploadModel);
|
|
105
108
|
}
|