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
package/dist/tests/test1.js
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const openai_1 = __importDefault(require("openai"));
|
|
7
|
+
const endpoint = "ai4automation";
|
|
8
|
+
const deploymentName = "gpt-4.1-mini";
|
|
9
|
+
const client = new openai_1.default({
|
|
10
|
+
apiKey: "DCcGR0NEoopbPaszZ93cj0v14hVcPqSY3dkuwtOXMA2XxtiCWBqwJQQJ99CDACYeBjFXJ3w3AAABACOGrIjB", // use env variable
|
|
11
|
+
baseURL: `https://${endpoint}.openai.azure.com/openai/v1/`,
|
|
12
|
+
});
|
|
13
|
+
async function run() {
|
|
14
|
+
try {
|
|
15
|
+
const completion = await client.chat.completions.create({
|
|
16
|
+
model: deploymentName,
|
|
17
|
+
messages: [
|
|
18
|
+
{
|
|
19
|
+
role: "user",
|
|
20
|
+
content: "What is the capital of France?",
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
});
|
|
24
|
+
console.log(completion.choices[0].message.content);
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
console.error("Error:", err.message);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
run();
|
package/dist/tests/test12.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/tests/test12.js
CHANGED
|
@@ -1,73 +1,74 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
2
|
+
// console.log(new Date().getTime())
|
|
3
|
+
// import { AutomationRunner } from "../index.js"
|
|
4
|
+
// import path from "path";
|
|
5
|
+
// import fs from "fs";
|
|
6
|
+
// const certPath = path.join("D:", "Bitbucket", "automationV2", "Certificates", "certificate.crt");
|
|
7
|
+
// const ssl = {
|
|
8
|
+
// ca: [fs.readFileSync(certPath, "utf-8")],
|
|
9
|
+
// rejectUnauthorized: false,
|
|
10
|
+
// }
|
|
11
|
+
// const runner = new AutomationRunner();
|
|
12
|
+
// runner.run({
|
|
13
|
+
// serviceAccounts: "",
|
|
14
|
+
// topic: "TEst",
|
|
15
|
+
// userStory:
|
|
16
|
+
// [
|
|
17
|
+
// ["Open browser"],
|
|
18
|
+
// ["Maximize the browser"],
|
|
19
|
+
// ["Navigate to https://www.saucedemo.com/"],
|
|
20
|
+
// ["enter standard_user as username"],
|
|
21
|
+
// ["enter secret_sauce as password"],
|
|
22
|
+
// ["click on Login button"],
|
|
23
|
+
// ["Close browser"],
|
|
24
|
+
// ],
|
|
25
|
+
// platform: "web",
|
|
26
|
+
// pageDetails: {
|
|
27
|
+
// Web: {
|
|
28
|
+
// pageId: "PAG73a7a0ad-c092-4351-8a93-68647f60e343",
|
|
29
|
+
// pageName: "ai-Page"
|
|
30
|
+
// }
|
|
31
|
+
// },
|
|
32
|
+
// sessionPath: path.join("D:", "Bitbucket", "automationV2"),
|
|
33
|
+
// serverHost: "https://test3.fireflink.com",
|
|
34
|
+
// webSocketId: "",
|
|
35
|
+
// generatedBy: "",
|
|
36
|
+
// licenseType: "C-Professional",
|
|
37
|
+
// licenseId: "LIC3985",
|
|
38
|
+
// userId: "USR26935",
|
|
39
|
+
// projectType: "Web",
|
|
40
|
+
// browser: {
|
|
41
|
+
// browserName: "Google Chrome",
|
|
42
|
+
// },
|
|
43
|
+
// // broker: ["test3.fireflink.com:9092"],
|
|
44
|
+
// // sslConfig: ssl,
|
|
45
|
+
// // env: "test3",
|
|
46
|
+
// version: "asdfg",
|
|
47
|
+
// type: "sdfg",
|
|
48
|
+
// scriptName: "url",
|
|
49
|
+
// scriptType: "web",
|
|
50
|
+
// projectId: "PJT1116",
|
|
51
|
+
// testCaseId: "SCR1208",
|
|
52
|
+
// promptId: "3f6e123c-8ec6-47c1-90e1-1a2f53b49251",
|
|
53
|
+
// userName: "default-user",
|
|
54
|
+
// appiumPort: 0,
|
|
55
|
+
// platformVersion: "",
|
|
56
|
+
// realDeviceId: "",
|
|
57
|
+
// serverData: "",
|
|
58
|
+
// isCloud: false,
|
|
59
|
+
// cloudConfig: {
|
|
60
|
+
// // accessKey: "yfAa_w199cJge2Gezsgb2Jnu7hKdqER1tExY5kKvgSvXfi1lRUelFsbTFI5pMq7zQuwwNXXnsLTkjKhvWcKDWsUoGLi9KjUV6gbUNDhqj0jWYFyW9h_0LIDEg5qXigwZdqzQqAvWwHin3gBhzGndeROtixv_VFhnseGSWRAHTajZzE-Zl0d8BP6gl0TEBUfoNgqBtAQVDLP6wAQzPfcyjjGFsdHkXWeHFkKmA78D7rKlnNuN2WgjIUlhYheDRDeqZ98Ig_PyS1GbUvjwJ73L38sr_cD4Y9lrKyWJV-m5RmtKhmkqRM8uk5gEfjzgwy30",
|
|
61
|
+
// hostname: "d900-2409-40f2-2165-b548-215a-4429-f3ac-107f.ngrok-free.app",
|
|
62
|
+
// // licenseId: "LIC2026658",
|
|
63
|
+
// // projectName: "Project-6",
|
|
64
|
+
// protocol: "https",
|
|
65
|
+
// path: "wd/hub"
|
|
66
|
+
// },
|
|
67
|
+
// capabilities: {
|
|
68
|
+
// browserName: "MicrosoftEdge",
|
|
69
|
+
// // platformName: "Windows 11",
|
|
70
|
+
// // browserVersion: "146"
|
|
71
|
+
// },
|
|
72
|
+
// isTerminate: false,
|
|
73
|
+
// token: "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJRUFRfTnFuMkxxdDVmN09tOElWaW53dUJlR3ZVUUVBUkdxZkFuRHJxZU9NIn0.eyJleHAiOjE3NzY0MjU3ODQsImlhdCI6MTc3NjMzOTM4NCwianRpIjoib25ydHJvOmY1ZGE1NDljLWIwOWEtNDgyZi1hYmRiLWJlOGYzMGZmZjMxYyIsImlzcyI6Imh0dHA6Ly8xMDMuMTgyLjIxMC4yMjY6MzAxMDcvcmVhbG1zL0ZpcmVGbGluay10ZXN0MyIsImF1ZCI6InRhcmdldC1jbGllbnQiLCJzdWIiOiJmOmNhMzBmNDk3LTY1Y2YtNGU4Zi1iZGE3LTE0ZjM1NTNiYzZmNTpqYWlha2FzaEB5b3BtYWlsLmNvbSIsInR5cCI6IkJlYXJlciIsImF6cCI6ImZsaW5rLXNlcnZpY2UiLCJzaWQiOiI2MzkyMWU2My03MGJlLTQ1MTgtYWU5MS1hZjk3Y2Y2ZDE0ZDIiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbIioiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInNjb3BlIjoiZW1haWwgcHJvZmlsZSIsImN1cnJlbnRMaWNlbnNlSWQiOiJMSUMzOTg1IiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjdXJyZW50UHJpdmlsZWdlIjoiU3VwZXIgQWRtaW4iLCJmdWxsTmFtZSI6ImphaSIsImFjdGl2YXRpb25TdGF0dXMiOiJBQ1RJVkUiLCJwcml2aWxlZ2UiOiJTdXBlciBBZG1pbiIsImxpY2Vuc2VOYW1lIjoiRmlyZUZsaW5rIC0gTElDMzk4NSIsInByZWZlcnJlZF91c2VybmFtZSI6ImphaSIsInVzZXJOYW1lIjoiamFpYWthc2hAeW9wbWFpbC5jb20iLCJiaWxsaW5nQ3ljbGUiOiJRdWFydGVybHkiLCJpZCI6IlVTUjI2OTM1IiwibGljZW5zZUlkIjoiTElDMzk4NSIsImVtYWlsIjoiamFpYWthc2hAeW9wbWFpbC5jb20ifQ.eO4c1JoekBHymCU7OpxdVVZhKysFdH5kLbb7HveZk7HyzaS4Bjc1fdmMBu-BuvUvxHUdWYlRZP_9Zc8LKHsqe0uF_qwTddT7QDWnnS0TgFHLHCIcd_uQ1KHrfPGvEyaxpylrbke9KOWG66N37h1JaBfyT-b5P_CxKn5K_MsSpJH3U8ceDk8F1cKoz_L_ArM1rPMAsJxCAANf3PJfTt8F4qlgxEW6CoqY1W-qba_Dw8PztU3uL0ERrIT0ZDI8u1Nj9LaN_j9NDruu2kB_KNa2n_pcFqq2hvu8Ac1dF5t6n_sU5TXElYSO5FOkLXRgkYpX4ClZuqDU8Oza1PaYxLGuLw"
|
|
74
|
+
// })
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const fireflinkKafka_service_js_1 = require("../service/kafka/fireflinkKafka.service.js");
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const certPath = path_1.default.join("D:", "Bitbucket", "automationV2", "Certificates", "certificate.crt");
|
|
10
|
+
const ssl = {
|
|
11
|
+
ca: [fs_1.default.readFileSync(certPath, "utf-8")],
|
|
12
|
+
rejectUnauthorized: false,
|
|
13
|
+
};
|
|
14
|
+
const inst = new fireflinkKafka_service_js_1.KafkaProducerService(["test.fireflink.com:9222"], ssl);
|
|
15
|
+
let payload = {
|
|
16
|
+
topic: `Topic-FIREFLINK-api-requests-test3`,
|
|
17
|
+
message: {
|
|
18
|
+
"stepData": [{
|
|
19
|
+
"nlpName": "OpenBrowser",
|
|
20
|
+
"elementsData": [],
|
|
21
|
+
"stepInputs": []
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"type": "web",
|
|
25
|
+
"scriptName": "NLPList6",
|
|
26
|
+
"version": "",
|
|
27
|
+
"scriptType": "Web & Mobile (Android & iOS)",
|
|
28
|
+
"projectId": "PJT1041",
|
|
29
|
+
"testCaseId": "SCR1930",
|
|
30
|
+
"promptId": "1f348fb3-b0f6-4eb4-b9a0-6c6cc33fea68",
|
|
31
|
+
"pageDetails": {
|
|
32
|
+
"Web": {
|
|
33
|
+
"pageId": "PAG025b6c68-9a55-46da-b353-0894f29c7f27",
|
|
34
|
+
"pageName": "ai-Page"
|
|
35
|
+
},
|
|
36
|
+
"Android": {
|
|
37
|
+
"pageId": "PAGb830f55d-077a-4d09-ae71-91fece6b0011",
|
|
38
|
+
"pageName": "ai-Android-Page"
|
|
39
|
+
},
|
|
40
|
+
"iOS": {
|
|
41
|
+
"pageId": "PAGcbb751fe-f056-4a09-a2ba-64c1092b5f89",
|
|
42
|
+
"pageName": "ai-Ios-Page"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"generatedBy": "",
|
|
46
|
+
"webSocketId": "",
|
|
47
|
+
"licenseType": "C-Professional",
|
|
48
|
+
"licenseId": "LIC3916",
|
|
49
|
+
"userId": "USR26696",
|
|
50
|
+
"projectType": "Web & Mobile",
|
|
51
|
+
"topic": "Topic-FIREFLINK-api-requests-performances",
|
|
52
|
+
"serverHost": "https://performances.fireflink.com",
|
|
53
|
+
"tokensConsumed": 1234,
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
inst.produceMessage(payload);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const webdriverio_1 = require("webdriverio");
|
|
4
|
+
(async () => {
|
|
5
|
+
const browser = await (0, webdriverio_1.remote)({
|
|
6
|
+
automationProtocol: 'webdriver',
|
|
7
|
+
capabilities: {
|
|
8
|
+
browserName: 'chrome',
|
|
9
|
+
'goog:chromeOptions': {
|
|
10
|
+
debuggerAddress: '127.0.0.1:9222'
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
// Use existing Chrome session
|
|
15
|
+
const url = await browser.getUrl();
|
|
16
|
+
console.log('Current URL:', url);
|
|
17
|
+
// Navigate somewhere
|
|
18
|
+
await browser.url('https://www.google.com');
|
|
19
|
+
// Example action
|
|
20
|
+
const title = await browser.getTitle();
|
|
21
|
+
console.log('Page Title:', title);
|
|
22
|
+
// Don't close Chrome (important)
|
|
23
|
+
await browser.deleteSession();
|
|
24
|
+
})();
|
|
@@ -2,4 +2,4 @@ export interface AnnotatedDOMResult {
|
|
|
2
2
|
dom: string;
|
|
3
3
|
}
|
|
4
4
|
export declare function getAnnotatedDOM(browser: WebdriverIO.Browser): Promise<AnnotatedDOMResult>;
|
|
5
|
-
export declare function getAnnotatedDOMForMobile(driver: WebdriverIO.Browser): Promise<AnnotatedDOMResult>;
|
|
5
|
+
export declare function getAnnotatedDOMForMobile(driver: WebdriverIO.Browser, existingDom?: string): Promise<AnnotatedDOMResult>;
|
|
@@ -222,17 +222,21 @@ async function getAnnotatedDOM(browser) {
|
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
224
|
const xmldom_1 = require("@xmldom/xmldom");
|
|
225
|
-
async function getAnnotatedDOMForMobile(driver) {
|
|
225
|
+
async function getAnnotatedDOMForMobile(driver, existingDom) {
|
|
226
226
|
try {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
227
|
+
let pageSource = "";
|
|
228
|
+
if (existingDom) {
|
|
229
|
+
pageSource = existingDom;
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
await driver.pause(1000);
|
|
233
|
+
const startTime = Date.now();
|
|
234
|
+
pageSource = await driver.getPageSource();
|
|
235
|
+
logData_js_1.logger.info(`Page source captured in ${Date.now() - startTime}ms`);
|
|
236
|
+
}
|
|
232
237
|
if (!pageSource) {
|
|
233
238
|
throw new Error("Unable to capture DOM");
|
|
234
239
|
}
|
|
235
|
-
// Parse XML DOM
|
|
236
240
|
const parser = new xmldom_1.DOMParser();
|
|
237
241
|
const xmlDoc = parser.parseFromString(pageSource, "text/xml");
|
|
238
242
|
const allElements = xmlDoc.getElementsByTagName("*");
|
|
@@ -6,7 +6,8 @@ function getAiInstanceInfo(responseObject) {
|
|
|
6
6
|
serviceProvider: responseObject.serviceProvider,
|
|
7
7
|
apiKey: responseObject.instanceDetails.apiKey,
|
|
8
8
|
apiUrl: responseObject.instanceDetails.apiUrl,
|
|
9
|
-
visionApiKey: responseObject
|
|
9
|
+
visionApiKey: responseObject?.instanceDetails?.visionApiKey,
|
|
10
10
|
model: responseObject.model,
|
|
11
|
+
resource: responseObject.resource ?? null,
|
|
11
12
|
};
|
|
12
13
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function findElementInDom(driver: WebdriverIO.Browser, text: string): Promise<{
|
|
1
|
+
export declare function findElementInDom(driver: WebdriverIO.Browser, text: string, stepCount: number, rawdom: string): Promise<{
|
|
2
2
|
element: import("webdriverio").ChainablePromiseElement;
|
|
3
3
|
xpath: string;
|
|
4
4
|
annotatedDom: string;
|
|
@@ -2,29 +2,53 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.findElementInDom = findElementInDom;
|
|
4
4
|
const jsForAttributeInjection_js_1 = require("../DomExtraction/jsForAttributeInjection.js");
|
|
5
|
-
const simplifyAndFlatten_js_1 = require("../../domAnalysis/simplifyAndFlatten.js");
|
|
6
5
|
const xpathcreation_js_1 = require("../helpers/xpathcreation.js");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
6
|
+
const getRelaventElements_js_1 = require("../../domAnalysis/getRelaventElements.js");
|
|
7
|
+
const logData_js_1 = require("../logger/logData.js");
|
|
8
|
+
async function findElementInDom(driver, text, stepCount, rawdom) {
|
|
9
|
+
const engine = new getRelaventElements_js_1.DomProcessingEngine();
|
|
10
|
+
const { dom: annotatedDom } = await (0, jsForAttributeInjection_js_1.getAnnotatedDOMForMobile)(driver, rawdom);
|
|
11
|
+
logData_js_1.logger.saveDOM(annotatedDom, `annotated-dom-${100 + stepCount}`);
|
|
12
|
+
const results = engine.mobileProcess({
|
|
13
|
+
keywords: text,
|
|
14
|
+
rawDom: annotatedDom,
|
|
15
|
+
stepCount: 100 + stepCount
|
|
16
|
+
});
|
|
17
|
+
logData_js_1.logger.saveJSON(results, `relevant-dom-Mob-${100 + stepCount}`);
|
|
18
|
+
const keywords = text.toLowerCase().split(/\s+/);
|
|
19
|
+
function exactSequenceMatch(value, words) {
|
|
20
|
+
const v = (value || "").toLowerCase();
|
|
21
|
+
const escaped = words.map(w => w.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
22
|
+
const pattern = escaped.join("\\s*");
|
|
23
|
+
return new RegExp(pattern).test(v);
|
|
24
|
+
}
|
|
25
|
+
function matchNode(node, words) {
|
|
22
26
|
const textVal = (node["text"] || "").toLowerCase();
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
// const desc = (node.name || "").toLowerCase();
|
|
28
|
+
// const value = (node.value || "").toLowerCase();
|
|
29
|
+
const contentDesc = (node["content-desc"] ||
|
|
30
|
+
node.contentDesc ||
|
|
31
|
+
node.contentDescription ||
|
|
32
|
+
"").toLowerCase();
|
|
33
|
+
const resourceId = (node["resource-id"] ||
|
|
34
|
+
node.resourceId ||
|
|
35
|
+
node.id ||
|
|
36
|
+
"").toLowerCase();
|
|
37
|
+
logData_js_1.logger.info(`contentdesc is ${contentDesc}, Resource id is ${resourceId} the text is ${words}`);
|
|
38
|
+
if (exactSequenceMatch(textVal, words))
|
|
39
|
+
return true;
|
|
40
|
+
// if (exactSequenceMatch(desc, words)) return true;
|
|
41
|
+
// if (exactSequenceMatch(value, words)) return true;
|
|
42
|
+
if (exactSequenceMatch(contentDesc, words))
|
|
43
|
+
return true;
|
|
44
|
+
if (exactSequenceMatch(resourceId, words))
|
|
45
|
+
return true;
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
for (const group of results) {
|
|
49
|
+
for (const node of group) {
|
|
50
|
+
if (!matchNode(node, keywords))
|
|
51
|
+
continue;
|
|
28
52
|
const ffIndex = node["FF-inspecter"];
|
|
29
53
|
if (!ffIndex)
|
|
30
54
|
continue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ff-automationv2",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.26",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"description": "This lib is used to automate the manual testcase",
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
"files": [
|
|
17
17
|
"dist"
|
|
18
18
|
],
|
|
19
|
+
"overrides": {
|
|
20
|
+
"canvas": "@napi-rs/canvas"
|
|
21
|
+
},
|
|
19
22
|
"scripts": {
|
|
20
23
|
"type-check": "tsc --noEmit",
|
|
21
24
|
"builds": "npm run lint && tsc",
|
|
@@ -53,10 +56,8 @@
|
|
|
53
56
|
"typescript-eslint": "8.56.0",
|
|
54
57
|
"webdriverio": "9.26.1"
|
|
55
58
|
},
|
|
56
|
-
"peerDependencies": {
|
|
57
|
-
"canvas": "^3.2.3"
|
|
58
|
-
},
|
|
59
59
|
"dependencies": {
|
|
60
|
+
"@napi-rs/canvas": "^0.1.100",
|
|
60
61
|
"@xmldom/xmldom": "^0.8.11",
|
|
61
62
|
"axios": "^1.13.5",
|
|
62
63
|
"cheerio": "1.2.0",
|