automation_model 1.0.460-dev → 1.0.460

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 (74) hide show
  1. package/README.md +133 -0
  2. package/lib/analyze_helper.js.map +1 -1
  3. package/lib/api.d.ts +43 -2
  4. package/lib/api.js +240 -49
  5. package/lib/api.js.map +1 -1
  6. package/lib/auto_page.d.ts +7 -2
  7. package/lib/auto_page.js +280 -23
  8. package/lib/auto_page.js.map +1 -1
  9. package/lib/browser_manager.d.ts +6 -3
  10. package/lib/browser_manager.js +163 -47
  11. package/lib/browser_manager.js.map +1 -1
  12. package/lib/bruno.d.ts +2 -0
  13. package/lib/bruno.js +381 -0
  14. package/lib/bruno.js.map +1 -0
  15. package/lib/command_common.d.ts +6 -0
  16. package/lib/command_common.js +215 -0
  17. package/lib/command_common.js.map +1 -0
  18. package/lib/date_time.js.map +1 -1
  19. package/lib/drawRect.js.map +1 -1
  20. package/lib/environment.d.ts +1 -0
  21. package/lib/environment.js +6 -3
  22. package/lib/environment.js.map +1 -1
  23. package/lib/error-messages.d.ts +6 -0
  24. package/lib/error-messages.js +206 -0
  25. package/lib/error-messages.js.map +1 -0
  26. package/lib/file_checker.d.ts +1 -0
  27. package/lib/file_checker.js +165 -0
  28. package/lib/file_checker.js.map +1 -0
  29. package/lib/find_function.js.map +1 -1
  30. package/lib/generation_scripts.d.ts +4 -0
  31. package/lib/generation_scripts.js +2 -0
  32. package/lib/generation_scripts.js.map +1 -0
  33. package/lib/index.d.ts +3 -0
  34. package/lib/index.js +3 -0
  35. package/lib/index.js.map +1 -1
  36. package/lib/init_browser.d.ts +4 -2
  37. package/lib/init_browser.js +94 -25
  38. package/lib/init_browser.js.map +1 -1
  39. package/lib/locate_element.d.ts +7 -0
  40. package/lib/locate_element.js +215 -0
  41. package/lib/locate_element.js.map +1 -0
  42. package/lib/locator.d.ts +37 -0
  43. package/lib/locator.js +172 -0
  44. package/lib/locator.js.map +1 -1
  45. package/lib/locator_log.d.ts +26 -0
  46. package/lib/locator_log.js +69 -0
  47. package/lib/locator_log.js.map +1 -0
  48. package/lib/network.d.ts +5 -0
  49. package/lib/network.js +449 -0
  50. package/lib/network.js.map +1 -0
  51. package/lib/route.d.ts +21 -0
  52. package/lib/route.js +533 -0
  53. package/lib/route.js.map +1 -0
  54. package/lib/scripts/axe.mini.js +12 -0
  55. package/lib/snapshot_validation.d.ts +37 -0
  56. package/lib/snapshot_validation.js +357 -0
  57. package/lib/snapshot_validation.js.map +1 -0
  58. package/lib/stable_browser.d.ts +155 -55
  59. package/lib/stable_browser.js +2678 -1302
  60. package/lib/stable_browser.js.map +1 -1
  61. package/lib/table.d.ts +15 -0
  62. package/lib/table.js +257 -0
  63. package/lib/table.js.map +1 -0
  64. package/lib/table_analyze.js.map +1 -1
  65. package/lib/table_helper.d.ts +19 -0
  66. package/lib/table_helper.js +130 -0
  67. package/lib/table_helper.js.map +1 -0
  68. package/lib/test_context.d.ts +6 -0
  69. package/lib/test_context.js +16 -12
  70. package/lib/test_context.js.map +1 -1
  71. package/lib/utils.d.ts +36 -2
  72. package/lib/utils.js +706 -13
  73. package/lib/utils.js.map +1 -1
  74. package/package.json +22 -10
@@ -17,6 +17,7 @@ declare class Environment {
17
17
  localStorage: LocalStorage;
18
18
  }[];
19
19
  extensionPath?: string;
