automation_model 1.0.433-dev → 1.0.433

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 +371 -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 +1770 -1247
  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 +664 -11
  59. package/lib/utils.js.map +1 -1
  60. package/package.json +14 -8
package/lib/bruno.js ADDED
@@ -0,0 +1,371 @@
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
+ import objectPath from "object-path";
7
+ //@ts-ignore
8
+ import { bruToEnvJsonV2 } from "@usebruno/lang";
9
+ export async function loadBrunoParams(context, environmentName) {
10
+ // check if bruno/environment folder exists
11
+ // if exists find an environment that matches the current environment
12
+ const brunoEnvironmentsFolder = path.join(process.cwd(), "bruno", "environments");
13
+ if (!fs.existsSync(brunoEnvironmentsFolder)) {
14
+ return;
15
+ }
16
+ const envFiles = fs.readdirSync(brunoEnvironmentsFolder);
17
+ for (const envFile of envFiles) {
18
+ if (envFile.endsWith(".bru")) {
19
+ //rename it to end with .bruEnv
20
+ fs.renameSync(path.join(brunoEnvironmentsFolder, envFile), path.join(brunoEnvironmentsFolder, envFile.replace(".bru", ".bruEnv")));
21
+ }
22
+ }
23
+ const envFile = path.join(brunoEnvironmentsFolder, `${environmentName}.bruEnv`);
24
+ if (!fs.existsSync(envFile)) {
25
+ return;
26
+ }
27
+ const envFileContent = fs.readFileSync(envFile, "utf-8");
28
+ try {
29
+ const envJson = bruToEnvJsonV2(envFileContent);
30
+ if (!envJson) {
31
+ return;
32
+ }
33
+ const variables = envJson.variables;
34
+ for (const variable of variables) {
35
+ if (variable.enabled && variable.value) {
36
+ context.web.setTestData({ [variable.name]: variable.value }, context.web);
37
+ }
38
+ }
39
+ }
40
+ catch (e) {
41
+ console.error("Error parsing Bruno environment file", e);
42
+ }
43
+ }
44
+ export async function executeBrunoRequest(requestName, options, context, world) {
45
+ if (!options) {
46
+ options = {};
47
+ }
48
+ const state = {
49
+ locate: false,
50
+ scroll: false,
51
+ screenshot: false,
52
+ highlight: false,
53
+ throwError: true,
54
+ operation: "bruno",
55
+ text: "bruno " + requestName,
56
+ _text: "bruno " + requestName,
57
+ options: options,
58
+ type: Types.BRUNO,
59
+ world: world,
60
+ };
61
+ await _preCommand(state, context.web);
62
+ const filesToDelete = [];
63
+ try {
64
+ let brunoFolder = options.brunoFolder || path.join(process.cwd(), "bruno");
65
+ if (!brunoFolder) {
66
+ throw new Error("brunoFolder is not defined, place your bruno folder in the current working directory.");
67
+ }
68
+ // generate a temporary folder .tmp under the project root
69
+ const resultFolder = path.join(process.cwd(), ".tmp");
70
+ if (!fs.existsSync(resultFolder)) {
71
+ fs.mkdirSync(resultFolder);
72
+ }
73
+ const runtimeFolder = process.cwd();
74
+ // link node_modules to the runtime folder
75
+ //const nodeModulesFolder = path.join(process.cwd(), "node_modules");
76
+ // if (fs.existsSync(nodeModulesFolder)) {
77
+ // // check if the node_modules folder exists
78
+ // const runtimeNodeModulesFolder = path.join(runtimeFolder, "node_modules");
79
+ // if (!fs.existsSync(runtimeNodeModulesFolder)) {
80
+ // // create a symbolic link to the node_modules folder
81
+ // fs.symlinkSync(nodeModulesFolder, runtimeNodeModulesFolder, "dir");
82
+ // }
83
+ // }
84
+ // identify the bruno file
85
+ const brunoFile = path.join(brunoFolder, `${requestName}.bru`);
86
+ // check if the bruno file exists
87
+ if (!fs.existsSync(brunoFile)) {
88
+ throw new Error(`Bruno file not found: ${brunoFile}`);
89
+ }
90
+ const brunoConfigFile = path.join(brunoFolder, "bruno.json");
91
+ let brunoConfig = {
92
+ version: "1",
93
+ name: "blinq",
94
+ type: "collection",
95
+ ignore: ["node_modules", ".git"],
96
+ };
97
+ // check if the bruno config file exists and copy it to the runtime folder
98
+ if (fs.existsSync(brunoConfigFile)) {
99
+ // read the bruno config file
100
+ brunoConfig = JSON.parse(fs.readFileSync(brunoConfigFile, "utf-8"));
101
+ if (!brunoConfig.scripts) {
102
+ brunoConfig.scripts = {
103
+ filesystemAccess: {
104
+ allow: true,
105
+ },
106
+ };
107
+ }
108
+ }
109
+ const brunoConfigFileName = path.join(runtimeFolder, "bruno.json");
110
+ const brunoConfigFileBackup = path.join(resultFolder, "bruno.json");
111
+ filesToDelete.push(brunoConfigFileName);
112
+ fs.writeFileSync(brunoConfigFileName, JSON.stringify(brunoConfig, null, 2));
113
+ fs.writeFileSync(brunoConfigFileBackup, JSON.stringify(brunoConfig, null, 2));
114
+ let expectRuntime = false;
115
+ // read the bruno file
116
+ let brunoFileContent = fs.readFileSync(brunoFile, "utf-8");
117
+ // populate runtime variables
118
+ brunoFileContent = await context.web._replaceWithLocalData(brunoFileContent, world);
119
+ // inject code to extract runtime variables
120
+ // first find the script:post-response
121
+ const scriptPostResponse = brunoFileContent.indexOf("script:post-response {");
122
+ if (scriptPostResponse !== -1) {
123
+ // need to search a new line follow by }
124
+ // find the end of the script
125
+ const scriptEnd = brunoFileContent.indexOf("\n}", scriptPostResponse);
126
+ // extract the script
127
+ const script = brunoFileContent.substring(scriptPostResponse, scriptEnd + 2);
128
+ // extract all the variables key names: bru.setVar("key", value)
129
+ const regex = /bru\.setVar\("([^"]+)",/g;
130
+ const variables = [];
131
+ let match;
132
+ while ((match = regex.exec(script)) !== null) {
133
+ // check if the variable is already in the list
134
+ if (!variables.includes(match[1])) {
135
+ variables.push(match[1]);
136
+ }
137
+ }
138
+ // check if the variables are not empty
139
+ if (variables.length > 0) {
140
+ expectRuntime = true;
141
+ let scriptVariables = "const runtimeVariables = {};\n";
142
+ // iterate over the variables and create a script to extract them
143
+ for (const variable of variables) {
144
+ scriptVariables += ` runtimeVariables["${variable}"] = bru.getVar("${variable}");\n`;
145
+ }
146
+ // check if the variable is not empty
147
+ // replace the script with the modified one
148
+ brunoFileContent = brunoFileContent.replace(script, `script:post-response {
149
+ const fs = require('fs');
150
+ // inject code to extract runtime variables
151
+ ${script.substring(script.indexOf("{") + 1, script.lastIndexOf("}"))}
152
+ // write the runtime variables to a file
153
+ ${scriptVariables}
154
+ fs.writeFileSync("${path.join(runtimeFolder, "runtime.json")}", JSON.stringify(runtimeVariables, null, 2));
155
+ }`);
156
+ }
157
+ }
158
+ // write the bruno file to the runtime folder
159
+ const executeBruFile = path.join(runtimeFolder, `${requestName}.bru`);
160
+ const executeBruFileBackup = path.join(resultFolder, `${requestName}.bru`);
161
+ filesToDelete.push(executeBruFile);
162
+ fs.writeFileSync(executeBruFile, brunoFileContent);
163
+ fs.writeFileSync(executeBruFileBackup, brunoFileContent);
164
+ const outputFile = path.join(resultFolder, `bruno_${context.web.stepIndex ? context.web.stepIndex : 0}.json`);
165
+ if (fs.existsSync(outputFile)) {
166
+ // remove the file if it exists
167
+ fs.unlinkSync(outputFile);
168
+ }
169
+ // if the runtime.json file exists, remove it
170
+ const runtimeFile = path.join(runtimeFolder, "runtime.json");
171
+ filesToDelete.push(runtimeFile);
172
+ if (fs.existsSync(runtimeFile)) {
173
+ // remove the file if it exists
174
+ fs.unlinkSync(runtimeFile);
175
+ }
176
+ const commandOptions = {
177
+ cwd: runtimeFolder,
178
+ env: {
179
+ ...process.env,
180
+ },
181
+ stdio: "pipe",
182
+ encoding: "utf-8",
183
+ };
184
+ const brunoFilePath = path.join(runtimeFolder, `${requestName}.bru`);
185
+ const args = ["bru", "run", "--reporter-json", outputFile];
186
+ // check if options.brunoArgs is defined
187
+ if (options.brunoArgs) {
188
+ // check if options.brunoArgs is an array
189
+ if (Array.isArray(options.brunoArgs)) {
190
+ // add the args to the command
191
+ args.push(...options.brunoArgs);
192
+ }
193
+ }
194
+ args.push(brunoFilePath);
195
+ const { stdout, stderr } = await runCommand(args, commandOptions);
196
+ // check if the command was successful
197
+ if (!fs.existsSync(outputFile)) {
198
+ if (stderr) {
199
+ console.error(`Error executing Bruno request: ${stderr}`);
200
+ }
201
+ if (stdout) {
202
+ console.log(`Bruno request executed successfully: ${stdout}`);
203
+ }
204
+ throw new Error(`Bruno request failed: ${stderr}`);
205
+ }
206
+ // read the output file
207
+ const result = JSON.parse(fs.readFileSync(outputFile, "utf-8"));
208
+ if (world && world.attach) {
209
+ await world.attach(JSON.stringify(fs.readFileSync(outputFile, "utf-8")), "application/json+bruno");
210
+ }
211
+ if (context.reportFolder) {
212
+ // copy the output file to the report folder
213
+ const reportFile = path.join(context.reportFolder, `bruno_${context.web.stepIndex ? context.web.stepIndex : 0}.json`);
214
+ fs.copyFileSync(outputFile, reportFile);
215
+ }
216
+ // validate result: totlaRequests === passedRequests, totalAssertions === passedAssertions, totalTests === passedTests
217
+ /*
218
+ [
219
+ {
220
+ "iterationIndex": 0,
221
+ "summary": {
222
+ "totalRequests": 1,
223
+ "passedRequests": 1,
224
+ "failedRequests": 0,
225
+ "skippedRequests": 0,
226
+ "totalAssertions": 0,
227
+ "passedAssertions": 0,
228
+ "failedAssertions": 0,
229
+ "totalTests": 1,
230
+ "passedTests": 1,
231
+ "failedTests": 0
232
+ },
233
+ */
234
+ if (result &&
235
+ result.length > 0 &&
236
+ result[0] &&
237
+ result[0].results &&
238
+ result[0].results.length > 0 &&
239
+ result[0].results[0].error) {
240
+ console.error(`Error executing Bruno request: ${result[0].results[0].error}`);
241
+ throw new Error(`Bruno request failed: ${result[0].results[0].error}`);
242
+ }
243
+ if (!result || !Array.isArray(result) || result.length === 0) {
244
+ throw new Error(`Bruno request failed: ${stderr}`);
245
+ }
246
+ const summary = result[0].summary;
247
+ if (summary.totalRequests !== summary.passedRequests) {
248
+ throw new Error(`Bruno request failed: ${stderr}`);
249
+ }
250
+ if (summary.totalAssertions !== summary.passedAssertions) {
251
+ let assertionError = "";
252
+ if (result[0].results && result[0].results.length > 0 && result[0].results[0].assertionResults) {
253
+ for (const assertion of result[0].results[0].assertionResults) {
254
+ if (assertion.error) {
255
+ assertionError += assertion.error + "\n";
256
+ }
257
+ }
258
+ }
259
+ throw new Error(`Bruno request failed: ${assertionError}`);
260
+ }
261
+ let testsError = "";
262
+ if (summary.totalTests !== summary.passedTests) {
263
+ testsError = "";
264
+ if (result[0].results && result[0].results.length > 0 && result[0].results[0].testResults) {
265
+ for (const testResult of result[0].results[0].testResults) {
266
+ if (testResult.error) {
267
+ testsError += testResult.error + "\n";
268
+ }
269
+ }
270
+ }
271
+ throw new Error(`Bruno tests failed: ${testsError}`);
272
+ }
273
+ console.log(requestName + " - request executed successfully");
274
+ console.log(`requests: ${summary.passedRequests}/${summary.totalRequests}`);
275
+ if (summary.totalAssertions > 0) {
276
+ console.log(`assertions: ${summary.passedAssertions}/${summary.totalAssertions}`);
277
+ }
278
+ if (summary.totalTests > 0) {
279
+ console.log(`tests: ${summary.passedTests}/${summary.totalTests}`);
280
+ }
281
+ if (!options.brunoScope) {
282
+ options.brunoScope = "bruno";
283
+ }
284
+ const data = {};
285
+ let scope = options.brunoScope;
286
+ data[scope] = result[0].results[0];
287
+ // check for vars:post-response {
288
+ const varsPostResponse = brunoFileContent.indexOf("vars:post-response {");
289
+ if (varsPostResponse !== -1) {
290
+ // need to search a new line follow by }
291
+ const varsEnd = brunoFileContent.indexOf("\n}", varsPostResponse);
292
+ // extract the script remove the open { and the close }
293
+ const script = brunoFileContent.substring(varsPostResponse + 20, varsEnd);
294
+ // the result loolks like this:
295
+ // aaaa: res.body.data.guid
296
+ // bbbb: res.body.data.guid2
297
+ const lines = script.split("\n");
298
+ for (const line of lines) {
299
+ const trimmedLine = line.trim();
300
+ if (trimmedLine.length === 0) {
301
+ continue;
302
+ }
303
+ // split the line by :
304
+ const parts = trimmedLine.split(":");
305
+ if (parts.length !== 2) {
306
+ continue;
307
+ }
308
+ const key = parts[0].trim();
309
+ let opath = parts[1].trim();
310
+ // check if the value is a variable
311
+ let path = opath.replace(/res\.body\./g, "response.").split(".");
312
+ const value = objectPath.get(result[0].results[0], path);
313
+ if (value) {
314
+ data[key] = value;
315
+ }
316
+ }
317
+ }
318
+ context.web.setTestData(data, world);
319
+ // if the expectRuntime is true, read the runtime.json file
320
+ if (expectRuntime) {
321
+ // check if the runtime.json file exists
322
+ if (fs.existsSync(runtimeFile)) {
323
+ // read the runtime.json file
324
+ const runtimeData = JSON.parse(fs.readFileSync(runtimeFile, "utf-8"));
325
+ // set test data
326
+ context.web.setTestData(runtimeData, world);
327
+ }
328
+ }
329
+ return result;
330
+ }
331
+ catch (error) {
332
+ await _commandError(state, error, context.web);
333
+ }
334
+ finally {
335
+ // delete the files to delete
336
+ for (const file of filesToDelete) {
337
+ if (fs.existsSync(file)) {
338
+ fs.unlinkSync(file);
339
+ }
340
+ }
341
+ await _commandFinally(state, context.web);
342
+ }
343
+ }
344
+ const runCommand = async (args, options) => {
345
+ return new Promise((resolve, reject) => {
346
+ const _cmd = process.platform === "win32" ? "npx.cmd" : "npx";
347
+ const _options = process.platform === "win32" ? { ...options, shell: true } : options;
348
+ const child = spawn(_cmd, args, _options);
349
+ let stdout = "";
350
+ let stderr = "";
351
+ child.stdout?.on("data", (data) => {
352
+ stdout += data.toString();
353
+ //process.stdout.write(data);
354
+ });
355
+ child.stderr?.on("data", (data) => {
356
+ stderr += data.toString();
357
+ process.stderr.write(data);
358
+ });
359
+ child.on("error", (err) => {
360
+ reject(err);
361
+ });
362
+ child.on("close", (code) => {
363
+ // if (code !== 0) {
364
+ // reject(new Error(`Process exited with code ${code}: ${stderr}`));
365
+ // } else {
366
+ resolve({ stdout, stderr });
367
+ //}
368
+ });
369
+ });
370
+ };
371
+ //# sourceMappingURL=bruno.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bruno.js","sourceRoot":"","sources":["../../src/bruno.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CA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AAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;QAC9D,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;QACtF,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QAE1C,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,MAAM,GAAG,EAAE,CAAC;QAEhB,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;YAChC,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,6BAA6B;QAC/B,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;YAChC,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;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;KACzB;IACD,IAAI,KAAK,CAAC,SAAS,KAAK,KAAK,EAAE;QAC7B,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;KACxB;IACD,IAAI,KAAK,CAAC,UAAU,KAAK,KAAK,EAAE;QAC9B,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC;KACzB;IACD,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC;IAChB,IAAI,KAAK,CAAC,KAAK,EAAE;QACf,KAAK,CAAC,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAC1D,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC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K,CAAC,IAAI,EAAE;QACrC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;KACnD;IACD,cAAc,CAAC,KAAK,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;AAC5C,CAAC;AACD,MAAM,UAAU,kBAAkB,CAAC,SAAc;IAC/C,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;KACtC;IACD,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;KAC/C;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;QACtC,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;KAC5D;IACD,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;QACnC,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;KACtE;AACH,CAAC;AACD,MAAM,UAAU,cAAc,CAAC,KAAU,EAAE,UAAe;IACxD,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;QAC3B,OAAO;KACR;IACD,KAAK,CAAC,MAAM,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 };