ff-dom 1.0.18-beta.3 → 1.0.18-beta.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ff-dom",
3
- "version": "1.0.18-beta.3",
3
+ "version": "1.0.18-beta.4",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "files": [
@@ -408,19 +408,18 @@ const getElementsFromHTML = (
408
408
  });
409
409
  }
410
410
 
411
- const fnValue = parseDOM(targetElement, document, false, true);
412
- record.locators.forEach((loc) => {
413
- createLocator(loc, {
414
- name: 'xpath',
415
- value: fnValue,
416
- isRecorded: fnValue?.find((x) => x.value === loc.value)
417
- ? loc.isRecorded
418
- : "Y",
419
- isSelfHealed: fnValue?.find((x) => x.value === loc.value)
420
- ? loc.isSelfHealed
421
- : "Y",
411
+ const xpathResults = parseDOM(targetElement, document, false, true);
412
+ xpathResults.forEach((result) => {
413
+ const fnValue = result.value;
414
+ record.locators.forEach((loc) => {
415
+ createLocator(loc, {
416
+ name: 'xpath',
417
+ value: fnValue,
418
+ isRecorded: loc.value === fnValue ? loc.isRecorded : 'Y',
419
+ isSelfHealed: loc.value === fnValue ? loc.isSelfHealed : 'Y',
420
+ });
422
421
  });
423
- });
422
+ })
424
423
 
425
424
  for (const locator of record.locators) {
426
425
  try {
@@ -440,7 +439,7 @@ const getElementsFromHTML = (
440
439
  value: relativeXpath,
441
440
  isRecorded:
442
441
  locator.isRecorded !== "" &&
443
- locator.isRecorded !== null
442
+ locator.isRecorded !== null
444
443
  ? locator.isRecorded
445
444
  : "Y",
446
445
  });