automation_model 1.0.404-dev → 1.0.404-main

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.
Files changed (47) hide show
  1. package/lib/api.d.ts +42 -1
  2. package/lib/api.js +227 -41
  3. package/lib/api.js.map +1 -1
  4. package/lib/auto_page.d.ts +1 -1
  5. package/lib/auto_page.js +43 -17
  6. package/lib/auto_page.js.map +1 -1
  7. package/lib/axe/axe.mini.js +12 -0
  8. package/lib/browser_manager.d.ts +6 -3
  9. package/lib/browser_manager.js +48 -20
  10. package/lib/browser_manager.js.map +1 -1
  11. package/lib/command_common.d.ts +6 -0
  12. package/lib/command_common.js +138 -0
  13. package/lib/command_common.js.map +1 -0
  14. package/lib/environment.d.ts +3 -0
  15. package/lib/environment.js +5 -2
  16. package/lib/environment.js.map +1 -1
  17. package/lib/error-messages.d.ts +6 -0
  18. package/lib/error-messages.js +188 -0
  19. package/lib/error-messages.js.map +1 -0
  20. package/lib/index.d.ts +1 -0
  21. package/lib/index.js +1 -0
  22. package/lib/index.js.map +1 -1
  23. package/lib/init_browser.d.ts +2 -1
  24. package/lib/init_browser.js +54 -3
  25. package/lib/init_browser.js.map +1 -1
  26. package/lib/locate_element.d.ts +7 -0
  27. package/lib/locate_element.js +213 -0
  28. package/lib/locate_element.js.map +1 -0
  29. package/lib/locator.d.ts +36 -0
  30. package/lib/locator.js +165 -0
  31. package/lib/locator.js.map +1 -1
  32. package/lib/network.d.ts +3 -0
  33. package/lib/network.js +144 -0
  34. package/lib/network.js.map +1 -0
  35. package/lib/stable_browser.d.ts +40 -23
  36. package/lib/stable_browser.js +942 -891
  37. package/lib/stable_browser.js.map +1 -1
  38. package/lib/table.d.ts +13 -0
  39. package/lib/table.js +187 -0
  40. package/lib/table.js.map +1 -0
  41. package/lib/test_context.d.ts +4 -0
  42. package/lib/test_context.js +12 -9
  43. package/lib/test_context.js.map +1 -1
  44. package/lib/utils.d.ts +3 -1
  45. package/lib/utils.js +70 -3
  46. package/lib/utils.js.map +1 -1
  47. package/package.json +10 -7
