automation_model 1.0.434-dev → 1.0.434

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.
Files changed (60) hide show
  1. package/README.md +130 -0
  2. package/lib/api.d.ts +43 -1
  3. package/lib/api.js +241 -41
  4. package/lib/api.js.map +1 -1
  5. package/lib/auto_page.d.ts +5 -2
  6. package/lib/auto_page.js +177 -46
  7. package/lib/auto_page.js.map +1 -1
  8. package/lib/browser_manager.d.ts +7 -3
  9. package/lib/browser_manager.js +157 -49
  10. package/lib/browser_manager.js.map +1 -1
  11. package/lib/bruno.d.ts +2 -0
  12. package/lib/bruno.js +374 -0
  13. package/lib/bruno.js.map +1 -0
  14. package/lib/command_common.d.ts +6 -0
  15. package/lib/command_common.js +198 -0
  16. package/lib/command_common.js.map +1 -0
  17. package/lib/environment.d.ts +3 -0
  18. package/lib/environment.js +5 -2
  19. package/lib/environment.js.map +1 -1
  20. package/lib/error-messages.d.ts +6 -0
  21. package/lib/error-messages.js +206 -0
  22. package/lib/error-messages.js.map +1 -0
  23. package/lib/generation_scripts.d.ts +4 -0
  24. package/lib/generation_scripts.js +2 -0
  25. package/lib/generation_scripts.js.map +1 -0
  26. package/lib/index.d.ts +2 -0
  27. package/lib/index.js +2 -0
  28. package/lib/index.js.map +1 -1
  29. package/lib/init_browser.d.ts +5 -2
  30. package/lib/init_browser.js +124 -7
  31. package/lib/init_browser.js.map +1 -1
  32. package/lib/locate_element.d.ts +7 -0
  33. package/lib/locate_element.js +215 -0
  34. package/lib/locate_element.js.map +1 -0
  35. package/lib/locator.d.ts +36 -0
  36. package/lib/locator.js +165 -0
  37. package/lib/locator.js.map +1 -1
  38. package/lib/locator_log.d.ts +26 -0
  39. package/lib/locator_log.js +69 -0
  40. package/lib/locator_log.js.map +1 -0
  41. package/lib/network.d.ts +3 -0
  42. package/lib/network.js +183 -0
  43. package/lib/network.js.map +1 -0
  44. package/lib/scripts/axe.mini.js +12 -0
  45. package/lib/stable_browser.d.ts +103 -36
  46. package/lib/stable_browser.js +1766 -1246
  47. package/lib/stable_browser.js.map +1 -1
  48. package/lib/table.d.ts +13 -0
  49. package/lib/table.js +187 -0
  50. package/lib/table.js.map +1 -0
  51. package/lib/table_helper.d.ts +19 -0
  52. package/lib/table_helper.js +116 -0
  53. package/lib/table_helper.js.map +1 -0
  54. package/lib/test_context.d.ts +6 -0
  55. package/lib/test_context.js +14 -10
  56. package/lib/test_context.js.map +1 -1
  57. package/lib/utils.d.ts +22 -2
  58. package/lib/utils.js +669 -11
  59. package/lib/utils.js.map +1 -1
  60. package/package.json +14 -8
