automation_model 1.0.473-dev → 1.0.473

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 (77) 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 -47
  5. package/lib/api.js.map +1 -1
  6. package/lib/auto_page.d.ts +7 -2
  7. package/lib/auto_page.js +282 -26
  8. package/lib/auto_page.js.map +1 -1
  9. package/lib/browser_manager.d.ts +6 -3
  10. package/lib/browser_manager.js +195 -48
  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/check_performance.d.ts +1 -0
  16. package/lib/check_performance.js +57 -0
  17. package/lib/check_performance.js.map +1 -0
  18. package/lib/command_common.d.ts +5 -4
  19. package/lib/command_common.js +137 -21
  20. package/lib/command_common.js.map +1 -1
  21. package/lib/date_time.js.map +1 -1
  22. package/lib/drawRect.js.map +1 -1
  23. package/lib/environment.d.ts +1 -0
  24. package/lib/environment.js +6 -3
  25. package/lib/environment.js.map +1 -1
  26. package/lib/error-messages.d.ts +6 -0
  27. package/lib/error-messages.js +206 -0
  28. package/lib/error-messages.js.map +1 -0
  29. package/lib/file_checker.d.ts +1 -0
  30. package/lib/file_checker.js +172 -0
  31. package/lib/file_checker.js.map +1 -0
  32. package/lib/find_function.js.map +1 -1
  33. package/lib/generation_scripts.d.ts +4 -0
  34. package/lib/generation_scripts.js +2 -0
  35. package/lib/generation_scripts.js.map +1 -0
  36. package/lib/index.d.ts +3 -0
  37. package/lib/index.js +4 -0
  38. package/lib/index.js.map +1 -1
  39. package/lib/init_browser.d.ts +4 -3
  40. package/lib/init_browser.js +160 -83
  41. package/lib/init_browser.js.map +1 -1
  42. package/lib/locate_element.js +16 -14
  43. package/lib/locate_element.js.map +1 -1
  44. package/lib/locator.d.ts +37 -0
  45. package/lib/locator.js +172 -0
  46. package/lib/locator.js.map +1 -1
  47. package/lib/locator_log.d.ts +26 -0
  48. package/lib/locator_log.js +69 -0
  49. package/lib/locator_log.js.map +1 -0
  50. package/lib/network.d.ts +5 -0
  51. package/lib/network.js +494 -0
  52. package/lib/network.js.map +1 -0
  53. package/lib/route.d.ts +83 -0
  54. package/lib/route.js +682 -0
  55. package/lib/route.js.map +1 -0
  56. package/lib/scripts/axe.mini.js +24005 -0
  57. package/lib/snapshot_validation.d.ts +37 -0
  58. package/lib/snapshot_validation.js +357 -0
  59. package/lib/snapshot_validation.js.map +1 -0
  60. package/lib/stable_browser.d.ts +146 -45
  61. package/lib/stable_browser.js +2577 -862
  62. package/lib/stable_browser.js.map +1 -1
  63. package/lib/table.d.ts +15 -0
  64. package/lib/table.js +257 -0
  65. package/lib/table.js.map +1 -0
  66. package/lib/table_analyze.js.map +1 -1
  67. package/lib/table_helper.d.ts +19 -0
  68. package/lib/table_helper.js +130 -0
  69. package/lib/table_helper.js.map +1 -0
  70. package/lib/test_context.d.ts +6 -0
  71. package/lib/test_context.js +16 -12
  72. package/lib/test_context.js.map +1 -1
  73. package/lib/utils.d.ts +38 -2
  74. package/lib/utils.js +728 -13
  75. package/lib/utils.js.map +1 -1
  76. package/package.json +33 -13
  77. package/lib/axe/axe.mini.js +0 -12
