ff-automationv2 2.2.24 → 2.2.25

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.
Files changed (98) hide show
  1. package/dist/ai/llmprompts/systemPrompts/actionExtractorPrompt.js +2 -2
  2. package/dist/ai/llmprompts/systemPrompts/errorDescriptionPrompt.js +1 -1
  3. package/dist/ai/llmprompts/systemPrompts/fireflinkElementIndexExtactors.js +1 -1
  4. package/dist/ai/llmprompts/systemPrompts/fireflinkElementIndexExtractor_Mob.js +1 -1
  5. package/dist/ai/llmprompts/systemPrompts/getActionExtractorPrompt.js +3 -3
  6. package/dist/ai/llmprompts/systemPrompts/verifyActionExtractorPrompt.js +4 -2
  7. package/dist/ai/llmprompts/systemPrompts/visionPrompt.js +1 -0
  8. package/dist/automation/actions/executor.d.ts +1 -1
  9. package/dist/automation/actions/executor.js +2 -1
  10. package/dist/automation/actions/interaction/clear/clear.js +1 -1
  11. package/dist/automation/actions/interaction/clear/clearAndEnter.js +1 -1
  12. package/dist/automation/actions/interaction/click/click.js +1 -1
  13. package/dist/automation/actions/interaction/click/clickNtimes.js +1 -1
  14. package/dist/automation/actions/interaction/click/doubleClick.js +1 -1
  15. package/dist/automation/actions/interaction/click/waitAndClick.js +1 -1
  16. package/dist/automation/actions/interaction/dragAndDrop/dragAndDrop.js +1 -1
  17. package/dist/automation/actions/interaction/enterActions/EnterInputIntoElementFromClipBoardInterface_mob.js +1 -1
  18. package/dist/automation/actions/interaction/enterActions/enterInput.js +1 -1
  19. package/dist/automation/actions/interaction/enterActions/enterInputAndPress.js +1 -1
  20. package/dist/automation/actions/interaction/find/MOB_FindElement.js +2 -2
  21. package/dist/automation/actions/interaction/find/findElements.js +3 -4
  22. package/dist/automation/actions/interaction/get/MOB_GetHeightOfElement.js +1 -1
  23. package/dist/automation/actions/interaction/get/MOB_GetTextFromElementAndSetToClipBoard.js +1 -1
  24. package/dist/automation/actions/interaction/get/MOB_GetWidthOfElement.js +1 -1
  25. package/dist/automation/actions/interaction/get/getAttribute.js +1 -1
  26. package/dist/automation/actions/interaction/get/getListOfElementsFromLocatorTypeLocatorValue.js +1 -1
  27. package/dist/automation/actions/interaction/get/getLocation.js +1 -1
  28. package/dist/automation/actions/interaction/get/getRect.js +2 -2
  29. package/dist/automation/actions/interaction/get/getSize.js +1 -1
  30. package/dist/automation/actions/interaction/get/getSizeOfBrowserWindow.js +3 -0
  31. package/dist/automation/actions/interaction/get/getTagName.js +1 -1
  32. package/dist/automation/actions/interaction/get/getText.js +1 -1
  33. package/dist/automation/actions/interaction/get/getWidthOfWebElement.js +2 -0
  34. package/dist/automation/actions/interaction/get/getXLocationOfBrowserWindow.js +2 -0
  35. package/dist/automation/actions/interaction/get/getXLocationOfWebElement.js +1 -1
  36. package/dist/automation/actions/interaction/get/getYLocationOfWebElement.js +1 -1
  37. package/dist/automation/actions/interaction/maximize/maximize.js +2 -2
  38. package/dist/automation/actions/interaction/pinch/PinchInByPercentMob.js +3 -3
  39. package/dist/automation/actions/interaction/pinch/PinchOutByPercentMob.js +1 -3
  40. package/dist/automation/actions/interaction/press/longPress.js +1 -1
  41. package/dist/automation/actions/interaction/swipe/swipeDownToElement.js +6 -9
  42. package/dist/automation/actions/interaction/swipe/swipeLeftToElement.js +6 -9
  43. package/dist/automation/actions/interaction/swipe/swipeRightToElement.js +6 -9
  44. package/dist/automation/actions/interaction/swipe/swipeUpToElement.js +6 -9
  45. package/dist/automation/actions/interaction/swipe/swipeUpToElementForMWeb.js +5 -5
  46. package/dist/automation/actions/interaction/swipe/swipeUsingReferenceElement.js +71 -76
  47. package/dist/automation/actions/interaction/verify/VerifyAllOptionsAreDeSelected.js +1 -1
  48. package/dist/automation/actions/interaction/verify/VerifyCheckBoxIsNotSelected.js +2 -1
  49. package/dist/automation/actions/interaction/verify/VerifyElementIsClickable.js +1 -1
  50. package/dist/automation/actions/interaction/verify/VerifyElementIsDisabled.js +1 -1
  51. package/dist/automation/actions/interaction/verify/VerifyElementIsDisplayed.js +1 -1
  52. package/dist/automation/actions/interaction/verify/VerifyElementIsEnabled.js +1 -1
  53. package/dist/automation/actions/interaction/verify/VerifyElementIsSelected.js +1 -1
  54. package/dist/automation/actions/interaction/verify/VerifyElementNotContainsText.js +1 -1
  55. package/dist/automation/actions/interaction/verify/VerifyHeightOfWebElement.js +2 -2
  56. package/dist/automation/actions/interaction/verify/VerifyIfXAndYCoordinateOfElement.js +5 -5
  57. package/dist/automation/actions/interaction/verify/VerifyNumberOfElementsByTagName.js +1 -1
  58. package/dist/automation/actions/interaction/verify/VerifyNumberOfElementsByXpath.js +1 -1
  59. package/dist/automation/actions/interaction/verify/VerifyWidthOfElement.js +3 -3
  60. package/dist/automation/actions/interaction/verify/VerifyXLocationOfElement.js +3 -3
  61. package/dist/automation/actions/interaction/verify/VerifyYLocationOfElement.js +3 -3
  62. package/dist/automation/actions/interaction/verify/verifypartialtext.js +1 -1
  63. package/dist/automation/actions/interaction/verify/verifytext.js +1 -1
  64. package/dist/automation/actions/interaction/wait/MOB_WaitTillAttributeOfElementContainsString.js +1 -1
  65. package/dist/automation/actions/interaction/wait/MOB_WaitTillElementIsEnabled.js +1 -1
  66. package/dist/automation/actions/interaction/wait/MOB_WaitTillElementIsInvisible.js +1 -1
  67. package/dist/automation/actions/interaction/wait/MOB_WaitTillElementIsSelected.js +1 -1
  68. package/dist/automation/actions/interaction/wait/MOB_WaitTillElementIsVisible.js +1 -1
  69. package/dist/automation/actions/interaction/wait/MOB_WaitTillStalenessOfElement.js +1 -1
  70. package/dist/automation/actions/interface/verifyActionInterface.d.ts +1 -0
  71. package/dist/automation/mobileSession/initiateMobileSession.d.ts +2 -1
  72. package/dist/automation/mobileSession/initiateMobileSession.js +4 -3
  73. package/dist/core/constants/allAction.js +1 -0
  74. package/dist/core/constants/supportedActions.js +29 -2
  75. package/dist/core/interfaces/actionInterface.d.ts +1 -1
  76. package/dist/core/interfaces/executionDetails.d.ts +1 -0
  77. package/dist/core/interfaces/llmConfigurationInterface.d.ts +1 -1
  78. package/dist/core/main/actionHandlerFactory.js +6 -3
  79. package/dist/core/main/executionContext.js +1 -1
  80. package/dist/core/main/runAutomationScript.js +21 -21
  81. package/dist/imageAnalysisMobile/annotatedScreenshotMobile.js +1 -1
  82. package/dist/imageAnalysisWeb/annotateScreenshot.js +1 -1
  83. package/dist/llmConfig/llmConfiguration.d.ts +1 -2
  84. package/dist/llmConfig/llmConfiguration.js +15 -13
  85. package/dist/tests/test1.d.ts +1 -7
  86. package/dist/tests/test1.js +29 -11
  87. package/dist/tests/test12.d.ts +0 -1
  88. package/dist/tests/test12.js +73 -72
  89. package/dist/tests/testkaf.d.ts +1 -0
  90. package/dist/tests/testkaf.js +56 -0
  91. package/dist/tests/testwe.d.ts +1 -0
  92. package/dist/tests/testwe.js +24 -0
  93. package/dist/utils/DomExtraction/jsForAttributeInjection.d.ts +1 -1
  94. package/dist/utils/DomExtraction/jsForAttributeInjection.js +11 -7
  95. package/dist/utils/InstancesDetails/getInstancesInfo.js +2 -1
  96. package/dist/utils/swipe/domSearchHelper.d.ts +1 -1
  97. package/dist/utils/swipe/domSearchHelper.js +45 -21
  98. package/package.json +5 -4
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.keywordExtractor = keywordExtractor;
4
4
  async function keywordExtractor({ priorAndNextSteps }) {
5
- const allowedActions = ["enter", "wait", "verify", "scroll", "navigate", "click", "maximize", "minimize", "get", "upload", "close", "open", "drag_and_drop", "switch", "cleartext"];
5
+ const allowedActions = ["enter", "wait", "verify", "scroll", "navigate", "navigateBack", "click", "maximize", "minimize", "get", "upload", "close", "open", "drag_and_drop", "switch", "cleartext"];
6
6
  const prompt = `
7
7
  You are an expert in Web application testing.
8
8
  From the step, extract ONLY the meaningful keywords so that i can search for the element in the dom.
@@ -24,7 +24,7 @@ You are an expert in Web application testing.
24
24
  - Do NOT include status/technical words (displayed, enabled, authenticate, visible).
25
25
  - If an element label contains multiple words (e.g., "Sign In", "Add to Cart"), keep them together as ONE keyword like ["Sign In", "SignIn", "Add to Cart", "AddToCart"] and Never split them and also for keywords you generated, should not split them like ["sign", "in","add","to","cart"].
26
26
  - element_name: extract name of the element that mentioned in the the step.(eg:tap on x -> element_name:x) keep element_name as short as possible and make the first letter of first word of the element_name as capital. beacuse element_name is also used to find element in the dom. and if element_name is not mentioned in step than return action of the step as element_name.
27
- - action: click for taping, clicking or selecting, enter for entering input, wait for waiting or sleeping,scroll for scrolling and swiping, navigate for navigating to page using url or navigateing back to previous page, get for getting,fetching element,maximize for maximizing browser window, close for closing browser window,open for opening browser window, upload for uploading file using path, drag_and_drop for dragging and dropping element, switch is for switching to tab or window or frame,cleartext for clearing or removing text from element.
27
+ - action: click for taping, clicking or selecting, enter for entering input, wait for waiting or sleeping,scroll for scrolling and swiping, navigate for navigating to page using url, navigateBack for navigateing back to previous page, get for getting,fetching element,maximize for maximizing browser window, close for closing browser window,open for opening browser window, upload for uploading file using path, drag_and_drop for dragging and dropping element, switch is for switching to tab or window or frame,cleartext for clearing or removing text from element.
28
28
  - action must be one of from this list ${JSON.stringify(allowedActions)}.if not one of them, return '0'. if step about set or find action return '0'
29
29
  - For navigate action, keywords should contain only one keyword which is full url from the step and should not include any other text. and if step has another actions, including navigate action, don't return navigate action return another action witch is in the step. and element_name should be "URL".
30
30
  Navigate action is allowed only when the step intent is purely navigation (e.g., "Navigate to URL").
@@ -30,7 +30,7 @@ STRICT OUTPUT RULES:
30
30
  Return a JSON object with EXACTLY these keys:
31
31
 
32
32
  1. "error":
33
- - A concise, single-line, selenium exception name or appium exception name (error).__name__ (e.g., "InvalidSessionIdException", "NoSuchElementException", "WebDriverException" etc) expamle: if error is element not found, return "NoSuchElementException"
33
+ - A concise, single-line, selenium exception name or appium exception name (error).__name__ (e.g., "InvalidSessionIdException", "NoSuchElementException", "WebDriverException","ElementNotInteractableException" etc) expamle: if error is element not found, return "NoSuchElementException"
34
34
  - Must contain ONLY a single Selenium-style exception class name.
35
35
  - Do NOT include additional words.
36
36
 
@@ -64,7 +64,7 @@ Respond only with JSON using this format:
64
64
  {
65
65
  "drag": "Fire-Flink-x",
66
66
  "drop": "Fire-Flink-x",
67
- "action": "Builtin_DragAndDropToElement",
67
+ "nlpName": "Builtin_DragAndDropToElement",
68
68
  "drag_element_name": "x",
69
69
  "drop_element_name": "x"
70
70
  "drag_element_type": "x",
@@ -50,7 +50,7 @@ You are an AI assistant. For the step, extract the element keyword from the step
50
50
  filtered dom JSON: ${extractedDomJson}
51
51
  `;
52
52
  }