package/lib/network.js ADDED
@@ -0,0 +1,144 @@
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
+ fs.mkdirSync(downloadPath);
30
+ }
31
+ page.on("download", async (download) => {
32
+ const suggestedFilename = download.suggestedFilename(); // Get the original file name
33
+ const filePath = `${downloadPath}/${suggestedFilename}`;
34
+ // Save the download with the original name
35
+ await download.saveAs(filePath);
36
+ console.log(`Downloaded file saved as: ${filePath}`);
37
+ });
38
+ }
39
+ }
40
+ function registerNetworkEvents(world, stable, context, page) {
41
+ const networkFile = _getNetworkFile(world, stable, context);
42
+ function saveNetworkData() {
43
+ if (context && context.networkData) {
44
+ fs.writeFileSync(networkFile, JSON.stringify(context.networkData, null, 2), "utf8");
45
+ }
46
+ }
47
+ if (!context) {
48
+ console.error("No context found to register network events");
49
+ return;
50
+ }
51
+ // Map to hold request start times and IDs
52
+ const requestTimes = new Map();
53
+ let requestIdCounter = 0;
54
+ if (page) {
55
+ if (!context.networkData) {
56
+ context.networkData = [];
57
+ const networkData = context.networkData;
58
+ // Event listener for when a request is made
59
+ page.on("request", (request) => {
60
+ const requestId = requestIdCounter++;
61
+ request.requestId = requestId; // Assign a unique ID to the request
62
+ const startTime = Date.now();
63
+ requestTimes.set(requestId, startTime);
64
+ // Initialize data for this request
65
+ networkData.push({
66
+ requestId,
67
+ requestStart: startTime,
68
+ requestUrl: request.url(),
69
+ method: request.method(),
70
+ status: "Pending",
71
+ responseTime: null,
72
+ responseReceived: null,
73
+ responseEnd: null,
74
+ size: null,
75
+ });
76
+ saveNetworkData();
77
+ });
78
+ // Event listener for when a response is received
79
+ page.on("response", async (response) => {
80
+ const request = response.request();
81
+ const requestId = request.requestId;
82
+ const receivedTime = Date.now();
83
+ // Find the corresponding data object
84
+ const data = networkData.find((item) => item.requestId === requestId);
85
+ if (data) {
86
+ data.status = response.status();
87
+ data.responseReceived = receivedTime;
88
+ saveNetworkData();
89
+ }
90
+ else {
91
+ console.error("No data found for request ID", requestId);
92
+ }
93
+ });
94
+ // Event listener for when a request is finished
95
+ page.on("requestfinished", async (request) => {
96
+ const requestId = request.requestId;
97
+ const endTime = Date.now();
98
+ const startTime = requestTimes.get(requestId);
99
+ const response = await request.response();
100
+ // Find the corresponding data object
101
+ const data = networkData.find((item) => item.requestId === requestId);
102
+ if (data) {
103
+ data.responseEnd = endTime;
104
+ data.responseTime = endTime - startTime;
105
+ // Get response size
106
+ try {
107
+ const body = await response.body();
108
+ data.size = body.length;
109
+ }
110
+ catch (e) {
111
+ data.size = 0;
112
+ }
113
+ saveNetworkData();
114
+ }
115
+ else {
116
+ console.error("No data found for request ID", requestId);
117
+ }
118
+ });
119
+ // Event listener for when a request fails
120
+ page.on("requestfailed", (request) => {
121
+ const requestId = request.requestId;
122
+ const endTime = Date.now();
123
+ const startTime = requestTimes.get(requestId);
124
+ // Find the corresponding data object
125
+ const data = networkData.find((item) => item.requestId === requestId);
126
+ if (data) {
127
+ data.responseEnd = endTime;
128
+ data.responseTime = endTime - startTime;
129
+ data.status = "Failed";
130
+ data.size = 0;
131
+ saveNetworkData();
132
+ }
133
+ else {
134
+ console.error("No data found for request ID", requestId);
135
+ }
136
+ });
137
+ }
138
+ }
139
+ else {
140
+ console.error("No page found to register network events");
141
+ }
142
+ }
143
+ export { registerNetworkEvents, registerDownloadEvent };
144
+ //# 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,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC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C,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;iBACnB;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"}
@@ -1,43 +1,56 @@
1
1
  import type { Browser, Page } from "playwright";
2
2
  type Params = Record<string, string>;