@@ -0,0 +1,37 @@
1
+ export declare function highlightSnapshot(snapshot: any, scope: any): Promise<void>;
2
+ /**
3
+ * One flattened line of an ARIA snapshot
4
+ */
5
+ interface SnapshotLine {
6
+ /** original 0-based line number in the file that was parsed */
7
+ line: number;
8
+ /** the ARIA role / node name: “text”, “button”, “listitem”… */
9
+ key: string;
10
+ /** the textual value after the role, or null */
11
+ value: string | null;
12
+ /** indentation depth (0 = root, 1 = child of the previous level, …) */
13
+ level: number;
14
+ /** validation / parsing flags */
15
+ error: string | null;
16
+ /** interpret `value` as a RegExp instead of literal text */
17
+ regex: boolean;
18
+ /** the original line text */
19
+ line_text: string;
20
+ }
21
+ export declare function fromLinesToSnapshotLines(lines: string[]): SnapshotLine[];
22
+ /**
23
+ * Successful-/error-report returned by `matchSnapshot`.
24
+ *
25
+ * ─ matchingLines … full-snapshot **original** line numbers that correspond
26
+ * to every line in the sub-snapshot (same order & length).
27
+ * ─ errorLine ….. first sub-snapshot index that could **not** be matched,
28
+ * or -1 when the whole sub-snapshot was found.
29
+ */
30
+ export interface MatchResult {
31
+ matchingLines: number[];
32
+ errorLine: number;
33
+ errorLineText: string | null;
34
+ }
35
+ export declare function snapshotValidation(snapshot: string, referanceSnapshot: string, snapshotName: string): MatchResult;
36
+ export declare function matchSnapshot(full: SnapshotLine[], sub: SnapshotLine[], snapshotName: string): MatchResult;
37
+ export {};
@@ -0,0 +1,357 @@
1
+ export async function highlightSnapshot(snapshot, scope) {
2
+ const lines = snapshot.split("\n");
3
+ const nodes = fromLinesToSnapshotLines(lines);
4
+ // build a SnapshotNode tree
5
+ const root = new SnapshotNode("root", null);
6
+ const stack = [root];
7
+ const allNodes = [];
8
+ for (const node of nodes) {
9
+ const newNode = new SnapshotNode(node.key, node.value);
10
+ allNodes.push(newNode);
11
+ newNode.level = node.level;
12
+ newNode.regex = node.regex;
13
+ if (node.level > stack.length - 1) {
14
+ // add to the last node
15
+ stack[stack.length - 1].children.push(newNode);
16
+ newNode.parent = stack[stack.length - 1];
17
+ stack.push(newNode);
18
+ }
19
+ else {
20
+ // pop the stack until we find the right level
21
+ while (stack.length > node.level + 1) {
22
+ stack.pop();
23
+ }
24
+ // add to the parent
25
+ stack[stack.length - 1].children.push(newNode);
26
+ newNode.parent = stack[stack.length - 1];
27
+ stack.push(newNode);
28
+ }
29
+ }
30
+ // go over all the nodes in the tree and generate an array of full locators
31
+ const locators = [];
32
+ for (const node of allNodes) {
33
+ const locator = node.getFullLocator();
34
+ locators.push(locator);
35
+ }
36
+ const elements = [];
37
+ // go over all the locators and find the elements
38
+ for (const locator of locators) {
39
+ const l = scope.locator(locator);
40
+ let count = 0;
41
+ try {
42
+ count = await l.count();
43
+ }
44
+ catch (e) {
45
+ //console.log("Error in locator", locator, e);
46
+ continue;
47
+ }
48
+ for (let i = 0; i < count; i++) {
49
+ const element = l.nth(i);
50
+ elements.push(element);
51
+ }
52
+ }
53
+ // go over all the elements and highlight them
54
+ for (const element of elements) {
55
+ try {
56
+ await element.evaluate((el) => {
57
+ if (!el?.style)
58
+ return;
59
+ const originalOutline = el.style.outline;
60
+ el.__previousOutline = originalOutline;
61
+ el.style.outline = "2px solid red";
62
+ if (window) {
63
+ window.addEventListener("beforeunload", function () {
64
+ el.style.outline = originalOutline;
65
+ });
66
+ }
67
+ setTimeout(() => {
68
+ el.style.outline = originalOutline;
69
+ }, 4000);
70
+ });
71
+ }
72
+ catch (e) { }
73
+ }
74
+ }
75
+ /*
76
+ - banner:
77
+ - heading "Shop NOW" [level=6]
78
+ - text: Log In Username
79
+ - textbox "Username"
80
+ - text: Password
81
+ - textbox "Password"
82
+ - button "Login"
83
+ - paragraph: "Accepted usernames are:"
84
+ - list:
85
+ - listitem:
86
+ - paragraph: blinq_user
87
+ - listitem:
88
+ - paragraph: blinq_admin
89
+ - paragraph: "Password for all users:"
90
+ - paragraph: let_me_in
91
+ */
92
+ class SnapshotNode {
93
+ key;
94
+ value;
95
+ role;
96
+ name;
97
+ level = 0;
98
+ regex = false;
99
+ children = [];
100
+ parent = null;
101
+ constructor(key, value) {
102
+ this.key = key;
103
+ this.value = value;
104
+ if (!key) {
105
+ throw new Error("Key cannot be null or undefined");
106
+ }
107
+ this.role = key.split(" ")[0];
108
+ if (this.value) {
109
+ this.name = this.value;
110
+ }
111
+ else {
112
+ // the value will be from the first " to the last "
113
+ const start = key.indexOf('"') + 1;
114
+ const end = key.lastIndexOf('"');
115
+ if (start > -1 && end > -1 && start < end) {
116
+ this.name = key.substring(start, end);
117
+ }
118
+ else {
119
+ this.name = null;
120
+ }
121
+ }
122
+ }
123
+ generateNodeLocator() {
124
+ let locator = `internal:role=${this.role}`;
125
+ switch (this.role) {
126
+ case "paragraph":
127
+ // internal:role=paragraph >> internal:text='blinq_user'"
128
+ return `internal:role=${this.role} >> internal:text=${this.name}`;
129
+ default:
130
+ // "internal:role=textbox[name=\"Password\"]"
131
+ if (this.name) {
132
+ locator += `[name="${this.name}"]`;
133
+ }
134
+ return locator;
135
+ }
136
+ }
137
+ getFullLocator() {
138
+ // create an array of all the parents and current node locators
139
+ const locators = [];
140
+ let currentNode = this;
141
+ while (currentNode) {
142
+ if (currentNode.role !== "root") {
143
+ locators.unshift(currentNode.generateNodeLocator());
144
+ }
145
+ currentNode = currentNode.parent;
146
+ }
147
+ // join the locators with " >> "
148
+ return locators.join(" >> ");
149
+ }
150
+ }
151
+ export function fromLinesToSnapshotLines(lines) {
152
+ // the input is yaml text split into lines, 2 spaces is 1 level
153
+ const nodes = [];
154
+ // identify the space count for tabulation
155
+ let previouseLineSpaceCount = -1;
156
+ let foundTabulationCount = -1;
157
+ // look for 2 consecutive lines that have different space counts, the absolute difference is the space count for tabulation
158
+ for (let i = 0; i < lines.length; i++) {
159
+ const line = lines[i];
160
+ const trimmedLine = line.trim();
161
+ if (trimmedLine.length === 0) {
162
+ continue;
163
+ }
164
+ // count the number of leading spaces
165
+ const match = line.match(/^ */); // Matches spaces at the beginning
166
+ const count = match ? match[0].length : 0;
167
+ if (previouseLineSpaceCount !== -1 && previouseLineSpaceCount !== count) {
168
+ foundTabulationCount = Math.abs(previouseLineSpaceCount - count);
169
+ break;
170
+ }
171
+ previouseLineSpaceCount = count;
172
+ }
173
+ if (foundTabulationCount === -1) {
174
+ foundTabulationCount = 2;
175
+ }
176
+ for (let i = 0; i < lines.length; i++) {
177
+ const line = lines[i];
178
+ const trimmedLine = line.trim();
179
+ if (trimmedLine.length === 0) {
180
+ continue;
181
+ }
182
+ // count the number of leading spaces
183
+ let level = 0;
184
+ const match = line.match(/^ */); // Matches spaces at the beginning
185
+ const count = match ? match[0].length : 0;
186
+ level = count / foundTabulationCount; // 2 spaces is 1 level
187
+ // find the start of the line: - and space
188
+ const start = line.indexOf("- ") + 2;
189
+ if (start === -1) {
190
+ // no - found, set it to error
191
+ nodes.push({
192
+ line: i,
193
+ line_text: line,
194
+ key: line,
195
+ value: null,
196
+ level,
197
+ error: "No - found",
198
+ regex: false,
199
+ });
200
+ continue;
201
+ }
202
+ // first we need to extract the role, we should find the first space or : after the start
203
+ const end = line.indexOf(" ", start);
204
+ const end2 = line.indexOf(":", start);
205
+ if (end === -1 && end2 === -1) {
206
+ // no space or : found, set it to error
207
+ nodes.push({
208
+ line: i,
209
+ line_text: line,
210
+ key: line,
211
+ value: null,
212
+ level,
213
+ error: "No space or : found",
214
+ regex: false,
215
+ });
216
+ continue;
217
+ }
218
+ const endIndex = end === -1 ? end2 : end2 === -1 ? end : Math.min(end, end2);
219
+ const key = line.substring(start, endIndex).trim();
220
+ // define value is string or null
221
+ let value = line.substring(endIndex + 1).trim();
222
+ if (value.startsWith('"')) {
223
+ const lastQuote = value.lastIndexOf('"');
224
+ if (lastQuote !== -1) {
225
+ value = value.substring(0, lastQuote + 1);
226
+ }
227
+ }
228
+ // improved regex detection
229
+ const rawValue = value.endsWith(":") ? value.slice(0, -1) : value;
230
+ const regex = rawValue.startsWith("/") && /\/[a-z]*$/.test(rawValue);
231
+ nodes.push({
232
+ line: i,
233
+ line_text: line,
234
+ key,
235
+ value: value.length > 0 ? value : null,
236
+ level,
237
+ error: null,
238
+ regex,
239
+ });
240
+ }
241
+ return nodes;
242
+ }
243
+ /**
244
+ * Turn a “/pattern/flags” string into a real RegExp.
245
+ */
246
+ function toRegExp(raw) {
247
+ // Remove trailing colon from YAML-style key: /pattern/: → /pattern/
248
+ const sanitized = raw.endsWith(":") ? raw.slice(0, -1) : raw;
249
+ if (!sanitized.startsWith("/"))
250
+ return new RegExp(sanitized);
251
+ const lastSlash = sanitized.lastIndexOf("/");
252
+ const pattern = sanitized.slice(1, lastSlash);
253
+ const flags = sanitized.slice(lastSlash + 1); // i, g, etc.
254
+ return new RegExp(pattern, flags);
255
+ }
256
+ /**
257
+ * Single-line comparison with fixed regex handling.
258
+ */
259
+ function lineMatches(full, sub) {
260
+ let status = { status: false };
261
+ if (full.key !== sub.key)
262
+ return status;
263
+ // We handle level offset outside this function
264
+ if (sub.value === null) {
265
+ status.status = true;
266
+ return status;
267
+ }
268
+ if (sub.regex) {
269
+ status.status = toRegExp(sub.value).test(full.value ?? "");
270
+ }
271
+ else if (full.regex) {
272
+ status.status = toRegExp(full.value).test(sub.value ?? "");
273
+ }
274
+ else {
275
+ status.status = full.value === sub.value;
276
+ }
277
+ return status;
278
+ }
279
+ export function snapshotValidation(snapshot, referanceSnapshot, snapshotName) {
280
+ const lines = snapshot.split("\n");
281
+ const nodes = fromLinesToSnapshotLines(lines);
282
+ const subLines = referanceSnapshot.split("\n");
283
+ const subNodes = fromLinesToSnapshotLines(subLines);
284
+ return matchSnapshot(nodes, subNodes, snapshotName);
285
+ }
286
+ export function matchSnapshot(full, sub, snapshotName) {
287
+ const parentIdx = sub.map((_, i) => {
288
+ for (let j = i - 1; j >= 0; j--)
289
+ if (sub[j].level < sub[i].level)
290
+ return j;
291
+ return -1;
292
+ });
293
+ const fullIdx = new Array(sub.length);
294
+ const mapping = new Array(sub.length);
295
+ let failureAt = -1;
296
+ function dfs(s, fFrom, baseLevelOffset) {
297
+ if (s === sub.length)
298
+ return true;
299
+ for (let f = fFrom; f < full.length; f++) {
300
+ let levelMatch = true;
301
+ if (baseLevelOffset !== null) {
302
+ // Must match levels relative to initial offset
303
+ if (full[f].level !== sub[s].level + baseLevelOffset)
304
+ continue;
305
+ }
306
+ const status = lineMatches(full[f], sub[s]);
307
+ if (!status.status)
308
+ continue;
309
+ // For first match, set level offset
310
+ const nextBaseOffset = baseLevelOffset !== null ? baseLevelOffset : full[f].level - sub[s].level;
311
+ const pSub = parentIdx[s];
312
+ if (pSub !== -1) {
313
+ let pFull = f - 1;
314
+ while (pFull >= 0 && full[pFull].level >= full[f].level)
315
+ pFull--;
316
+ if (pFull < 0 || pFull !== fullIdx[pSub])
317
+ continue;
318
+ }
319
+ fullIdx[s] = f;
320
+ mapping[s] = full[f].line;
321
+ if (dfs(s + 1, f + 1, nextBaseOffset))
322
+ return true;
323
+ }
324
+ if (failureAt === -1)
325
+ failureAt = s;
326
+ return false;
327
+ }
328
+ const found = dfs(0, 0, null);
329
+ let error = null;
330
+ if (!found) {
331
+ error = `Snapshot file: ${snapshotName}\nLine no.: ${sub[failureAt].line}\nLine: ${sub[failureAt].line_text}`;
332
+ }
333
+ return {
334
+ matchingLines: found ? mapping : mapping.slice(0, failureAt),
335
+ errorLine: found ? -1 : failureAt,
336
+ errorLineText: error,
337
+ };
338
+ }
339
+ // let ttt = `- banner:
340
+ // - heading "Shop NOW" [level=6]
341
+ // - text: Log In Username
342
+ // - textbox "Username"
343
+ // - text: Password
344
+ // - textbox "Password"
345
+ // - button "Login"
346
+ // - paragraph: "Accepted usernames are:"
347
+ // - list:
348
+ // - listitem:
349
+ // - paragraph: blinq_user
350
+ // - listitem:
351
+ // - paragraph: blinq_admin
352
+ // - paragraph: "Password for all users:"
353
+ // - paragraph: let_me_in`;
354
+ // const lines = ttt.split("\n");
355
+ // const nodes = fromLinesToSnapshotLines(lines);
356
+ // console.log("nodes", nodes);
357
+ //# sourceMappingURL=snapshot_validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot_validation.js","sourceRoot":"","sources":["../../src/snapshot_validation.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,QAAa,EAAE,KAAU;IAC/D,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,KAAK,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAC9C,4BAA4B;IAC5B,MAAM,IAAI,GAAG,IAAI,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC5C,MAAM,KAAK,GAAmB,CAAC,IAAI,CAAC,CAAC;IACrC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AAC;IAED,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;IAC9B,IAAI,KAAK,GAAG,IAAI,CAAC;IACjB,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,KAAK,GAAG,kBAAkB,YAAY,eAAe,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,WAAW,GAAG,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,CAAC;IAChH,CAAC;IAED,OAAO;QACL,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC;QAC5D,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;QACjC,aAAa,EAAE,KAAK;KACrB,CAAC;AACJ,CAAC;AACD,uBAAuB;AACvB,mCAAmC;AACnC,0BAA0B;AAC1B,uBAAuB;AACvB,mBAAmB;AACnB,uBAAuB;AACvB,mBAAmB;AACnB,yCAAyC;AACzC,UAAU;AACV,gBAAgB;AAChB,8BAA8B;AAC9B,gBAAgB;AAChB,+BAA+B;AAC/B,yCAAyC;AACzC,2BAA2B;AAC3B,iCAAiC;AACjC,iDAAiD;AACjD,+BAA+B"}
@@ -1,5 +1,52 @@
1
1
  import type { Browser, Page } from "playwright";
