automation_model 1.0.439-dev → 1.0.439

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 (63) hide show
  1. package/README.md +130 -0
  2. package/lib/api.d.ts +43 -1
  3. package/lib/api.js +241 -44
  4. package/lib/api.js.map +1 -1
  5. package/lib/auto_page.d.ts +5 -2
  6. package/lib/auto_page.js +197 -50
  7. package/lib/auto_page.js.map +1 -1
  8. package/lib/browser_manager.d.ts +7 -3
  9. package/lib/browser_manager.js +156 -85
  10. package/lib/browser_manager.js.map +1 -1
  11. package/lib/bruno.d.ts +2 -0
  12. package/lib/bruno.js +381 -0
  13. package/lib/bruno.js.map +1 -0
  14. package/lib/command_common.d.ts +6 -0
  15. package/lib/command_common.js +198 -0
  16. package/lib/command_common.js.map +1 -0
  17. package/lib/environment.d.ts +3 -0
  18. package/lib/environment.js +5 -2
  19. package/lib/environment.js.map +1 -1
  20. package/lib/error-messages.d.ts +6 -0
  21. package/lib/error-messages.js +206 -0
  22. package/lib/error-messages.js.map +1 -0
  23. package/lib/file_checker.d.ts +1 -0
  24. package/lib/file_checker.js +61 -0
  25. package/lib/file_checker.js.map +1 -0
  26. package/lib/generation_scripts.d.ts +4 -0
  27. package/lib/generation_scripts.js +2 -0
  28. package/lib/generation_scripts.js.map +1 -0
  29. package/lib/index.d.ts +3 -0
  30. package/lib/index.js +3 -0
  31. package/lib/index.js.map +1 -1
  32. package/lib/init_browser.d.ts +5 -2
  33. package/lib/init_browser.js +124 -7
  34. package/lib/init_browser.js.map +1 -1
  35. package/lib/locate_element.d.ts +7 -0
  36. package/lib/locate_element.js +215 -0
  37. package/lib/locate_element.js.map +1 -0
  38. package/lib/locator.d.ts +36 -0
  39. package/lib/locator.js +165 -0
  40. package/lib/locator.js.map +1 -1
  41. package/lib/locator_log.d.ts +26 -0
  42. package/lib/locator_log.js +69 -0
  43. package/lib/locator_log.js.map +1 -0
  44. package/lib/network.d.ts +3 -0
  45. package/lib/network.js +183 -0
  46. package/lib/network.js.map +1 -0
  47. package/lib/scripts/axe.mini.js +12 -0
  48. package/lib/stable_browser.d.ts +106 -36
  49. package/lib/stable_browser.js +1824 -1245
  50. package/lib/stable_browser.js.map +1 -1
  51. package/lib/table.d.ts +13 -0
  52. package/lib/table.js +187 -0
  53. package/lib/table.js.map +1 -0
  54. package/lib/table_helper.d.ts +19 -0
  55. package/lib/table_helper.js +116 -0
  56. package/lib/table_helper.js.map +1 -0
  57. package/lib/test_context.d.ts +6 -0
  58. package/lib/test_context.js +14 -10
  59. package/lib/test_context.js.map +1 -1
  60. package/lib/utils.d.ts +22 -2
  61. package/lib/utils.js +672 -11
  62. package/lib/utils.js.map +1 -1
  63. package/package.json +15 -12
@@ -1,44 +1,94 @@
1
1
  import type { Browser, Page } from "playwright";