53
- else if (stepAction === "swipe") {
53
+ else if (stepAction === "swipe" || stepAction === "scroll") {
54
54
  prompt = `
55
55
  You are an intelligent assistant that extracts structured mobile scroll/swipe action data.
56
56
  Given the step: ${JSON.stringify(priorAndNextSteps)}, the simplified DOM (for scroll context): ${extractedDomJson}, and the list of NLP names: ${SwipeActions}.
@@ -26,8 +26,8 @@ Select the perfect matching NLP name from the list that best fits the step's int
26
26
  {
27
27
  "attribute_value": "Fire-Flink-x",
28
28
  "nlpName": "x",
29
- "input_text":"x"
30
- "element_type": "x"
29
+ "input_text":"x",
30
+ "elementType": "x"
31
31
  }
32
32
  Rules:
33
33
  - nlpName must be exactly one from the provided list.
@@ -49,7 +49,7 @@ and also If a step is about getting value from element or some kind of locator t
49
49
  - If no explicit option is mentioned in the step, map it to the most relevant non-option getting NLP based on the intent of the step.
50
50
  - Extract input_text from the step that is which is being getting in the step, if you can't find any input text in the step, return keyword as input_text.
51
51
  - Use the closest semantic match for the step; return attribute_value as Fire-Flink-0, only if nothing is found.and never return Fire-Flink-x.
52
- - Based on step give most relevant type of element. use this list to choose element_type: ${elementType} and Never change syntax of element_type, follow the syntax of element_type in list.if element_type is not there in list return 'link'.
52
+ - Based on step give most relevant type of element. use this list to choose elementType: ${elementType} and Never change syntax of elementType, follow the syntax of elementType in list.if elementType is not there in list return 'link'.
53
53
  - **Respond with valid JSON only. don't return any other text* or or don't return response in list format*.
54
54
  `;
55
55
  return prompt;
@@ -2,14 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.verifyActionExtractorPrompt = verifyActionExtractorPrompt;
4
4
  async function verifyActionExtractorPrompt({ extractedDomJson, priorAndNextSteps, }) {
5
- const nlpList = `VerifyElementIsDisabled,VerifyElementIsEnabled,VerifyElementIsSelected,VerifyIfOptionWithIndexIsSelectedInListBox,VerifyWidthOfElement,VerifyBrowserWindowXLocation,
5
+ const nlpList = `VerifyElementIsDisabled,VerifyElementIsEnabled,VerifyElementIsSelected,VerifyIfOptionWithIndexIsDeselectedInElement,
6
+ VerifyIfOptionWithIndexIsSelectedInListBox,VerifyWidthOfElement,VerifyBrowserWindowXLocation,
6
7
  VerifyIfCookieNameIsDeleted,VerifyBrowserWindowWidth,VerifyValueOfElementIsCleared,
7
8
  VerifyTagName,VerifyIfCookieNameIsAdded,VerifyLinkNavigatesToTitle,VerifyXLocationOfElement,
8
9
  VerifyAllOptionsAreDeselected,VerifyBrowserHtmlCodeContainsString,VerifyBrowserWindowYLocation,
9
10
  VerifyNumberOfElementsByTagName,VerifyListBoxOptionsAreSorted,VerifyNavigateURL,
10
11
  VerifyHeightOfWebElement,VerifyValueOfElementContainsString,VerifyBrowserWindowHeight,VerifyIfLinksAreBroken,
11
12
  VerifyIfLinkIsBroken,VerifyValueOfElementIsString,VerifyYLocationOfElement,
12
- VerifyNumberOfElementsByXpath,VerifyIfOptionWithIndexIsDeselectedInElement,VerifyAttributeValue,
13
+ VerifyNumberOfElementsByXpath,VerifyAttributeValue,
13
14
  VerifyElementIsDisplayed,VerifyAllOptionsAreSelected,VerifyIfOptionWithValueIsDeselected,
14
15
  VerifyBrowserWindowTitleContainsString,VerifyBrowserWindowTitleIsString,
15
16
  VerifyTitleOfCurrentPage,VerifyPartialTitleOfCurrentPage,VerifyElementIsNotDisplayed,
@@ -39,6 +40,7 @@ Select the perfect matching NLP name from the list that best fits the step's int
39
40
  **The NLP name must match exactly one value from the approved NLP list. Do not generate or suggest any new NLP names under any condition.**
40
41
  step may give any way,you need to get most matching and most related nlp name from the list that relates to step.
41
42
  for these nlp's VerifyIfSpecifiedOptionIsSelected,VerifyThatSpecifiedOptionIsNotSelected,VerifyIfOptionWithValueIsSelected,VerifyIfOptionWithValueIsDeselected,in step if they mention word value then only match with these VerifyIfOptionWithValueIsSelected,VerifyIfOptionWithValueIsDeselected.Otherwise go with specified option nlp's.
43
+ if step is verify option with index is deselected map to VerifyIfOptionWithIndexIsDeselectedInElement and if step is verify option with index is selected then map to VerifyIfOptionWithIndexIsSelectedInListBox.
42
44
  example: verify if email element is present
43
45
  nlp name should be VerifyElementIsDisplayed
44
46
 
@@ -9,6 +9,7 @@ Context: ${priorAndNextSteps}
9
9
  - **If u can't find the element and also If there is no element with number, return Fire-Flink-0. dont return any other elements index.**
10
10
  - Using the provided annotated screenshot and Step, identify the correct element index from the image.
11
11
  - Match the index to the text or action described in Step as accurately as possible.
12
+ - Allow partial and case-insensitive matching. If a clear match exists, return its index.
12
13
  - Return only the Fire-Flink-x for the target element .
13
14
  - **Never return Fire-Flink-1 only return Fire-Flink-0.**
14
15
  - Do not provide any additional text or explanation. The output must be strictly Fire-Flink-x.
@@ -224,7 +224,7 @@ export declare class ActionExecutor implements IActionExecutor {
224
224
  VerifyBrowserWindowTitleContainsString(value: string): Promise<void>;
225
225
  VerifyBrowserWindowUrlIsString(value: string): Promise<void>;
226
226
  VerifyBrowserWindowUrlContainsExpectedUrl(value: string): Promise<void>;
227
- VerifyCheckBoxIsNotSelected(pageDOM: string, selector: string, fireflinkIndex: string, elementName: string, elementType: string): Promise<void>;
227
+ VerifyCheckBoxIsNotSelected(pageDOM: string, selector: string, value: string, fireflinkIndex: string, elementName: string, elementType: string): Promise<void>;
228
228
  VerifyCheckBoxIsSelected(pageDOM: string, selector: string, fireflinkIndex: string, elementName: string, elementType: string): Promise<void>;
229
229
  VerifyBrowserWindowTitleIsString(value: string): Promise<void>;
230
230
  VerifyIfBrowserWindowIsClosed(): Promise<void>;
@@ -3822,11 +3822,12 @@ class ActionExecutor {
3822
3822
  throw error;
3823
3823
  }
3824
3824
  }
3825
- async VerifyCheckBoxIsNotSelected(pageDOM, selector, fireflinkIndex, elementName, elementType) {
3825
+ async VerifyCheckBoxIsNotSelected(pageDOM, selector, value, fireflinkIndex, elementName, elementType) {
3826
3826
  try {
3827
3827
  await (0, VerifyCheckBoxIsNotSelected_js_1.verifyCheckboxIsNotSelected)({
3828
3828
  driver: this.driver,
3829
3829
  selector: selector,
3830
+ value: value,
3830
3831
  scriptDataAppender: this.scriptDataAppender,
3831
3832
  elementGetter: this.elementGetter,
3832
3833
  fireflinkIndex,
@@ -13,7 +13,7 @@ async function clear(args) {
13
13
  elementsData: [{
14
14
  name: args.elementName,
15
15
  type: args.elementType,
16
- locators: [{ "xpath": args.selector }],
16
+ locators: [{ "name": "xpath", "value": args.selector }],
17
17
  platform: args.platform
18
18
  }]
19
19
  };
@@ -15,7 +15,7 @@ async function clearAndEnter(args) {
15
15
  elementsData: [{
16
16
  name: args.elementName,
17
17
  type: args.elementType,
18
- locators: [{ "xpath": args.selector }],
18
+ locators: [{ "name": "xpath", "value": args.selector }],
19
19
  platform: args.platform
20
20
  }]
21
21
  };
@@ -13,7 +13,7 @@ async function click(args) {
13
13
  elementsData: [{
14
14
  name: args.elementName,
15
15
  type: args.elementType,
16
- locators: [{ "xpath": args.selector }],
16
+ locators: [{ "name": "xpath", "value": args.selector }],
17
17
  platform: args.platform
18
18
  }]
19
19
  }));
@@ -16,7 +16,7 @@ async function clickNTimes(args) {
16
16
  elementsData: [{
17
17
  name: args.elementName,
18
18
  type: args.elementType,
19
- locators: [{ "xpath": args.selector }],
19
+ locators: [{ "name": "xpath", "value": args.selector }],
20
20
  platform: args.platform
21
21
  }]
22
22
  };
@@ -14,7 +14,7 @@ async function doubleClick(args) {
14
14
  elementsData: [{
15
15
  name: args.elementName,
16
16
  type: args.elementType,
17
- locators: [{ "xpath": args.selector }],
17
+ locators: [{ "name": "xpath", "value": args.selector }],
18
18
  platform: args.platform
19
19
  }]
20
20
  };
@@ -24,7 +24,7 @@ async function waitAndClick(args) {
24
24
  elementsData: [{
25
25
  name: args.elementName,
26
26
  type: args.elementType,
27
- locators: [{ "xpath": args.selector }],
27
+ locators: [{ "name": "xpath", "value": args.selector }],
28
28
  platform: args.platform
29
29
  }]
30
30
  };
@@ -25,7 +25,7 @@ async function dragAndDropToElement(args) {
25
25
  platform: args.platform
26
26
  }
27
27
  ],
28
- stepInputs: [args.elementName1, args.elementName2]
28
+ stepInputs: []
29
29
  };
30
30
  });
31
31
  }
@@ -16,7 +16,7 @@ async function MOB_EnterInputIntoElementFromClipBoard(args) {
16
16
  elementsData: [{
17
17
  name: args.elementName,
18
18
  type: args.elementType,
19
- locators: [{ "xpath": args.selector }],
19
+ locators: [{ "name": "xpath", "value": args.selector }],
20
20
  platform: args.platform
21
21
  }]
22
22
  };
@@ -54,7 +54,7 @@ async function enterInput(args) {
54
54
  elementsData: [{
55
55
  name: args.elementName,
56
56
  type: args.elementType,
57
- locators: [{ "xpath": args.selector }],
57
+ locators: [{ "name": "xpath", "value": args.selector }],
58
58
  platform: args.platform
59
59
  }]
60
60
  };
@@ -46,7 +46,7 @@ async function enterInputAndPress(args) {
46
46
  elementsData: [{
47
47
  name: args.elementName,
48
48
  type: args.elementType,
49
- locators: [{ "xpath": args.selector }],
49
+ locators: [{ "name": "xpath", "value": args.selector }],
50
50
  platform: args.platform
51
51
  }]
52
52
  };
@@ -22,8 +22,8 @@ async function MOB_FindElement(args) {
22
22
  name: args.elementName,
23
23
  type: args.elementType,
24
24
  locators: [{
25
- "locatorType": "xpath",
26
- "locatorValue": args.selector
25
+ "name": "xpath",
26
+ "value": args.selector
27
27
  }],
28
28
  platform: args.platform
29
29
  }]