3
+ export declare const apps: {};
3
4
  declare class StableBrowser {
4
5
  browser: Browser;
5
6
  page: Page;
6
7
  logger: any;
7
8
  context: any;
9
+ world?: any;
8
10
  project_path: null;
9
11
  webLogFile: null;
12
+ networkLogger: null;
10
13
  configuration: null;
11
- constructor(browser: Browser, page: Page, logger?: any, context?: any);
14
+ appName: string;
15
+ tags: null;
16
+ constructor(browser: Browser, page: Page, logger?: any, context?: any, world?: any);
17
+ scrollPageToLoadLazyElements(): Promise<void>;
18
+ registerEventListeners(context: any): void;
19
+ switchApp(appName: any): Promise<void>;
20
+ _copyContext(from: any, to: any): void;
12
21
  getWebLogFile(logFolder: string): string;
13
- registerConsoleLogListener(page: Page, context: any, logFile: string): void;
14
- registerRequestListener(): void;
22
+ registerConsoleLogListener(page: Page, context: any): void;
23
+ registerRequestListener(page: Page, context: any, logFile: string): void;
15
24
  goto(url: string): Promise<void>;
16
- _validateSelectors(selectors: any): void;
17
25
  _fixUsingParams(text: any, _params: Params): any;
18
26
  _fixLocatorUsingParams(locator: any, _params: Params): any;
19
27
  _isObject(value: any): any;
20
28
  scanAndManipulate(currentObj: any, _params: Params): void;
21
- _getLocator(locator: any, scope: any, _params: Params): any;
29
+ _getLocator(locator: any, scope: any, _params: any): any;
22
30
  _locateElmentByTextClimbCss(scope: any, text: any, climb: any, css: any, _params: Params): Promise<string | undefined>;
23
31
  _locateElementByText(scope: any, text1: any, tag1: any, regex1: boolean | undefined, partial1: any, _params: Params): Promise<any>;
24
32
  _collectLocatorInformation(selectorHierarchy: any, index: number | undefined, scope: any, foundLocators: any, _params: Params, info: any, visibleOnly?: boolean): Promise<void>;
25
33
  closeUnexpectedPopups(info: any, _params: any): Promise<{
26
34
  rerun: boolean;
27
35
  }>;
28
- _locate(selectors: any, info: any, _params?: Params, timeout?: number): Promise<any>;
36
+ _locate(selectors: any, info: any, _params?: Params, timeout: any): Promise<any>;
37
+ _findFrameScope(selectors: any, timeout: number | undefined, info: any): Promise<any>;
38
+ _getDocumentBody(selectors: any, timeout: number | undefined, info: any): Promise<any>;
29
39
  _locate_internal(selectors: any, info: any, _params?: Params, timeout?: number): Promise<any>;
30
40
  _scanLocatorsGroup(locatorsGroup: any, scope: any, _params: any, info: any, visibleOnly: any): Promise<{
31
41
  foundElements: any[];
32
42
  }>;
33
- click(selectors: any, _params?: Params, options?: {}, world?: null): Promise<{}>;
34
- setCheck(selectors: any, checked?: boolean, _params?: Params, options?: {}, world?: null): Promise<{}>;
35
- hover(selectors: any, _params?: Params, options?: {}, world?: null): Promise<{}>;
36
- selectOption(selectors: any, values: any, _params?: null, options?: {}, world?: null): Promise<{}>;
37
- type(_value: any, _params?: null, options?: {}, world?: null): Promise<{}>;
43
+ simpleClick(elementDescription: any, _params?: Params, options?: {}, world?: null): Promise<void>;
44
+ simpleClickType(elementDescription: any, value: any, _params?: Params, options?: {}, world?: null): Promise<void>;
45
+ click(selectors: any, _params?: Params, options?: {}, world?: null): Promise<any>;
46
+ setCheck(selectors: any, checked?: boolean, _params?: Params, options?: {}, world?: null): Promise<any>;
47
+ hover(selectors: any, _params?: Params, options?: {}, world?: null): Promise<any>;
48
+ selectOption(selectors: any, values: any, _params?: null, options?: {}, world?: null): Promise<any>;
49
+ type(_value: any, _params?: null, options?: {}, world?: null): Promise<any>;
50
+ setInputValue(selectors: any, value: any, _params?: null, options?: {}, world?: null): Promise<void>;
38
51
  setDateTime(selectors: any, value: any, format?: null, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<void>;
39
- clickType(selectors: any, _value: any, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<{}>;
40
- fill(selectors: any, value: any, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<{}>;
52
+ clickType(selectors: any, _value: any, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<any>;
53
+ fill(selectors: any, value: any, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<any>;
41
54
  getText(selectors: any, _params?: null, options?: {}, info?: {}, world?: null): Promise<{
42
55
  text: any;
43
56
  screenshotId: any;
@@ -64,9 +77,10 @@ declare class StableBrowser {
64
77
  value: any;
65
78
  element?: undefined;
66
79
  }>;
67
- containsPattern(selectors: any, pattern: any, text: any, _params?: null, options?: {}, world?: null): Promise<{}>;
68
- containsText(selectors: any, text: any, climb: any, _params?: null, options?: {}, world?: null): Promise<{}>;
80
+ containsPattern(selectors: any, pattern: any, text: any, _params?: null, options?: {}, world?: null): Promise<any>;
81
+ containsText(selectors: any, text: any, climb: any, _params?: null, options?: {}, world?: null): Promise<any>;
69
82
  _getDataFile(world?: null): string;
83
+ waitForUserInput(message: any, world?: null): Promise<void>;
70
84
  setTestData(testData: any, world?: null): void;
71
85
  _getDataFilePath(fileName: any): string;
72
86
  _parseCSVSync(filePath: any): Promise<unknown>;
@@ -79,28 +93,31 @@ declare class StableBrowser {
79
93
  getTestData(world?: null): {};
80
94
  _screenShot(options?: {}, world?: null, info?: null): Promise<{}>;
81
95
  takeScreenshot(screenshotPath: any): Promise<any>;
82
- verifyElementExistInPage(selectors: any, _params?: null, options?: {}, world?: null): Promise<{}>;
83
- extractAttribute(selectors: any, attribute: any, variable: any, _params?: null, options?: {}, world?: null): Promise<{}>;
96
+ verifyElementExistInPage(selectors: any, _params?: null, options?: {}, world?: null): Promise<any>;
97
+ extractAttribute(selectors: any, attribute: any, variable: any, _params?: null, options?: {}, world?: null): Promise<any>;
84
98
  extractEmailData(emailAddress: any, options: any, world: any): Promise<{
85
99
  emailUrl: any;
86
100
  emailCode: any;
87
101
  }>;
88
102
  _highlightElements(scope: any, css: any): Promise<void>;
89
103
  verifyPagePath(pathPart: any, options?: {}, world?: null): Promise<{} | undefined>;
90
- verifyTextExistInPage(text: any, options?: {}, world?: null): Promise<{}>;
104
+ verifyTextExistInPage(text: any, options?: {}, world?: null): Promise<any>;
105
+ waitForTextToDisappear(text: any, options?: {}, world?: null): Promise<any>;
91
106
  _getServerUrl(): string;
92
- visualVerification(text: any, options?: {}, world?: null): Promise<{}>;
107
+ visualVerification(text: any, options?: {}, world?: null): Promise<{} | undefined>;
93
108
  verifyTableData(selectors: any, data: any, _params?: null, options?: {}, world?: null): Promise<void>;
94
109
  getTableData(selectors: any, _params?: null, options?: {}, world?: null): Promise<any>;
95
- analyzeTable(selectors: any, query: any, operator: any, value: any, _params?: null, options?: {}, world?: null): Promise<{}>;
96
- _replaceWithLocalData(value: any, world: any, _decrypt?: boolean, totpWait?: boolean): Promise<any>;
110
+ analyzeTable(selectors: any, query: any, operator: any, value: any, _params?: null, options?: {}, world?: null): Promise<{} | undefined>;
111
+ _replaceWithLocalData(value: any, world: any, _decrypt?: boolean, totpWait?: boolean): Promise<string>;
97
112
  _getLoadTimeout(options: any): number;
98
113
  waitForPageLoad(options?: {}, world?: null): Promise<void>;
99
114
  closePage(options?: {}, world?: null): Promise<void>;
115
+ saveTestDataAsGlobal(options: any, world: any): void;
100
116
  setViewportSize(width: number, hight: number, options?: {}, world?: null): Promise<void>;
101
117
  reloadPage(options?: {}, world?: null): Promise<void>;
102
118
  scrollIfNeeded(element: any, info: any): Promise<void>;
103
- _reportToWorld(world: any, properties: JsonCommandReport): void;
119
+ beforeStep(world: any, step: any): Promise<void>;
120
+ afterStep(world: any, step: any): Promise<void>;
104
121
  }
105
122
  type JsonTimestamp = number;
106
123
  type JsonResultPassed = {
@@ -115,7 +132,7 @@ type JsonResultFailed = {
115
132
  message?: string;
116
133
  };
117
134
  type JsonCommandResult = JsonResultPassed | JsonResultFailed;
118
- type JsonCommandReport = {
135
+ export type JsonCommandReport = {
119
136
  type: string;
120
137
  value?: string;
121
138
  text: string;