20
+ name?: string;
20
21
  constructor(baseUrl?: string | undefined);
21
22
  setBaseUrl(url: string): void;
22
23
  apps: {
@@ -1,13 +1,16 @@
1
1
  class Environment {
2
+ baseUrl;
3
+ cookies = [];
4
+ origins = [];
5
+ extensionPath;
6
+ name;
2
7
  constructor(baseUrl) {
3
8
  this.baseUrl = baseUrl;
4
- this.cookies = [];
5
- this.origins = [];
6
- this.apps = {};
7
9
  }
8
10
  setBaseUrl(url) {
9
11
  this.baseUrl = url;
10
12
  }
13
+ apps = {};
11
14
  }
12
15
  export { Environment };
13
16
  //# 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;QAM/D,SAAI,GAAmC,EAAE,CAAC;IAJJ,CAAC;IACvC,UAAU,CAAC,GAAW;QACpB,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;IACrB,CAAC;CAEF;AACD,OAAO,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"environment.js","sourceRoot":"","sources":["../../src/environment.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW;IAKI;IAJnB,OAAO,GAAa,EAAE,CAAC;IACvB,OAAO,GAAqD,EAAE,CAAC;IAC/D,aAAa,CAAU;IACvB,IAAI,CAAU;IACd,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 };
@@ -0,0 +1,206 @@
1
+ function classifyPlaywrightError(error) {
2
+ const errorMessage = error.message.toLowerCase();
3
+ // Timeout Errors
4
+ if (error.name === "TimeoutError" || errorMessage.includes("timeout")) {
5
+ return {
6
+ errorType: "TimeoutError",
7
+ errorMessage: error.message,
8
+ };
9
+ }
10
+ // Network Errors
11
+ if (errorMessage.includes("connect econnrefused") ||
12
+ errorMessage.includes("net::") ||
13
+ errorMessage.includes("network") ||
14
+ errorMessage.includes("connection refused") ||
15
+ errorMessage.includes("failed to fetch")) {
16
+ return {
17
+ errorType: "NetworkError",
18
+ errorMessage: error.message,
19
+ };
20
+ }
21
+ // Selector Errors
22
+ if (errorMessage.includes("no element matches selector") ||
23
+ errorMessage.includes("no node found for selector") ||
24
+ errorMessage.includes("resolved to") ||
25
+ errorMessage.includes("element not found")) {
26
+ return {
27
+ errorType: "SelectorError",
28
+ errorMessage: error.message,
29
+ };
30
+ }
31
+ // Frame Errors
32
+ if (errorMessage.includes("frame was detached") ||
33
+ errorMessage.includes("frame not found") ||
34
+ errorMessage.includes("execution context was destroyed")) {
35
+ return {
36
+ errorType: "FrameError",
37
+ errorMessage: error.message,
38
+ };
39
+ }
40
+ // Element State Errors
41
+ if (errorMessage.includes("element is not clickable") ||
42
+ errorMessage.includes("element is outside of viewport") ||
43
+ errorMessage.includes("element is not visible") ||
44
+ errorMessage.includes("element is disabled")) {
45
+ return {
46
+ errorType: "ElementStateError",
47
+ errorMessage: error.message,
48
+ };
49
+ }
50
+ // Browser Context Errors
51
+ if (errorMessage.includes("target closed") ||
52
+ errorMessage.includes("browser has been closed") ||
53
+ errorMessage.includes("connection closed")) {
54
+ return {
55
+ errorType: "BrowserContextError",
56
+ errorMessage: error.message,
57
+ };
58
+ }
59
+ // Screenshot Errors
60
+ if (errorMessage.includes("failed to save screenshot") ||
61
+ errorMessage.includes("screenshot") ||
62
+ (errorMessage.includes("enoent") && errorMessage.includes("screenshots"))) {
63
+ return {
64
+ errorType: "ScreenshotError",
65
+ errorMessage: error.message,
66
+ };
67
+ }
68
+ // Type Errors
69
+ if (errorMessage.includes("cannot type") ||
70
+ errorMessage.includes("element is not an <input>") ||
71
+ errorMessage.includes("element is not focusable")) {
72
+ return {
73
+ errorType: "TypeError",
74
+ errorMessage: error.message,
75
+ };
76
+ }
77
+ // Evaluation Errors
78
+ if (errorMessage.includes("evaluation failed") ||
79
+ errorMessage.includes("execution context was destroyed") ||
80
+ errorMessage.includes("cannot execute in detached frame")) {
81
+ return {
82
+ errorType: "EvaluationError",
83
+ errorMessage: error.message,
84
+ };
85
+ }
86
+ // Assertion Errors
87
+ if (error.name === "AssertionError" || errorMessage.includes("expect(") || errorMessage.includes("assertion")) {
88
+ return {
89
+ errorType: "AssertionError",
90
+ errorMessage: error.message,
91
+ };
92
+ }
93
+ // Default case for unrecognized errors
94
+ return {
95
+ errorType: "UnknownError",
96
+ errorMessage: error.message,
97
+ };
98
+ }
99
+ function classifyJSError(error) {
100
+ const errorMessage = error.message.toLowerCase();
101
+ // Syntax Errors
102
+ if (error.name === "SyntaxError" || errorMessage.includes("syntax error")) {
103
+ return {
104
+ errorType: "SyntaxError",
105
+ errorMessage: error.message,
106
+ };
107
+ }
108
+ // Reference Errors
109
+ if (error.name === "ReferenceError" || errorMessage.includes("reference error")) {
110
+ return {
111
+ errorType: "ReferenceError",
112
+ errorMessage: error.message,
113
+ };
114
+ }
115
+ // Type Errors
116
+ if (error.name === "TypeError" || errorMessage.includes("type error")) {
117
+ return {
118
+ errorType: "TypeError",
119
+ errorMessage: error.message,
120
+ };
121
+ }
122
+ // Range Errors
123
+ if (error.name === "RangeError" || errorMessage.includes("range error")) {
124
+ return {
125
+ errorType: "RangeError",
126
+ errorMessage: error.message,
127
+ };
128
+ }
129
+ // Default case for unrecognized errors
130
+ return {
131
+ errorType: "UnknownError",
132
+ errorMessage: error.message,
133
+ };
134
+ }
135
+ const classifyErrorFromInfo = (error, info) => {
136
+ const failCause = info?.failCause;
137
+ if (!failCause) {
138
+ return {
139
+ errorType: "UnknownError",
140
+ errorMessage: error.message,
141
+ };
142
+ }
143
+ if (failCause.enabled === false) {
144
+ return {
145
+ errorType: "ElementDisabled",
146
+ errorMessage: failCause.lastError,
147
+ };
148
+ }
149
+ if (failCause.visible === false) {
150
+ return {
151
+ errorType: "ElementNotVisible",
152
+ errorMessage: failCause.lastError,
153
+ };
154
+ }
155
+ if (failCause.textNotFound) {
156
+ return {
157
+ errorType: "TextNotFoundError",
158
+ errorMessage: failCause.lastError,
159
+ };
160
+ }
161
+ if (failCause.iframeNotFound) {
162
+ return {
163
+ errorType: "IframeNotFoundError",
164
+ errorMessage: failCause.lastError,
165
+ };
166
+ }
167
+ if (failCause.locatorNotFound) {
168
+ return {
169
+ errorType: "ElementNotFoundError",
170
+ errorMessage: failCause.lastError,
171
+ };
172
+ }
173
+ if (failCause.foundMultiple) {
174
+ return {
175
+ errorType: "MultipleElementsFoundError",
176
+ errorMessage: failCause.lastError ?? `Found ${failCause.count} elements`,
177
+ };
178
+ }
179
+ if (failCause.assertionFailed) {
180
+ return {
181
+ errorType: "AssertionError",
182
+ errorMessage: failCause.lastError,
183
+ };
184
+ }
185
+ return {
186
+ errorType: "UnknownError",
187
+ errorMessage: error.message,
188
+ };
189
+ };
190
+ const getHumanReadableErrorMessage = (error, info) => {
191
+ // @ts-ignore
192
+ if (error.errors && error.errors.length > 0) {
193
+ // @ts-ignore
194
+ return getHumanReadableErrorMessage(error.errors[0], info);
195
+ }
196
+ let errorClassification = classifyErrorFromInfo(error, info);
197
+ if (errorClassification.errorType === "UnknownError") {
198
+ errorClassification = classifyPlaywrightError(error);
199
+ }
200
+ if (errorClassification.errorType === "UnknownError") {
201
+ errorClassification = classifyJSError(error);
202
+ }
203
+ return errorClassification;
204
+ };
205
+ export { getHumanReadableErrorMessage };
206
+ //# sourceMappingURL=error-messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-messages.js","sourceRoot":"","sources":["../../src/error-messages.ts"],"names":[],"mappings":"AAKA,SAAS,uBAAuB,CAAC,KAAY;IAC3C,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IAEjD,iBAAiB;IACjB,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,IAAI,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QACtE,OAAO;YACL,SAAS,EAAE,cAAc;YACzB,YAAY,EAAE,KAAK,CAAC,OAAO;SAC5B,CAAC;IACJ,CAAC;IAED,iBAAiB;IACjB,IACE,YAA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gBAAgB;YAC3B,YAAY,EAAE,SAAS,CAAC,SAAS;SAClC,CAAC;IACJ,CAAC;IACD,OAAO;QACL,SAAS,EAAE,cAAc;QACzB,YAAY,EAAE,KAAK,CAAC,OAAO;KAC5B,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,4BAA4B,GAAG,CAAC,KAAY,EAAE,IAAS,EAAuB,EAAE;IACpF,aAAa;IACb,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5C,aAAa;QACb,OAAO,4BAA4B,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAC7D,CAAC;IACD,IAAI,mBAAmB,GAAG,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC7D,IAAI,mBAAmB,CAAC,SAAS,KAAK,cAAc,EAAE,CAAC;QACrD,mBAAmB,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAC;IACvD,CAAC;IACD,IAAI,mBAAmB,CAAC,SAAS,KAAK,cAAc,EAAE,CAAC;QACrD,mBAAmB,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,mBAAmB,CAAC;AAC7B,CAAC,CAAC;AACF,OAAO,EAAE,4BAA4B,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const verifyFileExists: (filePath: string, options: any, context: any, world: any) => Promise<void>;
@@ -0,0 +1,165 @@
1
+ import * as fs from "fs"; // sync fs
2
+ import * as path from "path";
3
+ import { promises as fsAsync } from "fs"; // async fs
4
+ import { _commandError, _commandFinally, _preCommand } from "./command_common.js";
5
+ import { Types } from "./stable_browser.js";
6
+ const checkFileAccess = (filePath, accessMode) => {
7
+ return new Promise((resolve) => {
8
+ fs.access(filePath, accessMode, (err) => {
9
+ resolve(!err);
10
+ });
11
+ });
12
+ };
13
+ const getFileName = (filePath) => {
14
+ const platform = process.platform;
15
+ return platform === "win32" ? filePath.split("\\").pop() || "" : filePath.split("/").pop() || "";
16
+ };
17
+ // Simplified regex check
18
+ function testForRegex(text) {
19
+ return text.startsWith("regex:");
20
+ }
21
+ export const verifyFileExists = async (filePath, options, context, world) => {
22
+ if (!options)
23
+ options = {};
24
+ const fileName = getFileName(filePath);
25
+ let isSoft = false;
26
+ const match = filePath.match(/(soft:)?(regex:|exact:|contains:)(.*)/);
27
+ if (match) {
28
+ isSoft = !!match[1]; // true if 'soft:' is present
29
+ }
30
+ const state = {
31
+ locate: false,
32
+ scroll: false,
33
+ screenshot: false,
34
+ highlight: false,
35
+ throwError: !isSoft, // don't throw error for soft assertions
36
+ operation: "verifyFileExists",
37
+ value: filePath,
38
+ text: `Verify file ${fileName} exists`,
39
+ options,
40
+ type: Types.VERIFY_FILE_EXISTS,
41
+ world,
42
+ };
43
+ await _preCommand(state, context.web);
44
+ try {
45
+ let pathToMatch = filePath;
46
+ if (isSoft) {
47
+ pathToMatch = filePath.replace(/^soft:/, ""); // remove soft: prefix for parsing
48
+ }
49
+ let dir;
50
+ let input;
51
+ console.log("pathSeparator", path.sep);
52
+ if (pathToMatch.includes("regex:")) {
53
+ const regexIndex = pathToMatch.indexOf("regex:");
54
+ // Handle both forward slashes and backslashes before regex:
55
+ let dirPart = pathToMatch.substring(0, regexIndex);
56
+ // Remove trailing slash/backslash
57
+ if (dirPart.endsWith("/") || dirPart.endsWith("\\")) {
58
+ dirPart = dirPart.slice(0, -1);
59
+ }
60
+ dir = dirPart;
61
+ input = pathToMatch.substring(regexIndex);
62
+ }
63
+ else {
64
+ // Use path.sep to handle both forward and backward slashes
65
+ const pathSeparator = path.sep;
66
+ const lastSlashIndex = pathToMatch.lastIndexOf(pathSeparator);
67
+ // If no separator found, try the other separator (for mixed paths)
68
+ if (lastSlashIndex === -1) {
69
+ const alternativeSeparator = pathSeparator === "/" ? "\\" : "/";
70
+ const altLastSlashIndex = pathToMatch.lastIndexOf(alternativeSeparator);
71
+ if (altLastSlashIndex !== -1) {
72
+ dir = pathToMatch.substring(0, altLastSlashIndex);
73
+ input = pathToMatch.substring(altLastSlashIndex + 1);
74
+ }
75
+ else {
76
+ // No separator found, assume current directory
77
+ dir = ".";
78
+ input = pathToMatch;
79
+ }
80
+ }
81
+ else {
82
+ dir = pathToMatch.substring(0, lastSlashIndex);
83
+ input = pathToMatch.substring(lastSlashIndex + 1);
84
+ }
85
+ }
86
+ if (isSoft) {
87
+ dir = dir.slice(0, -5);
88
+ }
89
+ console.log(`Directory to check: ${dir}`);
90
+ console.log(`Input pattern: ${input}`);
91
+ const files = await fsAsync.readdir(dir);
92
+ let found = false;
93
+ if (input.startsWith("exact:")) {
94
+ const target = input.replace("exact:", "");
95
+ found = files.includes(target);
96
+ }
97
+ else if (input.startsWith("contains:")) {
98
+ const target = input.replace("contains:", "");
99
+ found = files.some((f) => f.includes(target));
100
+ }
101
+ else if (input.startsWith("format:")) {
102
+ const extension = input.replace("format:", "");
103
+ found = files.some((f) => f.endsWith(`.${extension}`));
104
+ }
105
+ else if (testForRegex(input)) {
106
+ let raw = input.replace("regex:", "").trim(); // e.g. "/file/i" or "file.*::i"
107
+ let pattern = raw;
108
+ let flags = "";
109
+ // Normalize delimiters: convert backslash delimiters to forward slash delimiters
110
+ // This preserves the regex pattern while standardizing the delimiter format
111
+ if (raw.startsWith("\\") && raw.lastIndexOf("\\") > 0) {
112
+ // Convert \pattern\flags to /pattern/flags format
113
+ const lastBackslash = raw.lastIndexOf("\\");
114
+ const patternPart = raw.substring(1, lastBackslash);
115
+ const flagsPart = raw.substring(lastBackslash + 1);
116
+ raw = `/${patternPart}/${flagsPart}`;
117
+ }
118
+ // Now handle the standardized format
119
+ if (raw.startsWith("/") && raw.lastIndexOf("/") > 0) {
120
+ // Standard regex format: /pattern/flags
121
+ const lastSlash = raw.lastIndexOf("/");
122
+ flags = raw.substring(lastSlash + 1);
123
+ pattern = raw.substring(1, lastSlash);
124
+ }
125
+ else if (raw.includes("::")) {
126
+ // Alternative format: pattern::flags
127
+ [pattern, flags] = raw.split("::");
128
+ }
129
+ console.log(`Regex pattern: ${pattern}, flags: ${flags}`);
130
+ try {
131
+ const regex = new RegExp(pattern, flags);
132
+ found = files.some((f) => {
133
+ const matched = regex.test(f);
134
+ return matched;
135
+ });
136
+ }
137
+ catch (regexError) {
138
+ throw new Error(`Invalid regex pattern: ${pattern}`);
139
+ }
140
+ }
141
+ else {
142
+ // Fallback to exact path check
143
+ found = await checkFileAccess(pathToMatch, fs.constants.F_OK);
144
+ }
145
+ if (!found) {
146
+ console.log(`Available files in '${dir}':`, files);
147
+ if (!isSoft) {
148
+ throw new Error(`No file matched the pattern: ${filePath}`);
149
+ }
150
+ else {
151
+ console.warn(`Soft assertion failed for pattern: ${filePath}`);
152
+ }
153
+ }
154
+ else {
155
+ console.log(`File verification successful for pattern: ${input}`);
156
+ }
157
+ }
158
+ catch (err) {
159
+ await _commandError(state, err, context.web);
160
+ }
161
+ finally {
162
+ await _commandFinally(state, context.web);
163
+ }
164
+ };
165
+ //# sourceMappingURL=file_checker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file_checker.js","sourceRoot":"","sources":["../../src/file_checker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC,CAAC,UAAU;AACpC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,MAAM,IAAI,CAAC,CAAC,WAAW;AACrD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,MAAM,eAAe,GAAG,CAAC,QAAgB,EAAE,UAAkB,EAAoB,EAAE;IACjF,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,UAAU,EAAE,CAAC,GAAG,EAA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AS;QACX,CAAC;QACD,MAAM,mBAAmB,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnE,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACrC,IAAI,mBAAmB,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC7C,KAAK,EAAE,CAAC;YACV,CAAC;QACH,CAAC;QACD,IAAI,KAAK,GAAG,SAAS,EAAE,CAAC;YACtB,SAAS,GAAG,KAAK,CAAC;YAClB,KAAK,GAAG,CAAC,CAAC;QACZ,CAAC;IACH,CAAC;IACD,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;QACjB,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;AACtB,CAAC,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ export interface InitScripts {
2
+ recorderCjs: string | null;
3
+ scripts: string[] | null;
4
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generation_scripts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generation_scripts.js","sourceRoot":"","sources":["../../src/generation_scripts.ts"],"names":[],"mappings":""}
package/lib/index.d.ts CHANGED
@@ -7,3 +7,6 @@ export * from "./browser_manager.js";
7
7
  export * from "./analyze_helper.js";
8
8
  export * from "./find_function.js";
9
9
  export * from "./utils.js";
10
+ export * from "./table.js";
11
+ export * from "./bruno.js";
12
+ export * from "./file_checker.js";
package/lib/index.js CHANGED
@@ -7,4 +7,7 @@ export * from "./browser_manager.js";
7
7
  export * from "./analyze_helper.js";
8
8
  export * from "./find_function.js";
9
9
  export * from "./utils.js";
10
+ export * from "./table.js";
11
+ export * from "./bruno.js";
12
+ export * from "./file_checker.js";
10
13
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC"}
@@ -3,6 +3,8 @@ import { TestContext } from "./test_context.js";
3
3
  import { StableBrowser } from "./stable_browser.js";
4
4
  import { Browser as PlaywrightBrowser } from "playwright";
5
5
  import { Browser } from "./browser_manager.js";
6
- declare const getContext: (environment: Environment | null, headless: boolean | undefined, world: any, logger?: null, appName?: string | null, createStable?: boolean, stable?: StableBrowser | null, moveToRight?: number) => Promise<TestContext>;
6
+ import { InitScripts } from "./generation_scripts.js";
7
+ declare const getContext: (environment: Environment | null, headless: boolean | undefined, world: any, logger?: null, appName?: string | null, createStable?: boolean, web?: StableBrowser | null, moveToRight?: number, reportFolder?: string | null, initScripts?: InitScripts | null, storageState?: any | null) => Promise<TestContext>;
8
+ declare const refreshBrowser: (web: any, sessionPath: string, world: any) => Promise<void>;
7
9
  declare const closeBrowser: (browser?: Browser | PlaywrightBrowser) => Promise<void>;
8
- export { getContext, closeBrowser };
10
+ export { getContext, closeBrowser, refreshBrowser };