package/lib/bruno.js ADDED
@@ -0,0 +1,374 @@
1
+ import path from "path";
2
+ import fs from "fs";
3
+ import { spawn } from "child_process";
4
+ import { _commandError, _commandFinally, _preCommand } from "./command_common.js";
5
+ import { Types } from "./stable_browser.js";
6
+ //@ts-ignore
7
+ import { bruToEnvJsonV2 } from "@usebruno/lang";
8
+ import objectPath from "object-path";
9
+ import { replaceWithLocalTestData } from "./utils.js";
10
+ export async function loadBrunoParams(context, environmentName) {
11
+ // check if bruno/environment folder exists
12
+ // if exists find an environment that matches the current environment
13
+ const brunoEnvironmentsFolder = path.join(process.cwd(), "bruno", "environments");
14
+ if (!fs.existsSync(brunoEnvironmentsFolder)) {
15
+ return;
16
+ }
17
+ const envFiles = fs.readdirSync(brunoEnvironmentsFolder);
18
+ for (const envFile of envFiles) {
19
+ if (envFile.endsWith(".bru")) {
20
+ //rename it to end with .bruEnv
21
+ fs.renameSync(path.join(brunoEnvironmentsFolder, envFile), path.join(brunoEnvironmentsFolder, envFile.replace(".bru", ".bruEnv")));
22
+ }
23
+ }
24
+ const envFile = path.join(brunoEnvironmentsFolder, `${environmentName}.bruEnv`);
25
+ if (!fs.existsSync(envFile)) {
26
+ return;
27
+ }
28
+ const envFileContent = fs.readFileSync(envFile, "utf-8");
29
+ try {
30
+ const envJson = bruToEnvJsonV2(envFileContent);
31
+ if (!envJson) {
32
+ return;
33
+ }
34
+ const variables = envJson.variables;
35
+ for (const variable of variables) {
36
+ if (variable.enabled && variable.value) {
37
+ context.web.setTestData({ [variable.name]: variable.value }, context.web);
38
+ }
39
+ }
40
+ }
41
+ catch (e) {
42
+ console.error("Error parsing Bruno environment file", e);
43
+ }
44
+ }
45
+ export async function executeBrunoRequest(requestName, options, context, world) {
46
+ if (!options) {
47
+ options = {};
48
+ }
49
+ const state = {
50
+ locate: false,
51
+ scroll: false,
52
+ screenshot: false,
53
+ highlight: false,
54
+ throwError: true,
55
+ operation: "bruno",
56
+ text: "bruno " + requestName,
57
+ _text: "bruno " + requestName,
58
+ options: options,
59
+ type: Types.BRUNO,
60
+ world: world,
61
+ };
62
+ await _preCommand(state, context.web);
63
+ const filesToDelete = [];
64
+ try {
65
+ let brunoFolder = options.brunoFolder || path.join(process.cwd(), "bruno");
66
+ if (!brunoFolder) {
67
+ throw new Error("brunoFolder is not defined, place your bruno folder in the current working directory.");
68
+ }
69
+ // generate a temporary folder .tmp under the project root
70
+ const resultFolder = path.join(process.cwd(), ".tmp");
71
+ if (!fs.existsSync(resultFolder)) {
72
+ fs.mkdirSync(resultFolder);
73
+ }
74
+ const runtimeFolder = process.cwd();
75
+ // link node_modules to the runtime folder
76
+ //const nodeModulesFolder = path.join(process.cwd(), "node_modules");
77
+ // if (fs.existsSync(nodeModulesFolder)) {
78
+ // // check if the node_modules folder exists
79
+ // const runtimeNodeModulesFolder = path.join(runtimeFolder, "node_modules");
80
+ // if (!fs.existsSync(runtimeNodeModulesFolder)) {
81
+ // // create a symbolic link to the node_modules folder
82
+ // fs.symlinkSync(nodeModulesFolder, runtimeNodeModulesFolder, "dir");
83
+ // }
84
+ // }
85
+ // identify the bruno file
86
+ const brunoFile = path.join(brunoFolder, `${requestName}.bru`);
87
+ // check if the bruno file exists
88
+ if (!fs.existsSync(brunoFile)) {
89
+ throw new Error(`Bruno file not found: ${brunoFile}`);
90
+ }
91
+ const brunoConfigFile = path.join(brunoFolder, "bruno.json");
92
+ let brunoConfig = {
93
+ version: "1",
94
+ name: "blinq",
95
+ type: "collection",
96
+ ignore: ["node_modules", ".git"],
97
+ };
98
+ // check if the bruno config file exists and copy it to the runtime folder
99
+ if (fs.existsSync(brunoConfigFile)) {
100
+ // read the bruno config file
101
+ brunoConfig = JSON.parse(fs.readFileSync(brunoConfigFile, "utf-8"));
102
+ if (!brunoConfig.scripts) {
103
+ brunoConfig.scripts = {
104
+ filesystemAccess: {
105
+ allow: true,
106
+ },
107
+ };
108
+ }
109
+ }
110
+ const brunoConfigFileName = path.join(runtimeFolder, "bruno.json");
111
+ const brunoConfigFileBackup = path.join(resultFolder, "bruno.json");
112
+ filesToDelete.push(brunoConfigFileName);
113
+ fs.writeFileSync(brunoConfigFileName, JSON.stringify(brunoConfig, null, 2));
114
+ fs.writeFileSync(brunoConfigFileBackup, JSON.stringify(brunoConfig, null, 2));
115
+ let expectRuntime = false;
116
+ // read the bruno file
117
+ let brunoFileContent = fs.readFileSync(brunoFile, "utf-8");
118
+ // populate runtime variables
119
+ //brunoFileContent = await context.web._replaceWithLocalData(brunoFileContent, world);
120
+ brunoFileContent = await replaceWithLocalTestData(brunoFileContent, world, true, true, context, context.web, false);
121
+ // inject code to extract runtime variables
122
+ // first find the script:post-response
123
+ const scriptPostResponse = brunoFileContent.indexOf("script:post-response {");
124
+ if (scriptPostResponse !== -1) {
125
+ // need to search a new line follow by }
126
+ // find the end of the script
127
+ const scriptEnd = brunoFileContent.indexOf("\n}", scriptPostResponse);
128
+ // extract the script
129
+ const script = brunoFileContent.substring(scriptPostResponse, scriptEnd + 2);
130
+ // extract all the variables key names: bru.setVar("key", value)
131
+ const regex = /bru\.setVar\("([^"]+)",/g;
132
+ const variables = [];
133
+ let match;
134
+ while ((match = regex.exec(script)) !== null) {
135
+ // check if the variable is already in the list
136
+ if (!variables.includes(match[1])) {
137
+ variables.push(match[1]);
138
+ }
139
+ }
140
+ // check if the variables are not empty
141
+ if (variables.length > 0) {
142
+ expectRuntime = true;
143
+ let scriptVariables = "const runtimeVariables = {};\n";
144
+ // iterate over the variables and create a script to extract them
145
+ for (const variable of variables) {
146
+ scriptVariables += ` runtimeVariables["${variable}"] = bru.getVar("${variable}");\n`;
147
+ }
148
+ const fsRqureExists = script.indexOf("fs = require('fs');") !== -1;
149
+ // check if the variable is not empty
150
+ // replace the script with the modified one
151
+ brunoFileContent = brunoFileContent.replace(script, `script:post-response {
152
+ ${fsRqureExists ? "" : "const fs = require('fs')"};
153
+ // inject code to extract runtime variables
154
+ ${script.substring(script.indexOf("{") + 1, script.lastIndexOf("}"))}
155
+ // write the runtime variables to a file
156
+ ${scriptVariables}
157
+ fs.writeFileSync("${path.join(runtimeFolder, "runtime.json")}", JSON.stringify(runtimeVariables, null, 2));
158
+ }`);
159
+ }
160
+ }
161
+ // write the bruno file to the runtime folder
162
+ const executeBruFile = path.join(runtimeFolder, `${requestName}.bru`);
163
+ const executeBruFileBackup = path.join(resultFolder, `${requestName}.bru`);
164
+ filesToDelete.push(executeBruFile);
165
+ fs.writeFileSync(executeBruFile, brunoFileContent);
166
+ fs.writeFileSync(executeBruFileBackup, brunoFileContent);
167
+ const outputFile = path.join(resultFolder, `bruno_${context.web.stepIndex ? context.web.stepIndex : 0}.json`);
168
+ if (fs.existsSync(outputFile)) {
169
+ // remove the file if it exists
170
+ fs.unlinkSync(outputFile);
171
+ }
172
+ // if the runtime.json file exists, remove it
173
+ const runtimeFile = path.join(runtimeFolder, "runtime.json");
174
+ filesToDelete.push(runtimeFile);
175
+ if (fs.existsSync(runtimeFile)) {
176
+ // remove the file if it exists
177
+ fs.unlinkSync(runtimeFile);
178
+ }
179
+ const commandOptions = {
180
+ cwd: runtimeFolder,
181
+ env: {
182
+ ...process.env,
183
+ },
184
+ stdio: "pipe",
185
+ encoding: "utf-8",
186
+ };
187
+ const brunoFilePath = path.join(runtimeFolder, `${requestName}.bru`);
188
+ const args = ["bru", "run", "--reporter-json", outputFile];
189
+ // check if options.brunoArgs is defined
190
+ if (options.brunoArgs) {
191
+ // check if options.brunoArgs is an array
192
+ if (Array.isArray(options.brunoArgs)) {
193
+ // add the args to the command
194
+ args.push(...options.brunoArgs);
195
+ }
196
+ }
197
+ args.push(brunoFilePath);
198
+ const { stdout, stderr } = await runCommand(args, commandOptions);
199
+ // check if the command was successful
200
+ if (!fs.existsSync(outputFile)) {
201
+ if (stderr) {
202
+ console.error(`Error executing Bruno request: ${stderr}`);
203
+ }
204
+ if (stdout) {
205
+ console.log(`Bruno request executed successfully: ${stdout}`);
206
+ }
207
+ throw new Error(`Bruno request failed: ${stderr}`);
208
+ }
209
+ // read the output file
210
+ const result = JSON.parse(fs.readFileSync(outputFile, "utf-8"));
211
+ if (world && world.attach) {
212
+ await world.attach(JSON.stringify(fs.readFileSync(outputFile, "utf-8")), "application/json+bruno");
213
+ }
214
+ if (context.reportFolder) {
215
+ // copy the output file to the report folder
216
+ const reportFile = path.join(context.reportFolder, `bruno_${context.web.stepIndex ? context.web.stepIndex : 0}.json`);
217
+ fs.copyFileSync(outputFile, reportFile);
218
+ }
219
+ // validate result: totlaRequests === passedRequests, totalAssertions === passedAssertions, totalTests === passedTests
220
+ /*
221
+ [
222
+ {
223
+ "iterationIndex": 0,
224
+ "summary": {
225
+ "totalRequests": 1,
226
+ "passedRequests": 1,
227
+ "failedRequests": 0,
228
+ "skippedRequests": 0,
229
+ "totalAssertions": 0,
230
+ "passedAssertions": 0,
231
+ "failedAssertions": 0,
232
+ "totalTests": 1,
233
+ "passedTests": 1,
234
+ "failedTests": 0
235
+ },
236
+ */
237
+ if (result &&
238
+ result.length > 0 &&
239
+ result[0] &&
240
+ result[0].results &&
241
+ result[0].results.length > 0 &&
242
+ result[0].results[0].error) {
243
+ console.error(`Error executing Bruno request: ${result[0].results[0].error}`);
244
+ throw new Error(`Bruno request failed: ${result[0].results[0].error}`);
245
+ }
246
+ if (!result || !Array.isArray(result) || result.length === 0) {
247
+ throw new Error(`Bruno request failed: ${stderr}`);
248
+ }
249
+ const summary = result[0].summary;
250
+ if (summary.totalRequests !== summary.passedRequests) {
251
+ throw new Error(`Bruno request failed: ${stderr}`);
252
+ }
253
+ if (summary.totalAssertions !== summary.passedAssertions) {
254
+ let assertionError = "";
255
+ if (result[0].results && result[0].results.length > 0 && result[0].results[0].assertionResults) {
256
+ for (const assertion of result[0].results[0].assertionResults) {
257
+ if (assertion.error) {
258
+ assertionError += assertion.error + "\n";
259
+ }
260
+ }
261
+ }
262
+ throw new Error(`Bruno request failed: ${assertionError}`);
263
+ }
264
+ let testsError = "";
265
+ if (summary.totalTests !== summary.passedTests) {
266
+ testsError = "";
267
+ if (result[0].results && result[0].results.length > 0 && result[0].results[0].testResults) {
268
+ for (const testResult of result[0].results[0].testResults) {
269
+ if (testResult.error) {
270
+ testsError += testResult.error + "\n";
271
+ }
272
+ }
273
+ }
274
+ throw new Error(`Bruno tests failed: ${testsError}`);
275
+ }
276
+ console.log(requestName + " - request executed successfully");
277
+ console.log(`requests: ${summary.passedRequests}/${summary.totalRequests}`);
278
+ if (summary.totalAssertions > 0) {
279
+ console.log(`assertions: ${summary.passedAssertions}/${summary.totalAssertions}`);
280
+ }
281
+ if (summary.totalTests > 0) {
282
+ console.log(`tests: ${summary.passedTests}/${summary.totalTests}`);
283
+ }
284
+ if (!options.brunoScope) {
285
+ options.brunoScope = "bruno";
286
+ }
287
+ const data = {};
288
+ let scope = options.brunoScope;
289
+ data[scope] = result[0].results[0];
290
+ // check for vars:post-response {
291
+ const varsPostResponse = brunoFileContent.indexOf("vars:post-response {");
292
+ if (varsPostResponse !== -1) {
293
+ // need to search a new line follow by }
294
+ const varsEnd = brunoFileContent.indexOf("\n}", varsPostResponse);
295
+ // extract the script remove the open { and the close }
296
+ const script = brunoFileContent.substring(varsPostResponse + 20, varsEnd);
297
+ // the result loolks like this:
298
+ // aaaa: res.body.data.guid
299
+ // bbbb: res.body.data.guid2
300
+ const lines = script.split("\n");
301
+ for (const line of lines) {
302
+ const trimmedLine = line.trim();
303
+ if (trimmedLine.length === 0) {
304
+ continue;
305
+ }
306
+ // split the line by :
307
+ const parts = trimmedLine.split(":");
308
+ if (parts.length !== 2) {
309
+ continue;
310
+ }
311
+ const key = parts[0].trim();
312
+ let opath = parts[1].trim();
313
+ // check if the value is a variable
314
+ let path = opath.replace(/res\.body\./g, "response.data.").split(".");
315
+ const value = objectPath.get(result[0].results[0], path);
316
+ if (value) {
317
+ data[key] = value;
318
+ }
319
+ }
320
+ }
321
+ context.web.setTestData(data, world);
322
+ // if the expectRuntime is true, read the runtime.json file
323
+ if (expectRuntime) {
324
+ // check if the runtime.json file exists
325
+ if (fs.existsSync(runtimeFile)) {
326
+ // read the runtime.json file
327
+ const runtimeData = JSON.parse(fs.readFileSync(runtimeFile, "utf-8"));
328
+ // set test data
329
+ context.web.setTestData(runtimeData, world);
330
+ }
331
+ }
332
+ return result;
333
+ }
334
+ catch (error) {
335
+ await _commandError(state, error, context.web);
336
+ }
337
+ finally {
338
+ // delete the files to delete
339
+ for (const file of filesToDelete) {
340
+ if (fs.existsSync(file)) {
341
+ fs.unlinkSync(file);
342
+ }
343
+ }
344
+ await _commandFinally(state, context.web);
345
+ }
346
+ }
347
+ const runCommand = async (args, options) => {
348
+ return new Promise((resolve, reject) => {
349
+ const _cmd = process.platform === "win32" ? "npx.cmd" : "npx";
350
+ const _options = process.platform === "win32" ? { ...options, shell: true } : options;
351
+ const child = spawn(_cmd, args, _options);
352
+ let stdout = "";
353
+ let stderr = "";
354
+ child.stdout?.on("data", (data) => {
355
+ stdout += data.toString();
356
+ //process.stdout.write(data);
357
+ });
358
+ child.stderr?.on("data", (data) => {
359
+ stderr += data.toString();
360
+ process.stderr.write(data);
361
+ });
362
+ child.on("error", (err) => {
363
+ reject(err);
364
+ });
365
+ child.on("close", (code) => {
366
+ // if (code !== 0) {
367
+ // reject(new Error(`Process exited with code ${code}: ${stderr}`));
368
+ // } else {
369
+ resolve({ stdout, stderr });
370
+ //}
371
+ });
372
+ });
373
+ };
374
+ //# sourceMappingURL=bruno.js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AAE;YACxB,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YACzB,oBAAoB;YACpB,sEAAsE;YACtE,WAAW;YACX,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;YAC5B,GAAG;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare function _preCommand(state: any, web: any): Promise<void>;
2
+ export declare function _commandError(state: any, error: any, web: any): Promise<void>;
3
+ export declare function _screenshot(state: any, web: any, specificElement?: any): Promise<void>;
4
+ export declare function _commandFinally(state: any, web: any): Promise<void>;
5
+ export declare function _validateSelectors(selectors: any): void;
6
+ export declare function _reportToWorld(world: any, properties: any): void;
@@ -0,0 +1,198 @@
1
+ import { getHumanReadableErrorMessage } from "./error-messages.js";
2
+ import { LocatorLog } from "./locator_log.js";
3
+ import { _fixUsingParams, maskValue, replaceWithLocalTestData } from "./utils.js";
4
+ export async function _preCommand(state, web) {
5
+ if (!state) {
6
+ return;
7
+ }
8
+ let allowDisabled = false;
9
+ if (state.allowDisabled) {
10
+ allowDisabled = true;
11
+ }
12
+ if (state.locate !== false) {
13
+ state.locate = true;
14
+ }
15
+ if (state.scroll !== false) {
16
+ state.scroll = true;
17
+ }
18
+ if (state.screenshot !== false) {
19
+ state.screenshot = true;
20
+ }
21
+ if (state.highlight !== false) {
22
+ state.highlight = true;
23
+ }
24
+ if (state.throwError !== false) {
25
+ state.throwError = true;
26
+ }
27
+ state.info = {};
28
+ if (state.value) {
29
+ state.value = _fixUsingParams(state.value, state._params);
30
+ state.info.value = state.value;
31
+ }
32
+ if (state.attribute) {
33
+ state.info.attribute = state.attribute;
34
+ }
35
+ if (state.selectors) {
36
+ _validateSelectors(state.selectors);
37
+ const originalSelectors = state.selectors;
38
+ state.selectors = JSON.parse(JSON.stringify(state.selectors));
39
+ if (originalSelectors.frame) {
40
+ state.selectors.frame = originalSelectors.frame;
41
+ }
42
+ }
43
+ state.startTime = Date.now();
44
+ state.info.selectors = state.selectors;
45
+ state.info.log = state.log ? state.log : "";
46
+ if (state.selectors) {
47
+ state.info.locatorLog = new LocatorLog();
48
+ state.info.locatorLog.mission = state.info.log.trim();
49
+ }
50
+ state.info.operation = state.operation;
51
+ state.info.failCause = {};
52
+ state.error = null;
53
+ state.screenshotId = null;
54
+ state.screenshotPath = null;
55
+ if (state.locate === true) {
56
+ let timeout = null;
57
+ if (state.options && state.options.timeout) {
58
+ timeout = state.options.timeout;
59
+ }
60
+ state.element = await web._locate(state.selectors, state.info, state._params, timeout, allowDisabled);
61
+ }
62
+ if (state.scroll === true) {
63
+ await web.scrollIfNeeded(state.element, state.info);
64
+ }
65
+ if (state.screenshot === true) {
66
+ await _screenshot(state, web);
67
+ }
68
+ if (state.highlight === true) {
69
+ try {
70
+ await web._highlightElements(state.element);
71
+ }
72
+ catch (e) {
73
+ // ignore
74
+ }
75
+ }
76
+ state.info.failCause.operationFailed = true;
77
+ }
78
+ export async function _commandError(state, error, web) {
79
+ if (!state.info) {
80
+ state.info = {};
81
+ }
82
+ if (!state.info.failCause) {
83
+ state.info.failCause = {};
84
+ }
85
+ web.logger.error(state.text + " failed");
86
+ if (error && error.message) {
87
+ web.logger.error(error.message);
88
+ }
89
+ if (state.info.locatorLog) {
90
+ const lines = state.info.locatorLog.toString().split("\n");
91
+ for (let line of lines) {
92
+ web.logger.error(line);
93
+ }
94
+ }
95
+ const { screenshotId, screenshotPath } = await web._screenShot(state.options, state.world, state.info);
96
+ state.screenshotId = screenshotId;
97
+ state.screenshotPath = screenshotPath;
98
+ state.info.screenshotPath = screenshotPath;
99
+ // state.info.failCause.error = error;
100
+ state.info.failCause.fail = true;
101
+ const errorClassification = getHumanReadableErrorMessage(error, state.info);
102
+ state.info.errorType = errorClassification.errorType;
103
+ state.info.errorMessage = errorClassification.errorMessage;
104
+ state.info.errorStack = error.stack;
105
+ Object.assign(error, { info: state.info });
106
+ state.error = error;
107
+ state.commandError = true;
108
+ if (state.throwError) {
109
+ throw error;
110
+ }
111
+ }
112
+ export async function _screenshot(state, web, specificElement) {
113
+ // let focusedElement = null;
114
+ // if (specificElement !== undefined) {
115
+ // focusedElement = specificElement;
116
+ // } else {
117
+ // focusedElement = state.element;
118
+ // }
119
+ // const { screenshotId, screenshotPath } = await web._screenShot(
120
+ // state.options,
121
+ // state.world,
122
+ // state.info,
123
+ // focusedElement
124
+ // );
125
+ // ;
126
+ const { screenshotId, screenshotPath } = await web._screenShot(state.options, state.world, state.info);
127
+ state.screenshotId = screenshotId;
128
+ state.screenshotPath = screenshotPath;
129
+ }
130
+ export async function _commandFinally(state, web) {
131
+ if (state && !state.commandError === true) {
132
+ state.info.failCause = {};
133
+ }
134
+ state.endTime = Date.now();
135
+ let _value = "";
136
+ if (state.originalValue) {
137
+ try {
138
+ if (state.originalValue.startsWith("{{") && state.originalValue.endsWith("}}")) {
139
+ _value = (await replaceWithLocalTestData(state.originalValue, state.world, false, true, web.context, web));
140
+ }
141
+ else {
142
+ _value = state.originalValue;
143
+ }
144
+ }
145
+ catch (e) {
146
+ console.error("Error replacing test data value", e);
147
+ _value = state.originalValue;
148
+ }
149
+ }
150
+ const reportObject = {
151
+ element_name: state.selectors ? state.selectors.element_name : null,
152
+ type: state.type,
153
+ text: state.text,
154
+ _text: state._text,
155
+ value: state.originalValue ? maskValue(_value) : state.value,
156
+ screenshotId: state.screenshotId,
157
+ result: state.error
158
+ ? {
159
+ status: "FAILED",
160
+ startTime: state.startTime,
161
+ endTime: state.endTime,
162
+ message: state?.info?.errorMessage ?? state.error?.message,
163
+ stack: state.error?.stack,
164
+ }
165
+ : {
166
+ status: "PASSED",
167
+ startTime: state.startTime,
168
+ endTime: state.endTime,
169
+ },
170
+ info: state.info,
171
+ locatorLog: state.info.locatorLog ? state.info.locatorLog.toString() : null,
172
+ };
173
+ if (state.originalValue && state.info) {
174
+ state.info.value = maskValue(state.originalValue);
175
+ }
176
+ _reportToWorld(state.world, reportObject);
177
+ }
178
+ export function _validateSelectors(selectors) {
179
+ if (!selectors) {
180
+ throw new Error("selectors is null");
181
+ }
182
+ if (!selectors.locators) {
183
+ throw new Error("selectors.locators is null");
184
+ }
185
+ if (!Array.isArray(selectors.locators)) {
186
+ throw new Error("selectors.locators expected to be array");
187
+ }
188
+ if (selectors.locators.length === 0) {
189
+ throw new Error("selectors.locators expected to be non empty array");
190
+ }
191
+ }
192
+ export function _reportToWorld(world, properties) {
193
+ if (!world || !world.attach) {
194
+ return;
195
+ }
196
+ world.attach(JSON.stringify(properties), { mediaType: "application/json" });
197
+ }
198
+ //# sourceMappingURL=command_common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command_common.js","sourceRoot":"","sources":["../../src/command_common.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAClF,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,KAAU,EAAE,GAAQ;IACpD,IAAI,CAAC,KAAK,EAAE;QACV,OAAO;KACR;IAED,IAAI,aAAa,GAAG,KAAK,CAAC;IAC1B,IAAI,KAAK,CAAC,aAAa,EAAE;QACvB,aAAa,GAAG,IAAI,CAAC;KACtB;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,EAAE;QAC1B,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;KACrB;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,EAAE;QAC1B,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;KACrB;IACD,IAAI,KAAK,CAAC,UAAU,KAAK,KAAK,EAAE;QAC9B,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC;KACz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,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC,CAAC;AAC9E,CAAC"}
@@ -19,6 +19,9 @@ declare class Environment {
19
19
  extensionPath?: string;
20
20
  constructor(baseUrl?: string | undefined);
21
21
  setBaseUrl(url: string): void;
22
+ apps: {
23
+ [key: string]: Environment;
24
+ };
22
25
  }
