ff-dom 1.0.14 → 1.0.16
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getElementsFromHTML = void 0;
|
|
4
|
+
//@ts-nocheck
|
|
4
5
|
const jsdom_1 = require("jsdom");
|
|
5
6
|
const isUnique = (xpathResult) => {
|
|
6
7
|
return xpathResult && xpathResult.snapshotLength === 1;
|
|
@@ -477,14 +478,17 @@ const getElementsFromHTML = (name, desc, type, locators, isShared, projectId, pr
|
|
|
477
478
|
}
|
|
478
479
|
}
|
|
479
480
|
let uniqueLocators = new Map();
|
|
480
|
-
finalLocators.forEach((
|
|
481
|
-
|
|
482
|
-
|
|
481
|
+
finalLocators.forEach((obj) => {
|
|
482
|
+
let val = obj.value;
|
|
483
|
+
if (obj.isRecorded === 'Y' && val) {
|
|
484
|
+
val = String(val).replace(/"/g, "'").replace(/\\'/g, "'");
|
|
483
485
|
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
486
|
+
// filter out redundant/invalid values
|
|
487
|
+
if (!val || val === 'null' || val === "''")
|
|
488
|
+
return;
|
|
489
|
+
// ensure unique entries
|
|
490
|
+
if (!uniqueLocators.has(val)) {
|
|
491
|
+
uniqueLocators.set(val, { ...obj, value: val });
|
|
488
492
|
}
|
|
489
493
|
});
|
|
490
494
|
let ffLoc = Array.from(uniqueLocators.values());
|
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//@ts-nocheck
|
|
1
2
|
import { JSDOM, VirtualConsole } from "jsdom";
|
|
2
3
|
|
|
3
4
|
type ElementDetails = {
|
|
@@ -623,13 +624,19 @@ const getElementsFromHTML = (
|
|
|
623
624
|
}
|
|
624
625
|
|
|
625
626
|
let uniqueLocators = new Map();
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
627
|
+
|
|
628
|
+
finalLocators.forEach((obj) => {
|
|
629
|
+
let val = obj.value;
|
|
630
|
+
if (obj.isRecorded === 'Y' && val) {
|
|
631
|
+
val = String(val).replace(/"/g, "'").replace(/\\'/g, "'");
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
// filter out redundant/invalid values
|
|
635
|
+
if (!val || val === 'null' || val === "''") return;
|
|
636
|
+
|
|
637
|
+
// ensure unique entries
|
|
638
|
+
if (!uniqueLocators.has(val)) {
|
|
639
|
+
uniqueLocators.set(val, { ...obj, value: val });
|
|
633
640
|
}
|
|
634
641
|
});
|
|
635
642
|
|