ff-dom 1.0.15 → 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.
|
@@ -478,22 +478,17 @@ const getElementsFromHTML = (name, desc, type, locators, isShared, projectId, pr
|
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
480
|
let uniqueLocators = new Map();
|
|
481
|
-
finalLocators.forEach((
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
value: String(obj.value).replace(/"/g, "'"),
|
|
486
|
-
}));
|
|
481
|
+
finalLocators.forEach((obj) => {
|
|
482
|
+
let val = obj.value;
|
|
483
|
+
if (obj.isRecorded === 'Y' && val) {
|
|
484
|
+
val = String(val).replace(/"/g, "'").replace(/\\'/g, "'");
|
|
487
485
|
}
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
if (!uniqueLocators.has(loc.value)) {
|
|
495
|
-
uniqueLocators.set(loc.value, loc);
|
|
496
|
-
}
|
|
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 });
|
|
497
492
|
}
|
|
498
493
|
});
|
|
499
494
|
let ffLoc = Array.from(uniqueLocators.values());
|
package/package.json
CHANGED
|
@@ -624,21 +624,19 @@ const getElementsFromHTML = (
|
|
|
624
624
|
}
|
|
625
625
|
|
|
626
626
|
let uniqueLocators = new Map();
|
|
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, "'");
|
|
633
632
|
}
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
if (
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
}
|
|
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 });
|
|
642
640
|
}
|
|
643
641
|
});
|
|
644
642
|
|