ff-automationv2 2.2.16 → 2.2.18
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/automation/browserSession/initiateBrowserSession.d.ts +2 -2
- package/dist/core/interfaces/browserConfigurationInterface.d.ts +2 -2
- package/dist/core/interfaces/executionDetails.d.ts +3 -1
- package/dist/core/interfaces/fireflinkScriptPayloadInterface.d.ts +1 -1
- package/dist/core/main/executionContext.js +2 -1
- package/dist/core/main/runAutomationScript.js +3 -3
- package/dist/core/types/browserType.d.ts +8 -1
- package/dist/core/types/browserType.js +6 -1
- package/dist/service/fireflink.service.d.ts +1 -1
- package/dist/service/fireflink.service.js +2 -2
- package/dist/service/kafka/fireflinkKafka.service.d.ts +1 -1
- package/dist/service/kafka/fireflinkKafka.service.js +11 -10
- package/dist/utils/browserCap/capability.d.ts +2 -2
- package/package.json +1 -1
- package/dist/tests/test12.d.ts +0 -1
- package/dist/tests/test12.js +0 -74
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BrowserId } from "../../core/types/browserType.js";
|
|
2
2
|
import { CloudConfig } from "../../core/interfaces/cloudConfigInterface.js";
|
|
3
3
|
export declare class BrowserSession {
|
|
4
4
|
private driver;
|
|
@@ -6,7 +6,7 @@ export declare class BrowserSession {
|
|
|
6
6
|
private pageLoad;
|
|
7
7
|
private cloudSessionInstances;
|
|
8
8
|
private isCloud;
|
|
9
|
-
constructor(browserName:
|
|
9
|
+
constructor(browserName: BrowserId, isCloud: boolean | undefined, capabilities: Record<string, any> | undefined, pageLoad: number, CloudConfig: CloudConfig | undefined);
|
|
10
10
|
private openBrowser;
|
|
11
11
|
open(): Promise<void>;
|
|
12
12
|
close(): Promise<void>;
|
|
@@ -27,8 +27,10 @@ export interface AutomationRequest {
|
|
|
27
27
|
appiumPort: number;
|
|
28
28
|
realDeviceId: string;
|
|
29
29
|
platformVersion: string;
|
|
30
|
+
broker: string[];
|
|
31
|
+
sslConfig: any;
|
|
32
|
+
isTerminate: boolean;
|
|
30
33
|
isCloud?: boolean;
|
|
31
34
|
capabilities?: Record<string, any>;
|
|
32
35
|
cloudConfig?: CloudConfig;
|
|
33
|
-
isTerminate: boolean;
|
|
34
36
|
}
|
|
@@ -3,11 +3,12 @@ import { MobileSession } from "../../automation/mobileSession/initiateMobileSess
|
|
|
3
3
|
import { ElementGetter } from "../../fireflinkData/fireflinkLocators/getListOfLocators.js";
|
|
4
4
|
import { ScriptDataAppender } from "../../fireflinkData/fireflinkScript/scriptGenrationData.js";
|
|
5
5
|
import { DEFAULT_PAGE_LOAD } from "../constants/defaultValues.js";
|
|
6
|
+
import { browsers } from "../../core/types/browserType.js";
|
|
6
7
|
export class ExecutionContext {
|
|
7
8
|
constructor(request) {
|
|
8
9
|
this.request = request;
|
|
9
10
|
this.executor = null;
|
|
10
|
-
this.session = new BrowserSession(request.browser.browserName, request.isCloud, request.capabilities, DEFAULT_PAGE_LOAD, request.cloudConfig);
|
|
11
|
+
this.session = new BrowserSession(browsers[request.browser.browserName], request.isCloud, request.capabilities, DEFAULT_PAGE_LOAD, request.cloudConfig);
|
|
11
12
|
this.locator = new ElementGetter();
|
|
12
13
|
this.scriptAppender = new ScriptDataAppender();
|
|
13
14
|
this.androidSession = new MobileSession(request.appiumPort, request.isCloud, request.capabilities, request.cloudConfig);
|
|
@@ -86,7 +86,7 @@ export class AutomationRunner {
|
|
|
86
86
|
return AutomationRunner.updateSessionTerminationInfo(request.testCaseId);
|
|
87
87
|
AutomationRunner.sessionTerminationDetails[request.testCaseId] = request.isTerminate;
|
|
88
88
|
const apiService = new FireFlinkApiService();
|
|
89
|
-
const fireflinkServiceInstance = new fireflinkService(apiService);
|
|
89
|
+
const fireflinkServiceInstance = new fireflinkService(apiService, request.broker, request.sslConfig);
|
|
90
90
|
const instanceDetails = await fireflinkServiceInstance.runGetInstancesDetails(request.projectId, request.token, request.serverData);
|
|
91
91
|
const aiInfo = getAiInstanceInfo(instanceDetails.responseObject);
|
|
92
92
|
const context = new ExecutionContext(request);
|
|
@@ -559,11 +559,11 @@ export class AutomationRunner {
|
|
|
559
559
|
};
|
|
560
560
|
try {
|
|
561
561
|
await context.scriptAppender.waitForAllSteps();
|
|
562
|
-
|
|
562
|
+
logger.info(context.scriptAppender.getData(), payload);
|
|
563
563
|
this.KafkaPayload.topic = `Topic-FIREFLINK-api-requests-${request.serverHost}`;
|
|
564
564
|
this.KafkaPayload.message = {
|
|
565
565
|
...payload,
|
|
566
|
-
|
|
566
|
+
stepData: context.scriptAppender.getData(),
|
|
567
567
|
serverHost: request.serverHost
|
|
568
568
|
};
|
|
569
569
|
logger.info(this.KafkaPayload);
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const browsers: {
|
|
2
|
+
readonly "Microsoft Edge": "edge";
|
|
3
|
+
readonly "Google Chrome": "chrome";
|
|
4
|
+
readonly "Mozilla Firefox": "firefox";
|
|
5
|
+
readonly Safari: "safari";
|
|
6
|
+
};
|
|
7
|
+
export type BrowserName = keyof typeof browsers;
|
|
8
|
+
export type BrowserId = typeof browsers[BrowserName];
|
|
@@ -2,7 +2,7 @@ import { IFireflinkService, IFireFlinkApiService, IKafkaPayload } from "../core/
|
|
|
2
2
|
export declare class fireflinkService implements IFireflinkService {
|
|
3
3
|
private apiService;
|
|
4
4
|
private kafkaProducer;
|
|
5
|
-
constructor(apiService: IFireFlinkApiService);
|
|
5
|
+
constructor(apiService: IFireFlinkApiService, broker: string[], sslConfig: any);
|
|
6
6
|
runGetInstancesDetails(projectId: string, token: string, serverData: string): Promise<any>;
|
|
7
7
|
produceMessageToKafka(kafkaArgs: IKafkaPayload): Promise<void>;
|
|
8
8
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { KafkaProducerService } from "./kafka/fireflinkKafka.service.js";
|
|
2
2
|
import { logger } from "../utils/logger/logData.js";
|
|
3
3
|
export class fireflinkService {
|
|
4
|
-
constructor(apiService) {
|
|
4
|
+
constructor(apiService, broker, sslConfig) {
|
|
5
5
|
this.apiService = apiService;
|
|
6
|
-
this.kafkaProducer = new KafkaProducerService();
|
|
6
|
+
this.kafkaProducer = new KafkaProducerService(broker, sslConfig);
|
|
7
7
|
}
|
|
8
8
|
async runGetInstancesDetails(projectId, token, serverData) {
|
|
9
9
|
const headers = {
|
|
@@ -2,6 +2,6 @@ import { IKafkaPayload } from "../../core/interfaces/fireflinkScriptPayloadInter
|
|
|
2
2
|
export declare class KafkaProducerService {
|
|
3
3
|
private kafka;
|
|
4
4
|
private kafkaProducer;
|
|
5
|
-
constructor();
|
|
5
|
+
constructor(brokers: string[], sslConfig: any);
|
|
6
6
|
produceMessage(kafkaArgs: IKafkaPayload): Promise<void>;
|
|
7
7
|
}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { Kafka } from "kafkajs";
|
|
1
|
+
import { Kafka, logLevel } from "kafkajs";
|
|
2
2
|
import { logger } from "../../utils/logger/logData.js";
|
|
3
|
-
import fs from "fs";
|
|
4
3
|
import dotenv from "dotenv";
|
|
5
4
|
dotenv.config();
|
|
6
5
|
export class KafkaProducerService {
|
|
7
|
-
constructor() {
|
|
6
|
+
constructor(brokers, sslConfig) {
|
|
8
7
|
this.kafka = new Kafka({
|
|
9
|
-
clientId:
|
|
10
|
-
brokers:
|
|
11
|
-
ssl:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
clientId: "FireFlinK-AI-Automation",
|
|
9
|
+
brokers: brokers,
|
|
10
|
+
ssl: sslConfig,
|
|
11
|
+
logLevel: logLevel.ERROR,
|
|
12
|
+
connectionTimeout: 10000,
|
|
13
|
+
requestTimeout: 60000,
|
|
14
|
+
retry: {
|
|
15
|
+
initialRetryTime: 300,
|
|
16
|
+
retries: 10,
|
|
16
17
|
},
|
|
17
18
|
});
|
|
18
19
|
this.kafkaProducer = this.kafka.producer();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function getCapabilities(browserName:
|
|
1
|
+
import { BrowserId } from "../../core/types/browserType.js";
|
|
2
|
+
export declare function getCapabilities(browserName: BrowserId): {
|
|
3
3
|
'goog:chromeOptions'?: {
|
|
4
4
|
args: string[];
|
|
5
5
|
} | undefined;
|
package/package.json
CHANGED
package/dist/tests/test12.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/tests/test12.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { AutomationRunner } from "../index.js";
|
|
2
|
-
import path from "path";
|
|
3
|
-
const runner = new AutomationRunner();
|
|
4
|
-
runner.run({
|
|
5
|
-
userStory: [
|
|
6
|
-
["Open browser"],
|
|
7
|
-
["Navigate to https://www.google.com/"],
|
|
8
|
-
["Maximize the browser"],
|
|
9
|
-
// ["Navigate to https://www.google.com/"],
|
|
10
|
-
// ["Maximize the browser"],
|
|
11
|
-
// ["Navigate to https://www.google.com/"],
|
|
12
|
-
// ["Maximize the browser"],
|
|
13
|
-
// ["click on Gmail link"],
|
|
14
|
-
["Close browser"],
|
|
15
|
-
// ["start iteration using 'Data1' Dataprovider"],
|
|
16
|
-
// ["enter 'startIteration1' in search field"],
|
|
17
|
-
// ["enter level-A in search field"],
|
|
18
|
-
// ["start iteration using 'Data1' Dataprovider"],
|
|
19
|
-
// ["enter 'startIteration1' in search field"],
|
|
20
|
-
// ["enter level-B in search field"],
|
|
21
|
-
// ["End iteration"],
|
|
22
|
-
// ["End iteration"],
|
|
23
|
-
// ["click on Gmail link"],
|
|
24
|
-
// ["Close browser"],
|
|
25
|
-
],
|
|
26
|
-
platform: "web",
|
|
27
|
-
pageDetails: {
|
|
28
|
-
Web: {
|
|
29
|
-
pageId: "PAG73a7a0ad-c092-4351-8a93-68647f60e343",
|
|
30
|
-
pageName: "ai-Page"
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
sessionPath: path.join("D:", "Bitbucket", "automationV2"),
|
|
34
|
-
serverHost: "test3",
|
|
35
|
-
// topic: "",
|
|
36
|
-
// serviceAccounts: "",
|
|
37
|
-
webSocketId: "",
|
|
38
|
-
generatedBy: "",
|
|
39
|
-
licenseType: "C-Professional",
|
|
40
|
-
licenseId: "LIC3985",
|
|
41
|
-
userId: "USR26935",
|
|
42
|
-
projectType: "Web",
|
|
43
|
-
browser: {
|
|
44
|
-
browserName: "chrome",
|
|
45
|
-
},
|
|
46
|
-
serverData: "https://test3.fireflink.com",
|
|
47
|
-
version: "asdfg",
|
|
48
|
-
type: "sdfg",
|
|
49
|
-
scriptName: "url",
|
|
50
|
-
scriptType: "web",
|
|
51
|
-
projectId: "PJT1116",
|
|
52
|
-
testCaseId: "SCR1208",
|
|
53
|
-
promptId: "3f6e123c-8ec6-47c1-90e1-1a2f53b49251",
|
|
54
|
-
userName: "default-user",
|
|
55
|
-
appiumPort: 0,
|
|
56
|
-
platformVersion: "",
|
|
57
|
-
realDeviceId: "",
|
|
58
|
-
isCloud: false,
|
|
59
|
-
cloudConfig: {
|
|
60
|
-
accessKey: "yfAa_w199cJge2Gezsgb2Jnu7hKdqER1tExY5kKvgSvXfi1lRUelFsbTFI5pMq7zQuwwNXXnsLTkjKhvWcKDWsUoGLi9KjUV6gbUNDhqj0jWYFyW9h_0LIDEg5qXigwZdqzQqAvWwHin3gBhzGndeROtixv_VFhnseGSWRAHTajZzE-Zl0d8BP6gl0TEBUfoNgqBtAQVDLP6wAQzPfcyjjGFsdHkXWeHFkKmA78D7rKlnNuN2WgjIUlhYheDRDeqZ98Ig_PyS1GbUvjwJ73L38sr_cD4Y9lrKyWJV-m5RmtKhmkqRM8uk5gEfjzgwy30",
|
|
61
|
-
hostname: "devicefarm.fireflink.com",
|
|
62
|
-
licenseId: "LIC2026658",
|
|
63
|
-
projectName: "Project-6",
|
|
64
|
-
protocol: "https",
|
|
65
|
-
path: "backend/fireflinkcloud/wd/hub"
|
|
66
|
-
},
|
|
67
|
-
capabilities: {
|
|
68
|
-
browserName: "chrome",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