automation_model 1.0.810-dev → 1.0.812-dev
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/lib/auto_page.js +48 -50
- package/lib/auto_page.js.map +1 -1
- package/lib/command_common.js +3 -0
- package/lib/command_common.js.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/init_browser.js +115 -113
- package/lib/init_browser.js.map +1 -1
- package/lib/profile.d.ts +0 -0
- package/lib/profile.js +55 -0
- package/lib/profile.js.map +1 -0
- package/lib/stable_browser.js +23 -14
- package/lib/stable_browser.js.map +1 -1
- package/lib/utils.js +3 -0
- package/lib/utils.js.map +1 -1
- package/package.json +1 -1
package/lib/stable_browser.js
CHANGED
|
@@ -508,12 +508,6 @@ class StableBrowser {
|
|
|
508
508
|
if (!el.setAttribute) {
|
|
509
509
|
el = el.parentElement;
|
|
510
510
|
}
|
|
511
|
-
// remove any attributes start with data-blinq-id
|
|
512
|
-
// for (let i = 0; i < el.attributes.length; i++) {
|
|
513
|
-
// if (el.attributes[i].name.startsWith("data-blinq-id")) {
|
|
514
|
-
// el.removeAttribute(el.attributes[i].name);
|
|
515
|
-
// }
|
|
516
|
-
// }
|
|
517
511
|
el.setAttribute("data-blinq-id-" + randomToken, "");
|
|
518
512
|
return true;
|
|
519
513
|
}, [tag1, randomToken]))) {
|
|
@@ -808,16 +802,23 @@ class StableBrowser {
|
|
|
808
802
|
element = await this._locate_internal(selectors, info, _params, timeout, allowDisabled);
|
|
809
803
|
}
|
|
810
804
|
if (!element.rerun) {
|
|
811
|
-
const randomToken = Math.random().toString(36).substring(7);
|
|
812
|
-
await element.evaluate((el, randomToken) => {
|
|
813
|
-
|
|
814
|
-
|
|
805
|
+
const randomToken = "blinq_" + Math.random().toString(36).substring(7);
|
|
806
|
+
const id = await element.evaluate((el, randomToken) => {
|
|
807
|
+
// check if the element has id attribute
|
|
808
|
+
if (el.id) {
|
|
809
|
+
return el.id;
|
|
810
|
+
}
|
|
811
|
+
el.setAttribute("id", randomToken);
|
|
812
|
+
console.log("set id=" + randomToken + " on element", el);
|
|
813
|
+
return randomToken;
|
|
815
814
|
}, randomToken);
|
|
816
|
-
// if (element._frame) {
|
|
817
|
-
// return element;
|
|
818
|
-
// }
|
|
819
815
|
const scope = element._frame ?? element.page();
|
|
820
|
-
let newElementSelector = "
|
|
816
|
+
let newElementSelector = "#" + id;
|
|
817
|
+
// check if the id contains :
|
|
818
|
+
if (id.includes(":")) {
|
|
819
|
+
// //*[@id="radix-:r0:"]
|
|
820
|
+
newElementSelector = `//*[@id="${id}"]`;
|
|
821
|
+
}
|
|
821
822
|
let prefixSelector = "";
|
|
822
823
|
const frameControlSelector = " >> internal:control=enter-frame";
|
|
823
824
|
const frameSelectorIndex = element._selector.lastIndexOf(frameControlSelector);
|
|
@@ -1245,11 +1246,16 @@ class StableBrowser {
|
|
|
1245
1246
|
operation: "click",
|
|
1246
1247
|
log: "***** click on " + selectors.element_name + " *****\n",
|
|
1247
1248
|
};
|
|
1249
|
+
//profile("click_all ***", this.context, true);
|
|
1248
1250
|
try {
|
|
1251
|
+
//profile("click_preCommand", this.context, true);
|
|
1249
1252
|
await _preCommand(state, this);
|
|
1253
|
+
//profile("click_preCommand", this.context, false);
|
|
1250
1254
|
await performAction("click", state.element, options, this, state, _params);
|
|
1251
1255
|
if (!this.fastMode) {
|
|
1256
|
+
//profile("click_waitForPageLoad", this.context, true);
|
|
1252
1257
|
await this.waitForPageLoad({ noSleep: true });
|
|
1258
|
+
//profile("click_waitForPageLoad", this.context, false);
|
|
1253
1259
|
}
|
|
1254
1260
|
return state.info;
|
|
1255
1261
|
}
|
|
@@ -1257,7 +1263,10 @@ class StableBrowser {
|
|
|
1257
1263
|
await _commandError(state, e, this);
|
|
1258
1264
|
}
|
|
1259
1265
|
finally {
|
|
1266
|
+
//profile("click_commandFinally", this.context, true);
|
|
1260
1267
|
await _commandFinally(state, this);
|
|
1268
|
+
//profile("click_commandFinally", this.context, false);
|
|
1269
|
+
//profile("click_all ***", this.context, false);
|
|
1261
1270
|
}
|
|
1262
1271
|
}
|
|
1263
1272
|
async waitForElement(selectors, _params, options = {}, world = null) {
|