@auxcode/auxta 1.3.67 → 1.3.68

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.
@@ -16,10 +16,11 @@ exports.captureScreenshotPage = exports.captureScreenshot = void 0;
16
16
  const puppeteer_1 = __importDefault(require("../../puppeteer/puppeteer"));
17
17
  const log_service_1 = __importDefault(require("../services/log.service"));
18
18
  const status_of_step_1 = __importDefault(require("../enums/status-of.step"));
19
+ const RETRY_NUMBERS = 10;
19
20
  function captureScreenshot() {
20
21
  return __awaiter(this, void 0, void 0, function* () {
21
22
  let count = 0;
22
- while (count <= 10) {
23
+ while (count <= RETRY_NUMBERS) {
23
24
  try {
24
25
  const pages = yield puppeteer_1.default.defaultPage.browser().pages();
25
26
  if (!pages.length)
@@ -34,12 +35,12 @@ function captureScreenshot() {
34
35
  return screenshotBuffer;
35
36
  }
36
37
  catch (e) {
37
- if (count == 10) {
38
+ if (count == RETRY_NUMBERS) {
38
39
  log_service_1.default.push('When', e.toString(), status_of_step_1.default.FAILED);
39
40
  return undefined;
40
41
  }
42
+ count++;
41
43
  }
42
- count++;
43
44
  }
44
45
  return undefined;
45
46
  });
@@ -47,19 +48,26 @@ function captureScreenshot() {
47
48
  exports.captureScreenshot = captureScreenshot;
48
49
  function captureScreenshotPage(page) {
49
50
  return __awaiter(this, void 0, void 0, function* () {
50
- try {
51
- const screenshotBuffer = yield page.screenshot({
52
- fullPage: true,
53
- captureBeyondViewport: false,
54
- encoding: 'binary'
55
- });
56
- if (Buffer.isBuffer(screenshotBuffer))
57
- return screenshotBuffer;
58
- }
59
- catch (e) {
60
- log_service_1.default.push('When', e.toString(), status_of_step_1.default.FAILED);
61
- return undefined;
51
+ let count = 0;
52
+ while (count <= RETRY_NUMBERS) {
53
+ try {
54
+ const screenshotBuffer = yield page.screenshot({
55
+ fullPage: true,
56
+ captureBeyondViewport: false,
57
+ encoding: 'binary'
58
+ });
59
+ if (Buffer.isBuffer(screenshotBuffer))
60
+ return screenshotBuffer;
61
+ }
62
+ catch (e) {
63
+ if (count == RETRY_NUMBERS) {
64
+ log_service_1.default.push('When', e.toString(), status_of_step_1.default.FAILED);
65
+ return undefined;
66
+ }
67
+ count++;
68
+ }
62
69
  }
70
+ return undefined;
63
71
  });
64
72
  }
65
73
  exports.captureScreenshotPage = captureScreenshotPage;
@@ -37,7 +37,7 @@ class EmailHelper {
37
37
  if (!messagesIds || messagesIds.length === 0) {
38
38
  throw new Error('No messagesIds found.');
39
39
  }
40
- log_service_1.default.push('Then', `Getting the full details of the emails`, AuxTA_1.StepStatus.PASSED);
40
+ log_service_1.default.push('Then', `Entering main for`, AuxTA_1.StepStatus.PASSED);
41
41
  for (const messageId of messagesIds) {
42
42
  if (messageId.id) {
43
43
  let gmailResponse;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auxcode/auxta",
3
- "version": "1.3.67",
3
+ "version": "1.3.68",
4
4
  "description": "",
5
5
  "main": "./build/AuxTA.js",
6
6
  "types": "./build/AuxTA.d.ts",