automation_model 1.0.511-dev → 1.0.511

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 (79) hide show
  1. package/README.md +133 -0
  2. package/lib/analyze_helper.js.map +1 -1
  3. package/lib/api.d.ts +2 -2
  4. package/lib/api.js +162 -121
  5. package/lib/api.js.map +1 -1
  6. package/lib/auto_page.d.ts +7 -2
  7. package/lib/auto_page.js +308 -20
  8. package/lib/auto_page.js.map +1 -1
  9. package/lib/browser_manager.d.ts +4 -2
  10. package/lib/browser_manager.js +229 -58
  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 +104 -20
  20. package/lib/command_common.js.map +1 -1
  21. package/lib/constants.d.ts +4 -0
  22. package/lib/constants.js +2 -0
  23. package/lib/constants.js.map +1 -0
  24. package/lib/date_time.js.map +1 -1
  25. package/lib/drawRect.js.map +1 -1
  26. package/lib/environment.d.ts +1 -0
  27. package/lib/environment.js +1 -0
  28. package/lib/environment.js.map +1 -1
  29. package/lib/error-messages.js +26 -2
  30. package/lib/error-messages.js.map +1 -1
  31. package/lib/file_checker.d.ts +1 -0
  32. package/lib/file_checker.js +172 -0
  33. package/lib/file_checker.js.map +1 -0
  34. package/lib/find_function.js.map +1 -1
  35. package/lib/generation_scripts.d.ts +4 -0
  36. package/lib/generation_scripts.js +2 -0
  37. package/lib/generation_scripts.js.map +1 -0
  38. package/lib/index.d.ts +3 -0
  39. package/lib/index.js +4 -0
  40. package/lib/index.js.map +1 -1
  41. package/lib/init_browser.d.ts +4 -3
  42. package/lib/init_browser.js +173 -98
  43. package/lib/init_browser.js.map +1 -1
  44. package/lib/locate_element.js +16 -14
  45. package/lib/locate_element.js.map +1 -1
  46. package/lib/locator.d.ts +37 -0
  47. package/lib/locator.js +172 -0
  48. package/lib/locator.js.map +1 -1
  49. package/lib/locator_log.d.ts +26 -0
  50. package/lib/locator_log.js +69 -0
  51. package/lib/locator_log.js.map +1 -0
  52. package/lib/network.d.ts +3 -1
  53. package/lib/network.js +418 -68
  54. package/lib/network.js.map +1 -1
  55. package/lib/route.d.ts +83 -0
  56. package/lib/route.js +695 -0
  57. package/lib/route.js.map +1 -0
  58. package/lib/scripts/axe.mini.js +23989 -0
  59. package/lib/snapshot_validation.d.ts +37 -0
  60. package/lib/snapshot_validation.js +360 -0
  61. package/lib/snapshot_validation.js.map +1 -0
  62. package/lib/stable_browser.d.ts +141 -41
  63. package/lib/stable_browser.js +2444 -666
  64. package/lib/stable_browser.js.map +1 -1
  65. package/lib/table.d.ts +15 -0
  66. package/lib/table.js +257 -0
  67. package/lib/table.js.map +1 -0
  68. package/lib/table_analyze.js.map +1 -1
  69. package/lib/table_helper.d.ts +19 -0
  70. package/lib/table_helper.js +130 -0
  71. package/lib/table_helper.js.map +1 -0
  72. package/lib/test_context.d.ts +6 -0
  73. package/lib/test_context.js +5 -0
  74. package/lib/test_context.js.map +1 -1
  75. package/lib/utils.d.ts +38 -3
  76. package/lib/utils.js +777 -35
  77. package/lib/utils.js.map +1 -1
  78. package/package.json +32 -13
  79. 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,360 @@
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
+ console.log("Size of page snapshot :", lines?.length || 0);
282
+ const nodes = fromLinesToSnapshotLines(lines);
283
+ const subLines = referanceSnapshot.split("\n");
284
+ console.log("Size of reference snapshot :", subLines?.length || 0);
285
+ const subNodes = fromLinesToSnapshotLines(subLines);
286
+ return matchSnapshot(nodes, subNodes, snapshotName);
287
+ }
288
+ export function matchSnapshot(full, sub, snapshotName) {
289
+ const parentIdx = sub.map((_, i) => {
290
+ for (let j = i - 1; j >= 0; j--)
291
+ if (sub[j].level < sub[i].level)
292
+ return j;
293
+ return -1;
294
+ });
295
+ const fullIdx = new Array(sub.length);
296
+ const mapping = new Array(sub.length);
297
+ let failureAt = -1;
298
+ function dfs(s, fFrom, baseLevelOffset) {
299
+ if (s === sub.length)
300
+ return true;
301
+ for (let f = fFrom; f < full.length; f++) {
302
+ let levelMatch = true;
303
+ if (baseLevelOffset !== null) {
304
+ // Must match levels relative to initial offset
305
+ if (full[f].level !== sub[s].level + baseLevelOffset)
306
+ continue;
307
+ }
308
+ const status = lineMatches(full[f], sub[s]);
309
+ if (!status.status)
310
+ continue;
311
+ // For first match, set level offset
312
+ const nextBaseOffset = baseLevelOffset !== null ? baseLevelOffset : full[f].level - sub[s].level;
313
+ const pSub = parentIdx[s];
314
+ if (pSub !== -1) {
315
+ let pFull = f - 1;
316
+ while (pFull >= 0 && full[pFull].level >= full[f].level)
317
+ pFull--;
318
+ if (pFull < 0 || pFull !== fullIdx[pSub])
319
+ continue;
320
+ }
321
+ fullIdx[s] = f;
322
+ mapping[s] = full[f].line;
323
+ if (dfs(s + 1, f + 1, nextBaseOffset))
324
+ return true;
325
+ }
326
+ if (failureAt === -1)
327
+ failureAt = s;
328
+ return false;
329
+ }
330
+ const found = dfs(0, 0, null);
331
+ console.log("Snapshot validation result:", found ? "MATCH" : `NO MATCH`);
332
+ let error = null;
333
+ if (!found) {
334
+ error = `Snapshot file: ${snapshotName}\nLine no.: ${sub[failureAt].line}\nLine: ${sub[failureAt].line_text}`;
335
+ }
336
+ return {
337
+ matchingLines: found ? mapping : mapping.slice(0, failureAt),
338
+ errorLine: found ? -1 : failureAt,
339
+ errorLineText: error,
340
+ };
341
+ }
342
+ // let ttt = `- banner:
343
+ // - heading "Shop NOW" [level=6]
344
+ // - text: Log In Username
345
+ // - textbox "Username"
346
+ // - text: Password
347
+ // - textbox "Password"
348
+ // - button "Login"
349
+ // - paragraph: "Accepted usernames are:"
350
+ // - list:
351
+ // - listitem:
352
+ // - paragraph: blinq_user
353
+ // - listitem:
354
+ // - paragraph: blinq_admin
355
+ // - paragraph: "Password for all users:"
356
+ // - paragraph: let_me_in`;
357
+ // const lines = ttt.split("\n");
358
+ // const nodes = fromLinesToSnapshotLines(lines);
359
+ // console.log("nodes", nodes);
360
+ //# sourceMappingURL=snapshot_validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot_validation.js","sourceRoot":"","sources":["../../src/snapshot_validation.ts"],"names":[],"mappings":"AAAA,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,KAA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AAiD;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,40 +54,50 @@ 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
+ inStepReport: boolean;
69
+ constructor(browser: Browser, page: Page, logger?: any, context?: any, world?: any, fastMode?: boolean, stepTags?: string[]);
16
70
  registerEventListeners(context: any): void;
