automation_model 1.0.55 → 1.0.57
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/stable_browser.js +5 -5
- package/package.json +1 -1
package/bin/stable_browser.js
CHANGED
|
@@ -66,7 +66,7 @@ class StableBrowser {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
async _locate(selectors, info, _params, timeout =
|
|
69
|
+
async _locate(selectors, info, _params, timeout = 30000) {
|
|
70
70
|
let locatorsByPriority = [];
|
|
71
71
|
let startTime = performance.now();
|
|
72
72
|
let locatorsCount = 0;
|
|
@@ -217,7 +217,7 @@ class StableBrowser {
|
|
|
217
217
|
foundText = await this.getText(selector, _params, options, info);
|
|
218
218
|
let escapedText = text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
219
219
|
pattern = pattern.replace("{text}", escapedText);
|
|
220
|
-
let regex = new RegExp(pattern);
|
|
220
|
+
let regex = new RegExp(pattern, "m");
|
|
221
221
|
if (!regex.test(foundText)) {
|
|
222
222
|
info.foundText = foundText;
|
|
223
223
|
throw new Error("element doesn't contain text " + text);
|
|
@@ -371,13 +371,13 @@ class StableBrowser {
|
|
|
371
371
|
let timeout = 10000;
|
|
372
372
|
if (!configuration) {
|
|
373
373
|
try {
|
|
374
|
-
if (fs.existsSync("
|
|
375
|
-
configuration = JSON.parse(fs.readFileSync("
|
|
374
|
+
if (fs.existsSync("ai_config.json")) {
|
|
375
|
+
configuration = JSON.parse(fs.readFileSync("ai_config.json"));
|
|
376
376
|
} else {
|
|
377
377
|
configuration = {};
|
|
378
378
|
}
|
|
379
379
|
} catch (e) {
|
|
380
|
-
this.logger.error("unable to read
|
|
380
|
+
this.logger.error("unable to read ai_config.json");
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
383
|
if (configuration.page_timeout) {
|