askui 0.20.4 → 0.20.6

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.
@@ -2963,10 +2963,10 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2963
2963
  */
2964
2964
  contains(): FluentFiltersGetter;
2965
2965
  /**
2966
- * Returns a list of detected elements
2967
- *
2968
- * @return {DetectedElement[]}
2969
- */
2966
+ * Returns a list of detected elements
2967
+ *
2968
+ * @return {DetectedElement[]}
2969
+ */
2970
2970
  exec(): Promise<DetectedElement[]>;
2971
2971
  }
2972
2972
  export declare abstract class Getter extends FluentCommand {
@@ -6,6 +6,33 @@
6
6
  // Autogenerated from typescript.template file
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.ApiCommands = exports.Getter = exports.FluentFiltersOrRelationsGetter = exports.FluentFiltersGetter = exports.ExecGetter = exports.FluentCommand = exports.FluentFiltersOrRelationsCondition = exports.FluentFiltersCondition = exports.FluentFiltersOrRelations = exports.FluentFilters = exports.Exec = exports.Separators = void 0;
9
+ function isStackTraceCodeline(line) {
10
+ return /[ \t]+at .+/.test(line);
11
+ }
12
+ function splitStackTrace(stacktrace) {
13
+ const errorStackTraceLines = stacktrace.split('\n');
14
+ const errorIndexOfFirstCodeLine = errorStackTraceLines.findIndex(isStackTraceCodeline);
15
+ const errorStacktraceHead = errorStackTraceLines.slice(0, errorIndexOfFirstCodeLine);
16
+ const errorStacktraceCodeLines = errorStackTraceLines.slice(errorIndexOfFirstCodeLine);
17
+ return { head: errorStacktraceHead, codelines: errorStacktraceCodeLines };
18
+ }
19
+ function rewriteStackTraceForError(error, newStackTrace) {
20
+ const errorCopy = new Error(error.message);
21
+ if (!error.stack) {
22
+ errorCopy.stack = newStackTrace;
23
+ return errorCopy;
24
+ }
25
+ const errorStacktraceSplit = splitStackTrace(error.stack);
26
+ const newStacktraceSplit = splitStackTrace(newStackTrace);
27
+ errorCopy.stack = [
28
+ ...errorStacktraceSplit.head,
29
+ ...newStacktraceSplit.codelines,
30
+ ' ',
31
+ ...errorStacktraceSplit.head,
32
+ ...errorStacktraceSplit.codelines,
33
+ ].join('\n');
34
+ return errorCopy;
35
+ }
9
36
  var Separators;
10
37
  (function (Separators) {
11
38
  Separators["STRING"] = "<|string|>";
@@ -30,12 +57,8 @@ class FluentBase {
30
57
  const newParamsList = FluentBase.addParams(paramsList, this._params);
31
58
  if (this instanceof FluentCommand) {
32
59
  const fluentCommand = this;
33
- const customElements = newParamsList.has('customElement')
34
- ? newParamsList.get('customElement')
35
- : [];
36
- const aiElementNames = newParamsList.has('aiElementName')
37
- ? newParamsList.get('aiElementName')
38
- : [];
60
+ const customElements = newParamsList.has('customElement') ? newParamsList.get('customElement') : [];
61
+ const aiElementNames = newParamsList.has('aiElementName') ? newParamsList.get('aiElementName') : [];
39
62
  return fluentCommand.fluentCommandExecutor(newCurrentInstruction.trim(), {
40
63
  customElementsJson: customElements,
41
64
  aiElementNames,
@@ -51,12 +74,8 @@ class FluentBase {
51
74
  const newParamsList = FluentBase.addParams(paramsList, this._params);
52
75
  if (this instanceof Getter) {
53
76
  const getter = this;
54
- const customElements = newParamsList.has('customElement')
55
- ? newParamsList.get('customElement')
56
- : [];
57
- const aiElementNames = newParamsList.has('aiElementName')
58
- ? newParamsList.get('aiElementName')
59
- : [];
77
+ const customElements = newParamsList.has('customElement') ? newParamsList.get('customElement') : [];
78
+ const aiElementNames = newParamsList.has('aiElementName') ? newParamsList.get('aiElementName') : [];
60
79
  return getter.getterExecutor(newCurrentInstruction.trim(), {
61
80
  customElementsJson: customElements,
62
81
  aiElementNames,
@@ -67,16 +86,14 @@ class FluentBase {
67
86
  }
68
87
  return this.prev.getterStringBuilder(newCurrentInstruction, newParamsList);
69
88
  }
70
- get textStr() {
71
- return this._textStr;
72
- }
73
- get params() {
74
- return this._params;
75
- }
89
+ get textStr() { return this._textStr; }
90
+ get params() { return this._params; }
76
91
  }
77
92
  class Exec extends FluentBase {
78
93
  exec() {
79
- return this.fluentCommandStringBuilder();
94
+ const originStacktrace = { stack: '' };
95
+ Error.captureStackTrace(originStacktrace, this.exec);
96
+ return this.fluentCommandStringBuilder().catch((err) => Promise.reject(rewriteStackTraceForError(err, originStacktrace.stack)));
80
97
  }
81
98
  }
82
99
  exports.Exec = Exec;
@@ -1074,7 +1091,9 @@ class FluentFiltersOrRelations extends FluentFilters {
1074
1091
  return new FluentFilters(this);
1075
1092
  }
1076
1093
  exec() {
1077
- return this.fluentCommandStringBuilder();
1094
+ const originStacktrace = { stack: '' };
1095
+ Error.captureStackTrace(originStacktrace, this.exec);
1096
+ return this.fluentCommandStringBuilder().catch((err) => Promise.reject(rewriteStackTraceForError(err, originStacktrace.stack)));
1078
1097
  }
1079
1098
  }
1080
1099
  exports.FluentFiltersOrRelations = FluentFiltersOrRelations;
@@ -3755,10 +3774,10 @@ class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
3755
3774
  return new FluentFiltersGetter(this);
3756
3775
  }
3757
3776
  /**
3758
- * Returns a list of detected elements
3759
- *
3760
- * @return {DetectedElement[]}
3761
- */
3777
+ * Returns a list of detected elements
3778
+ *
3779
+ * @return {DetectedElement[]}
3780
+ */
3762
3781
  exec() {
3763
3782
  return this.getterStringBuilder();
3764
3783
  }
@@ -20,6 +20,7 @@ export declare class CreateExampleProject {
20
20
  private static installTestFrameworkPackages;
21
21
  private addUserCredentials;
22
22
  private copyESLintConfigFiles;
23
+ private copyGitignore;
23
24
  private copyTsConfigFile;
24
25
  createExampleProject(): Promise<void>;
25
26
  }
@@ -237,6 +237,25 @@ class CreateExampleProject {
237
237
  ];
238
238
  });
239
239
  }
240
+ copyGitignore() {
241
+ return __awaiter(this, void 0, void 0, function* () {
242
+ const gitignoreFilePath = path_1.default.join('example_projects_templates', 'typescript', 'gitignore');
243
+ return [{
244
+ title: 'Copy .gitignore',
245
+ task: () => __awaiter(this, void 0, void 0, function* () {
246
+ return new listr_1.default([
247
+ {
248
+ title: 'Add .gitignore',
249
+ task: () => __awaiter(this, void 0, void 0, function* () {
250
+ return fs_extra_1.default.copyFile(path_1.default.join((0, path_2.getPathToNodeModulesRoot)(), gitignoreFilePath), path_1.default.join(this.projectRootDirectoryPath, '.gitignore'));
251
+ }),
252
+ },
253
+ ]);
254
+ }),
255
+ },
256
+ ];
257
+ });
258
+ }
240
259
  copyTsConfigFile() {
241
260
  return __awaiter(this, void 0, void 0, function* () {
242
261
  const tsConfigFilePath = path_1.default.join('example_projects_templates', 'typescript', 'tsconfig.json');
@@ -261,6 +280,7 @@ class CreateExampleProject {
261
280
  ...(yield this.copyTemplateProject()),
262
281
  ...(yield this.setupTestFrameWork()),
263
282
  ...(yield this.copyESLintConfigFiles()),
283
+ ...(yield this.copyGitignore()),
264
284
  ...(yield this.copyTsConfigFile()),
265
285
  ...(yield this.addUserCredentials()),
266
286
  ...(yield this.createAskUIHelperFromTemplate()),
@@ -2963,10 +2963,10 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2963
2963
  */
2964
2964
  contains(): FluentFiltersGetter;
2965
2965
  /**
2966
- * Returns a list of detected elements
2967
- *
2968
- * @return {DetectedElement[]}
2969
- */
2966
+ * Returns a list of detected elements
2967
+ *
2968
+ * @return {DetectedElement[]}
2969
+ */
2970
2970
  exec(): Promise<DetectedElement[]>;
2971
2971
  }
2972
2972
  export declare abstract class Getter extends FluentCommand {
@@ -3,6 +3,33 @@
3
3
  /* eslint-disable max-classes-per-file */
4
4
  /* eslint-disable max-len */
5
5
  // Autogenerated from typescript.template file
6
+ function isStackTraceCodeline(line) {
7
+ return /[ \t]+at .+/.test(line);
8
+ }
9
+ function splitStackTrace(stacktrace) {
10
+ const errorStackTraceLines = stacktrace.split('\n');
11
+ const errorIndexOfFirstCodeLine = errorStackTraceLines.findIndex(isStackTraceCodeline);
12
+ const errorStacktraceHead = errorStackTraceLines.slice(0, errorIndexOfFirstCodeLine);
13
+ const errorStacktraceCodeLines = errorStackTraceLines.slice(errorIndexOfFirstCodeLine);
14
+ return { head: errorStacktraceHead, codelines: errorStacktraceCodeLines };
15
+ }
16
+ function rewriteStackTraceForError(error, newStackTrace) {
17
+ const errorCopy = new Error(error.message);
18
+ if (!error.stack) {
19
+ errorCopy.stack = newStackTrace;
20
+ return errorCopy;
21
+ }
22
+ const errorStacktraceSplit = splitStackTrace(error.stack);
23
+ const newStacktraceSplit = splitStackTrace(newStackTrace);
24
+ errorCopy.stack = [
25
+ ...errorStacktraceSplit.head,
26
+ ...newStacktraceSplit.codelines,
27
+ ' ',
28
+ ...errorStacktraceSplit.head,
29
+ ...errorStacktraceSplit.codelines,
30
+ ].join('\n');
31
+ return errorCopy;
32
+ }
6
33
  export var Separators;
7
34
  (function (Separators) {
8
35
  Separators["STRING"] = "<|string|>";
@@ -27,12 +54,8 @@ class FluentBase {
27
54
  const newParamsList = FluentBase.addParams(paramsList, this._params);
28
55
  if (this instanceof FluentCommand) {
29
56
  const fluentCommand = this;
30
- const customElements = newParamsList.has('customElement')
31
- ? newParamsList.get('customElement')
32
- : [];
33
- const aiElementNames = newParamsList.has('aiElementName')
34
- ? newParamsList.get('aiElementName')
35
- : [];
57
+ const customElements = newParamsList.has('customElement') ? newParamsList.get('customElement') : [];
58
+ const aiElementNames = newParamsList.has('aiElementName') ? newParamsList.get('aiElementName') : [];
36
59
  return fluentCommand.fluentCommandExecutor(newCurrentInstruction.trim(), {
37
60
  customElementsJson: customElements,
38
61
  aiElementNames,
@@ -48,12 +71,8 @@ class FluentBase {
48
71
  const newParamsList = FluentBase.addParams(paramsList, this._params);
49
72
  if (this instanceof Getter) {
50
73
  const getter = this;
51
- const customElements = newParamsList.has('customElement')
52
- ? newParamsList.get('customElement')
53
- : [];
54
- const aiElementNames = newParamsList.has('aiElementName')
55
- ? newParamsList.get('aiElementName')
56
- : [];
74
+ const customElements = newParamsList.has('customElement') ? newParamsList.get('customElement') : [];
75
+ const aiElementNames = newParamsList.has('aiElementName') ? newParamsList.get('aiElementName') : [];
57
76
  return getter.getterExecutor(newCurrentInstruction.trim(), {
58
77
  customElementsJson: customElements,
59
78
  aiElementNames,
@@ -64,16 +83,14 @@ class FluentBase {
64
83
  }
65
84
  return this.prev.getterStringBuilder(newCurrentInstruction, newParamsList);
66
85
  }
67
- get textStr() {
68
- return this._textStr;
69
- }
70
- get params() {
71
- return this._params;
72
- }
86
+ get textStr() { return this._textStr; }
87
+ get params() { return this._params; }
73
88
  }
74
89
  export class Exec extends FluentBase {
75
90
  exec() {
76
- return this.fluentCommandStringBuilder();
91
+ const originStacktrace = { stack: '' };
92
+ Error.captureStackTrace(originStacktrace, this.exec);
93
+ return this.fluentCommandStringBuilder().catch((err) => Promise.reject(rewriteStackTraceForError(err, originStacktrace.stack)));
77
94
  }
78
95
  }
79
96
  // Filters
@@ -1069,7 +1086,9 @@ export class FluentFiltersOrRelations extends FluentFilters {
1069
1086
  return new FluentFilters(this);
1070
1087
  }
1071
1088
  exec() {
1072
- return this.fluentCommandStringBuilder();
1089
+ const originStacktrace = { stack: '' };
1090
+ Error.captureStackTrace(originStacktrace, this.exec);
1091
+ return this.fluentCommandStringBuilder().catch((err) => Promise.reject(rewriteStackTraceForError(err, originStacktrace.stack)));
1073
1092
  }
1074
1093
  }
1075
1094
  // Filters
@@ -3744,10 +3763,10 @@ export class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
3744
3763
  return new FluentFiltersGetter(this);
3745
3764
  }
3746
3765
  /**
3747
- * Returns a list of detected elements
3748
- *
3749
- * @return {DetectedElement[]}
3750
- */
3766
+ * Returns a list of detected elements
3767
+ *
3768
+ * @return {DetectedElement[]}
3769
+ */
3751
3770
  exec() {
3752
3771
  return this.getterStringBuilder();
3753
3772
  }
@@ -20,6 +20,7 @@ export declare class CreateExampleProject {
20
20
  private static installTestFrameworkPackages;
21
21
  private addUserCredentials;
22
22
  private copyESLintConfigFiles;
23
+ private copyGitignore;
23
24
  private copyTsConfigFile;
24
25
  createExampleProject(): Promise<void>;
25
26
  }
@@ -231,6 +231,25 @@ export class CreateExampleProject {
231
231
  ];
232
232
  });
233
233
  }
234
+ copyGitignore() {
235
+ return __awaiter(this, void 0, void 0, function* () {
236
+ const gitignoreFilePath = path.join('example_projects_templates', 'typescript', 'gitignore');
237
+ return [{
238
+ title: 'Copy .gitignore',
239
+ task: () => __awaiter(this, void 0, void 0, function* () {
240
+ return new Listr([
241
+ {
242
+ title: 'Add .gitignore',
243
+ task: () => __awaiter(this, void 0, void 0, function* () {
244
+ return fs.copyFile(path.join(getPathToNodeModulesRoot(), gitignoreFilePath), path.join(this.projectRootDirectoryPath, '.gitignore'));
245
+ }),
246
+ },
247
+ ]);
248
+ }),
249
+ },
250
+ ];
251
+ });
252
+ }
234
253
  copyTsConfigFile() {
235
254
  return __awaiter(this, void 0, void 0, function* () {
236
255
  const tsConfigFilePath = path.join('example_projects_templates', 'typescript', 'tsconfig.json');
@@ -255,6 +274,7 @@ export class CreateExampleProject {
255
274
  ...(yield this.copyTemplateProject()),
256
275
  ...(yield this.setupTestFrameWork()),
257
276
  ...(yield this.copyESLintConfigFiles()),
277
+ ...(yield this.copyGitignore()),
258
278
  ...(yield this.copyTsConfigFile()),
259
279
  ...(yield this.addUserCredentials()),
260
280
  ...(yield this.createAskUIHelperFromTemplate()),
@@ -2,6 +2,7 @@
2
2
  "compilerOptions": {
3
3
  "module": "CommonJS",
4
4
  "esModuleInterop": true,
5
- "moduleResolution": "node"
5
+ "moduleResolution": "node",
6
+ "sourceMap": true
6
7
  }
7
8
  }
@@ -17,12 +17,16 @@ beforeAll(async () => {
17
17
  });
18
18
 
19
19
  beforeEach(async () => {
20
+ /* Uncomment to enable video recording
20
21
  await aui.startVideoRecording();
22
+ */
21
23
  });
22
24
 
23
25
  afterEach(async () => {
26
+ /* Uncomment to enable video recording
24
27
  await aui.stopVideoRecording();
25
28
  {{ allure_stepreporter_attach_video }}
29
+ */
26
30
  });
27
31
 
28
32
  afterAll(async () => {
@@ -29,12 +29,16 @@ beforeAll(async () => {
29
29
  });
30
30
 
31
31
  beforeEach(async () => {
32
+ /* Uncomment to enable video recording
32
33
  await aui.startVideoRecording();
34
+ */
33
35
  });
34
36
 
35
37
  afterEach(async () => {
38
+ /* Uncomment to enable video recording
36
39
  await aui.stopVideoRecording();
37
40
  {{ allure_stepreporter_attach_video }}
41
+ */
38
42
  });
39
43
 
40
44
  afterAll(async () => {
@@ -0,0 +1,24 @@
1
+ allure-results/
2
+ report/
3
+ xray-report/
4
+
5
+ .env
6
+ .vscode
7
+
8
+ # Dangerous (may contain secrets)
9
+ .npmrc
10
+
11
+ # Dependencies
12
+ /node_modules
13
+
14
+ # Caches
15
+ .npm
16
+ .eslintcache
17
+
18
+ # Misc
19
+ .DS_Store
20
+
21
+ # Logs
22
+ npm-debug.log*
23
+ yarn-debug.log*
24
+ yarn-error.log*
@@ -2,6 +2,7 @@
2
2
  "compilerOptions": {
3
3
  "module": "CommonJS",
4
4
  "esModuleInterop": true,
5
- "moduleResolution": "node"
5
+ "moduleResolution": "node",
6
+ "sourceMap": true
6
7
  }
7
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "askui",
3
- "version": "0.20.4",
3
+ "version": "0.20.6",
4
4
  "license": "MIT",
5
5
  "author": "askui GmbH <info@askui.com> (http://www.askui.com/)",
6
6
  "description": "Reliable, automated end-to-end-testing that depends on what is shown on your screen instead of the technology you are running on",