17
71
  switchApp(appName: any): Promise<void>;
18
- _copyContext(from: any, to: any): void;
19
- getWebLogFile(logFolder: string): string;
72
+ switchTab(tabTitleOrIndex: number | string): Promise<void>;
20
73
  registerConsoleLogListener(page: Page, context: any): void;
21
74
  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;
75
+ goto(url: string, world?: null, options?: {}): Promise<void>;
76
+ goBack(options: any, world?: null): Promise<void>;
77
+ goForward(options: any, world?: null): Promise<void>;
78
+ _getLocator(locator: any, scope: any, _params: any): Promise<any>;
28
79
  _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>;
80
+ _locateElementByText(scope: any, text1: any, tag1: any, regex1: boolean | undefined, partial1: any, ignoreCase: boolean | undefined, _params: Params): Promise<{
81
+ elementCount: number;
82
+ randomToken: string;
83
+ }>;
84
+ _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
85
  closeUnexpectedPopups(info: any, _params: any): Promise<{
32
86
  rerun: boolean;
33
87
  }>;
34
- _locate(selectors: any, info: any, _params?: Params, timeout: any): Promise<any>;
88
+ getFilePath(): string | null;
89
+ getFullElementLocators(selectors: any, filePath: any): any;
90
+ _locate(selectors: any, info: any, _params?: Params, timeout: any, allowDisabled?: boolean | undefined): Promise<any>;
35
91
  _findFrameScope(selectors: any, timeout: number | undefined, info: any): Promise<any>;
