automation_model 1.0.26 → 1.0.28
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 +6 -3
- package/package.json +1 -1
package/bin/stable_browser.js
CHANGED
|
@@ -16,11 +16,11 @@ class StableBrowser {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
_fixUsingParams(text, _params) {
|
|
19
|
-
if (!_params) {
|
|
19
|
+
if (!_params || typeof text !== "string") {
|
|
20
20
|
return text;
|
|
21
21
|
}
|
|
22
22
|
for (let key in _params) {
|
|
23
|
-
text = text.
|
|
23
|
+
text = text.replaceAll(new RegExp("{" + key + "}", "g"), _params[key]);
|
|
24
24
|
}
|
|
25
25
|
return text;
|
|
26
26
|
}
|
|
@@ -30,7 +30,10 @@ class StableBrowser {
|
|
|
30
30
|
locator.role[1].name = reg_parser(locator.role[1].nameReg);
|
|
31
31
|
delete locator.role[1].nameReg;
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
if (locator.role[1].name) {
|
|
34
|
+
locator.role[1].name = this._fixUsingParams(locator.role[1].name, _params);
|
|
35
|
+
}
|
|
36
|
+
return scope.getByRole(locator.role[0], locator.role[1]);
|
|
34
37
|
}
|
|
35
38
|
if (locator.css) {
|
|
36
39
|
return scope.locator(this._fixUsingParams(locator.css, _params));
|