automation_model 1.0.477-dev → 1.0.477-stage
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/lib/api.d.ts +42 -1
- package/lib/api.js +221 -47
- package/lib/api.js.map +1 -1
- package/lib/auto_page.d.ts +2 -1
- package/lib/auto_page.js +39 -17
- package/lib/auto_page.js.map +1 -1
- package/lib/browser_manager.d.ts +6 -3
- package/lib/browser_manager.js +92 -18
- package/lib/browser_manager.js.map +1 -1
- package/lib/command_common.d.ts +1 -0
- package/lib/command_common.js +61 -7
- package/lib/command_common.js.map +1 -1
- package/lib/environment.js +5 -3
- package/lib/environment.js.map +1 -1
- package/lib/error-messages.d.ts +6 -0
- package/lib/error-messages.js +188 -0
- package/lib/error-messages.js.map +1 -0
- package/lib/generation_scripts.d.ts +4 -0
- package/lib/generation_scripts.js +2 -0
- package/lib/generation_scripts.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/init_browser.d.ts +2 -1
- package/lib/init_browser.js +31 -4
- package/lib/init_browser.js.map +1 -1
- package/lib/locate_element.js +5 -3
- package/lib/locate_element.js.map +1 -1
- package/lib/locator.d.ts +36 -0
- package/lib/locator.js +165 -0
- package/lib/locator.js.map +1 -1
- package/lib/locator_log.d.ts +26 -0
- package/lib/locator_log.js +69 -0
- package/lib/locator_log.js.map +1 -0
- package/lib/network.d.ts +3 -0
- package/lib/network.js +155 -0
- package/lib/network.js.map +1 -0
- package/lib/stable_browser.d.ts +44 -9
- package/lib/stable_browser.js +490 -295
- package/lib/stable_browser.js.map +1 -1
- package/lib/table.d.ts +13 -0
- package/lib/table.js +187 -0
- package/lib/table.js.map +1 -0
- package/lib/test_context.d.ts +1 -0
- package/lib/test_context.js +12 -12
- package/lib/test_context.js.map +1 -1
- package/lib/utils.d.ts +3 -1
- package/lib/utils.js +68 -1
- package/lib/utils.js.map +1 -1
- package/package.json +5 -4
package/lib/network.js
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
function _getNetworkFile(world = null, stable = null, context = null) {
|
|
4
|
+
let networkFile = null;
|
|
5
|
+
if (world && world.reportFolder) {
|
|
6
|
+
networkFile = path.join(world.reportFolder, "network.json");
|
|
7
|
+
}
|
|
8
|
+
else if (stable.reportFolder) {
|
|
9
|
+
networkFile = path.join(stable.reportFolder, "network.json");
|
|
10
|
+
}
|
|
11
|
+
else if (context && context.reportFolder) {
|
|
12
|
+
networkFile = path.join(context.reportFolder, "network.json");
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
networkFile = "network.json";
|
|
16
|
+
}
|
|
17
|
+
return networkFile;
|
|
18
|
+
}
|
|
19
|
+
function registerDownloadEvent(page, world, context) {
|
|
20
|
+
if (page) {
|
|
21
|
+
let downloadPath = "./downloads";
|
|
22
|
+
if (world && world.downloadsPath) {
|
|
23
|
+
downloadPath = world.downloadsPath;
|
|
24
|
+
}
|
|
25
|
+
else if (context && context.downloadsPath) {
|
|
26
|
+
downloadPath = context.downloadsPath;
|
|
27
|
+
}
|
|
28
|
+
if (!fs.existsSync(downloadPath)) {
|
|
29
|
+
try {
|
|
30
|
+
fs.mkdirSync(downloadPath);
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
// ignore
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
page.on("download", async (download) => {
|
|
37
|
+
const suggestedFilename = download.suggestedFilename(); // Get the original file name
|
|
38
|
+
const filePath = `${downloadPath}/${suggestedFilename}`;
|
|
39
|
+
// Save the download with the original name
|
|
40
|
+
await download.saveAs(filePath);
|
|
41
|
+
console.log(`Downloaded file saved as: ${filePath}`);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function registerNetworkEvents(world, stable, context, page) {
|
|
46
|
+
const networkFile = _getNetworkFile(world, stable, context);
|
|
47
|
+
function saveNetworkData() {
|
|
48
|
+
if (context && context.networkData) {
|
|
49
|
+
fs.writeFileSync(networkFile, JSON.stringify(context.networkData, null, 2), "utf8");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (!context) {
|
|
53
|
+
console.error("No context found to register network events");
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
// Map to hold request start times and IDs
|
|
57
|
+
const requestTimes = new Map();
|
|
58
|
+
let requestIdCounter = 0;
|
|
59
|
+
if (page) {
|
|
60
|
+
if (!context.networkData) {
|
|
61
|
+
context.networkData = [];
|
|
62
|
+
const networkData = context.networkData;
|
|
63
|
+
// Event listener for when a request is made
|
|
64
|
+
page.on("request", (request) => {
|
|
65
|
+
const requestId = requestIdCounter++;
|
|
66
|
+
request.requestId = requestId; // Assign a unique ID to the request
|
|
67
|
+
const startTime = Date.now();
|
|
68
|
+
requestTimes.set(requestId, startTime);
|
|
69
|
+
// Initialize data for this request
|
|
70
|
+
networkData.push({
|
|
71
|
+
requestId,
|
|
72
|
+
requestStart: startTime,
|
|
73
|
+
requestUrl: request.url(),
|
|
74
|
+
method: request.method(),
|
|
75
|
+
status: "Pending",
|
|
76
|
+
responseTime: null,
|
|
77
|
+
responseReceived: null,
|
|
78
|
+
responseEnd: null,
|
|
79
|
+
size: null,
|
|
80
|
+
});
|
|
81
|
+
saveNetworkData();
|
|
82
|
+
});
|
|
83
|
+
// Event listener for when a response is received
|
|
84
|
+
page.on("response", async (response) => {
|
|
85
|
+
const request = response.request();
|
|
86
|
+
const requestId = request.requestId;
|
|
87
|
+
const receivedTime = Date.now();
|
|
88
|
+
// Find the corresponding data object
|
|
89
|
+
const data = networkData.find((item) => item.requestId === requestId);
|
|
90
|
+
if (data) {
|
|
91
|
+
data.status = response.status();
|
|
92
|
+
data.responseReceived = receivedTime;
|
|
93
|
+
saveNetworkData();
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
console.error("No data found for request ID", requestId);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
// Event listener for when a request is finished
|
|
100
|
+
page.on("requestfinished", async (request) => {
|
|
101
|
+
const requestId = request.requestId;
|
|
102
|
+
const endTime = Date.now();
|
|
103
|
+
const startTime = requestTimes.get(requestId);
|
|
104
|
+
const response = await request.response();
|
|
105
|
+
// Find the corresponding data object
|
|
106
|
+
const data = networkData.find((item) => item.requestId === requestId);
|
|
107
|
+
if (data) {
|
|
108
|
+
data.responseEnd = endTime;
|
|
109
|
+
data.responseTime = endTime - startTime;
|
|
110
|
+
// Get response size
|
|
111
|
+
try {
|
|
112
|
+
const body = await response.body();
|
|
113
|
+
data.size = body.length;
|
|
114
|
+
}
|
|
115
|
+
catch (e) {
|
|
116
|
+
data.size = 0;
|
|
117
|
+
}
|
|
118
|
+
saveNetworkData();
|
|
119
|
+
if (world && world.attach) {
|
|
120
|
+
world.attach(JSON.stringify(data), { mediaType: "application/json+network" });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
console.error("No data found for request ID", requestId);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
// Event listener for when a request fails
|
|
128
|
+
page.on("requestfailed", (request) => {
|
|
129
|
+
const requestId = request.requestId;
|
|
130
|
+
const endTime = Date.now();
|
|
131
|
+
const startTime = requestTimes.get(requestId);
|
|
132
|
+
// Find the corresponding data object
|
|
133
|
+
const data = networkData.find((item) => item.requestId === requestId);
|
|
134
|
+
if (data) {
|
|
135
|
+
data.responseEnd = endTime;
|
|
136
|
+
data.responseTime = endTime - startTime;
|
|
137
|
+
data.status = "Failed";
|
|
138
|
+
data.size = 0;
|
|
139
|
+
saveNetworkData();
|
|
140
|
+
if (world && world.attach) {
|
|
141
|
+
world.attach(JSON.stringify(data), { mediaType: "application/json+network" });
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
console.error("No data found for request ID", requestId);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
console.error("No page found to register network events");
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
export { registerNetworkEvents, registerDownloadEvent };
|
|
155
|
+
//# sourceMappingURL=network.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.js","sourceRoot":"","sources":["../../src/network.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,SAAS,eAAe,CAAC,QAAa,IAAI,EAAE,SAAc,IAAI,EAAE,UAAe,IAAI;IACjF,IAAI,WAAW,GAAG,IAAI,CAAC;IACvB,IAAI,KAAK,IAAI,KAAK,CAAC,YAAY,EAAE;QAC/B,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;KAC7D;SAAM,IAAI,MAAM,CAAC,YAAY,EAAE;QAC9B,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;KAC9D;SAAM,IAAI,OAAO,IAAI,OAAO,CAAC,YAAY,EAAE;QAC1C,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;KAC/D;SAAM;QACL,WAAW,GAAG,cAAc,CAAC;KAC9B;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AACD,SAAS,qBAAqB,CAAC,IAAS,EAAE,KAAU,EAAE,OAAY;IAChE,IAAI,IAAI,EAAE;QACR,IAAI,YAAY,GAAG,aAAa,CAAC;QACjC,IAAI,KAAK,IAAI,KAAK,CAAC,aAAa,EAAE;YAChC,YAAY,GAAG,KAAK,CAAC,aAAa,CAAC;SACpC;aAAM,IAAI,OAAO,IAAI,OAAO,CAAC,aAAa,EAAE;YAC3C,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC;SACtC;QACD,IAAI,CAAC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ACH,CAAC,CAAC,CAAC;YAEH,0CAA0C;YAC1C,IAAI,CAAC,EAAE,CAAC,eAAe,EAAE,CAAC,OAAY,EAAE,EAAE;gBACxC,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;gBACpC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;gBAC3B,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;gBAE9C,qCAAqC;gBACrC,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC;gBAE3E,IAAI,IAAI,EAAE;oBACR,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;oBAC3B,IAAI,CAAC,YAAY,GAAG,OAAO,GAAG,SAAS,CAAC;oBACxC,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC;oBACvB,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;oBACd,eAAe,EAAE,CAAC;oBAClB,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE;wBACzB,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,0BAA0B,EAAE,CAAC,CAAC;qBAC/E;iBACF;qBAAM;oBACL,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,SAAS,CAAC,CAAC;iBAC1D;YACH,CAAC,CAAC,CAAC;SACJ;KACF;SAAM;QACL,OAAO,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;KAC3D;AACH,CAAC;AACD,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,CAAC"}
|
package/lib/stable_browser.d.ts
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
import type { Browser, Page } from "playwright";
|
|
2
2
|
type Params = Record<string, string>;
|
|
3
|
+
export declare const Types: {
|
|
4
|
+
CLICK: string;
|
|
5
|
+
NAVIGATE: string;
|
|
6
|
+
FILL: string;
|
|
7
|
+
EXECUTE: string;
|
|
8
|
+
OPEN: string;
|
|
9
|
+
COMPLETE: string;
|
|
10
|
+
ASK: string;
|
|
11
|
+
GET_PAGE_STATUS: string;
|
|
12
|
+
CLICK_ROW_ACTION: string;
|
|
13
|
+
VERIFY_ELEMENT_CONTAINS_TEXT: string;
|
|
14
|
+
ANALYZE_TABLE: string;
|
|
15
|
+
SELECT: string;
|
|
16
|
+
VERIFY_PAGE_PATH: string;
|
|
17
|
+
TYPE_PRESS: string;
|
|
18
|
+
PRESS: string;
|
|
19
|
+
HOVER: string;
|
|
20
|
+
CHECK: string;
|
|
21
|
+
UNCHECK: string;
|
|
22
|
+
EXTRACT: string;
|
|
23
|
+
CLOSE_PAGE: string;
|
|
24
|
+
SET_DATE_TIME: string;
|
|
25
|
+
SET_VIEWPORT: string;
|
|
26
|
+
VERIFY_VISUAL: string;
|
|
27
|
+
LOAD_DATA: string;
|
|
28
|
+
SET_INPUT: string;
|
|
29
|
+
WAIT_FOR_TEXT_TO_DISAPPEAR: string;
|
|
30
|
+
VERIFY_ATTRIBUTE: string;
|
|
31
|
+
};
|
|
3
32
|
export declare const apps: {};
|
|
4
33
|
declare class StableBrowser {
|
|
5
34
|
browser: Browser;
|
|
@@ -12,7 +41,9 @@ declare class StableBrowser {
|
|
|
12
41
|
networkLogger: null;
|
|
13
42
|
configuration: null;
|
|
14
43
|
appName: string;
|
|
44
|
+
tags: null;
|
|
15
45
|
constructor(browser: Browser, page: Page, logger?: any, context?: any, world?: any);
|
|
46
|
+
scrollPageToLoadLazyElements(): Promise<void>;
|
|
16
47
|
registerEventListeners(context: any): void;
|
|
17
48
|
switchApp(appName: any): Promise<void>;
|
|
18
49
|
_copyContext(from: any, to: any): void;
|
|
@@ -32,8 +63,8 @@ declare class StableBrowser {
|
|
|
32
63
|
rerun: boolean;
|
|
33
64
|
}>;
|
|
34
65
|
_locate(selectors: any, info: any, _params?: Params, timeout: any): Promise<any>;
|
|
35
|
-
_findFrameScope(selectors: any, timeout
|
|
36
|
-
_getDocumentBody(selectors: any, timeout
|
|
66
|
+
_findFrameScope(selectors: any, timeout: number | undefined, info: any): Promise<any>;
|
|
67
|
+
_getDocumentBody(selectors: any, timeout: number | undefined, info: any): Promise<any>;
|
|
37
68
|
_locate_internal(selectors: any, info: any, _params?: Params, timeout?: number): Promise<any>;
|
|
38
69
|
_scanLocatorsGroup(locatorsGroup: any, scope: any, _params: any, info: any, visibleOnly: any): Promise<{
|
|
39
70
|
foundElements: any[];
|
|
@@ -92,27 +123,31 @@ declare class StableBrowser {
|
|
|
92
123
|
_screenShot(options?: {}, world?: null, info?: null): Promise<{}>;
|
|
93
124
|
takeScreenshot(screenshotPath: any): Promise<any>;
|
|
94
125
|
verifyElementExistInPage(selectors: any, _params?: null, options?: {}, world?: null): Promise<any>;
|
|
95
|
-
extractAttribute(selectors: any, attribute: any, variable: any, _params?: null, options?: {}, world?: null): Promise<
|
|
126
|
+
extractAttribute(selectors: any, attribute: any, variable: any, _params?: null, options?: {}, world?: null): Promise<any>;
|
|
127
|
+
verifyAttribute(selectors: any, attribute: any, value: any, _params?: null, options?: {}, world?: null): Promise<any>;
|
|
96
128
|
extractEmailData(emailAddress: any, options: any, world: any): Promise<{
|
|
97
129
|
emailUrl: any;
|
|
98
130
|
emailCode: any;
|
|
99
131
|
}>;
|
|
100
132
|
_highlightElements(scope: any, css: any): Promise<void>;
|
|
101
133
|
verifyPagePath(pathPart: any, options?: {}, world?: null): Promise<{} | undefined>;
|
|
102
|
-
verifyTextExistInPage(text: any, options?: {}, world?: null): Promise<
|
|
134
|
+
verifyTextExistInPage(text: any, options?: {}, world?: null): Promise<any>;
|
|
135
|
+
waitForTextToDisappear(text: any, options?: {}, world?: null): Promise<any>;
|
|
103
136
|
_getServerUrl(): string;
|
|
104
|
-
visualVerification(text: any, options?: {}, world?: null): Promise<{}>;
|
|
137
|
+
visualVerification(text: any, options?: {}, world?: null): Promise<{} | undefined>;
|
|
105
138
|
verifyTableData(selectors: any, data: any, _params?: null, options?: {}, world?: null): Promise<void>;
|
|
106
139
|
getTableData(selectors: any, _params?: null, options?: {}, world?: null): Promise<any>;
|
|
107
|
-
analyzeTable(selectors: any, query: any, operator: any, value: any, _params?: null, options?: {}, world?: null): Promise<{}>;
|
|
108
|
-
_replaceWithLocalData(value: any, world: any, _decrypt?: boolean, totpWait?: boolean): Promise<
|
|
140
|
+
analyzeTable(selectors: any, query: any, operator: any, value: any, _params?: null, options?: {}, world?: null): Promise<{} | undefined>;
|
|
141
|
+
_replaceWithLocalData(value: any, world: any, _decrypt?: boolean, totpWait?: boolean): Promise<string>;
|
|
109
142
|
_getLoadTimeout(options: any): number;
|
|
110
143
|
waitForPageLoad(options?: {}, world?: null): Promise<void>;
|
|
111
144
|
closePage(options?: {}, world?: null): Promise<void>;
|
|
145
|
+
saveTestDataAsGlobal(options: any, world: any): void;
|
|
112
146
|
setViewportSize(width: number, hight: number, options?: {}, world?: null): Promise<void>;
|
|
113
147
|
reloadPage(options?: {}, world?: null): Promise<void>;
|
|
114
148
|
scrollIfNeeded(element: any, info: any): Promise<void>;
|
|
115
|
-
|
|
149
|
+
beforeStep(world: any, step: any): Promise<void>;
|
|
150
|
+
afterStep(world: any, step: any): Promise<void>;
|
|
116
151
|
}
|
|
117
152
|
type JsonTimestamp = number;
|
|
118
153
|
type JsonResultPassed = {
|
|
@@ -127,7 +162,7 @@ type JsonResultFailed = {
|
|
|
127
162
|
message?: string;
|
|
128
163
|
};
|
|
129
164
|
type JsonCommandResult = JsonResultPassed | JsonResultFailed;
|
|
130
|
-
type JsonCommandReport = {
|
|
165
|
+
export type JsonCommandReport = {
|
|
131
166
|
type: string;
|
|
132
167
|
value?: string;
|
|
133
168
|
text: string;
|