@@ -23,10 +23,9 @@ async function findElements(args) {
23
23
  elementsData: [{
24
24
  name: args.elementName,
25
25
  type: args.elementType,
26
- locators: [{
27
- locatorType: "xpath",
28
- locatorValue: args.value
29
- }],
26
+ locators: [
27
+ { "name": "xpath", "value": args.value }
28
+ ],
30
29
  platform: args.platform
31
30
  }]
32
31
  };
@@ -13,7 +13,7 @@ const MOB_GetHeightOfElement = async (args) => {
13
13
  elementsData: [{
14
14
  name: args.elementName,
15
15
  type: args.elementType,
16
- locators: [{ "xpath": args.selector }],
16
+ locators: [{ "name": "xpath", "value": args.selector }],
17
17
  platform: args.platform
18
18
  }]
19
19
  };
@@ -22,7 +22,7 @@ const MOB_GetTextFromElementAndSetToClipBoard = async (args) => {
22
22
  elementsData: [{
23
23
  name: args.elementName,
24
24
  type: args.elementType,
25
- locators: [{ xpath: args.selector }],
25
+ locators: [{ "name": "xpath", "value": args.selector }],
26
26
  platform: args.platform
27
27
  }]
28
28
  }));
@@ -13,7 +13,7 @@ const MOB_GetWidthOfElement = async (args) => {
13
13
  elementsData: [{
14
14
  name: args.elementName,
15
15
  type: args.elementType,
16
- locators: [{ "xpath": args.selector }],
16
+ locators: [{ "name": "xpath", "value": args.selector }],
17
17
  platform: args.platform
18
18
  }]
19
19
  };