36
92
  _getDocumentBody(selectors: any, timeout: number | undefined, info: any): Promise<any>;
37
- _locate_internal(selectors: any, info: any, _params?: Params, timeout?: number): Promise<any>;
38
- _scanLocatorsGroup(locatorsGroup: any, scope: any, _params: any, info: any, visibleOnly: any): Promise<{
93
+ _locate_internal(selectors: any, info: any, _params?: Params, timeout?: number, allowDisabled?: boolean | undefined): Promise<any>;
94
+ _scanLocatorsGroup(locatorsGroup: any, scope: any, _params: any, info: any, visibleOnly: any, allowDisabled?: boolean | undefined, element_name: any, logErrors?: boolean | undefined): Promise<{
39
95
  foundElements: any[];
40
96
  }>;
41
97
  simpleClick(elementDescription: any, _params?: Params, options?: {}, world?: null): Promise<void>;
42
98
  simpleClickType(elementDescription: any, value: any, _params?: Params, options?: {}, world?: null): Promise<void>;
43
99
  click(selectors: any, _params?: Params, options?: {}, world?: null): Promise<any>;
100
+ waitForElement(selectors: any, _params?: Params, options?: {}, world?: null): Promise<boolean>;
44
101
  setCheck(selectors: any, checked?: boolean, _params?: Params, options?: {}, world?: null): Promise<any>;
45
102
  hover(selectors: any, _params?: Params, options?: {}, world?: null): Promise<any>;
46
103
  selectOption(selectors: any, values: any, _params?: null, options?: {}, world?: null): Promise<any>;
@@ -49,6 +106,7 @@ declare class StableBrowser {
49
106
  setDateTime(selectors: any, value: any, format?: null, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<void>;
50
107
  clickType(selectors: any, _value: any, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<any>;
51
108
  fill(selectors: any, value: any, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<any>;
109
+ setInputFiles(selectors: any, files: any, _params?: null, options?: {}, world?: null): Promise<any>;
52
110
  getText(selectors: any, _params?: null, options?: {}, info?: {}, world?: null): Promise<{
53
111
  text: any;
54
112
  screenshotId: any;
@@ -77,9 +135,10 @@ declare class StableBrowser {
77
135
  }>;
78
136
  containsPattern(selectors: any, pattern: any, text: any, _params?: null, options?: {}, world?: null): Promise<any>;
79
137
  containsText(selectors: any, text: any, climb: any, _params?: null, options?: {}, world?: null): Promise<any>;
80
- _getDataFile(world?: null): string;
138
+ snapshotValidation(frameSelectors: any, referanceSnapshot: any, _params?: null, options?: {}, world?: null): Promise<any>;
81
139
  waitForUserInput(message: any, world?: null): Promise<void>;
82
140
  setTestData(testData: any, world?: null): void;
141
+ overwriteTestData(testData: any, world?: null): void;
83
142
  _getDataFilePath(fileName: any): string;
84
143
  _parseCSVSync(filePath: any): Promise<unknown>;
85
144
  loadTestData(type: string, dataSelector: string, world?: null): {
@@ -88,51 +147,92 @@ declare class StableBrowser {
88
147
  totp: string | null;
89
148
  };
90
149
  loadTestDataAsync(type: string, dataSelector: string, world?: null): Promise<any>;
91
- getTestData(world?: null): {};
150
+ getTestData(world?: null): any;
92
151
  _screenShot(options?: {}, world?: null, info?: null): Promise<{}>;
93
- takeScreenshot(screenshotPath: any): Promise<any>;
152
+ takeScreenshot(screenshotPath: any, fullPage?: boolean): Promise<any>;
94
153
  verifyElementExistInPage(selectors: any, _params?: null, options?: {}, world?: null): Promise<any>;
95
154
  extractAttribute(selectors: any, attribute: any, variable: any, _params?: null, options?: {}, world?: null): Promise<any>;
155
+ extractProperty(selectors: any, property: any, variable: any, _params?: null, options?: {}, world?: null): Promise<any>;
156
+ verifyAttribute(selectors: any, attribute: any, value: any, _params?: null, options?: {}, world?: null): Promise<any>;
157
+ verifyProperty(selectors: any, property: any, value: any, _params?: null, options?: {}, world?: null): Promise<any>;
158
+ conditionalWait(selectors: any, condition: any, timeout?: number, _params?: null, options?: {}, world?: null): Promise<{}>;
96
159
  extractEmailData(emailAddress: any, options: any, world: any): Promise<{
97
160
  emailUrl: any;
98
161
  emailCode: any;
99
162
  }>;
100
163
  _highlightElements(scope: any, css: any): Promise<void>;
101
- verifyPagePath(pathPart: any, options?: {}, world?: null): Promise<{} | undefined>;
164
+ _matcher(text: any): {
165
+ matcher: any;
166
+ queryText: any;
167
+ };
168
+ _getDomain(url: string): string;
169
+ /**
170
+ * Verify the page path matches the given path.
171
+ * @param {string} pathPart - The path to verify.
172
+ * @param {object} options - Options for verification.
173
+ * @param {object} world - The world context.
174
+ * @returns {Promise<object>} - The state info after verification.
175
+ */
176
+ verifyPagePath(pathPart: string, options?: object, world?: object): Promise<object>;
177
+ /**
178
+ * Verify the page title matches the given title.
179
+ * @param {string} title - The title to verify.
180
+ * @param {object} options - Options for verification.
181
+ * @param {object} world - The world context.
182
+ * @returns {Promise<object>} - The state info after verification.
183
+ */
184
+ verifyPageTitle(title: string, options?: object, world?: object): Promise<object>;
185
+ findTextInAllFrames(dateAlternatives: any, numberAlternatives: any, text: any, state: any, partial?: boolean, ignoreCase?: boolean): Promise<{
186
+ elementCount: number;
187
+ randomToken: string;
188
+ }[]>;
102
189
  verifyTextExistInPage(text: any, options?: {}, world?: null): Promise<any>;
103
190
  waitForTextToDisappear(text: any, options?: {}, world?: null): Promise<any>;
104
- _getServerUrl(): string;
191
+ verifyTextRelatedToText(textAnchor: string, climb: number, textToVerify: string, options?: {}, world?: any): Promise<any>;
192
+ findRelatedTextInAllFrames(textAnchor: string, climb: number, textToVerify: string, params?: Params, options?: {}, world?: any): Promise<{
193
+ elementCount: number;
194
+ randomToken: string;
195
+ }[]>;
105
196
  visualVerification(text: any, options?: {}, world?: null): Promise<{} | undefined>;
106
197
  verifyTableData(selectors: any, data: any, _params?: null, options?: {}, world?: null): Promise<void>;
107
198
  getTableData(selectors: any, _params?: null, options?: {}, world?: null): Promise<any>;
108
199
  analyzeTable(selectors: any, query: any, operator: any, value: any, _params?: null, options?: {}, world?: null): Promise<{} | undefined>;
200
+ /**
201
+ * Explicit wait/sleep function that pauses execution for a specified duration
202
+ * @param duration - Duration to sleep in milliseconds (default: 1000ms)
203
+ * @param options - Optional configuration object
204
+ * @param world - Optional world context
205
+ * @returns Promise that resolves after the specified duration
206
+ */
207
+ sleep(duration?: number, options?: {}, world?: null): Promise<any>;
109
208
  _replaceWithLocalData(value: any, world: any, _decrypt?: boolean, totpWait?: boolean): Promise<string>;
110
209
  _getLoadTimeout(options: any): number;
210
+ _getFindElementTimeout(options: any): any;
211
+ saveStoreState(path?: string | null, world?: any): Promise<void>;
212
+ restoreSaveState(path?: string | null, world?: any): Promise<void>;
111
213
  waitForPageLoad(options?: {}, world?: null): Promise<void>;
112
214
  closePage(options?: {}, world?: null): Promise<void>;
215
+ tableCellOperation(headerText: string, rowText: string, options: any, _params: Params, world?: null): Promise<void>;
216
+ saveTestDataAsGlobal(options: any, world: any): void;
113
217
  setViewportSize(width: number, hight: number, options?: {}, world?: null): Promise<void>;
114
218
  reloadPage(options?: {}, world?: null): Promise<void>;
115
219
  scrollIfNeeded(element: any, info: any): Promise<void>;
116
- _reportToWorld(world: any, properties: JsonCommandReport): void;
220
+ beforeScenario(world: any, scenario: any): Promise<void>;
221
+ afterScenario(world: any, scenario: any): Promise<void>;
222
+ getGherkinKeyword(step: any): "" | "Given" | "When" | "Then" | "And";
223
+ beforeStep(world: any, step: any): Promise<void>;
224
+ setStepTags(tags: string[]): void;
225
+ getAriaSnapshot(): Promise<string | null>;
226
+ /**
227
+ * Sends command with custom payload to report.
228
+ * @param commandText - Title of the command to be shown in the report.
229
+ * @param commandStatus - Status of the command (e.g. "PASSED", "FAILED").
230
+ * @param content - Content of the command to be shown in the report.
231
+ * @param options - Options for the command. Example: { type: "json", screenshot: true }
232
+ * @param world - Optional world context.
233
+ * @public
234
+ */
235
+ addCommandToReport(commandText: string, commandStatus: "PASSED" | "FAILED", content: string, options?: any, world?: any): Promise<void>;
236
+ afterStep(world: any, step: any, result: any): Promise<void>;
117
237
  }
118
- type JsonTimestamp = number;
119
- type JsonResultPassed = {
120
- status: "PASSED";
121
- startTime: JsonTimestamp;
122
- endTime: JsonTimestamp;
123
- };
124
- type JsonResultFailed = {
125
- status: "FAILED";
126
- startTime: JsonTimestamp;
127
- endTime: JsonTimestamp;
128
- message?: string;
129
- };
130
- type JsonCommandResult = JsonResultPassed | JsonResultFailed;
131
- type JsonCommandReport = {
132
- type: string;
133
- value?: string;
134
- text: string;
135
- screenshotId?: string;
136
- result: JsonCommandResult;
137
- };
138
238
  export { StableBrowser };