automation_model 1.0.630-dev → 1.0.630-stage
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.
- package/README.md +16 -16
- package/lib/api.js +35 -21
- package/lib/api.js.map +1 -1
- package/lib/auto_page.d.ts +1 -1
- package/lib/auto_page.js +99 -28
- package/lib/auto_page.js.map +1 -1
- package/lib/browser_manager.js +38 -9
- package/lib/browser_manager.js.map +1 -1
- package/lib/bruno.d.ts +2 -0
- package/lib/bruno.js +381 -0
- package/lib/bruno.js.map +1 -0
- package/lib/command_common.d.ts +4 -4
- package/lib/command_common.js +32 -16
- package/lib/command_common.js.map +1 -1
- package/lib/environment.d.ts +1 -0
- package/lib/environment.js +1 -0
- package/lib/environment.js.map +1 -1
- package/lib/file_checker.d.ts +1 -0
- package/lib/file_checker.js +61 -0
- package/lib/file_checker.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/init_browser.d.ts +2 -2
- package/lib/init_browser.js +33 -27
- package/lib/init_browser.js.map +1 -1
- package/lib/locate_element.js +2 -2
- package/lib/locate_element.js.map +1 -1
- package/lib/locator_log.js.map +1 -1
- package/lib/network.d.ts +1 -1
- package/lib/network.js +5 -5
- package/lib/network.js.map +1 -1
- package/lib/snapshot_validation.d.ts +37 -0
- package/lib/snapshot_validation.js +357 -0
- package/lib/snapshot_validation.js.map +1 -0
- package/lib/stable_browser.d.ts +20 -3
- package/lib/stable_browser.js +568 -114
- package/lib/stable_browser.js.map +1 -1
- package/lib/table_helper.d.ts +19 -0
- package/lib/table_helper.js +116 -0
- package/lib/table_helper.js.map +1 -0
- package/lib/test_context.d.ts +2 -0
- package/lib/test_context.js +2 -0
- package/lib/test_context.js.map +1 -1
- package/lib/utils.d.ts +8 -4
- package/lib/utils.js +221 -20
- package/lib/utils.js.map +1 -1
- package/package.json +6 -5
|
@@ -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,MAAM,QAAQ,GAAmB,EAAE,CAAC;IACpC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QACvD,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAC3B,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAC3B,IAAI,IAAI,CAAC,KA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
@@ -24,6 +24,7 @@ export declare const Types: {
|
|
|
24
24
|
UNCHECK: string;
|
|
25
25
|
EXTRACT: string;
|
|
26
26
|
CLOSE_PAGE: string;
|
|
27
|
+
TABLE_OPERATION: string;
|
|
27
28
|
SET_DATE_TIME: string;
|
|
28
29
|
SET_VIEWPORT: string;
|
|
29
30
|
VERIFY_VISUAL: string;
|
|
@@ -32,6 +33,10 @@ export declare const Types: {
|
|
|
32
33
|
WAIT_FOR_TEXT_TO_DISAPPEAR: string;
|
|
33
34
|
VERIFY_ATTRIBUTE: string;
|
|
34
35
|
VERIFY_TEXT_WITH_RELATION: string;
|
|
36
|
+
BRUNO: string;
|
|
37
|
+
VERIFY_FILE_EXISTS: string;
|
|
38
|
+
SET_INPUT_FILES: string;
|
|
39
|
+
SNAPSHOT_VALIDATION: string;
|
|
35
40
|
};
|
|
36
41
|
export declare const apps: {};
|
|
37
42
|
declare class StableBrowser {
|
|
@@ -51,6 +56,7 @@ declare class StableBrowser {
|
|
|
51
56
|
constructor(browser: Browser, page: Page, logger?: any, context?: any, world?: any);
|
|
52
57
|
registerEventListeners(context: any): void;
|
|
53
58
|
switchApp(appName: any): Promise<void>;
|
|
59
|
+
switchTab(tabTitleOrIndex: number | string): Promise<void>;
|
|
54
60
|
registerConsoleLogListener(page: Page, context: any): void;
|
|
55
61
|
registerRequestListener(page: Page, context: any, logFile: string): void;
|
|
56
62
|
goto(url: string, world?: null): Promise<void>;
|
|
@@ -60,7 +66,7 @@ declare class StableBrowser {
|
|
|
60
66
|
elementCount: number;
|
|
61
67
|
randomToken: string;
|
|
62
68
|
}>;
|
|
63
|
-
_collectLocatorInformation(selectorHierarchy: any, index: number | undefined, scope: any, foundLocators: any, _params: Params, info: any, visibleOnly?: boolean, allowDisabled?: boolean | undefined, element_name?: null): Promise<void>;
|
|
69
|
+
_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>;
|
|
64
70
|
closeUnexpectedPopups(info: any, _params: any): Promise<{
|
|
65
71
|
rerun: boolean;
|
|
66
72
|
}>;
|
|
@@ -68,7 +74,7 @@ declare class StableBrowser {
|
|
|
68
74
|
_findFrameScope(selectors: any, timeout: number | undefined, info: any): Promise<any>;
|
|
69
75
|
_getDocumentBody(selectors: any, timeout: number | undefined, info: any): Promise<any>;
|
|
70
76
|
_locate_internal(selectors: any, info: any, _params?: Params, timeout?: number, allowDisabled?: boolean | undefined): Promise<any>;
|
|
71
|
-
_scanLocatorsGroup(locatorsGroup: any, scope: any, _params: any, info: any, visibleOnly: any, allowDisabled?: boolean | undefined, element_name: any): Promise<{
|
|
77
|
+
_scanLocatorsGroup(locatorsGroup: any, scope: any, _params: any, info: any, visibleOnly: any, allowDisabled?: boolean | undefined, element_name: any, logErrors?: boolean | undefined): Promise<{
|
|
72
78
|
foundElements: any[];
|
|
73
79
|
}>;
|
|
74
80
|
simpleClick(elementDescription: any, _params?: Params, options?: {}, world?: null): Promise<void>;
|
|
@@ -83,6 +89,7 @@ declare class StableBrowser {
|
|
|
83
89
|
setDateTime(selectors: any, value: any, format?: null, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<void>;
|
|
84
90
|
clickType(selectors: any, _value: any, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<any>;
|
|
85
91
|
fill(selectors: any, value: any, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<any>;
|
|
92
|
+
setInputFiles(selectors: any, files: any, _params?: null, options?: {}, world?: null): Promise<any>;
|
|
86
93
|
getText(selectors: any, _params?: null, options?: {}, info?: {}, world?: null): Promise<{
|
|
87
94
|
text: any;
|
|
88
95
|
screenshotId: any;
|
|
@@ -111,8 +118,10 @@ declare class StableBrowser {
|
|
|
111
118
|
}>;
|
|
112
119
|
containsPattern(selectors: any, pattern: any, text: any, _params?: null, options?: {}, world?: null): Promise<any>;
|
|
113
120
|
containsText(selectors: any, text: any, climb: any, _params?: null, options?: {}, world?: null): Promise<any>;
|
|
121
|
+
snapshotValidation(frameSelectors: any, referanceSnapshot: any, _params?: null, options?: {}, world?: null): Promise<any>;
|
|
114
122
|
waitForUserInput(message: any, world?: null): Promise<void>;
|
|
115
123
|
setTestData(testData: any, world?: null): void;
|
|
124
|
+
overwriteTestData(testData: any, world?: null): void;
|
|
116
125
|
_getDataFilePath(fileName: any): string;
|
|
117
126
|
_parseCSVSync(filePath: any): Promise<unknown>;
|
|
118
127
|
loadTestData(type: string, dataSelector: string, world?: null): {
|
|
@@ -133,13 +142,18 @@ declare class StableBrowser {
|
|
|
133
142
|
}>;
|
|
134
143
|
_highlightElements(scope: any, css: any): Promise<void>;
|
|
135
144
|
verifyPagePath(pathPart: any, options?: {}, world?: null): Promise<{} | undefined>;
|
|
136
|
-
|
|
145
|
+
verifyPageTitle(title: any, options?: {}, world?: null): Promise<{} | undefined>;
|
|
146
|
+
findTextInAllFrames(dateAlternatives: any, numberAlternatives: any, text: any, state: any, partial?: boolean, ignoreCase?: boolean): Promise<{
|
|
137
147
|
elementCount: number;
|
|
138
148
|
randomToken: string;
|
|
139
149
|
}[]>;
|
|
140
150
|
verifyTextExistInPage(text: any, options?: {}, world?: null): Promise<any>;
|
|
141
151
|
waitForTextToDisappear(text: any, options?: {}, world?: null): Promise<any>;
|
|
142
152
|
verifyTextRelatedToText(textAnchor: string, climb: number, textToVerify: string, options?: {}, world?: any): Promise<any>;
|
|
153
|
+
findRelatedTextInAllFrames(textAnchor: string, climb: number, textToVerify: string, params?: Params, options?: {}, world?: any): Promise<{
|
|
154
|
+
elementCount: number;
|
|
155
|
+
randomToken: string;
|
|
156
|
+
}[]>;
|
|
143
157
|
visualVerification(text: any, options?: {}, world?: null): Promise<{} | undefined>;
|
|
144
158
|
verifyTableData(selectors: any, data: any, _params?: null, options?: {}, world?: null): Promise<void>;
|
|
145
159
|
getTableData(selectors: any, _params?: null, options?: {}, world?: null): Promise<any>;
|
|
@@ -151,10 +165,13 @@ declare class StableBrowser {
|
|
|
151
165
|
restoreSaveState(path?: string | null, world?: any): Promise<void>;
|
|
152
166
|
waitForPageLoad(options?: {}, world?: null): Promise<void>;
|
|
153
167
|
closePage(options?: {}, world?: null): Promise<void>;
|
|
168
|
+
tableCellOperation(headerText: string, rowText: string, options: any, _params: Params, world?: null): Promise<void>;
|
|
154
169
|
saveTestDataAsGlobal(options: any, world: any): void;
|
|
155
170
|
setViewportSize(width: number, hight: number, options?: {}, world?: null): Promise<void>;
|
|
156
171
|
reloadPage(options?: {}, world?: null): Promise<void>;
|
|
157
172
|
scrollIfNeeded(element: any, info: any): Promise<void>;
|
|
173
|
+
beforeScenario(world: any, scenario: any): Promise<void>;
|
|
174
|
+
afterScenario(world: any, scenario: any): Promise<void>;
|
|
158
175
|
beforeStep(world: any, step: any): Promise<void>;
|
|
159
176
|
getAriaSnapshot(): Promise<string | null>;
|
|
160
177
|
afterStep(world: any, step: any): Promise<void>;
|