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
|
@@ -5,7 +5,7 @@ const logData_js_1 = require("../../../../utils/logger/logData.js");
|
|
|
5
5
|
async function verifyNumberOfElementsByXpath(args) {
|
|
6
6
|
try {
|
|
7
7
|
const parts = args.value.split(",");
|
|
8
|
-
const xpath = parts[0].trim();
|
|
8
|
+
const xpath = parts[0].trim().replace(/^['"]|['"]$/g, "");
|
|
9
9
|
const expectedCount = parseInt(parts[1], 10);
|
|
10
10
|
let elements;
|
|
11
11
|
try {
|
|
@@ -7,7 +7,7 @@ async function verifyWidthOfElement(args) {
|
|
|
7
7
|
case "android":
|
|
8
8
|
try {
|
|
9
9
|
const element = await args.driver.$(args.selector);
|
|
10
|
-
const expectedWidth =
|
|
10
|
+
const expectedWidth = Number(args.value);
|
|
11
11
|
const size = await element.getSize();
|
|
12
12
|
const isMatched = size.width === expectedWidth;
|
|
13
13
|
logData_js_1.logger.info("Width verification result:", {
|
|
@@ -25,7 +25,7 @@ async function verifyWidthOfElement(args) {
|
|
|
25
25
|
elementsData: [{
|
|
26
26
|
name: args.elementName,
|
|
27
27
|
type: args.elementType,
|
|
28
|
-
locators: [{ "xpath": args.selector }],
|
|
28
|
+
locators: [{ "name": "xpath", "value": args.selector }],
|
|
29
29
|
platform: args.platform
|
|
30
30
|
}]
|
|
31
31
|
};
|
|
@@ -40,7 +40,7 @@ async function verifyWidthOfElement(args) {
|
|
|
40
40
|
default:
|
|
41
41
|
try {
|
|
42
42
|
const element = await args.driver.$(args.selector);
|
|
43
|
-
const expectedWidth =
|
|
43
|
+
const expectedWidth = Number(args.value);
|
|
44
44
|
const size = await element.getSize();
|
|
45
45
|
const isMatched = size.width === expectedWidth;
|
|
46
46
|
logData_js_1.logger.info("Width verification result:", {
|
|
@@ -7,7 +7,7 @@ async function verifyXLocationOfElement(args) {
|
|
|
7
7
|
case "android":
|
|
8
8
|
try {
|
|
9
9
|
const element = await args.driver.$(args.selector);
|
|
10
|
-
const expectedX =
|
|
10
|
+
const expectedX = Number(args.value);
|
|
11
11
|
const location = await element.getLocation();
|
|
12
12
|
const isMatched = location.x === expectedX;
|
|
13
13
|
logData_js_1.logger.info("X location verification result:", {
|
|
@@ -25,7 +25,7 @@ async function verifyXLocationOfElement(args) {
|
|
|
25
25
|
elementsData: [{
|
|
26
26
|
name: args.elementName,
|
|
27
27
|
type: args.elementType,
|
|
28
|
-
locators: [{ "xpath": args.selector }],
|
|
28
|
+
locators: [{ "name": "xpath", "value": args.selector }],
|
|
29
29
|
platform: args.platform
|
|
30
30
|
}]
|
|
31
31
|
};
|
|
@@ -40,7 +40,7 @@ async function verifyXLocationOfElement(args) {
|
|
|
40
40
|
default:
|
|
41
41
|
try {
|
|
42
42
|
const element = await args.driver.$(args.selector);
|
|
43
|
-
const expectedX =
|
|
43
|
+
const expectedX = Number(args.value);
|
|
44
44
|
const location = await element.getLocation();
|
|
45
45
|
const isMatched = location.x === expectedX;
|
|
46
46
|
logData_js_1.logger.info("X location verification result:", {
|
|
@@ -7,7 +7,7 @@ async function verifyYLocationOfElement(args) {
|
|
|
7
7
|
case "android":
|
|
8
8
|
try {
|
|
9
9
|
const element = await args.driver.$(args.selector);
|
|
10
|
-
const expectedY =
|
|
10
|
+
const expectedY = Number(args.value);
|
|
11
11
|
const location = await element.getLocation();
|
|
12
12
|
const isMatched = location.y === expectedY;
|
|
13
13
|
logData_js_1.logger.info("Y location verification result:", {
|
|
@@ -22,7 +22,7 @@ async function verifyYLocationOfElement(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
|
};
|
|
@@ -37,7 +37,7 @@ async function verifyYLocationOfElement(args) {
|
|
|
37
37
|
default:
|
|
38
38
|
try {
|
|
39
39
|
const element = await args.driver.$(args.selector);
|
|
40
|
-
const expectedY =
|
|
40
|
+
const expectedY = Number(args.value);
|
|
41
41
|
const location = await element.getLocation();
|
|
42
42
|
const isMatched = location.y === expectedY;
|
|
43
43
|
logData_js_1.logger.info("Y location verification result:", {
|
package/dist/automation/actions/interaction/wait/MOB_WaitTillAttributeOfElementContainsString.js
CHANGED
|
@@ -17,7 +17,7 @@ const MOB_WaitTillAttributeOfElementContainsString = 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
|
};
|
|
@@ -12,7 +12,7 @@ const MOB_WaitTillElementIsEnabled = async (args) => {
|
|
|
12
12
|
elementsData: [{
|
|
13
13
|
name: args.elementName,
|
|
14
14
|
type: args.elementType,
|
|
15
|
-
locators: [{ "xpath": args.selector }],
|
|
15
|
+
locators: [{ "name": "xpath", "value": args.selector }],
|
|
16
16
|
platform: args.platform
|
|
17
17
|
}]
|
|
18
18
|
};
|
|
@@ -12,7 +12,7 @@ const MOB_WaitTillElementIsInvisible = async (args) => {
|
|
|
12
12
|
elementsData: [{
|
|
13
13
|
name: args.elementName,
|
|
14
14
|
type: args.elementType,
|
|
15
|
-
locators: [{ "xpath": args.selector }],
|
|
15
|
+
locators: [{ "name": "xpath", "value": args.selector }],
|
|
16
16
|
platform: args.platform
|
|
17
17
|
}]
|
|
18
18
|
};
|
|
@@ -12,7 +12,7 @@ const MOB_WaitTillElementIsSelected = async (args) => {
|
|
|
12
12
|
elementsData: [{
|
|
13
13
|
name: args.elementName,
|
|
14
14
|
type: args.elementType,
|
|
15
|
-
locators: [{ "xpath": args.selector }],
|
|
15
|
+
locators: [{ "name": "xpath", "value": args.selector }],
|
|
16
16
|
platform: args.platform
|
|
17
17
|
}]
|
|
18
18
|
};
|
|
@@ -12,7 +12,7 @@ const MOB_WaitTillElementIsVisible = async (args) => {
|
|
|
12
12
|
elementsData: [{
|
|
13
13
|
name: args.elementName,
|
|
14
14
|
type: args.elementType,
|
|
15
|
-
locators: [{ "xpath": args.selector }],
|
|
15
|
+
locators: [{ "name": "xpath", "value": args.selector }],
|
|
16
16
|
platform: args.platform
|
|
17
17
|
}]
|
|
18
18
|
};
|
|
@@ -12,7 +12,7 @@ const MOB_WaitTillStalenessOfElement = async (args) => {
|
|
|
12
12
|
elementsData: [{
|
|
13
13
|
name: args.elementName,
|
|
14
14
|
type: args.elementType,
|
|
15
|
-
locators: [{ "xpath": args.selector }],
|
|
15
|
+
locators: [{ "name": "xpath", "value": args.selector }],
|
|
16
16
|
platform: args.platform
|
|
17
17
|
}]
|
|
18
18
|
};
|
|
@@ -18,6 +18,7 @@ export interface MOB_SetEmulatorPowerStateOffInterface {
|
|
|
18
18
|
driver: WebdriverIO.Browser;
|
|
19
19
|
scriptDataAppender: ScriptDataAppender;
|
|
20
20
|
platform: string;
|
|
21
|
+
adbPath?: string;
|
|
21
22
|
}
|
|
22
23
|
export interface MOB_OpenChromeBrowserInterface {
|
|
23
24
|
driver: WebdriverIO.Browser;
|
|
@@ -38,11 +39,13 @@ export interface MOB_SetEmulatorPowerStateOnInterface {
|
|
|
38
39
|
driver: WebdriverIO.Browser;
|
|
39
40
|
scriptDataAppender: ScriptDataAppender;
|
|
40
41
|
platform: string;
|
|
42
|
+
adbPath?: string;
|
|
41
43
|
}
|
|
42
44
|
export interface MOB_AirplaneModeSwitchOnInterface {
|
|
43
45
|
driver: WebdriverIO.Browser;
|
|
44
46
|
scriptDataAppender: ScriptDataAppender;
|
|
45
47
|
platform: string;
|
|
48
|
+
adbPath?: string;
|
|
46
49
|
}
|
|
47
50
|
export interface MOB_LockDeviceInterface {
|
|
48
51
|
driver: WebdriverIO.Browser;
|
|
@@ -78,11 +81,13 @@ export interface MOB_RestartCurrentDeviceInterface {
|
|
|
78
81
|
driver: WebdriverIO.Browser;
|
|
79
82
|
scriptDataAppender: ScriptDataAppender;
|
|
80
83
|
platform: string;
|
|
84
|
+
adbPath?: string;
|
|
81
85
|
}
|
|
82
86
|
export interface MOB_AirplaneModeSwitchOffInterface {
|
|
83
87
|
driver: WebdriverIO.Browser;
|
|
84
88
|
scriptDataAppender: ScriptDataAppender;
|
|
85
89
|
platform: string;
|
|
90
|
+
adbPath?: string;
|
|
86
91
|
}
|
|
87
92
|
export interface BreakInterface {
|
|
88
93
|
driver: WebdriverIO.Browser;
|
|
@@ -16,6 +16,7 @@ export interface MOB_IsAppInstalledInterface {
|
|
|
16
16
|
scriptDataAppender: ScriptDataAppender;
|
|
17
17
|
platform: string;
|
|
18
18
|
value: string;
|
|
19
|
+
adbPath?: string;
|
|
19
20
|
}
|
|
20
21
|
export interface MOB_ReceiveMessageOnEmulatorInterface {
|
|
21
22
|
driver: WebdriverIO.Browser;
|
|
@@ -28,6 +29,7 @@ export interface MOB_UninstallAPKInterface {
|
|
|
28
29
|
scriptDataAppender: ScriptDataAppender;
|
|
29
30
|
platform: string;
|
|
30
31
|
value: string;
|
|
32
|
+
adbPath?: string;
|
|
31
33
|
}
|
|
32
34
|
export interface MOB_InstallAPKInterface {
|
|
33
35
|
driver: WebdriverIO.Browser;
|
|
@@ -46,6 +48,7 @@ export interface MOB_OpenAppWithApkFilePathInterface {
|
|
|
46
48
|
scriptDataAppender: ScriptDataAppender;
|
|
47
49
|
platform: string;
|
|
48
50
|
value: string;
|
|
51
|
+
adbPath?: string;
|
|
49
52
|
}
|
|
50
53
|
export interface MOB_ActivateAppUsingAppPackageInterface {
|
|
51
54
|
driver: WebdriverIO.Browser;
|
|
@@ -23,7 +23,8 @@ export declare class MobileSession {
|
|
|
23
23
|
private currentAppPackage;
|
|
24
24
|
private cloudSessionInstances;
|
|
25
25
|
private isCloud;
|
|
26
|
-
|
|
26
|
+
private adbPath;
|
|
27
|
+
constructor(appiumPort: number, isCloud: boolean | undefined, capabilities: Record<string, string | boolean> | undefined, CloudConfig: CloudConfig | undefined, adbPath: string | undefined);
|
|
27
28
|
private openApp;
|
|
28
29
|
open(arg: {
|
|
29
30
|
capabilities: IMobileCapabilities;
|
|
@@ -6,12 +6,13 @@ const child_process_1 = require("child_process");
|
|
|
6
6
|
const logData_js_1 = require("../../utils/logger/logData.js");
|
|
7
7
|
const initiateCloudSession_js_1 = require("../cloudSession/initiateCloudSession.js");
|
|
8
8
|
class MobileSession {
|
|
9
|
-
constructor(appiumPort, isCloud, capabilities, CloudConfig) {
|
|
9
|
+
constructor(appiumPort, isCloud, capabilities, CloudConfig, adbPath) {
|
|
10
10
|
this.driver = null;
|
|
11
11
|
this.currentAppPackage = "";
|
|
12
12
|
this.appiumPort = appiumPort;
|
|
13
13
|
this.isCloud = isCloud;
|
|
14
14
|
this.cloudSessionInstances = new initiateCloudSession_js_1.CloudSession(capabilities, CloudConfig);
|
|
15
|
+
this.adbPath = adbPath;
|
|
15
16
|
}
|
|
16
17
|
async openApp(arg) {
|
|
17
18
|
try {
|
|
@@ -42,8 +43,9 @@ class MobileSession {
|
|
|
42
43
|
throw new Error("Appium server is not running or unreachable.", { cause: error });
|
|
43
44
|
}
|
|
44
45
|
try {
|
|
45
|
-
|
|
46
|
-
await (0, child_process_1.execSync)(
|
|
46
|
+
logData_js_1.logger.info(this.adbPath);
|
|
47
|
+
await (0, child_process_1.execSync)(`${this.adbPath} -s ${arg.capabilities["appium:udid"]} shell pm clear ${appPackage}`).toString();
|
|
48
|
+
await (0, child_process_1.execSync)(`${this.adbPath} -s ${arg.capabilities["appium:udid"]} shell am start -n ${appPackage}/${appActivity}`).toString();
|
|
47
49
|
}
|
|
48
50
|
catch (error) {
|
|
49
51
|
const output = error.stderr?.toString() || error.message || "";
|
|
@@ -55,9 +57,10 @@ class MobileSession {
|
|
|
55
57
|
}
|
|
56
58
|
throw new Error(`ADB execution failed: ${output}`, { cause: error });
|
|
57
59
|
}
|
|
60
|
+
const startTime = Date.now();
|
|
58
61
|
this.driver = this.isCloud
|
|
59
62
|
? await this.cloudSessionInstances.initialize() : await this.openApp({ capabilities: arg.capabilities });
|
|
60
|
-
logData_js_1.logger.info(`Application
|
|
63
|
+
logData_js_1.logger.info(`Application started ',total time taken: ${Date.now() - startTime} ms`);
|
|
61
64
|
}
|
|
62
65
|
async close() {
|
|
63
66
|
if (this.driver) {
|
|
@@ -4,7 +4,7 @@ exports.ELEMENTLESS_ACTION = exports.INPUTLESS_ACTIONS = void 0;
|
|
|
4
4
|
exports.INPUTLESS_ACTIONS = [
|
|
5
5
|
"open",
|
|
6
6
|
"openApp",
|
|
7
|
-
"
|
|
7
|
+
"navigateBack",
|
|
8
8
|
"refresh",
|
|
9
9
|
"navigate",
|
|
10
10
|
"maximize",
|
|
@@ -187,5 +187,32 @@ exports.ELEMENTLESS_ACTION = [
|
|
|
187
187
|
"VerifyTitleOfCurrentPage",
|
|
188
188
|
"VerifyAllBrowserWindowsClosed",
|
|
189
189
|
"VerifyHexCodeForGivenXYCoordinates",
|
|
190
|
-
"VerifyIfXAndYCoordinateOfElement"
|
|
190
|
+
"VerifyIfXAndYCoordinateOfElement",
|
|
191
|
+
"GetSystemProperty",
|
|
192
|
+
"GetValueOfSystemVariable",
|
|
193
|
+
"GetStringDataFromLocalFile",
|
|
194
|
+
"GetValueFromXmlPath",
|
|
195
|
+
"GetAllBrokenImages",
|
|
196
|
+
"GetAllBrokenLinkCount",
|
|
197
|
+
"GetAllBrokenLinks",
|
|
198
|
+
"GetBestPracticesScore",
|
|
199
|
+
"GetCapabilityNames",
|
|
200
|
+
"GetCollectiveApiResponseTime",
|
|
201
|
+
"GetCollectiveApiStatusCode",
|
|
202
|
+
"GetDataFromApiRequestHeaderForJsonPath",
|
|
203
|
+
"GetDataFromApiResponseForJsonPath",
|
|
204
|
+
"GetDateWithGivenFormat",
|
|
205
|
+
"GetListOfElementsFromLocatorTypeLocatorValue",
|
|
206
|
+
"GetNumberOfBrokenImages",
|
|
207
|
+
"GetPwaScore",
|
|
208
|
+
"GetSeoScore",
|
|
209
|
+
"GetSingleApiRequestPayload",
|
|
210
|
+
"GetSingleApiResponse",
|
|
211
|
+
"GetSingleApiResponseTime",
|
|
212
|
+
"GetSingleApiStatusCode",
|
|
213
|
+
"GetTextPresentOnAlertPopup",
|
|
214
|
+
"GetTunnelIdentifier",
|
|
215
|
+
"GetValueByCookieName",
|
|
216
|
+
"GetValueFromLocalStorage",
|
|
217
|
+
"GetWorkingLinksFromCurrentPage",
|
|
191
218
|
];
|
|
@@ -140,7 +140,7 @@ export interface IActionExecutor {
|
|
|
140
140
|
VerifyBrowserWindowTitleContainsString(value: string, platform: string): Promise<void>;
|
|
141
141
|
VerifyBrowserWindowUrlIsString(value: string, platform: string): Promise<void>;
|
|
142
142
|
VerifyBrowserWindowUrlContainsExpectedUrl(value: string, platform: string): Promise<void>;
|
|
143
|
-
VerifyCheckBoxIsNotSelected(pageDOM: string, selector: string, fireflinkIndex: string, elementName: string, elementType: string, platform: string): Promise<void>;
|
|
143
|
+
VerifyCheckBoxIsNotSelected(pageDOM: string, selector: string, value: string, fireflinkIndex: string, elementName: string, elementType: string, platform: string): Promise<void>;
|
|
144
144
|
VerifyCheckBoxIsSelected(pageDOM: string, selector: string, fireflinkIndex: string, elementName: string, elementType: string, platform: string): Promise<void>;
|
|
145
145
|
VerifyBrowserWindowTitleIsString(value: string, platform: string): Promise<void>;
|
|
146
146
|
VerifyIfBrowserWindowIsClosed(platform: string): Promise<void>;
|
|
@@ -24,7 +24,7 @@ function createActionHandlers(context) {
|
|
|
24
24
|
open: async () => {
|
|
25
25
|
try {
|
|
26
26
|
await context.session.open();
|
|
27
|
-
context.executor = new executor_js_1.ActionExecutor(await context.session.getCurrentDriver(), context.scriptAppender, context.locator, context.request.platform);
|
|
27
|
+
context.executor = new executor_js_1.ActionExecutor(await context.session.getCurrentDriver(), context.scriptAppender, context.locator, context.request.platform, context.adbPath);
|
|
28
28
|
context.scriptAppender.add(async () => ({
|
|
29
29
|
nlpName: "OpenBrowser",
|
|
30
30
|
elementsData: [],
|
|
@@ -58,7 +58,7 @@ function createActionHandlers(context) {
|
|
|
58
58
|
},
|
|
59
59
|
keywords: result.keywords
|
|
60
60
|
});
|
|
61
|
-
context.executor = new executor_js_1.ActionExecutor(await context.androidSession.getCurrentDriver(), context.scriptAppender, context.locator, context.request.platform);
|
|
61
|
+
context.executor = new executor_js_1.ActionExecutor(await context.androidSession.getCurrentDriver(), context.scriptAppender, context.locator, context.request.platform, context.request.adbPath || "");
|
|
62
62
|
context.scriptAppender.add(async () => ({
|
|
63
63
|
nlpName: "Open Android App",
|
|
64
64
|
elementsData: [],
|
|
@@ -88,7 +88,7 @@ function createActionHandlers(context) {
|
|
|
88
88
|
try {
|
|
89
89
|
await context.androidSession.close();
|
|
90
90
|
context.scriptAppender.add(async () => ({
|
|
91
|
-
nlpName: "
|
|
91
|
+
nlpName: "MOB_CloseApp",
|
|
92
92
|
elementsData: [],
|
|
93
93
|
stepInputs: []
|
|
94
94
|
}));
|
|
@@ -107,7 +107,7 @@ function createActionHandlers(context) {
|
|
|
107
107
|
minimize: withExecutor(async (executor) => {
|
|
108
108
|
await executor.minimize();
|
|
109
109
|
}),
|
|
110
|
-
|
|
110
|
+
navigateBack: withExecutor(async (executor) => {
|
|
111
111
|
await executor.goBack();
|
|
112
112
|
}),
|
|
113
113
|
refresh: withExecutor(async (executor) => {
|
|
@@ -122,6 +122,9 @@ function createActionHandlers(context) {
|
|
|
122
122
|
Click: withExecutor(async (executor, result) => {
|
|
123
123
|
await executor.click(result.pageDOM, result.selector, result.fireflinkIndex, result.elementName, result.elementType);
|
|
124
124
|
}),
|
|
125
|
+
Select: withExecutor(async (executor, result) => {
|
|
126
|
+
await executor.click(result.pageDOM, result.selector, result.fireflinkIndex, result.elementName, result.elementType);
|
|
127
|
+
}),
|
|
125
128
|
RightClick: withExecutor(async (executor, result) => {
|
|
126
129
|
await executor.rightClick(result.pageDOM, result.selector, result.fireflinkIndex, result.elementName, result.elementType);
|
|
127
130
|
}),
|
|
@@ -636,7 +639,7 @@ function createActionHandlers(context) {
|
|
|
636
639
|
await executor.VerifyBrowserWindowUrlContainsExpectedUrl(result.value);
|
|
637
640
|
}),
|
|
638
641
|
VerifyCheckBoxIsNotSelected: withExecutor(async (executor, result) => {
|
|
639
|
-
await executor.VerifyCheckBoxIsNotSelected(result.pageDOM, result.selector, result.fireflinkIndex, result.elementName, result.elementType);
|
|
642
|
+
await executor.VerifyCheckBoxIsNotSelected(result.pageDOM, result.selector, result.value, result.fireflinkIndex, result.elementName, result.elementType);
|
|
640
643
|
}),
|
|
641
644
|
VerifyCheckBoxIsSelected: withExecutor(async (executor, result) => {
|
|
642
645
|
await executor.VerifyCheckBoxIsSelected(result.pageDOM, result.selector, result.fireflinkIndex, result.elementName, result.elementType);
|
|
@@ -14,7 +14,8 @@ class ExecutionContext {
|
|
|
14
14
|
this.session = new initiateBrowserSession_js_1.BrowserSession(browserType_js_1.browsers[request.browser.browserName], request.isCloud, request.capabilities, defaultValues_js_1.DEFAULT_PAGE_LOAD, request.cloudConfig);
|
|
15
15
|
this.locator = new getListOfLocators_js_1.ElementGetter();
|
|
16
16
|
this.scriptAppender = new scriptGenrationData_js_1.ScriptDataAppender();
|
|
17
|
-
this.androidSession = new initiateMobileSession_js_1.MobileSession(request.appiumPort, request.isCloud, request.capabilities, request.cloudConfig);
|
|
17
|
+
this.androidSession = new initiateMobileSession_js_1.MobileSession(request.appiumPort, request.isCloud, request.capabilities, request.cloudConfig, request.adbPath);
|
|
18
|
+
this.adbPath = request.adbPath || "";
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
exports.ExecutionContext = ExecutionContext;
|
|
@@ -95,7 +95,7 @@ class AutomationRunner {
|
|
|
95
95
|
const aiInfo = (0, getInstancesInfo_js_1.getAiInstanceInfo)(instanceDetails.responseObject);
|
|
96
96
|
const context = new executionContext_js_1.ExecutionContext(request);
|
|
97
97
|
const configProvider = new llmConfiguration_js_1.ServiceProviderBaseUrlProvider();
|
|
98
|
-
const baseUrl = configProvider.getBaseUrl(aiInfo
|
|
98
|
+
const baseUrl = configProvider.getBaseUrl(aiInfo);
|
|
99
99
|
let domInfo = null;
|
|
100
100
|
let extractedRelevantDom = null;
|
|
101
101
|
let errorInfo = {};
|
|
@@ -330,26 +330,6 @@ class AutomationRunner {
|
|
|
330
330
|
continue;
|
|
331
331
|
}
|
|
332
332
|
try {
|
|
333
|
-
fireflinkIndex = stepResult.response.attribute_value;
|
|
334
|
-
if (fireflinkIndex == "Fire-Flink-0") {
|
|
335
|
-
logData_js_1.logger.error(`element not found for step "${step}"`);
|
|
336
|
-
throw new Error(`element not found for step "${step}"`, { cause: node_console_1.error });
|
|
337
|
-
}
|
|
338
|
-
if (platform === "web") {
|
|
339
|
-
const ele = doc.querySelector(`[ff-inspect="${fireflinkIndex}"]`);
|
|
340
|
-
selector = ele.getAttribute("ff-xpath");
|
|
341
|
-
}
|
|
342
|
-
else {
|
|
343
|
-
const result = await (0, xpathcreation_js_1.getFFIndexAndXPath)(domInfo.dom, fireflinkIndex);
|
|
344
|
-
selector = result.xpathPath;
|
|
345
|
-
}
|
|
346
|
-
if (!selector) {
|
|
347
|
-
logData_js_1.logger.info(`Unable to resolve xpath for ${fireflinkIndex}`);
|
|
348
|
-
throw new Error(`Unable to resolve xpath for ${fireflinkIndex}`, { cause: node_console_1.error });
|
|
349
|
-
}
|
|
350
|
-
if (platform === "web") {
|
|
351
|
-
beforeHandles = await driver.getWindowHandles();
|
|
352
|
-
}
|
|
353
333
|
if (stepAction == "Builtin_DragAndDropToElement") {
|
|
354
334
|
handler = actionHandlers[stepAction];
|
|
355
335
|
const fireflinkIndex1 = stepResult.response.drag;
|
|
@@ -377,6 +357,26 @@ class AutomationRunner {
|
|
|
377
357
|
});
|
|
378
358
|
continue;
|
|
379
359
|
}
|
|
360
|
+
fireflinkIndex = stepResult.response.attribute_value;
|
|
361
|
+
if (fireflinkIndex == "Fire-Flink-0") {
|
|
362
|
+
logData_js_1.logger.error(`element not found for step "${step}"`);
|
|
363
|
+
throw new Error(`element not found for step "${step}"`, { cause: node_console_1.error });
|
|
364
|
+
}
|
|
365
|
+
if (platform === "web") {
|
|
366
|
+
const ele = doc.querySelector(`[ff-inspect="${fireflinkIndex}"]`);
|
|
367
|
+
selector = ele.getAttribute("ff-xpath");
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
const result = await (0, xpathcreation_js_1.getFFIndexAndXPath)(domInfo.dom, fireflinkIndex);
|
|
371
|
+
selector = result.xpathPath;
|
|
372
|
+
}
|
|
373
|
+
if (!selector) {
|
|
374
|
+
logData_js_1.logger.info(`Unable to resolve xpath for ${fireflinkIndex}`);
|
|
375
|
+
throw new Error(`Unable to resolve xpath for ${fireflinkIndex}`, { cause: node_console_1.error });
|
|
376
|
+
}
|
|
377
|
+
if (platform === "web") {
|
|
378
|
+
beforeHandles = await driver.getWindowHandles();
|
|
379
|
+
}
|
|
380
380
|
if (selector.includes("shadow")) {
|
|
381
381
|
stepAction = stepAction + "_shadow";
|
|
382
382
|
logData_js_1.logger.info(stepAction);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.annotateScreenshot = annotateScreenshot;
|
|
4
|
-
const canvas_1 = require("canvas");
|
|
4
|
+
const canvas_1 = require("@napi-rs/canvas");
|
|
5
5
|
const fast_xml_parser_1 = require("fast-xml-parser");
|
|
6
6
|
const logData_js_1 = require("../utils/logger/logData.js");
|
|
7
7
|
function parseBounds(bounds) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IServiceProviderBaseUrlConfiguration } from "../core/interfaces/llmConfigurationInterface.js";
|
|
2
2
|
export declare class ServiceProviderBaseUrlProvider implements IServiceProviderBaseUrlConfiguration {
|
|
3
|
-
|
|
4
|
-
getBaseUrl(provider: string): string;
|
|
3
|
+
getBaseUrl(aiInfo: Record<string, string>): string;
|
|
5
4
|
}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ServiceProviderBaseUrlProvider = void 0;
|
|
4
|
+
const BASE_URLS = {
|
|
5
|
+
Groq: "https://api.groq.com/openai/v1",
|
|
6
|
+
DefaultFireFlink: "https://api.groq.com/openai/v1",
|
|
7
|
+
OpenAi: "https://api.openai.com/v1",
|
|
8
|
+
Anthropic: "https://api.anthropic.com/v1/",
|
|
9
|
+
Gemini: "https://generativelanguage.googleapis.com/v1beta/openai/",
|
|
10
|
+
};
|
|
4
11
|
class ServiceProviderBaseUrlProvider {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Anthropic: "https://api.anthropic.com/v1/",
|
|
11
|
-
Gemini: "https://generativelanguage.googleapis.com/v1beta/openai/"
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
getBaseUrl(provider) {
|
|
15
|
-
const url = this.baseUrls[provider];
|
|
16
|
-
if (!url) {
|
|
17
|
-
throw new Error(`Unsupported service provider: ${provider}`);
|
|
12
|
+
getBaseUrl(aiInfo) {
|
|
13
|
+
if (aiInfo.serviceProvider === "Azure") {
|
|
14
|
+
if (!aiInfo.resource)
|
|
15
|
+
throw new Error("Resource not found");
|
|
16
|
+
return `https://${aiInfo.resource}.openai.azure.com/openai/v1/`;
|
|
18
17
|
}
|
|
18
|
+
const url = BASE_URLS[aiInfo.serviceProvider];
|
|
19
|
+
if (!url)
|
|
20
|
+
throw new Error(`Unsupported service provider: ${aiInfo.serviceProvider}`);
|
|
19
21
|
return url;
|
|
20
22
|
}
|
|
21
23
|
}
|