2
- type Params = Record<string, string>;
2
+ import { Params } from "./utils.js";
3
+ export declare const Types: {
4
+ CLICK: string;
5
+ WAIT_ELEMENT: string;
6
+ NAVIGATE: string;
7
+ GO_BACK: string;
8
+ GO_FORWARD: string;
9
+ FILL: string;
10
+ EXECUTE: string;
11
+ OPEN: string;
12
+ COMPLETE: string;
13
+ ASK: string;
14
+ GET_PAGE_STATUS: string;
15
+ CLICK_ROW_ACTION: string;
16
+ VERIFY_ELEMENT_CONTAINS_TEXT: string;
17
+ VERIFY_PAGE_CONTAINS_TEXT: string;
18
+ VERIFY_PAGE_CONTAINS_NO_TEXT: string;
19
+ ANALYZE_TABLE: string;
20
+ SELECT: string;
21
+ VERIFY_PROPERTY: string;
22
+ VERIFY_PAGE_PATH: string;
23
+ VERIFY_PAGE_TITLE: string;
24
+ TYPE_PRESS: string;
25
+ PRESS: string;
26
+ HOVER: string;
27
+ CHECK: string;
28
+ UNCHECK: string;
29
+ EXTRACT: string;
30
+ EXTRACT_PROPERTY: string;
31
+ CLOSE_PAGE: string;
32
+ TABLE_OPERATION: string;
33
+ SET_DATE_TIME: string;
34
+ SET_VIEWPORT: string;
35
+ VERIFY_VISUAL: string;
36
+ LOAD_DATA: string;
37
+ SET_INPUT: string;
38
+ WAIT_FOR_TEXT_TO_DISAPPEAR: string;
39
+ VERIFY_ATTRIBUTE: string;
40
+ VERIFY_TEXT_WITH_RELATION: string;
41
+ BRUNO: string;
42
+ VERIFY_FILE_EXISTS: string;
43
+ SET_INPUT_FILES: string;
44
+ SNAPSHOT_VALIDATION: string;
45
+ REPORT_COMMAND: string;
46
+ STEP_COMPLETE: string;
47
+ SLEEP: string;
48
+ CONDITIONAL_WAIT: string;
49
+ };
3
50
  export declare const apps: {};
