ff-automationv2 2.2.20 โ†’ 2.2.22

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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,222 @@
1
+ import { remote } from 'webdriverio';
2
+ import { DomSimplifier } from "../domAnalysis/simplifyAndFlatten.js";
3
+ import { DomSearcher } from "../domAnalysis/searchBest.js";
4
+ import { DomRelationshipBuilder } from "../domAnalysis/relativeElementsFromDom.js";
5
+ import { getAnnotatedDOM } from "../utils/DomExtraction/jsForAttributeInjection.js";
6
+ import { ElementGetter } from "../fireflinkData/fireflinkLocators/getListOfLocators.js";
7
+ import OpenAI from "openai";
8
+ import { DomProcessingEngine } from "../domAnalysis/getRelaventElements.js";
9
+ let simplifier = new DomSimplifier();
10
+ let searcher = new DomSearcher();
11
+ let relationshipBuilder = new DomRelationshipBuilder();
12
+ let data = new ElementGetter();
13
+ const client = new OpenAI({
14
+ baseURL: "https://api.groq.com/openai/v1",
15
+ apiKey: "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",
16
+ });
17
+ async function generateIndex(step, extractedDomJson) {
18
+ let prompt = `
19
+ -You are an intelligent assistant that extracts structured UI action data.
20
+ -Given a structured UI JSON representation with uniquely identified elements (ff-inspect values like Fire-Flink-0, Fire-Flink-1, Fire-Flink-2, Fire-Flink-3... in DOM order),
21
+ -locate the most appropriate element for an automation step by performing keyword-based matching using exact, partial, and fuzzy strategies, and
22
+ return the identifier of the best match.
23
+
24
+ Return **only valid JSON** in the following format:
25
+ {
26
+ "attribute_value": "Fire-Flink-x",
27
+ "action": "x",
28
+ "input_text": "x",
29
+ "elementType": "x"
30
+ }
31
+
32
+ Rules:
33
+ You are an AI assistant. For the step : ${step}, extract the element keyword from the step (the field name like 'Leaving from', 'Going To').
34
+ - Simplified JSON: ${JSON.stringify(extractedDomJson)} โ€” if it is empty, null, or has no valid data, return strictly "attribute_value":"Fire-Flink-0" and never use any other Fire-Flink-x value.
35
+ - Select the closest semantic match to step and return only its attribute_value, else Fire-Flink-0.
36
+ - **Find the FF-inspecter attribute value of the element in the Simplified JSON whose text or attributes best match the atep.**
37
+ - If multiple matches exist, use the reference element and choose the closest match by ff-inspect distance.
38
+ important example: step: "click on login below user login"
39
+ simplified json:
40
+ login - ff-inspect-300
41
+ user login - ff-inspect-790
42
+ login - ff-inspect-803
43
+ then should return login - ff-inspect-803 witch is near to user reference element user login - ff-inspect-790
44
+ `;
45
+ const response = await client.responses.create({
46
+ model: "openai/gpt-oss-20b",
47
+ input: prompt,
48
+ });
49
+ return JSON.parse(response.output_text);
50
+ }
51
+ async function generateKeywords(elementName) {
52
+ const prompt = `
53
+ You are an AI that generates keyword variations for identifying form elements in the DOM.
54
+
55
+ Given an element name, return ONLY a JSON array of relevant human-readable variations that could be used to identify that element in UI labels, placeholders, or attributes.
56
+
57
+ Rules:
58
+ - Return strictly a JSON array (no explanation, no extra text)
59
+ - Include common variations, phrasing, and synonyms
60
+ - Keep the list concise and relevant
61
+ - Do NOT include unrelated terms
62
+ - Do NOT include misspellings
63
+
64
+ Example:
65
+ Input: email
66
+
67
+ Output:
68
+ [
69
+ "email",
70
+ "email address",
71
+ "e-mail",
72
+ "mail",
73
+ "user email",
74
+ ]
75
+
76
+ Now generate the output for:
77
+ ${elementName}
78
+ `;
79
+ const response = await client.responses.create({
80
+ model: "openai/gpt-oss-20b",
81
+ input: prompt,
82
+ });
83
+ return response.output_text;
84
+ }
85
+ const steps = [
86
+ { action: "Open Browser" },
87
+ { action: "Maximize Browser" },
88
+ { action: "Navigate", value: "file:///D:/Bitbucket/testCase_Search/login.html" },
89
+ {
90
+ action: "Enter Text",
91
+ value: "test@example.com",
92
+ elementName: "email",
93
+ locators: [
94
+ { type: "id", value: "email" },
95
+ { type: "xpath", value: "//input[@type='email']" },
96
+ { type: "css", value: "input[placeholder='Enter Email']" }
97
+ ]
98
+ },
99
+ {
100
+ action: "Enter Text",
101
+ value: "123456",
102
+ locators: [
103
+ { type: "id", value: "password" },
104
+ { type: "xpath", value: "//input[@type='password']" },
105
+ { type: "css", value: "input[placeholder='Enter Password']" }
106
+ ]
107
+ },
108
+ {
109
+ action: "Click",
110
+ elementName: "login",
111
+ locators: [
112
+ { type: "xpath", value: "//button[text()='SignIn']" },
113
+ { type: "css", value: "buttoin" },
114
+ { type: "xpath", value: "//button[contains(text(),'SignInbtn')]" }
115
+ ]
116
+ },
117
+ ];
118
+ // ---------- ENGINE ----------
119
+ class Engine {
120
+ constructor(browser) {
121
+ this.browser = browser;
122
+ }
123
+ async open_browser() {
124
+ console.log("[STEP] Open Browser");
125
+ }
126
+ async maximize_browser() {
127
+ await this.browser.maximizeWindow();
128
+ console.log("[STEP] Maximize Browser");
129
+ }
130
+ async navigate(path) {
131
+ await this.browser.url(path);
132
+ console.log(`[STEP] Navigate โ†’ ${path}`);
133
+ }
134
+ async findElement(locators) {
135
+ for (const locator of locators) {
136
+ try {
137
+ let selector = "";
138
+ if (locator.type === "id") {
139
+ selector = `#${locator.value}`;
140
+ }
141
+ else if (locator.type === "css") {
142
+ selector = locator.value;
143
+ }
144
+ else if (locator.type === "xpath") {
145
+ selector = locator.value;
146
+ }
147
+ const element = await this.browser.$(selector);
148
+ if (await element.isExisting()) {
149
+ return element;
150
+ }
151
+ }
152
+ catch (e) {
153
+ continue;
154
+ }
155
+ }
156
+ throw new Error("Element not found");
157
+ }
158
+ async enter_text(step) {
159
+ const element = await this.findElement(step.locators);
160
+ await element.setValue(step.value);
161
+ console.log(`[STEP] Enter Text โ†’ ${step.value}`);
162
+ }
163
+ async click(step) {
164
+ const element = await this.findElement(step.locators);
165
+ await element.click();
166
+ console.log("[STEP] Click");
167
+ }
168
+ async verify_text(step) {
169
+ const element = await this.findElement(step.locators);
170
+ const isDisplayed = await element.isDisplayed();
171
+ if (isDisplayed) {
172
+ console.log(`[PASS] Found โ†’ ${step.value}`);
173
+ }
174
+ else {
175
+ console.log(`[FAIL] Not Found โ†’ ${step.value}`);
176
+ }
177
+ }
178
+ async close_browser() {
179
+ await this.browser.deleteSession();
180
+ console.log("[STEP] Close Browser");
181
+ }
182
+ }
183
+ // ---------- ACTION MAPPER ----------
184
+ function actionToMethod(action) {
185
+ return action.toLowerCase().replace(/ /g, "_");
186
+ }
187
+ let browser;
188
+ // ---------- MAIN EXECUTION ----------
189
+ (async () => {
190
+ browser = await remote({
191
+ logLevel: 'error',
192
+ capabilities: {
193
+ browserName: 'chrome'
194
+ }
195
+ });
196
+ const engine = new Engine(browser);
197
+ for (const step of steps) {
198
+ try {
199
+ const methodName = actionToMethod(step.action);
200
+ const method = engine[methodName];
201
+ if (step.value && !step.locators) {
202
+ await method.call(engine, step.value);
203
+ }
204
+ else {
205
+ await method.call(engine, step);
206
+ }
207
+ }
208
+ catch (error) {
209
+ let domInfo = await getAnnotatedDOM(browser);
210
+ const domProcessor = new DomProcessingEngine();
211
+ let extractedRelevantDom = domProcessor.webProcess({
212
+ keywords: await generateKeywords(JSON.stringify(step)),
213
+ rawDom: domInfo.dom,
214
+ stepCount: 1
215
+ });
216
+ console.log(await generateIndex(JSON.stringify(step), extractedRelevantDom));
217
+ let newData = await data.getFireFlinkElement(domInfo.dom, "[ff-inspect='Fire-Flink-8']");
218
+ console.log(newData);
219
+ break;
220
+ }
221
+ }
222
+ })();
@@ -4,32 +4,17 @@ import path from "path";
4
4
  import fs from "fs";
