@auxcode/auxta 1.3.106 → 1.3.107-beta.0

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.
@@ -3,6 +3,9 @@ export interface Step {
3
3
  keyword: string;
4
4
  tag: string;
5
5
  name: string;
6
+ isChecked?: boolean;
7
+ timeStamp?: Date;
8
+ userId?: string;
6
9
  imageCompareKey: string;
7
10
  result: {
8
11
  status: StatusOfStep;
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.getVerifyReceivedEmail = exports.postNotificationsOnFail = exports.postNotifications = exports.compareScreenshots = exports.getLastDayResults = exports.getReport = exports.updateReport = exports.uploadScenario = exports.uploadStep = exports.createEmptyReport = exports.setEmailProvider = exports.setTimeZone = void 0;
16
16
  const axios_1 = __importDefault(require("axios"));
17
17
  const config_1 = require("../configs/config");
18
+ const isManualChecklist = process.argv.includes('--create-manual-checklist');
18
19
  function headers(token) {
19
20
  return {
20
21
  headers: {
@@ -82,7 +83,8 @@ function createEmptyReport(body) {
82
83
  bucket: body.bucket,
83
84
  start: moment().tz(config_1.config.timezone),
84
85
  emailProvider: config_1.config.emailProvider,
85
- url: body.baseUrl
86
+ url: body.baseUrl,
87
+ isManualChecklist
86
88
  }, headers(token))).data.reportId;
87
89
  });
88
90
  }
@@ -137,7 +139,8 @@ function uploadScenario(stepRes, scenarioName, uri, hasFailed) {
137
139
  uri: uri
138
140
  },
139
141
  scenarios: stepRes,
140
- hasFailed: hasFailed
142
+ hasFailed: hasFailed,
143
+ isManualChecklist
141
144
  }, headers(token))).data;
142
145
  });
143
146
  }
@@ -16,6 +16,7 @@ exports.ExtendDefaultPage = void 0;
16
16
  const log_service_1 = __importDefault(require("../../auxta/services/log.service"));
17
17
  const status_of_step_1 = require("../../auxta/enums/status-of.step");
18
18
  const config_1 = require("../../auxta/configs/config");
19
+ const isManualChecklist = process.argv.includes('--create-manual-checklist');
19
20
  class ExtendDefaultPage {
20
21
  constructor() {
21
22
  this.defaultTimeout = config_1.config.timeout;
@@ -26,7 +27,9 @@ class ExtendDefaultPage {
26
27
  const { goto: original_goto, click: original_click, type: original_type, waitForNetworkIdle: original_waitForNetworkIdle } = page;
27
28
  page.goto = function goto(url, options) {
28
29
  log_service_1.default.push('Then', log_service_1.default.tag, `I go to the '${url}' page`, status_of_step_1.StatusOfStep.PASSED);
29
- return original_goto.apply(page, arguments);
30
+ if (!isManualChecklist) {
31
+ return original_goto.apply(page, arguments);
32
+ }
30
33
  };
31
34
  page.click = function click(selector, options) {
32
35
  return __awaiter(this, arguments, void 0, function* () {
@@ -37,13 +40,17 @@ class ExtendDefaultPage {
37
40
  let elementName = yield page.$eval(selector, (e) => e.textContent);
38
41
  if (!elementName || elementName === ' ')
39
42
  elementName = selector;
40
- yield original_click.apply(page, arguments);
43
+ if (!isManualChecklist) {
44
+ yield original_click.apply(page, arguments);
45
+ }
41
46
  log_service_1.default.push('Then', log_service_1.default.tag, `I click on the '${elementName}'`, status_of_step_1.StatusOfStep.PASSED);
42
47
  }
43
48
  catch (e) {
44
49
  const msg = `I click on the '${selector}'`;
45
50
  log_service_1.default.push('Then', log_service_1.default.tag, msg, status_of_step_1.StatusOfStep.FAILED);
46
- throw new Error(msg);
51
+ if (!isManualChecklist) {
52
+ throw new Error(msg);
53
+ }
47
54
  }
48
55
  });
49
56
  };
@@ -52,12 +59,16 @@ class ExtendDefaultPage {
52
59
  let message = 'I wait for the page to load';
53
60
  let result;
54
61
  try {
55
- result = yield original_waitForNetworkIdle.apply(page, arguments);
62
+ if (!isManualChecklist) {
63
+ result = yield original_waitForNetworkIdle.apply(page, arguments);
64
+ }
56
65
  log_service_1.default.push('Then', log_service_1.default.tag, message, status_of_step_1.StatusOfStep.PASSED);
57
66
  }
58
67
  catch (e) {
59
68
  log_service_1.default.push('Then', log_service_1.default.tag, message, status_of_step_1.StatusOfStep.FAILED);
60
- throw new Error(message);
69
+ if (!isManualChecklist) {
70
+ throw new Error(message);
71
+ }
61
72
  }
62
73
  return result;
63
74
  });
@@ -68,7 +79,9 @@ class ExtendDefaultPage {
68
79
  yield page.waitForSelector(field, {
69
80
  timeout: time
70
81
  });
71
- yield original_type.apply(page, arguments);
82
+ if (!isManualChecklist) {
83
+ yield original_type.apply(page, arguments);
84
+ }
72
85
  let elementName = yield page.$eval(field, (e) => e.textContent);
73
86
  if (!elementName || elementName === ' ')
74
87
  elementName = field;
@@ -77,7 +90,9 @@ class ExtendDefaultPage {
77
90
  catch (e) {
78
91
  const msg = `I type '${value}' into the '${field}' field`;
79
92
  log_service_1.default.push('Then', log_service_1.default.tag, msg, status_of_step_1.StatusOfStep.FAILED);
80
- throw new Error(msg);
93
+ if (!isManualChecklist) {
94
+ throw new Error(msg);
95
+ }
81
96
  }
82
97
  });
83
98
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auxcode/auxta",
3
- "version": "1.3.106",
3
+ "version": "1.3.107-beta.0",
4
4
  "description": "",
5
5
  "main": "./build/AuxTA.js",
6
6
  "types": "./build/AuxTA.d.ts",