ff-automationv2 2.2.24 → 2.2.26
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/dist/ai/llmcalls/llmAction.js +2 -2
- package/dist/ai/llmprompts/systemPrompts/actionExtractorPrompt.js +2 -2
- package/dist/ai/llmprompts/systemPrompts/errorDescriptionPrompt.js +1 -1
- package/dist/ai/llmprompts/systemPrompts/fireflinkElementIndexExtactors.js +1 -1
- package/dist/ai/llmprompts/systemPrompts/fireflinkElementIndexExtractor_Mob.js +1 -1
- package/dist/ai/llmprompts/systemPrompts/getActionExtractorPrompt.js +3 -3
- package/dist/ai/llmprompts/systemPrompts/verifyActionExtractorPrompt.js +4 -2
- package/dist/ai/llmprompts/systemPrompts/visionPrompt.js +1 -0
- package/dist/automation/actions/executor.d.ts +3 -2
- package/dist/automation/actions/executor.js +14 -2
- package/dist/automation/actions/interaction/clear/clear.js +1 -1
- package/dist/automation/actions/interaction/clear/clearAndEnter.js +1 -1
- package/dist/automation/actions/interaction/click/click.js +1 -1
- package/dist/automation/actions/interaction/click/clickNtimes.js +1 -1
- package/dist/automation/actions/interaction/click/doubleClick.js +1 -1
- package/dist/automation/actions/interaction/click/waitAndClick.js +1 -1
- package/dist/automation/actions/interaction/dragAndDrop/dragAndDrop.js +1 -1
- package/dist/automation/actions/interaction/elementlessActions/isAppInstalled.js +1 -1
- package/dist/automation/actions/interaction/elementlessActions/openAppWithApkFilePath.js +3 -3
- package/dist/automation/actions/interaction/elementlessActions/uninstallAPK.js +1 -1
- package/dist/automation/actions/interaction/enterActions/EnterInputIntoElementFromClipBoardInterface_mob.js +1 -1
- package/dist/automation/actions/interaction/enterActions/enterInput.js +2 -2
- package/dist/automation/actions/interaction/enterActions/enterInputAndPress.js +1 -1
- package/dist/automation/actions/interaction/find/MOB_FindElement.js +2 -2
- package/dist/automation/actions/interaction/find/findElements.js +3 -4
- package/dist/automation/actions/interaction/get/MOB_GetHeightOfElement.js +1 -1
- package/dist/automation/actions/interaction/get/MOB_GetTextFromElementAndSetToClipBoard.js +1 -1
- package/dist/automation/actions/interaction/get/MOB_GetWidthOfElement.js +1 -1
- package/dist/automation/actions/interaction/get/getAttribute.js +1 -1
- package/dist/automation/actions/interaction/get/getListOfElementsFromLocatorTypeLocatorValue.js +1 -1
- package/dist/automation/actions/interaction/get/getLocation.js +1 -1
- package/dist/automation/actions/interaction/get/getRect.js +2 -2
- package/dist/automation/actions/interaction/get/getSize.js +1 -1
- package/dist/automation/actions/interaction/get/getSizeOfBrowserWindow.js +3 -0
- package/dist/automation/actions/interaction/get/getTagName.js +1 -1
- package/dist/automation/actions/interaction/get/getText.js +1 -1
- package/dist/automation/actions/interaction/get/getWidthOfWebElement.js +2 -0
- package/dist/automation/actions/interaction/get/getXLocationOfBrowserWindow.js +2 -0
- package/dist/automation/actions/interaction/get/getXLocationOfWebElement.js +1 -1
- package/dist/automation/actions/interaction/get/getYLocationOfWebElement.js +1 -1
- package/dist/automation/actions/interaction/inputlessActions/AirplaneModeSwitchOff.js +2 -2
- package/dist/automation/actions/interaction/inputlessActions/AirplaneModeSwitchOn.js +2 -2
- package/dist/automation/actions/interaction/inputlessActions/RestartCurrentDevice.js +1 -1
- package/dist/automation/actions/interaction/inputlessActions/SetEmulatorPowerStateOff.js +1 -1
- package/dist/automation/actions/interaction/inputlessActions/SetEmulatorPowerStateOn.js +1 -1
- package/dist/automation/actions/interaction/maximize/maximize.js +2 -2
- package/dist/automation/actions/interaction/pinch/PinchInByPercentMob.js +3 -3
- package/dist/automation/actions/interaction/pinch/PinchOutByPercentMob.js +1 -3
- package/dist/automation/actions/interaction/press/longPress.js +1 -1
- package/dist/automation/actions/interaction/press/pressHomeKey.js +1 -1
- package/dist/automation/actions/interaction/swipe/swipeDownToElement.js +6 -9
- package/dist/automation/actions/interaction/swipe/swipeLeftToElement.js +6 -9
- package/dist/automation/actions/interaction/swipe/swipeRightToElement.js +6 -9
- package/dist/automation/actions/interaction/swipe/swipeUpToElement.js +6 -9
- package/dist/automation/actions/interaction/swipe/swipeUpToElementForMWeb.js +5 -5
- package/dist/automation/actions/interaction/swipe/swipeUsingReferenceElement.js +71 -76
- package/dist/automation/actions/interaction/verify/VerifyAllOptionsAreDeSelected.js +1 -1
- package/dist/automation/actions/interaction/verify/VerifyCheckBoxIsNotSelected.js +2 -1
- package/dist/automation/actions/interaction/verify/VerifyElementIsClickable.js +1 -1
- package/dist/automation/actions/interaction/verify/VerifyElementIsDisabled.js +1 -1
- package/dist/automation/actions/interaction/verify/VerifyElementIsDisplayed.js +1 -1
- package/dist/automation/actions/interaction/verify/VerifyElementIsEnabled.js +1 -1
- package/dist/automation/actions/interaction/verify/VerifyElementIsSelected.js +1 -1
- package/dist/automation/actions/interaction/verify/VerifyElementNotContainsText.js +1 -1
- package/dist/automation/actions/interaction/verify/VerifyHeightOfWebElement.js +2 -2
- package/dist/automation/actions/interaction/verify/VerifyIfXAndYCoordinateOfElement.js +5 -5
- package/dist/automation/actions/interaction/verify/VerifyNumberOfElementsByTagName.js +1 -1
- package/dist/automation/actions/interaction/verify/VerifyNumberOfElementsByXpath.js +1 -1
- package/dist/automation/actions/interaction/verify/VerifyWidthOfElement.js +3 -3
- package/dist/automation/actions/interaction/verify/VerifyXLocationOfElement.js +3 -3
- package/dist/automation/actions/interaction/verify/VerifyYLocationOfElement.js +3 -3
- package/dist/automation/actions/interaction/verify/verifypartialtext.js +1 -1
- package/dist/automation/actions/interaction/verify/verifytext.js +1 -1
- package/dist/automation/actions/interaction/wait/MOB_WaitTillAttributeOfElementContainsString.js +1 -1
- package/dist/automation/actions/interaction/wait/MOB_WaitTillElementIsEnabled.js +1 -1
- package/dist/automation/actions/interaction/wait/MOB_WaitTillElementIsInvisible.js +1 -1
- package/dist/automation/actions/interaction/wait/MOB_WaitTillElementIsSelected.js +1 -1
- package/dist/automation/actions/interaction/wait/MOB_WaitTillElementIsVisible.js +1 -1
- package/dist/automation/actions/interaction/wait/MOB_WaitTillStalenessOfElement.js +1 -1
- package/dist/automation/actions/interface/InputlessActionnterface.d.ts +5 -0
- package/dist/automation/actions/interface/elementlessInterface.d.ts +3 -0
- package/dist/automation/actions/interface/interactionActionInterface.d.ts +1 -0
- package/dist/automation/actions/interface/pressActionInterface.d.ts +1 -0
- package/dist/automation/actions/interface/verifyActionInterface.d.ts +1 -0
- package/dist/automation/mobileSession/initiateMobileSession.d.ts +2 -1
- package/dist/automation/mobileSession/initiateMobileSession.js +7 -4
- package/dist/core/constants/allAction.js +1 -0
- package/dist/core/constants/supportedActions.js +29 -2
- package/dist/core/interfaces/actionInterface.d.ts +1 -1
- package/dist/core/interfaces/executionDetails.d.ts +1 -0
- package/dist/core/interfaces/llmConfigurationInterface.d.ts +1 -1
- package/dist/core/main/actionHandlerFactory.js +8 -5
- package/dist/core/main/executionContext.d.ts +1 -0
- package/dist/core/main/executionContext.js +2 -1
- package/dist/core/main/runAutomationScript.js +21 -21
- package/dist/imageAnalysisMobile/annotatedScreenshotMobile.js +1 -1
- package/dist/imageAnalysisWeb/annotateScreenshot.js +1 -1
- package/dist/llmConfig/llmConfiguration.d.ts +1 -2
- package/dist/llmConfig/llmConfiguration.js +15 -13
- package/dist/tests/test1.d.ts +1 -7
- package/dist/tests/test1.js +29 -11
- package/dist/tests/test12.d.ts +0 -1
- package/dist/tests/test12.js +73 -72
- package/dist/tests/testkaf.d.ts +1 -0
- package/dist/tests/testkaf.js +56 -0
- package/dist/tests/testwe.d.ts +1 -0
- package/dist/tests/testwe.js +24 -0
- package/dist/utils/DomExtraction/jsForAttributeInjection.d.ts +1 -1
- package/dist/utils/DomExtraction/jsForAttributeInjection.js +11 -7
- package/dist/utils/InstancesDetails/getInstancesInfo.js +2 -1
- package/dist/utils/swipe/domSearchHelper.d.ts +1 -1
- package/dist/utils/swipe/domSearchHelper.js +45 -21
- package/package.json +5 -4
|
@@ -19,7 +19,7 @@ class llmAction {
|
|
|
19
19
|
baseURL: baseURL,
|
|
20
20
|
});
|
|
21
21
|
this.visionClient = new openai_1.default({
|
|
22
|
-
apiKey: (0, decodeApiKey_js_1.decodeApiKey)(this.visionApiKey),
|
|
22
|
+
apiKey: (0, decodeApiKey_js_1.decodeApiKey)(this.visionApiKey ?? apiKey),
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
async getLLMResponse(platform, type, args, userInput) {
|
|
@@ -92,7 +92,7 @@ class llmAction {
|
|
|
92
92
|
return response;
|
|
93
93
|
}
|
|
94
94
|
catch (error) {
|
|
95
|
-
logData_js_1.logger.error(`Vision LLM Error Attempt ${attempt}
|
|
95
|
+
logData_js_1.logger.error(`Vision LLM Error Attempt ${attempt}:`);
|
|
96
96
|
const structuredError = this.handleKnownErrors(error);
|
|
97
97
|
if (structuredError)
|
|
98
98
|
return structuredError;
|
|
@@ -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
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
|
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,
|
|
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,
|
|
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.
|
|
@@ -7,7 +7,8 @@ export declare class ActionExecutor implements IActionExecutor {
|
|
|
7
7
|
private scriptDataAppender;
|
|
8
8
|
private elementGetter;
|
|
9
9
|
private platform;
|
|
10
|
-
|
|
10
|
+
private adbPath;
|
|
11
|
+
constructor(driver: WebdriverIO.Browser, scriptDataAppender: ScriptDataAppender, elementGetter: ElementGetter, platform: string, adbPath: string);
|
|
11
12
|
navigate(url: string): Promise<void>;
|
|
12
13
|
goBack(): Promise<void>;
|
|
13
14
|
refresh(): Promise<void>;
|
|
@@ -224,7 +225,7 @@ export declare class ActionExecutor implements IActionExecutor {
|
|
|
224
225
|
VerifyBrowserWindowTitleContainsString(value: string): Promise<void>;
|
|
225
226
|
VerifyBrowserWindowUrlIsString(value: string): Promise<void>;
|
|
226
227
|
VerifyBrowserWindowUrlContainsExpectedUrl(value: string): Promise<void>;
|
|
227
|
-
VerifyCheckBoxIsNotSelected(pageDOM: string, selector: string, fireflinkIndex: string, elementName: string, elementType: string): Promise<void>;
|
|
228
|
+
VerifyCheckBoxIsNotSelected(pageDOM: string, selector: string, value: string, fireflinkIndex: string, elementName: string, elementType: string): Promise<void>;
|
|
228
229
|
VerifyCheckBoxIsSelected(pageDOM: string, selector: string, fireflinkIndex: string, elementName: string, elementType: string): Promise<void>;
|
|
229
230
|
VerifyBrowserWindowTitleIsString(value: string): Promise<void>;
|
|
230
231
|
VerifyIfBrowserWindowIsClosed(): Promise<void>;
|
|
@@ -354,11 +354,12 @@ const mobPressBackSpaceKey_js_1 = require("./interaction/press/mobPressBackSpace
|
|
|
354
354
|
const mobPressSpaceKey_js_1 = require("./interaction/press/mobPressSpaceKey.js");
|
|
355
355
|
const MOB_FindElement_js_1 = require("./interaction/find/MOB_FindElement.js");
|
|
356
356
|
class ActionExecutor {
|
|
357
|
-
constructor(driver, scriptDataAppender, elementGetter, platform) {
|
|
357
|
+
constructor(driver, scriptDataAppender, elementGetter, platform, adbPath) {
|
|
358
358
|
this.driver = driver;
|
|
359
359
|
this.scriptDataAppender = scriptDataAppender;
|
|
360
360
|
this.elementGetter = elementGetter;
|
|
361
361
|
this.platform = platform;
|
|
362
|
+
this.adbPath = adbPath;
|
|
362
363
|
}
|
|
363
364
|
async navigate(url) {
|
|
364
365
|
try {
|
|
@@ -550,6 +551,7 @@ class ActionExecutor {
|
|
|
550
551
|
driver: this.driver,
|
|
551
552
|
selector: selector,
|
|
552
553
|
value,
|
|
554
|
+
adbPath: this.adbPath,
|
|
553
555
|
scriptDataAppender: this.scriptDataAppender,
|
|
554
556
|
elementGetter: this.elementGetter,
|
|
555
557
|
fireflinkIndex,
|
|
@@ -3822,11 +3824,12 @@ class ActionExecutor {
|
|
|
3822
3824
|
throw error;
|
|
3823
3825
|
}
|
|
3824
3826
|
}
|
|
3825
|
-
async VerifyCheckBoxIsNotSelected(pageDOM, selector, fireflinkIndex, elementName, elementType) {
|
|
3827
|
+
async VerifyCheckBoxIsNotSelected(pageDOM, selector, value, fireflinkIndex, elementName, elementType) {
|
|
3826
3828
|
try {
|
|
3827
3829
|
await (0, VerifyCheckBoxIsNotSelected_js_1.verifyCheckboxIsNotSelected)({
|
|
3828
3830
|
driver: this.driver,
|
|
3829
3831
|
selector: selector,
|
|
3832
|
+
value: value,
|
|
3830
3833
|
scriptDataAppender: this.scriptDataAppender,
|
|
3831
3834
|
elementGetter: this.elementGetter,
|
|
3832
3835
|
fireflinkIndex,
|
|
@@ -4486,6 +4489,7 @@ class ActionExecutor {
|
|
|
4486
4489
|
try {
|
|
4487
4490
|
await (0, AirplaneModeSwitchOff_js_1.AirplaneModeSwitchOff)({
|
|
4488
4491
|
driver: this.driver,
|
|
4492
|
+
adbPath: this.adbPath,
|
|
4489
4493
|
scriptDataAppender: this.scriptDataAppender,
|
|
4490
4494
|
platform: this.platform
|
|
4491
4495
|
});
|
|
@@ -4499,6 +4503,7 @@ class ActionExecutor {
|
|
|
4499
4503
|
try {
|
|
4500
4504
|
await (0, AirplaneModeSwitchOn_js_1.AirplaneModeSwitchOn)({
|
|
4501
4505
|
driver: this.driver,
|
|
4506
|
+
adbPath: this.adbPath,
|
|
4502
4507
|
scriptDataAppender: this.scriptDataAppender,
|
|
4503
4508
|
platform: this.platform
|
|
4504
4509
|
});
|
|
@@ -4616,6 +4621,7 @@ class ActionExecutor {
|
|
|
4616
4621
|
try {
|
|
4617
4622
|
await (0, RestartCurrentDevice_js_1.RestartCurrentDevice)({
|
|
4618
4623
|
driver: this.driver,
|
|
4624
|
+
adbPath: this.adbPath,
|
|
4619
4625
|
scriptDataAppender: this.scriptDataAppender,
|
|
4620
4626
|
platform: this.platform
|
|
4621
4627
|
});
|
|
@@ -4655,6 +4661,7 @@ class ActionExecutor {
|
|
|
4655
4661
|
try {
|
|
4656
4662
|
await (0, SetEmulatorPowerStateOff_js_1.SetEmulatorPowerStateOff)({
|
|
4657
4663
|
driver: this.driver,
|
|
4664
|
+
adbPath: this.adbPath,
|
|
4658
4665
|
scriptDataAppender: this.scriptDataAppender,
|
|
4659
4666
|
platform: this.platform
|
|
4660
4667
|
});
|
|
@@ -4668,6 +4675,7 @@ class ActionExecutor {
|
|
|
4668
4675
|
try {
|
|
4669
4676
|
await (0, SetEmulatorPowerStateOn_js_1.SetEmulatorPowerStateOn)({
|
|
4670
4677
|
driver: this.driver,
|
|
4678
|
+
adbPath: this.adbPath,
|
|
4671
4679
|
scriptDataAppender: this.scriptDataAppender,
|
|
4672
4680
|
platform: this.platform
|
|
4673
4681
|
});
|
|
@@ -4707,6 +4715,7 @@ class ActionExecutor {
|
|
|
4707
4715
|
try {
|
|
4708
4716
|
await (0, pressHomeKey_js_1.PressHomeKey)({
|
|
4709
4717
|
driver: this.driver,
|
|
4718
|
+
adbPath: this.adbPath,
|
|
4710
4719
|
scriptDataAppender: this.scriptDataAppender,
|
|
4711
4720
|
platform: this.platform
|
|
4712
4721
|
});
|
|
@@ -4749,6 +4758,7 @@ class ActionExecutor {
|
|
|
4749
4758
|
await (0, isAppInstalled_js_1.IsAppInstalled)({
|
|
4750
4759
|
driver: this.driver,
|
|
4751
4760
|
value,
|
|
4761
|
+
adbPath: this.adbPath,
|
|
4752
4762
|
scriptDataAppender: this.scriptDataAppender,
|
|
4753
4763
|
platform: this.platform
|
|
4754
4764
|
});
|
|
@@ -4777,6 +4787,7 @@ class ActionExecutor {
|
|
|
4777
4787
|
await (0, uninstallAPK_js_1.UninstallAPK)({
|
|
4778
4788
|
driver: this.driver,
|
|
4779
4789
|
value,
|
|
4790
|
+
adbPath: this.adbPath,
|
|
4780
4791
|
scriptDataAppender: this.scriptDataAppender,
|
|
4781
4792
|
platform: this.platform
|
|
4782
4793
|
});
|
|
@@ -4819,6 +4830,7 @@ class ActionExecutor {
|
|
|
4819
4830
|
await (0, openAppWithApkFilePath_js_1.OpenAppWithApkFilePath)({
|
|
4820
4831
|
driver: this.driver,
|
|
4821
4832
|
value,
|
|
4833
|
+
adbPath: this.adbPath,
|
|
4822
4834
|
scriptDataAppender: this.scriptDataAppender,
|
|
4823
4835
|
platform: this.platform
|
|
4824
4836
|
});
|
|
@@ -16,7 +16,7 @@ async function IsAppInstalled(args) {
|
|
|
16
16
|
}
|
|
17
17
|
if (!isInstalled) {
|
|
18
18
|
const udid = args.driver.capabilities["appium:udid"] || args.driver.capabilities.udid;
|
|
19
|
-
const cmdPrefix = udid ?
|
|
19
|
+
const cmdPrefix = udid ? `${args.adbPath} -s ${udid} shell` : `${args.adbPath} shell`;
|
|
20
20
|
const result = (0, child_process_1.execSync)(`${cmdPrefix} pm list packages`).toString().toLowerCase();
|
|
21
21
|
if (result.includes(target.toLowerCase())) {
|
|
22
22
|
isInstalled = true;
|
|
@@ -8,7 +8,7 @@ const logData_js_1 = require("../../../../utils/logger/logData.js");
|
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const child_process_1 = require("child_process");
|
|
10
10
|
const path_1 = __importDefault(require("path"));
|
|
11
|
-
function getLatestInstalledPackage(apkPath) {
|
|
11
|
+
function getLatestInstalledPackage(apkPath, adbPath) {
|
|
12
12
|
// ✅ Step 1: Extract APK name
|
|
13
13
|
const apkName = path_1.default.basename(apkPath, ".apk").toLowerCase();
|
|
14
14
|
// Example:
|
|
@@ -16,7 +16,7 @@ function getLatestInstalledPackage(apkPath) {
|
|
|
16
16
|
// Normalize name (remove special chars)
|
|
17
17
|
const normalizedApkName = apkName.replace(/[^a-z0-9]/g, "");
|
|
18
18
|
// ✅ Step 2: Get installed packages (3rd party only)
|
|
19
|
-
const output = (0, child_process_1.execSync)(
|
|
19
|
+
const output = (0, child_process_1.execSync)(`${adbPath} shell pm list packages -3`, {
|
|
20
20
|
maxBuffer: 1024 * 1024 * 5
|
|
21
21
|
}).toString();
|
|
22
22
|
const packages = output
|
|
@@ -80,7 +80,7 @@ async function OpenAppWithApkFilePath(args) {
|
|
|
80
80
|
throw new Error(`Could not find or install APK: ${apkPath}`);
|
|
81
81
|
}
|
|
82
82
|
// ✅ Step 5: Launch app
|
|
83
|
-
const appPackage = await getLatestInstalledPackage(apkPath);
|
|
83
|
+
const appPackage = await getLatestInstalledPackage(apkPath, args.adbPath);
|
|
84
84
|
logData_js_1.logger.info(`Launching app: ${appPackage}`);
|
|
85
85
|
await args.driver.activateApp(appPackage);
|
|
86
86
|
// ✅ Script logging
|
|
@@ -19,7 +19,7 @@ async function UninstallAPK(args) {
|
|
|
19
19
|
}
|
|
20
20
|
if (!uninstalled) {
|
|
21
21
|
const udid = args.driver.capabilities["appium:udid"] || args.driver.capabilities.udid;
|
|
22
|
-
const cmdPrefix = udid ?
|
|
22
|
+
const cmdPrefix = udid ? `${args.adbPath} -s ${udid} shell` : `${args.adbPath} shell`;
|
|
23
23
|
const packagesResult = (0, child_process_1.execSync)(`${cmdPrefix} pm list packages`).toString().toLowerCase();
|
|
24
24
|
for (const line of packagesResult.split(/\r?\n/)) {
|
|
25
25
|
if (line.includes(target.toLowerCase())) {
|
|
@@ -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
|
};
|
|
@@ -45,7 +45,7 @@ async function enterInput(args) {
|
|
|
45
45
|
const text = await element.getAttribute("text");
|
|
46
46
|
if (text !== args.value) {
|
|
47
47
|
const { execSync } = await Promise.resolve().then(() => __importStar(require("child_process")));
|
|
48
|
-
execSync(
|
|
48
|
+
execSync(`${args.adbPath} shell input text ${args.value}`);
|
|
49
49
|
}
|
|
50
50
|
args.scriptDataAppender.add(async () => {
|
|
51
51
|
return {
|
|
@@ -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
|
};
|
|
@@ -23,10 +23,9 @@ async function findElements(args) {
|
|
|
23
23
|
elementsData: [{
|
|
24
24
|
name: args.elementName,
|
|
25
25
|
type: args.elementType,
|
|
26
|
-
locators: [
|
|
27
|
-
|
|
28
|
-
|
|
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
|
};
|
package/dist/automation/actions/interaction/get/getListOfElementsFromLocatorTypeLocatorValue.js
CHANGED
|
@@ -22,7 +22,7 @@ const getListOfElementsFromLocatorTypeLocatorValue = async (args) => {
|
|
|
22
22
|
finalSelector = locatorValue;
|
|
23
23
|
break;
|
|
24
24
|
case "xpath":
|
|
25
|
-
finalSelector =
|
|
25
|
+
finalSelector = locatorValue;
|
|
26
26
|
break;
|
|
27
27
|
case "name":
|
|
28
28
|
finalSelector = `[name="${locatorValue}"]`;
|
|
@@ -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
|
};
|
|
@@ -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: [],
|
|
@@ -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
|
};
|
|
@@ -7,8 +7,8 @@ async function AirplaneModeSwitchOff(args) {
|
|
|
7
7
|
try {
|
|
8
8
|
const udid = args.driver.capabilities["appium:udid"] || args.driver.capabilities.udid;
|
|
9
9
|
const cmdPrefix = udid
|
|
10
|
-
?
|
|
11
|
-
:
|
|
10
|
+
? `${args.adbPath} -s ${udid} shell`
|
|
11
|
+
: `${args.adbPath} shell`;
|
|
12
12
|
logData_js_1.logger.info("Attempting ADB fallback for AIRPLANE MODE OFF...");
|
|
13
13
|
// Android 10+
|
|
14
14
|
(0, child_process_1.execSync)(`${cmdPrefix} cmd connectivity airplane-mode disable`);
|