5
5
  const certPath = path.join("D:", "Bitbucket", "automationV2", "Certificates", "certificate.crt");
6
6
  const ssl = {
7
- cert: fs.readFileSync(certPath, "utf-8"),
7
+ ca: [fs.readFileSync(certPath, "utf-8")],
8
8
  rejectUnauthorized: false,
9
9
  };
10
10
  const runner = new AutomationRunner();
11
- console.log(new Date().getTime());
12
11
  runner.run({
13
12
  userStory: [
14
13
  ["Open browser"],
15
14
  ["Navigate to https://www.google.com/"],
16
15
  ["Maximize the browser"],
17
- // ["Navigate to https://www.google.com/"],
18
- // ["Maximize the browser"],
19
- // ["Navigate to https://www.google.com/"],
20
- // ["Maximize the browser"],
21
- // ["click on Gmail link"],
16
+ ["Wait for 10 seconds"],
22
17
  ["Close browser"],
23
- // ["start iteration using 'Data1' Dataprovider"],
24
- // ["enter 'startIteration1' in search field"],
25
- // ["enter level-A in search field"],
26
- // ["start iteration using 'Data1' Dataprovider"],
27
- // ["enter 'startIteration1' in search field"],
28
- // ["enter level-B in search field"],
29
- // ["End iteration"],
30
- // ["End iteration"],
31
- // ["click on Gmail link"],
32
- // ["Close browser"],
33
18
  ],
34
19
  platform: "web",
35
20
  pageDetails: {
@@ -40,8 +25,6 @@ runner.run({
40
25
  },
41
26
  sessionPath: path.join("D:", "Bitbucket", "automationV2"),
42
27
  serverHost: "https://test3.fireflink.com",
43
- // topic: "",
44
- // serviceAccounts: "",
45
28
  webSocketId: "",
46
29
  generatedBy: "",
47
30
  licenseType: "C-Professional",
@@ -51,7 +34,7 @@ runner.run({
51
34
  browser: {
52
35
  browserName: "Google Chrome",
53
36
  },
54
- broker: ["test3.fireflink.com"],
37
+ broker: ["test3.fireflink.com:9092"],
55
38
  sslConfig: ssl,
56
39
  env: "test3",
57
40
  version: "asdfg",
@@ -81,5 +64,5 @@ runner.run({
81
64
  browserVersion: "146"
82
65
  },
83
66
  isTerminate: false,
84
- token: "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJRUFRfTnFuMkxxdDVmN09tOElWaW53dUJlR3ZVUUVBUkdxZkFuRHJxZU9NIn0.eyJleHAiOjE3NzUyODczODQsImlhdCI6MTc3NTIwMDk4NCwianRpIjoib25ydHJvOjYzOTYzMjJkLTNlZWYtNDg1NC04NmUzLTdlNzBhNjY1ZjM0MSIsImlzcyI6Imh0dHA6Ly8xMDMuMTgyLjIxMC4yMjY6MzAxMDcvcmVhbG1zL0ZpcmVGbGluay10ZXN0MyIsImF1ZCI6InRhcmdldC1jbGllbnQiLCJzdWIiOiJmOmNhMzBmNDk3LTY1Y2YtNGU4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VybmFtZSI6ImphaSIsInVzZXJOYW1lIjoiamFpYWthc2hAeW9wbWFpbC5jb20iLCJiaWxsaW5nQ3ljbGUiOiJRdWFydGVybHkiLCJpZCI6IlVTUjI2OTM1IiwibGljZW5zZUlkIjoiTElDMzk4NSIsImVtYWlsIjoiamFpYWthc2hAeW9wbWFpbC5jb20ifQ.iWJJEzB83jy-YGIywIM1GYTqj3I23FZP0UMOy1VfB1vU1OBxcGWpJeHsJw-TA3s6ihHjQs-xCMj41DGDfEOVBUGLHwb0OLnj2wtoyjdsyc_qLegiWe4CDVmfF2zjhubF3gRhP1ZyuVHEcUQJmx_BuCL3FdeO4Vr6T-KM2TCniyXue9RLgVanuxqt8-bcGBtWfL8bYapecky8mjuCmbZNIA5plrK9b5BMf9N-lOp8fEcad0f9IWCA0Z8ixRVwaALnERDiZ0FwqvSxAnWxlb9oLeoZKRtVSYvKHB3BZQaimFyZqXN8RaMHHUpSEcDuTzbXkWbg-6xOi6Bm2qkoEQuvqA"
85
68
  });
@@ -1 +0,0 @@
1
- export {};
@@ -1,82 +1,87 @@
1
- import { remote } from 'webdriverio';
2
- import { encode } from '@toon-format/toon';
3
- import * as cheerio from 'cheerio';
4
- import fs from 'fs';
5
- import { encoding_for_model } from "@dqbd/tiktoken";
6
- // ๐Ÿ”„ HTML โ†’ JSON
7
- function htmlToJson(html) {
8
- const $ = cheerio.load(html);
9
- // ๐Ÿงน remove useless elements
10
- $('script, style, noscript, iframe').remove();
11
- function parseElement(elem, depth = 0) {
12
- if (!elem || depth > 6)
13
- return null;
14
- const node = {
15
- tag: elem.name,
16
- attrs: elem.attribs || {},
17
- children: [] // โœ… FIX
18
- };
19
- for (const child of elem.children || []) {
20
- if (child.type === 'text') {
21
- const text = child.data.trim();
22
- if (text) {
23
- node.children.push({ text });
24
- }
25
- }
26
- else if (child.type === 'tag') {
27
- const parsed = parseElement(child, depth + 1);
28
- if (parsed) {
29
- node.children.push(parsed);
30
- }
31
- }
32
- }
33
- return node;
34
- }
35
- return parseElement($('body')[0]);
36
- }
37
- // ๐Ÿš€ Main runner
38
- async function run() {
39
- const browser = await remote({
40
- capabilities: {
41
- browserName: 'chrome'
42
- }
43
- });
44
- try {
45
- // ๐ŸŒ Open Amazon
46
- await browser.url('https://www.amzon.in/');
47
- // โณ wait for search box
48
- const searchBox = await browser.$('#twotabsearchtextbox');
49
- await searchBox.waitForDisplayed({ timeout: 10000 });
50
- // ๐Ÿ“„ Get HTML
51
- const html = await browser.getPageSource();
52
- // ๐Ÿ”„ Convert HTML โ†’ JSON
53
- const json = htmlToJson(html);
54
- // ๐Ÿ”„ JSON โ†’ TOON
55
- const start = performance.now();
56
- const encoded = encode({ data: json });
57
- const end = performance.now();
58
- console.log('HTML :', html.length);
59
- console.log('json size:', JSON.stringify(json).length);
60
- console.log('Encoded length:', encoded.length);
61
- console.log(`Time taken: ${(end - start).toFixed(2)} ms`);
62
- // ๐Ÿ’พ Save outputs (optional but useful)
63
- fs.writeFileSync('output.json', JSON.stringify(json, null, 2));
64
- fs.writeFileSync('output.toon', encoded);
65
- const enc = encoding_for_model("gpt-4"); // closest available
66
- function countTokens(text) {
67
- return enc.encode(text).length;
68
- }
69
- const jsonString = JSON.stringify(json);
70
- console.log("Token JSON count:", countTokens(jsonString));
71
- const jsonStringencoded = JSON.stringify(encoded);
72
- console.log("Token TOON count:", countTokens(jsonStringencoded));
73
- }
74
- catch (err) {
75
- console.error(err);
76
- }
77
- finally {
78
- await browser.deleteSession();
79
- }
80
- }
81
- run();
82
- console.log("hi");
1
+ "use strict";
2
+ // import { remote } from 'webdriverio'
3
+ // import { encode } from '@toon-format/toon'
4
+ // import * as cheerio from 'cheerio'
5
+ // import fs from 'fs'
6
+ // import { Tokenizer } from "@huggingface/tokenizers"
7
+ // import { encoding_for_model } from "@dqbd/tiktoken"
8
+ // // ๐Ÿง  Define proper type (fixes "never" error)
9
+ // type NodeType = {
10
+ // tag?: string
11
+ // attrs?: Record<string, string>
12
+ // children?: NodeType[]
13
+ // text?: string
14
+ // }
15
+ // // ๐Ÿ”„ HTML โ†’ JSON
16
+ // function htmlToJson(html: string): NodeType | null {
17
+ // const $ = cheerio.load(html)
18
+ // // ๐Ÿงน remove useless elements
19
+ // $('script, style, noscript, iframe').remove()
20
+ // function parseElement(elem: any, depth = 0): NodeType | null {
21
+ // if (!elem || depth > 6) return null
22
+ // const node: NodeType = {
23
+ // tag: elem.name,
24
+ // attrs: elem.attribs || {},
25
+ // children: [] as NodeType[] // โœ… FIX
26
+ // }
27
+ // for (const child of elem.children || []) {
28
+ // if (child.type === 'text') {
29
+ // const text = child.data.trim()
30
+ // if (text) {
31
+ // node.children!.push({ text })
32
+ // }
33
+ // } else if (child.type === 'tag') {
34
+ // const parsed = parseElement(child, depth + 1)
35
+ // if (parsed) {
36
+ // node.children!.push(parsed)
37
+ // }
38
+ // }
39
+ // }
40
+ // return node
41
+ // }
42
+ // return parseElement($('body')[0])
43
+ // }
44
+ // // ๐Ÿš€ Main runner
45
+ // async function run() {
46
+ // const browser = await remote({
47
+ // capabilities: {
48
+ // browserName: 'chrome'
49
+ // }
50
+ // })
51
+ // try {
52
+ // // ๐ŸŒ Open Amazon
53
+ // await browser.url('https://www.amzon.in/')
54
+ // // โณ wait for search box
55
+ // const searchBox = await browser.$('#twotabsearchtextbox')
56
+ // await searchBox.waitForDisplayed({ timeout: 10000 })
57
+ // // ๐Ÿ“„ Get HTML
58
+ // const html = await browser.getPageSource()
59
+ // // ๐Ÿ”„ Convert HTML โ†’ JSON
60
+ // const json = htmlToJson(html)
61
+ // // ๐Ÿ”„ JSON โ†’ TOON
62
+ // const start = performance.now()
63
+ // const encoded = encode({ data: json })
64
+ // const end = performance.now()
65
+ // console.log('HTML :', html.length)
66
+ // console.log('json size:', JSON.stringify(json).length)
67
+ // console.log('Encoded length:', encoded.length)
68
+ // console.log(`Time taken: ${(end - start).toFixed(2)} ms`)
69
+ // // ๐Ÿ’พ Save outputs (optional but useful)
70
+ // fs.writeFileSync('output.json', JSON.stringify(json, null, 2))
71
+ // fs.writeFileSync('output.toon', encoded)
72
+ // const enc = encoding_for_model("gpt-4") // closest available
73
+ // function countTokens(text: string) {
74
+ // return enc.encode(text).length
75
+ // }
76
+ // const jsonString = JSON.stringify(json)
77
+ // console.log("Token JSON count:", countTokens(jsonString))
78
+ // const jsonStringencoded = JSON.stringify(encoded)
79
+ // console.log("Token TOON count:", countTokens(jsonStringencoded))
80
+ // } catch (err) {
81
+ // console.error(err)
82
+ // } finally {
83
+ // await browser.deleteSession()
84
+ // }
85
+ // }
86
+ // run()
87
+ // console.log("hi")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ff-automationv2",
3
- "version": "2.2.20",
3
+ "version": "2.2.22",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "This lib is used to automate the manual testcase",
@@ -49,24 +49,23 @@
49
49
  "nodemon": "3.1.11",
50
50
  "ts-node": "10.9.2",
51
51
  "typescript": "^5.9.3",
52
+ "typescript-eslint": "8.56.0",
53
+ "webdriverio": "9.26.1"
54
+ },
55
+ "peerDependencies": {
52
56
  "webdriverio": "9.26.1",
53
- "typescript-eslint": "8.56.0"
57
+ "kafkajs": "^2.2.4",
58
+ "jsdom": "27.4.0",
59
+ "canvas": "^3.2.3"
54
60
  },
55
61
  "dependencies": {
56
62
  "@xmldom/xmldom": "^0.8.11",
57
63
  "axios": "^1.13.5",
58
- "canvas": "3.2.1",
59
64
  "cheerio": "1.2.0",
60
- "devtools": "^8.42.0",
61
- "dotenv": "^17.3.1",
62
65
  "fast-fuzzy": "^1.12.0",
63
- "fs-extra": "11.3.3",
64
66
  "js-beautify": "1.15.1",
65
- "jsdom": "27.4.0",
66
- "kafkajs": "^2.2.4",
67
67
  "openai": "6.18.0",
68
68
  "uuid": "13.0.0",
69
- "webdriverio": "9.26.1",
70
69
  "xpath": "^0.0.34"
71
70
  }
72
71
  }