4
51
  declare class StableBrowser {
5
52
  browser: Browser;
@@ -7,38 +54,49 @@ declare class StableBrowser {
7
54
  logger: any;
8
55
  context: any;
9
56
  world?: any;
57
+ fastMode: boolean;
58
+ stepTags: string[];
10
59
  project_path: null;
11
60
  webLogFile: null;
12
61
  networkLogger: null;
13
62
  configuration: null;
14
63
  appName: string;
15
- constructor(browser: Browser, page: Page, logger?: any, context?: any, world?: any);
64
+ tags: null;
65
+ isRecording: boolean;
66
+ initSnapshotTaken: boolean;
67
+ onlyFailuresScreenshot: boolean;
68
+ constructor(browser: Browser, page: Page, logger?: any, context?: any, world?: any, fastMode?: boolean, stepTags?: string[]);
16
69
  registerEventListeners(context: any): void;
17
70
  switchApp(appName: any): Promise<void>;
18
- _copyContext(from: any, to: any): void;
19
- getWebLogFile(logFolder: string): string;
71
+ switchTab(tabTitleOrIndex: number | string): Promise<void>;
20
72
  registerConsoleLogListener(page: Page, context: any): void;
21
73
  registerRequestListener(page: Page, context: any, logFile: string): void;
22
- goto(url: string): Promise<void>;
23
- _fixUsingParams(text: any, _params: Params): any;
24
- _fixLocatorUsingParams(locator: any, _params: Params): any;
25
- _isObject(value: any): any;
26
- scanAndManipulate(currentObj: any, _params: Params): void;
27
- _getLocator(locator: any, scope: any, _params: any): any;
74
+ goto(url: string, world?: null): Promise<void>;
75
+ goBack(options: any, world?: null): Promise<void>;
76
+ goForward(options: any, world?: null): Promise<void>;
77
+ _getLocator(locator: any, scope: any, _params: any): Promise<any>;
28
78
  _locateElmentByTextClimbCss(scope: any, text: any, climb: any, css: any, _params: Params): Promise<string | undefined>;
29
- _locateElementByText(scope: any, text1: any, tag1: any, regex1: boolean | undefined, partial1: any, _params: Params): Promise<any>;
30
- _collectLocatorInformation(selectorHierarchy: any, index: number | undefined, scope: any, foundLocators: any, _params: Params, info: any, visibleOnly?: boolean): Promise<void>;
79
+ _locateElementByText(scope: any, text1: any, tag1: any, regex1: boolean | undefined, partial1: any, ignoreCase: boolean | undefined, _params: Params): Promise<{
80
+ elementCount: number;
81
+ randomToken: string;
82
+ }>;
83
+ _collectLocatorInformation(selectorHierarchy: any, index: number | undefined, scope: any, foundLocators: any, _params: Params, info: any, visibleOnly?: boolean, allowDisabled?: boolean | undefined, element_name?: null, logErrors?: boolean | undefined): Promise<void>;
31
84
  closeUnexpectedPopups(info: any, _params: any): Promise<{
32
85
  rerun: boolean;
33
86
  }>;
34
- _locate(selectors: any, info: any, _params?: Params, timeout?: number): Promise<any>;
35
- _locate_internal(selectors: any, info: any, _params?: Params, timeout?: number): Promise<any>;
36
- _scanLocatorsGroup(locatorsGroup: any, scope: any, _params: any, info: any, visibleOnly: any): Promise<{
87
+ getFilePath(): string | null;
88
+ getFullElementLocators(selectors: any, filePath: any): any;
89
+ _locate(selectors: any, info: any, _params?: Params, timeout: any, allowDisabled?: boolean | undefined): Promise<any>;
90
+ _findFrameScope(selectors: any, timeout: number | undefined, info: any): Promise<any>;
91
+ _getDocumentBody(selectors: any, timeout: number | undefined, info: any): Promise<any>;
92
+ _locate_internal(selectors: any, info: any, _params?: Params, timeout?: number, allowDisabled?: boolean | undefined): Promise<any>;
93
+ _scanLocatorsGroup(locatorsGroup: any, scope: any, _params: any, info: any, visibleOnly: any, allowDisabled?: boolean | undefined, element_name: any, logErrors?: boolean | undefined): Promise<{
37
94
  foundElements: any[];
38
95
  }>;
39
96
  simpleClick(elementDescription: any, _params?: Params, options?: {}, world?: null): Promise<void>;
40
97
  simpleClickType(elementDescription: any, value: any, _params?: Params, options?: {}, world?: null): Promise<void>;
41
98
  click(selectors: any, _params?: Params, options?: {}, world?: null): Promise<any>;
99
+ waitForElement(selectors: any, _params?: Params, options?: {}, world?: null): Promise<boolean>;
42
100
  setCheck(selectors: any, checked?: boolean, _params?: Params, options?: {}, world?: null): Promise<any>;
43
101
  hover(selectors: any, _params?: Params, options?: {}, world?: null): Promise<any>;
44
102
  selectOption(selectors: any, values: any, _params?: null, options?: {}, world?: null): Promise<any>;
@@ -47,6 +105,7 @@ declare class StableBrowser {
47
105
  setDateTime(selectors: any, value: any, format?: null, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<void>;
48
106
  clickType(selectors: any, _value: any, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<any>;
49
107
  fill(selectors: any, value: any, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<any>;
108
+ setInputFiles(selectors: any, files: any, _params?: null, options?: {}, world?: null): Promise<any>;
50
109
  getText(selectors: any, _params?: null, options?: {}, info?: {}, world?: null): Promise<{
51
110
  text: any;
52
111
  screenshotId: any;
@@ -75,9 +134,10 @@ declare class StableBrowser {
75
134
  }>;
76
135
  containsPattern(selectors: any, pattern: any, text: any, _params?: null, options?: {}, world?: null): Promise<any>;
77
136
  containsText(selectors: any, text: any, climb: any, _params?: null, options?: {}, world?: null): Promise<any>;
78
- _getDataFile(world?: null): string;
137
+ snapshotValidation(frameSelectors: any, referanceSnapshot: any, _params?: null, options?: {}, world?: null): Promise<any>;
79
138
  waitForUserInput(message: any, world?: null): Promise<void>;
80
139
  setTestData(testData: any, world?: null): void;
140
+ overwriteTestData(testData: any, world?: null): void;
81
141
  _getDataFilePath(fileName: any): string;
82
142
  _parseCSVSync(filePath: any): Promise<unknown>;
83
143
  loadTestData(type: string, dataSelector: string, world?: null): {
@@ -86,50 +146,91 @@ declare class StableBrowser {
86
146
  totp: string | null;
87
147
  };
88
148
  loadTestDataAsync(type: string, dataSelector: string, world?: null): Promise<any>;
89
- getTestData(world?: null): {};
149
+ getTestData(world?: null): any;
90
150
  _screenShot(options?: {}, world?: null, info?: null): Promise<{}>;
91
151
  takeScreenshot(screenshotPath: any): Promise<any>;
92
152
  verifyElementExistInPage(selectors: any, _params?: null, options?: {}, world?: null): Promise<any>;
93
- extractAttribute(selectors: any, attribute: any, variable: any, _params?: null, options?: {}, world?: null): Promise<{}>;
153
+ extractAttribute(selectors: any, attribute: any, variable: any, _params?: null, options?: {}, world?: null): Promise<any>;
154
+ extractProperty(selectors: any, property: any, variable: any, _params?: null, options?: {}, world?: null): Promise<any>;
155
+ verifyAttribute(selectors: any, attribute: any, value: any, _params?: null, options?: {}, world?: null): Promise<any>;
156
+ verifyProperty(selectors: any, property: any, value: any, _params?: null, options?: {}, world?: null): Promise<any>;
157
+ conditionalWait(selectors: any, condition: any, timeout?: number, _params?: null, options?: {}, world?: null): Promise<{}>;
94
158
  extractEmailData(emailAddress: any, options: any, world: any): Promise<{
95
159
  emailUrl: any;
96
160
  emailCode: any;
97
161
  }>;
98
162
  _highlightElements(scope: any, css: any): Promise<void>;
99
- verifyPagePath(pathPart: any, options?: {}, world?: null): Promise<{} | undefined>;
100
- verifyTextExistInPage(text: any, options?: {}, world?: null): Promise<{}>;
101
- _getServerUrl(): string;
102
- visualVerification(text: any, options?: {}, world?: null): Promise<{}>;
163
+ _matcher(text: any): {
164
+ matcher: any;
165
+ queryText: any;
166
+ };
167
+ _getDomain(url: string): string;
168
+ /**
169
+ * Verify the page path matches the given path.
170
+ * @param {string} pathPart - The path to verify.
171
+ * @param {object} options - Options for verification.
172
+ * @param {object} world - The world context.
173
+ * @returns {Promise<object>} - The state info after verification.
174
+ */
175
+ verifyPagePath(pathPart: string, options?: object, world?: object): Promise<object>;
176
+ /**
177
+ * Verify the page title matches the given title.
178
+ * @param {string} title - The title to verify.
179
+ * @param {object} options - Options for verification.
180
+ * @param {object} world - The world context.
181
+ * @returns {Promise<object>} - The state info after verification.
182
+ */
183
+ verifyPageTitle(title: string, options?: object, world?: object): Promise<object>;
184
+ findTextInAllFrames(dateAlternatives: any, numberAlternatives: any, text: any, state: any, partial?: boolean, ignoreCase?: boolean): Promise<{
185
+ elementCount: number;
186
+ randomToken: string;
187
+ }[]>;
188
+ verifyTextExistInPage(text: any, options?: {}, world?: null): Promise<any>;
189
+ waitForTextToDisappear(text: any, options?: {}, world?: null): Promise<any>;
190
+ verifyTextRelatedToText(textAnchor: string, climb: number, textToVerify: string, options?: {}, world?: any): Promise<any>;
191
+ findRelatedTextInAllFrames(textAnchor: string, climb: number, textToVerify: string, params?: Params, options?: {}, world?: any): Promise<{
192
+ elementCount: number;
193
+ randomToken: string;
194
+ }[]>;
195
+ visualVerification(text: any, options?: {}, world?: null): Promise<{} | undefined>;
103
196
  verifyTableData(selectors: any, data: any, _params?: null, options?: {}, world?: null): Promise<void>;
104
197
  getTableData(selectors: any, _params?: null, options?: {}, world?: null): Promise<any>;
105
- analyzeTable(selectors: any, query: any, operator: any, value: any, _params?: null, options?: {}, world?: null): Promise<{}>;
106
- _replaceWithLocalData(value: any, world: any, _decrypt?: boolean, totpWait?: boolean): Promise<any>;
198
+ analyzeTable(selectors: any, query: any, operator: any, value: any, _params?: null, options?: {}, world?: null): Promise<{} | undefined>;
199
+ /**
200
+ * Explicit wait/sleep function that pauses execution for a specified duration
201
+ * @param duration - Duration to sleep in milliseconds (default: 1000ms)
202
+ * @param options - Optional configuration object
203
+ * @param world - Optional world context
204
+ * @returns Promise that resolves after the specified duration
205
+ */
206
+ sleep(duration?: number, options?: {}, world?: null): Promise<any>;
207
+ _replaceWithLocalData(value: any, world: any, _decrypt?: boolean, totpWait?: boolean): Promise<string>;
107
208
  _getLoadTimeout(options: any): number;
209
+ _getFindElementTimeout(options: any): any;
210
+ saveStoreState(path?: string | null, world?: any): Promise<void>;
211
+ restoreSaveState(path?: string | null, world?: any): Promise<void>;
108
212
  waitForPageLoad(options?: {}, world?: null): Promise<void>;
109
213
  closePage(options?: {}, world?: null): Promise<void>;
214
+ tableCellOperation(headerText: string, rowText: string, options: any, _params: Params, world?: null): Promise<void>;
215
+ saveTestDataAsGlobal(options: any, world: any): void;
110
216
  setViewportSize(width: number, hight: number, options?: {}, world?: null): Promise<void>;
111
217
  reloadPage(options?: {}, world?: null): Promise<void>;
112
218
  scrollIfNeeded(element: any, info: any): Promise<void>;
113
- _reportToWorld(world: any, properties: JsonCommandReport): void;
219
+ beforeScenario(world: any, scenario: any): Promise<void>;
220
+ afterScenario(world: any, scenario: any): Promise<void>;
221
+ beforeStep(world: any, step: any): Promise<void>;
222
+ setStepTags(tags: string[]): void;
223
+ getAriaSnapshot(): Promise<string | null>;
224
+ /**
225
+ * Sends command with custom payload to report.
226
+ * @param commandText - Title of the command to be shown in the report.
227
+ * @param commandStatus - Status of the command (e.g. "PASSED", "FAILED").
228
+ * @param content - Content of the command to be shown in the report.
229
+ * @param options - Options for the command. Example: { type: "json", screenshot: true }
230
+ * @param world - Optional world context.
231
+ * @public
232
+ */
233
+ addCommandToReport(commandText: string, commandStatus: "PASSED" | "FAILED", content: string, options?: any, world?: any): Promise<void>;
234
+ afterStep(world: any, step: any): Promise<void>;
114
235
  }
115
- type JsonTimestamp = number;
116
- type JsonResultPassed = {
117
- status: "PASSED";
118
- startTime: JsonTimestamp;
119
- endTime: JsonTimestamp;
120
- };
121
- type JsonResultFailed = {
122
- status: "FAILED";
123
- startTime: JsonTimestamp;
124
- endTime: JsonTimestamp;
125
- message?: string;
126
- };
127
- type JsonCommandResult = JsonResultPassed | JsonResultFailed;
128
- type JsonCommandReport = {
129
- type: string;
130
- value?: string;
131
- text: string;
132
- screenshotId?: string;
133
- result: JsonCommandResult;
134
- };
135
236
  export { StableBrowser };