automation_model 1.0.53 → 1.0.55
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/bin/locator.js +4 -1
- package/bin/stable_browser.js +19 -5
- package/package.json +1 -1
package/bin/locator.js
CHANGED
|
@@ -57,7 +57,7 @@ function processTableQuary(table, quary) {
|
|
|
57
57
|
return { error: "Invalid quary" };
|
|
58
58
|
}
|
|
59
59
|
const rowSelector = match[1];
|
|
60
|
-
|
|
60
|
+
let columnSelector = match[2];
|
|
61
61
|
const property = match[3];
|
|
62
62
|
let selectedRows = [];
|
|
63
63
|
if (rowSelector === "*") {
|
|
@@ -77,7 +77,10 @@ function processTableQuary(table, quary) {
|
|
|
77
77
|
if (isNaN(columnSelector)) {
|
|
78
78
|
if (columnSelector.startsWith('"') && columnSelector.endsWith('"')) {
|
|
79
79
|
columnSelector = columnSelector.substring(1, columnSelector.length - 1);
|
|
80
|
+
} else if (columnSelector.startsWith("'") && columnSelector.endsWith("'")) {
|
|
81
|
+
columnSelector = columnSelector.substring(1, columnSelector.length - 1);
|
|
80
82
|
}
|
|
83
|
+
|
|
81
84
|
if (columnheader.length === 0) {
|
|
82
85
|
return { error: "No column header available" };
|
|
83
86
|
}
|
package/bin/stable_browser.js
CHANGED
|
@@ -198,7 +198,12 @@ class StableBrowser {
|
|
|
198
198
|
}
|
|
199
199
|
let element = await this._locate(selector, info, _params);
|
|
200
200
|
await this._screenShot(options);
|
|
201
|
-
|
|
201
|
+
try {
|
|
202
|
+
return await element.innerText();
|
|
203
|
+
} catch (e) {
|
|
204
|
+
this.logger.info("no innerText will use textContent");
|
|
205
|
+
return await element.textContent();
|
|
206
|
+
}
|
|
202
207
|
}
|
|
203
208
|
async containsPattern(selector, pattern, text, _params = null, options = {}) {
|
|
204
209
|
const info = {};
|
|
@@ -310,8 +315,11 @@ class StableBrowser {
|
|
|
310
315
|
if (cells.length === 0) {
|
|
311
316
|
throw new Error("no cells found");
|
|
312
317
|
}
|
|
318
|
+
value = Number(value);
|
|
313
319
|
for (let i = 0; i < cells.length; i++) {
|
|
314
|
-
|
|
320
|
+
let foundValue = Number(cells[i]);
|
|
321
|
+
|
|
322
|
+
if (foundValue < value) {
|
|
315
323
|
throw new Error(`found table cell value ${cells[i]} < ${value}`);
|
|
316
324
|
}
|
|
317
325
|
}
|
|
@@ -319,8 +327,10 @@ class StableBrowser {
|
|
|
319
327
|
if (cells.length === 0) {
|
|
320
328
|
throw new Error("no cells found");
|
|
321
329
|
}
|
|
330
|
+
value = Number(value);
|
|
322
331
|
for (let i = 0; i < cells.length; i++) {
|
|
323
|
-
|
|
332
|
+
let foundValue = Number(cells[i]);
|
|
333
|
+
if (foundValue <= value) {
|
|
324
334
|
throw new Error(`found table cell value ${cells[i]} <= ${value}`);
|
|
325
335
|
}
|
|
326
336
|
}
|
|
@@ -328,8 +338,10 @@ class StableBrowser {
|
|
|
328
338
|
if (cells.length === 0) {
|
|
329
339
|
throw new Error("no cells found");
|
|
330
340
|
}
|
|
341
|
+
value = Number(value);
|
|
331
342
|
for (let i = 0; i < cells.length; i++) {
|
|
332
|
-
|
|
343
|
+
let foundValue = Number(cells[i]);
|
|
344
|
+
if (foundValue > value) {
|
|
333
345
|
throw new Error(`found table cell value ${cells[i]} > ${value}`);
|
|
334
346
|
}
|
|
335
347
|
}
|
|
@@ -337,8 +349,10 @@ class StableBrowser {
|
|
|
337
349
|
if (cells.length === 0) {
|
|
338
350
|
throw new Error("no cells found");
|
|
339
351
|
}
|
|
352
|
+
value = Number(value);
|
|
340
353
|
for (let i = 0; i < cells.length; i++) {
|
|
341
|
-
|
|
354
|
+
let foundValue = Number(cells[i]);
|
|
355
|
+
if (foundValue >= value) {
|
|
342
356
|
throw new Error(`found table cell value ${cells[i]} >= ${value}`);
|
|
343
357
|
}
|
|
344
358
|
}
|