23
26
  export { Environment };
24
27
  export type { Cookie, LocalStorage };
@@ -1,12 +1,15 @@
1
1
  class Environment {
2
+ baseUrl;
3
+ cookies = [];
4
+ origins = [];
5
+ extensionPath;
2
6
  constructor(baseUrl) {
3
7
  this.baseUrl = baseUrl;
4
- this.cookies = [];
5
- this.origins = [];
6
8
  }
7
9
  setBaseUrl(url) {
8
10
  this.baseUrl = url;
9
11
  }
12
+ apps = {};
10
13
  }
11
14
  export { Environment };
12
15
  //# sourceMappingURL=environment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"environment.js","sourceRoot":"","sources":["../../src/environment.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW;IAIf,YAAmB,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;QAHnC,YAAO,GAAa,EAAE,CAAC;QACvB,YAAO,GAAqD,EAAE,CAAC;IAEzB,CAAC;IACvC,UAAU,CAAC,GAAW;QACpB,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;IACrB,CAAC;CACF;AACD,OAAO,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"environment.js","sourceRoot":"","sources":["../../src/environment.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW;IAII;IAHnB,OAAO,GAAa,EAAE,CAAC;IACvB,OAAO,GAAqD,EAAE,CAAC;IAC/D,aAAa,CAAU;IACvB,YAAmB,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;IAAG,CAAC;IACvC,UAAU,CAAC,GAAW;QACpB,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;IACrB,CAAC;IACD,IAAI,GAAmC,EAAE,CAAC;CAC3C;AACD,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ type ErrorClassification = {
2
+ errorType: string;
3
+ errorMessage: string;
4
+ };
5
+ declare const getHumanReadableErrorMessage: (error: Error, info: any) => ErrorClassification;
6
+ export { getHumanReadableErrorMessage };