2
- type Params = Record<string, string>;
2
+ import { Params } from "./utils.js";
3
+ export declare const Types: {
4
+ CLICK: string;
5
+ WAIT_ELEMENT: string;
6
+ NAVIGATE: string;
7
+ FILL: string;
8
+ EXECUTE: string;
9
+ OPEN: string;
10
+ COMPLETE: string;
11
+ ASK: string;
12
+ GET_PAGE_STATUS: string;
13
+ CLICK_ROW_ACTION: string;
14
+ VERIFY_ELEMENT_CONTAINS_TEXT: string;
15
+ VERIFY_PAGE_CONTAINS_TEXT: string;
16
+ VERIFY_PAGE_CONTAINS_NO_TEXT: string;
17
+ ANALYZE_TABLE: string;
18
+ SELECT: string;
19
+ VERIFY_PAGE_PATH: string;
20
+ TYPE_PRESS: string;
21
+ PRESS: string;
22
+ HOVER: string;
23
+ CHECK: string;
24
+ UNCHECK: string;
25
+ EXTRACT: string;
26
+ CLOSE_PAGE: string;
27
+ TABLE_OPERATION: string;
28
+ SET_DATE_TIME: string;
29
+ SET_VIEWPORT: string;
30
+ VERIFY_VISUAL: string;
31
+ LOAD_DATA: string;
32
+ SET_INPUT: string;
33
+ WAIT_FOR_TEXT_TO_DISAPPEAR: string;
34
+ VERIFY_ATTRIBUTE: string;
35
+ VERIFY_TEXT_WITH_RELATION: string;
36
+ BRUNO: string;
37
+ VERIFY_FILE_EXISTS: string;
38
+ SET_INPUT_FILES: string;
39
+ };
40
+ export declare const apps: {};
3
41
  declare class StableBrowser {
4
42
  browser: Browser;
5
43
  page: Page;
6
44
  logger: any;
7
45
  context: any;
46
+ world?: any;
8
47
  project_path: null;
9
48
  webLogFile: null;
49
+ networkLogger: null;
10
50
  configuration: null;
11
- constructor(browser: Browser, page: Page, logger?: any, context?: any);
12
- getWebLogFile(logFolder: string): string;
13
- registerConsoleLogListener(page: Page, context: any, logFile: string): void;
14
- registerRequestListener(): void;
15
- goto(url: string): Promise<void>;
16
- _validateSelectors(selectors: any): void;
17
- _fixUsingParams(text: any, _params: Params): any;
18
- _fixLocatorUsingParams(locator: any, _params: Params): any;
19
- _isObject(value: any): any;
20
- scanAndManipulate(currentObj: any, _params: Params): void;
21
- _getLocator(locator: any, scope: any, _params: any): any;
51
+ appName: string;
52
+ tags: null;
53
+ isRecording: boolean;
54
+ initSnapshotTaken: boolean;
55
+ constructor(browser: Browser, page: Page, logger?: any, context?: any, world?: any);
56
+ registerEventListeners(context: any): void;
57
+ switchApp(appName: any): Promise<void>;
58
+ switchTab(tabTitleOrIndex: number | string): Promise<void>;
59
+ registerConsoleLogListener(page: Page, context: any): void;
60
+ registerRequestListener(page: Page, context: any, logFile: string): void;
61
+ goto(url: string, world?: null): Promise<void>;
62
+ _getLocator(locator: any, scope: any, _params: any): Promise<any>;
22
63
  _locateElmentByTextClimbCss(scope: any, text: any, climb: any, css: any, _params: Params): Promise<string | undefined>;
23
- _locateElementByText(scope: any, text1: any, tag1: any, regex1: boolean | undefined, partial1: any, _params: Params): Promise<any>;
24
- _collectLocatorInformation(selectorHierarchy: any, index: number | undefined, scope: any, foundLocators: any, _params: Params, info: any, visibleOnly?: boolean): Promise<void>;
64
+ _locateElementByText(scope: any, text1: any, tag1: any, regex1: boolean | undefined, partial1: any, ignoreCase: boolean | undefined, _params: Params): Promise<{
65
+ elementCount: number;
66
+ randomToken: string;
67
+ }>;
68
+ _collectLocatorInformation(selectorHierarchy: any, index: number | undefined, scope: any, foundLocators: any, _params: Params, info: any, visibleOnly?: boolean, allowDisabled?: boolean | undefined, element_name?: null): Promise<void>;
25
69
  closeUnexpectedPopups(info: any, _params: any): Promise<{
26
70
  rerun: boolean;
27
71
  }>;
28
- _locate(selectors: any, info: any, _params?: Params, timeout?: number): Promise<any>;
29
- _locate_internal(selectors: any, info: any, _params?: Params, timeout?: number): Promise<any>;
30
- _scanLocatorsGroup(locatorsGroup: any, scope: any, _params: any, info: any, visibleOnly: any): Promise<{
72
+ _locate(selectors: any, info: any, _params?: Params, timeout: any, allowDisabled?: boolean | undefined): Promise<any>;
73
+ _findFrameScope(selectors: any, timeout: number | undefined, info: any): Promise<any>;
74
+ _getDocumentBody(selectors: any, timeout: number | undefined, info: any): Promise<any>;
75
+ _locate_internal(selectors: any, info: any, _params?: Params, timeout?: number, allowDisabled?: boolean | undefined): Promise<any>;
76
+ _scanLocatorsGroup(locatorsGroup: any, scope: any, _params: any, info: any, visibleOnly: any, allowDisabled?: boolean | undefined, element_name: any): Promise<{
31
77
  foundElements: any[];
32
78
  }>;
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<{}>;
79
+ simpleClick(elementDescription: any, _params?: Params, options?: {}, world?: null): Promise<void>;
80
+ simpleClickType(elementDescription: any, value: any, _params?: Params, options?: {}, world?: null): Promise<void>;
81
+ click(selectors: any, _params?: Params, options?: {}, world?: null): Promise<any>;
82
+ waitForElement(selectors: any, _params?: Params, options?: {}, world?: null): Promise<boolean>;
83
+ setCheck(selectors: any, checked?: boolean, _params?: Params, options?: {}, world?: null): Promise<any>;
84
+ hover(selectors: any, _params?: Params, options?: {}, world?: null): Promise<any>;
85
+ selectOption(selectors: any, values: any, _params?: null, options?: {}, world?: null): Promise<any>;
86
+ type(_value: any, _params?: null, options?: {}, world?: null): Promise<any>;
38
87
  setInputValue(selectors: any, value: any, _params?: null, options?: {}, world?: null): Promise<void>;
39
88
  setDateTime(selectors: any, value: any, format?: null, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<void>;
40
- clickType(selectors: any, _value: any, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<{}>;
41
- fill(selectors: any, value: any, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<{}>;
89
+ clickType(selectors: any, _value: any, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<any>;
90
+ fill(selectors: any, value: any, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<any>;
91
+ setInputFiles(selectors: any, files: any, _params?: null, options?: {}, world?: null): Promise<any>;
42
92
  getText(selectors: any, _params?: null, options?: {}, info?: {}, world?: null): Promise<{
43
93
  text: any;
44
94
  screenshotId: any;
@@ -65,11 +115,11 @@ declare class StableBrowser {
65
115
  value: any;
66
116
  element?: undefined;
67
117
  }>;
68
- containsPattern(selectors: any, pattern: any, text: any, _params?: null, options?: {}, world?: null): Promise<{}>;
69
- containsText(selectors: any, text: any, climb: any, _params?: null, options?: {}, world?: null): Promise<{}>;
70
- _getDataFile(world?: null): string;
118
+ containsPattern(selectors: any, pattern: any, text: any, _params?: null, options?: {}, world?: null): Promise<any>;
119
+ containsText(selectors: any, text: any, climb: any, _params?: null, options?: {}, world?: null): Promise<any>;
71
120
  waitForUserInput(message: any, world?: null): Promise<void>;
72
121
  setTestData(testData: any, world?: null): void;
122
+ overwriteTestData(testData: any, world?: null): void;
73
123
  _getDataFilePath(fileName: any): string;
74
124
  _parseCSVSync(filePath: any): Promise<unknown>;
75
125
  loadTestData(type: string, dataSelector: string, world?: null): {
@@ -81,28 +131,48 @@ declare class StableBrowser {
81
131
  getTestData(world?: null): {};
82
132
  _screenShot(options?: {}, world?: null, info?: null): Promise<{}>;
83
133
  takeScreenshot(screenshotPath: any): Promise<any>;
84
- verifyElementExistInPage(selectors: any, _params?: null, options?: {}, world?: null): Promise<{}>;
85
- extractAttribute(selectors: any, attribute: any, variable: any, _params?: null, options?: {}, world?: null): Promise<{}>;
134
+ verifyElementExistInPage(selectors: any, _params?: null, options?: {}, world?: null): Promise<any>;
135
+ extractAttribute(selectors: any, attribute: any, variable: any, _params?: null, options?: {}, world?: null): Promise<any>;
136
+ verifyAttribute(selectors: any, attribute: any, value: any, _params?: null, options?: {}, world?: null): Promise<any>;
86
137
  extractEmailData(emailAddress: any, options: any, world: any): Promise<{
87
138
  emailUrl: any;
88
139
  emailCode: any;
89
140
  }>;
90
141
  _highlightElements(scope: any, css: any): Promise<void>;
91
142
  verifyPagePath(pathPart: any, options?: {}, world?: null): Promise<{} | undefined>;
92
- verifyTextExistInPage(text: any, options?: {}, world?: null): Promise<{}>;
93
- _getServerUrl(): string;
94
- visualVerification(text: any, options?: {}, world?: null): Promise<{}>;
143
+ verifyPageTitle(title: any, options?: {}, world?: null): Promise<{} | undefined>;
144
+ findTextInAllFrames(dateAlternatives: any, numberAlternatives: any, text: any, state: any, partial?: boolean, ignoreCase?: boolean): Promise<{
145
+ elementCount: number;
146
+ randomToken: string;
147
+ }[]>;
148
+ verifyTextExistInPage(text: any, options?: {}, world?: null): Promise<any>;
149
+ waitForTextToDisappear(text: any, options?: {}, world?: null): Promise<any>;
150
+ verifyTextRelatedToText(textAnchor: string, climb: number, textToVerify: string, options?: {}, world?: any): Promise<any>;
151
+ findRelatedTextInAllFrames(textAnchor: string, climb: number, textToVerify: string, params?: Params, options?: {}, world?: any): Promise<{
152
+ elementCount: number;
153
+ randomToken: string;
154
+ }[]>;
155
+ visualVerification(text: any, options?: {}, world?: null): Promise<{} | undefined>;
95
156
  verifyTableData(selectors: any, data: any, _params?: null, options?: {}, world?: null): Promise<void>;
96
157
  getTableData(selectors: any, _params?: null, options?: {}, world?: null): Promise<any>;
97
- analyzeTable(selectors: any, query: any, operator: any, value: any, _params?: null, options?: {}, world?: null): Promise<{}>;
98
- _replaceWithLocalData(value: any, world: any, _decrypt?: boolean, totpWait?: boolean): Promise<any>;
158
+ analyzeTable(selectors: any, query: any, operator: any, value: any, _params?: null, options?: {}, world?: null): Promise<{} | undefined>;
159
+ _replaceWithLocalData(value: any, world: any, _decrypt?: boolean, totpWait?: boolean): Promise<string>;
99
160
  _getLoadTimeout(options: any): number;
161
+ _getFindElementTimeout(options: any): any;
162
+ saveStoreState(path?: string | null, world?: any): Promise<void>;
163
+ restoreSaveState(path?: string | null, world?: any): Promise<void>;
100
164
  waitForPageLoad(options?: {}, world?: null): Promise<void>;
101
165
  closePage(options?: {}, world?: null): Promise<void>;
166
+ tableCellOperation(headerText: string, rowText: string, options: any, _params: Params, world?: null): Promise<void>;
167
+ saveTestDataAsGlobal(options: any, world: any): void;
102
168
  setViewportSize(width: number, hight: number, options?: {}, world?: null): Promise<void>;
103
169
  reloadPage(options?: {}, world?: null): Promise<void>;
104
170
  scrollIfNeeded(element: any, info: any): Promise<void>;
105
- _reportToWorld(world: any, properties: JsonCommandReport): void;
171
+ beforeScenario(world: any, scenario: any): Promise<void>;
172
+ afterScenario(world: any, scenario: any): Promise<void>;
173
+ beforeStep(world: any, step: any): Promise<void>;
174
+ getAriaSnapshot(): Promise<string | null>;
175
+ afterStep(world: any, step: any): Promise<void>;
106
176
  }
107
177
  type JsonTimestamp = number;
108
178
  type JsonResultPassed = {
@@ -117,7 +187,7 @@ type JsonResultFailed = {
117
187
  message?: string;
118
188
  };
119
189
  type JsonCommandResult = JsonResultPassed | JsonResultFailed;
120
- type JsonCommandReport = {
190
+ export type JsonCommandReport = {
121
191
  type: string;
122
192
  value?: string;
123
193
  text: string;