@auxcode/auxta 1.3.91 → 1.3.92-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.
@@ -2,6 +2,7 @@ export declare enum StatusOfStep {
2
2
  PASSED = "passed",
3
3
  FAILED = "failed",
4
4
  SKIPPED = "skipped",
5
- SUGGESTION = "suggestion"
5
+ SUGGESTION = "suggestion",
6
+ PERFORMANCE_FAIL = "performanceFailure"
6
7
  }
7
8
  export default StatusOfStep;
@@ -7,5 +7,6 @@ var StatusOfStep;
7
7
  StatusOfStep["FAILED"] = "failed";
8
8
  StatusOfStep["SKIPPED"] = "skipped";
9
9
  StatusOfStep["SUGGESTION"] = "suggestion";
10
+ StatusOfStep["PERFORMANCE_FAIL"] = "performanceFailure";
10
11
  })(StatusOfStep || (exports.StatusOfStep = StatusOfStep = {}));
11
12
  exports.default = StatusOfStep;
@@ -18,10 +18,12 @@ export declare class LogSteps {
18
18
  failed: number;
19
19
  skipped: number;
20
20
  suggestion: number;
21
+ performanceFailure: number;
21
22
  };
22
23
  private stepLog;
23
24
  private lastStepTime;
24
25
  addSuggestion(text: string): void;
26
+ addPerformanceFail(text: string, screenshot?: ArrayBuffer): void;
25
27
  clear(): void;
26
28
  push(keyword: string, name: string, status: StatusOfStep, screenshot?: ArrayBuffer, imageCompareKey?: string): void;
27
29
  returnScenarioReport(): Step[];
@@ -9,6 +9,7 @@ class LogSteps {
9
9
  [status_of_step_1.StatusOfStep.FAILED]: 0,
10
10
  [status_of_step_1.StatusOfStep.SKIPPED]: 0,
11
11
  [status_of_step_1.StatusOfStep.SUGGESTION]: 0,
12
+ [status_of_step_1.StatusOfStep.PERFORMANCE_FAIL]: 0
12
13
  };
13
14
  this.stepLog = [];
14
15
  this.lastStepTime = new Date().getTime();
@@ -19,6 +20,29 @@ class LogSteps {
19
20
  keyword: 'Suggestion', name: text, imageCompareKey: '', result: { status: status_of_step_1.StatusOfStep.SUGGESTION, duration: 0 }
20
21
  });
21
22
  }
23
+ addPerformanceFail(text, screenshot = new ArrayBuffer(0)) {
24
+ this.statusCounter[status_of_step_1.StatusOfStep.PERFORMANCE_FAIL]++;
25
+ if (screenshot.byteLength != 0) {
26
+ const embedding = {
27
+ data: screenshot,
28
+ mime_type: "image/png"
29
+ };
30
+ this.stepLog.push({
31
+ keyword: 'PerformanceFail',
32
+ name: text,
33
+ imageCompareKey: '',
34
+ result: { status: status_of_step_1.StatusOfStep.PERFORMANCE_FAIL, duration: 0, embedding: embedding }
35
+ });
36
+ }
37
+ else {
38
+ this.stepLog.push({
39
+ keyword: 'PerformanceFail',
40
+ name: text,
41
+ imageCompareKey: '',
42
+ result: { status: status_of_step_1.StatusOfStep.PERFORMANCE_FAIL, duration: 0 }
43
+ });
44
+ }
45
+ }
22
46
  clear() {
23
47
  this.stepLog = [];
24
48
  this.statusCounter = {
@@ -26,6 +50,7 @@ class LogSteps {
26
50
  [status_of_step_1.StatusOfStep.FAILED]: 0,
27
51
  [status_of_step_1.StatusOfStep.SKIPPED]: 0,
28
52
  [status_of_step_1.StatusOfStep.SUGGESTION]: 0,
53
+ [status_of_step_1.StatusOfStep.PERFORMANCE_FAIL]: 0
29
54
  };
30
55
  }
31
56
  push(keyword, name, status, screenshot = new ArrayBuffer(0), imageCompareKey = '') {
@@ -8,6 +8,7 @@ export declare class FunctionHelper extends ExtendDefaultPage {
8
8
  screenshot(page?: import("puppeteer").Page): Promise<Buffer | undefined>;
9
9
  screenshotCompare(key: string, threshold?: number, page?: import("puppeteer").Page): Promise<void>;
10
10
  suggest(name: string): void;
11
+ PerformanceFail(name: string, screenshot?: ArrayBuffer): void;
11
12
  clickByText(selector: string, text: string, dotOrText?: string, options?: {}, page?: import("puppeteer").Page, time?: number, log_message?: boolean): Promise<void>;
12
13
  clickByTextWithClass(class_selector: string, class_name: string, selector: string, text: string, dotOrText?: string, page?: import("puppeteer").Page): Promise<void>;
13
14
  waitForSelectorWithText(selector: string, text: string, dotOrText?: string, page?: import("puppeteer").Page): Promise<boolean>;
@@ -56,6 +56,9 @@ class FunctionHelper extends extend_default_page_1.ExtendDefaultPage {
56
56
  suggest(name) {
57
57
  log_service_1.default.addSuggestion(name);
58
58
  }
59
+ PerformanceFail(name, screenshot) {
60
+ log_service_1.default.addPerformanceFail(name, screenshot);
61
+ }
59
62
  clickByText(selector, text, dotOrText = '.', options = {}, page = puppeteer_1.default.defaultPage, time = this.defaultTimeout, log_message = true) {
60
63
  return __awaiter(this, void 0, void 0, function* () {
61
64
  const message = `I clicked on the '${text}' '${selector}'`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auxcode/auxta",
3
- "version": "1.3.91",
3
+ "version": "1.3.92-beta.0",
4
4
  "description": "",
5
5
  "main": "./build/AuxTA.js",
6
6
  "types": "./build/AuxTA.d.ts",