@@ -20,7 +20,7 @@ async function getAttribute(args) {
20
20
  elementsData: [{
21
21
  name: args.elementName,
22
22
  type: args.elementType,
23
- locators: [{ "xpath": args.selector }],
23
+ locators: [{ "name": "xpath", "value": args.selector }],
24
24
  platform: args.platform
25
25
  }]
26
26
  };
@@ -22,7 +22,7 @@ const getListOfElementsFromLocatorTypeLocatorValue = async (args) => {
22
22
  finalSelector = locatorValue;
23
23
  break;
24
24
  case "xpath":
25
- finalSelector = `xpath=${locatorValue}`;
25
+ finalSelector = locatorValue;
26
26
  break;
27
27
  case "name":
28
28
  finalSelector = `[name="${locatorValue}"]`;
@@ -16,7 +16,7 @@ const getLocation = async (args) => {
16
16
  elementsData: [{
17
17
  name: args.elementName,
18
18
  type: args.elementType,
19
- locators: [{ "xpath": args.selector }],
19
+ locators: [{ "name": "xpath", "value": args.selector }],
20
20
  platform: args.platform
21
21
  }]
22
22
  };
@@ -23,7 +23,7 @@ const getRect = async (args) => {
23
23
  elementsData: [{
24
24
  name: args.elementName,
25
25
  type: args.elementType,
26
- locators: [{ "xpath": args.selector }],
26
+ locators: [{ "name": "xpath", "value": args.selector }],
27
27
  platform: args.platform
28
28
  }]
29
29
  };
@@ -54,7 +54,7 @@ const getRect = async (args) => {
54
54
  elementsData: [{
55
55
  name: args.elementName,
56
56
  type: args.elementType,
57
- locators: [{ "xpath": args.selector }],
57
+ locators: [{ "name": "xpath", "value": args.selector }],
58
58
  platform: args.platform
59
59
  }]
60
60
  };
@@ -16,7 +16,7 @@ const getSize = async (args) => {
16
16
  elementsData: [{
17
17
  name: args.elementName,
18
18
  type: args.elementType,
19
- locators: [{ "xpath": args.selector }],
19
+ locators: [{ "name": "xpath", "value": args.selector }],
20
20
  platform: args.platform
21
21
  }]
22
22
  };
@@ -1,8 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getSizeOfBrowserWindow = void 0;
4
+ // import { logger } from "../../../../utils/logger/logData.js";
4
5
  const getSizeOfBrowserWindow = async (args) => {
5
6
  try {
7
+ // const rect = await args.driver.getWindowSize();
8
+ // logger.info(rect);
6
9
  args.scriptDataAppender.add(async () => ({
7
10
  nlpName: "GetSizeOfBrowserWindow",
8
11
  stepInputs: [],
@@ -16,7 +16,7 @@ async function getTagName(args) {
16
16
  elementsData: [{
17
17
  name: args.elementName,
18
18
  type: args.elementType,
19
- locators: [{ "xpath": args.selector }],
19
+ locators: [{ "name": "xpath", "value": args.selector }],
20
20
  platform: args.platform
21
21
  }]
22
22
  };
@@ -16,7 +16,7 @@ const getText = async (args) => {
16
16
  elementsData: [{
17
17
  name: args.elementName,
18
18
  type: args.elementType,
19
- locators: [{ "xpath": args.selector }],
19
+ locators: [{ "name": "xpath", "value": args.selector }],
20
20
  platform: args.platform
21
21
  }]
22
22
  };
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getWidthOfWebElement = void 0;
4
+ const logData_js_1 = require("../../../../utils/logger/logData.js");
4
5
  const getWidthOfWebElement = async (args) => {
5
6
  try {
6
7
  const element = await args.driver.$(args.selector);
7
8
  const _size = await element.getSize();
8
9
  const _width = _size.width;
10
+ logData_js_1.logger.info('width --', _width);
9
11
  args.scriptDataAppender.add(async () => {
10
12
  const ffElement = await args.elementGetter.getFireFlinkElement(args.pageDOM, `[ff-inspect="${args.fireflinkIndex}"]`);
11
13
  return {
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getXLocationOfBrowserWindow = void 0;
4
4
  const getXLocationOfBrowserWindow = async (args) => {
5
5
  try {
6
+ // const position = await args.driver.getWindowRect();
7
+ // logger.info(position.x, position.y);
6
8
  args.scriptDataAppender.add(async () => ({
7
9
  nlpName: "GetXLocationOfBrowserWindow",
8
10
  stepInputs: [],
@@ -17,7 +17,7 @@ const getXLocationOfWebElement = async (args) => {
17
17
  elementsData: [{
18
18
  name: args.elementName,
19
19
  type: args.elementType,
20
- locators: [{ "xpath": args.selector }],
20
+ locators: [{ "name": "xpath", "value": args.selector }],
21
21
  platform: args.platform
22
22
  }]
23
23
  };
@@ -17,7 +17,7 @@ const getYLocationOfWebElement = async (args) => {
17
17
  elementsData: [{
18
18
  name: args.elementName,
19
19
  type: args.elementType,
20
- locators: [{ "xpath": args.selector }],
20
+ locators: [{ "name": "xpath", "value": args.selector }],
21
21
  platform: args.platform
22
22
  }]
23
23
  };
@@ -6,13 +6,13 @@ async function maximize(maximizeInterface) {
6
6
  const { driver, scriptDataAppender } = maximizeInterface;
7
7
  await driver.maximizeWindow();
8
8
  scriptDataAppender.add(async () => ({
9
- nlpName: "Maximize",
9
+ nlpName: "MaximizeBrowser",
10
10
  elementsData: [],
11
11
  stepInputs: []
12
12
  }));
13
13
  }
14
14
  catch (error) {
15
- maximizeInterface.scriptDataAppender.setErrorNLP("Maximize");
15
+ maximizeInterface.scriptDataAppender.setErrorNLP("MaximizeBrowser");
16
16
  throw new Error("Maximize action failed", { cause: error });
17
17
  }
18
18
  }
@@ -15,9 +15,9 @@ async function MOB_PinchInByPercent(args) {
15
15
  elementsData: [{
16
16
  name: args.elementName,
17
17
  type: args.elementType,
18
- locators: [{
19
- xpath: args.selector
20
- }],
18
+ locators: [
19
+ { "name": "xpath", "value": args.selector }
20
+ ],
21
21
  platform: args.platform
22
22
  }]
23
23
  };
@@ -15,9 +15,7 @@ async function MOB_PinchOutByPercent(args) {
15
15
  elementsData: [{
16
16
  name: args.elementName,
17
17
  type: args.elementType,
18
- locators: [{
19
- xpath: args.selector
20
- }],
18
+ locators: [{ "name": "xpath", "value": args.selector }],
21
19
  platform: args.platform
22
20
  }]
23
21
  };
@@ -35,7 +35,7 @@ const LongPress = async (args) => {
35
35
  elementsData: [{
36
36
  name: args.elementName,
37
37
  type: args.elementType,
38
- locators: [{ "xpath": args.selector }],
38
+ locators: [{ "name": "xpath", "value": args.selector }],
39
39
  platform: args.platform
40
40
  }]
41
41
  }));
@@ -14,14 +14,16 @@ async function swipeDownToElement(args) {
14
14
  let found = false;
15
15
  let discoveredXPath = "";
16
16
  let previousDom = "";
17
- for (let attempt = 1; attempt <= maxScrolls; attempt++) {
17
+ let attempt = 1;
18
+ for (attempt; attempt <= maxScrolls; attempt++) {
18
19
  await (0, swipeMovement_js_1.executeSwipeMovement)(args.driver, direction);
20
+ await args.driver.pause(1000);
19
21
  const currentDom = await args.driver.getPageSource();
20
22
  if (currentDom === previousDom) {
21
23
  throw new Error("End of page reached. Stopping swipe.");
22
24
  }
23
25
  previousDom = currentDom;
24
- const result = await (0, domSearchHelper_js_1.findElementInDom)(args.driver, searchText);
26
+ const result = await (0, domSearchHelper_js_1.findElementInDom)(args.driver, searchText, attempt, currentDom);
25
27
  if (result) {
26
28
  discoveredXPath = result.xpath;
27
29
  found = true;
@@ -33,13 +35,8 @@ async function swipeDownToElement(args) {
33
35
  }
34
36
  args.scriptDataAppender.add(async () => ({
35
37
  nlpName: "MOB_SwipeDownToElement",
36
- stepInputs: [],
37
- elementsData: [{
38
- name: args.elementName || searchText,
39
- type: args.elementType,
40
- locators: [{ xpath: discoveredXPath }],
41
- platform: args.platform
42
- }]
38
+ stepInputs: ["xpath", discoveredXPath, attempt],
39
+ elementsData: []
43
40
  }));
44
41
  }
45
42
  catch (error) {
@@ -14,14 +14,16 @@ async function swipeLeftToElement(args) {
14
14
  let found = false;
15
15
  let discoveredXPath = "";
16
16
  let previousDom = "";
17
- for (let attempt = 1; attempt <= maxScrolls; attempt++) {
17
+ let attempt = 1;
18
+ for (attempt = 1; attempt <= maxScrolls; attempt++) {
18
19
  await (0, swipeMovement_js_1.executeSwipeMovement)(args.driver, direction);
20
+ await args.driver.pause(1000);
19
21
  const currentDom = await args.driver.getPageSource();
20
22
  if (currentDom === previousDom) {
21
23
  throw new Error("End of page reached. Stopping swipe.");
22
24
  }
23
25
  previousDom = currentDom;
24
- const result = await (0, domSearchHelper_js_1.findElementInDom)(args.driver, searchText);
26
+ const result = await (0, domSearchHelper_js_1.findElementInDom)(args.driver, searchText, attempt, currentDom);
25
27
  if (result) {
26
28
  discoveredXPath = result.xpath;
27
29
  found = true;
@@ -33,13 +35,8 @@ async function swipeLeftToElement(args) {
33
35
  }
34
36
  args.scriptDataAppender.add(async () => ({
35
37
  nlpName: "MOB_SwipeLeftToElement",
36
- stepInputs: [],
37
- elementsData: [{
38
- name: args.elementName || searchText,
39
- type: args.elementType,
40
- locators: [{ xpath: discoveredXPath }],
41
- platform: args.platform
42
- }]
38
+ stepInputs: ["xpath", discoveredXPath, attempt],
39
+ elementsData: []
43
40
  }));
44
41
  }
45
42
  catch (error) {
@@ -14,14 +14,16 @@ async function swipeRightToElement(args) {
14
14
  let found = false;
15
15
  let discoveredXPath = "";
16
16
  let previousDom = "";
17
- for (let attempt = 1; attempt <= maxScrolls; attempt++) {
17
+ let attempt = 1;
18
+ for (attempt; attempt <= maxScrolls; attempt++) {
18
19
  await (0, swipeMovement_js_1.executeSwipeMovement)(args.driver, direction);
20
+ await args.driver.pause(1000);
19
21
  const currentDom = await args.driver.getPageSource();
20
22
  if (currentDom === previousDom) {
21
23
  throw new Error("End of page reached. Stopping swipe.");
22
24
  }
23
25
  previousDom = currentDom;
24
- const result = await (0, domSearchHelper_js_1.findElementInDom)(args.driver, searchText);
26
+ const result = await (0, domSearchHelper_js_1.findElementInDom)(args.driver, searchText, attempt, currentDom);
25
27
  if (result) {
26
28
  discoveredXPath = result.xpath;
27
29
  found = true;
@@ -33,13 +35,8 @@ async function swipeRightToElement(args) {
33
35
  }
34
36
  args.scriptDataAppender.add(async () => ({
35
37
  nlpName: "MOB_SwipeRightToElement",
36
- stepInputs: [],
37
- elementsData: [{
38
- name: args.elementName || searchText,
39
- type: args.elementType,
40
- locators: [{ xpath: discoveredXPath }],
41
- platform: args.platform
42
- }]
38
+ stepInputs: ["xpath", discoveredXPath, attempt],
39
+ elementsData: []
43
40
  }));
44
41
  }
45
42
  catch (error) {