automation_model 1.0.643-dev → 1.0.643-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.
Files changed (57) hide show
  1. package/README.md +16 -16
  2. package/lib/analyze_helper.js.map +1 -1
  3. package/lib/api.d.ts +0 -1
  4. package/lib/api.js +35 -21
  5. package/lib/api.js.map +1 -1
  6. package/lib/auto_page.d.ts +1 -1
  7. package/lib/auto_page.js +96 -26
  8. package/lib/auto_page.js.map +1 -1
  9. package/lib/browser_manager.js +28 -8
  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 +4 -4
  15. package/lib/command_common.js +36 -16
  16. package/lib/command_common.js.map +1 -1
  17. package/lib/date_time.js.map +1 -1
  18. package/lib/drawRect.js.map +1 -1
  19. package/lib/environment.d.ts +1 -0
  20. package/lib/environment.js +1 -0
  21. package/lib/environment.js.map +1 -1
  22. package/lib/error-messages.js.map +1 -1
  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/find_function.js.map +1 -1
  27. package/lib/index.d.ts +2 -0
  28. package/lib/index.js +2 -0
  29. package/lib/index.js.map +1 -1
  30. package/lib/init_browser.d.ts +2 -2
  31. package/lib/init_browser.js +29 -27
  32. package/lib/init_browser.js.map +1 -1
  33. package/lib/locate_element.js +2 -2
  34. package/lib/locate_element.js.map +1 -1
  35. package/lib/locator.js +1 -1
  36. package/lib/locator.js.map +1 -1
  37. package/lib/locator_log.js.map +1 -1
  38. package/lib/network.d.ts +1 -1
  39. package/lib/network.js +5 -5
  40. package/lib/network.js.map +1 -1
  41. package/lib/snapshot_validation.d.ts +37 -0
  42. package/lib/snapshot_validation.js +357 -0
  43. package/lib/snapshot_validation.js.map +1 -0
  44. package/lib/stable_browser.d.ts +46 -23
  45. package/lib/stable_browser.js +683 -187
  46. package/lib/stable_browser.js.map +1 -1
  47. package/lib/table.js.map +1 -1
  48. package/lib/table_analyze.js.map +1 -1
  49. package/lib/table_helper.js +15 -0
  50. package/lib/table_helper.js.map +1 -1
  51. package/lib/test_context.d.ts +2 -0
  52. package/lib/test_context.js +2 -0
  53. package/lib/test_context.js.map +1 -1
  54. package/lib/utils.d.ts +6 -4
  55. package/lib/utils.js +176 -59
  56. package/lib/utils.js.map +1 -1
  57. package/package.json +11 -6
@@ -17,6 +17,7 @@ export declare const Types: {
17
17
  ANALYZE_TABLE: string;
18
18
  SELECT: string;
19
19
  VERIFY_PAGE_PATH: string;
20
+ VERIFY_PAGE_TITLE: string;
20
21
  TYPE_PRESS: string;
21
22
  PRESS: string;
22
23
  HOVER: string;
@@ -33,6 +34,12 @@ export declare const Types: {
33
34
  WAIT_FOR_TEXT_TO_DISAPPEAR: string;
34
35
  VERIFY_ATTRIBUTE: string;
35
36
  VERIFY_TEXT_WITH_RELATION: string;
37
+ BRUNO: string;
38
+ VERIFY_FILE_EXISTS: string;
39
+ SET_INPUT_FILES: string;
40
+ SNAPSHOT_VALIDATION: string;
41
+ REPORT_COMMAND: string;
42
+ STEP_COMPLETE: string;
36
43
  };
37
44
  export declare const apps: {};
38
45
  declare class StableBrowser {
@@ -52,6 +59,7 @@ declare class StableBrowser {
52
59
  constructor(browser: Browser, page: Page, logger?: any, context?: any, world?: any);
53
60
  registerEventListeners(context: any): void;
54
61
  switchApp(appName: any): Promise<void>;
62
+ switchTab(tabTitleOrIndex: number | string): Promise<void>;
55
63
  registerConsoleLogListener(page: Page, context: any): void;
56
64
  registerRequestListener(page: Page, context: any, logFile: string): void;
57
65
  goto(url: string, world?: null): Promise<void>;
@@ -61,7 +69,7 @@ declare class StableBrowser {
61
69
  elementCount: number;
62
70
  randomToken: string;
63
71
  }>;
64
- _collectLocatorInformation(selectorHierarchy: any, index: number | undefined, scope: any, foundLocators: any, _params: Params, info: any, visibleOnly?: boolean, allowDisabled?: boolean | undefined, element_name?: null): Promise<void>;
72
+ _collectLocatorInformation(selectorHierarchy: any, index: number | undefined, scope: any, foundLocators: any, _params: Params, info: any, visibleOnly?: boolean, allowDisabled?: boolean | undefined, element_name?: null, logErrors?: boolean | undefined): Promise<void>;
65
73
  closeUnexpectedPopups(info: any, _params: any): Promise<{
66
74
  rerun: boolean;
67
75
  }>;
@@ -69,7 +77,7 @@ declare class StableBrowser {
69
77
  _findFrameScope(selectors: any, timeout: number | undefined, info: any): Promise<any>;
70
78
  _getDocumentBody(selectors: any, timeout: number | undefined, info: any): Promise<any>;
71
79
  _locate_internal(selectors: any, info: any, _params?: Params, timeout?: number, allowDisabled?: boolean | undefined): Promise<any>;
72
- _scanLocatorsGroup(locatorsGroup: any, scope: any, _params: any, info: any, visibleOnly: any, allowDisabled?: boolean | undefined, element_name: any): Promise<{
80
+ _scanLocatorsGroup(locatorsGroup: any, scope: any, _params: any, info: any, visibleOnly: any, allowDisabled?: boolean | undefined, element_name: any, logErrors?: boolean | undefined): Promise<{
73
81
  foundElements: any[];
74
82
  }>;
75
83
  simpleClick(elementDescription: any, _params?: Params, options?: {}, world?: null): Promise<void>;
@@ -84,6 +92,7 @@ declare class StableBrowser {
84
92
  setDateTime(selectors: any, value: any, format?: null, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<void>;
85
93
  clickType(selectors: any, _value: any, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<any>;
86
94
  fill(selectors: any, value: any, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<any>;
95
+ setInputFiles(selectors: any, files: any, _params?: null, options?: {}, world?: null): Promise<any>;
87
96
  getText(selectors: any, _params?: null, options?: {}, info?: {}, world?: null): Promise<{
88
97
  text: any;
89
98
  screenshotId: any;
@@ -112,8 +121,10 @@ declare class StableBrowser {
112
121
  }>;
113
122
  containsPattern(selectors: any, pattern: any, text: any, _params?: null, options?: {}, world?: null): Promise<any>;
114
123
  containsText(selectors: any, text: any, climb: any, _params?: null, options?: {}, world?: null): Promise<any>;
124
+ snapshotValidation(frameSelectors: any, referanceSnapshot: any, _params?: null, options?: {}, world?: null): Promise<any>;
115
125
  waitForUserInput(message: any, world?: null): Promise<void>;
116
126
  setTestData(testData: any, world?: null): void;
127
+ overwriteTestData(testData: any, world?: null): void;
117
128
  _getDataFilePath(fileName: any): string;
118
129
  _parseCSVSync(filePath: any): Promise<unknown>;
119
130
  loadTestData(type: string, dataSelector: string, world?: null): {
@@ -133,7 +144,27 @@ declare class StableBrowser {
133
144
  emailCode: any;
134
145
  }>;
135
146
  _highlightElements(scope: any, css: any): Promise<void>;
136
- verifyPagePath(pathPart: any, options?: {}, world?: null): Promise<{} | undefined>;
147
+ _matcher(text: any): {
148
+ matcher: any;
149
+ queryText: any;
150
+ };
151
+ _getDomain(url: string): string;
152
+ /**
153
+ * Verify the page path matches the given path.
154
+ * @param {string} pathPart - The path to verify.
155
+ * @param {object} options - Options for verification.
156
+ * @param {object} world - The world context.
157
+ * @returns {Promise<object>} - The state info after verification.
158
+ */
159
+ verifyPagePath(pathPart: string, options?: object, world?: object): Promise<object>;
160
+ /**
161
+ * Verify the page title matches the given title.
162
+ * @param {string} title - The title to verify.
163
+ * @param {object} options - Options for verification.
164
+ * @param {object} world - The world context.
165
+ * @returns {Promise<object>} - The state info after verification.
166
+ */
167
+ verifyPageTitle(title: string, options?: object, world?: object): Promise<object>;
137
168
  findTextInAllFrames(dateAlternatives: any, numberAlternatives: any, text: any, state: any, partial?: boolean, ignoreCase?: boolean): Promise<{
138
169
  elementCount: number;
139
170
  randomToken: string;
@@ -161,28 +192,20 @@ declare class StableBrowser {
161
192
  setViewportSize(width: number, hight: number, options?: {}, world?: null): Promise<void>;
162
193
  reloadPage(options?: {}, world?: null): Promise<void>;
163
194
  scrollIfNeeded(element: any, info: any): Promise<void>;
195
+ beforeScenario(world: any, scenario: any): Promise<void>;
196
+ afterScenario(world: any, scenario: any): Promise<void>;
164
197
  beforeStep(world: any, step: any): Promise<void>;
165
198
  getAriaSnapshot(): Promise<string | null>;
199
+ /**
200
+ * Sends command with custom payload to report.
201
+ * @param commandText - Title of the command to be shown in the report.
202
+ * @param commandStatus - Status of the command (e.g. "PASSED", "FAILED").
203
+ * @param content - Content of the command to be shown in the report.
204
+ * @param options - Options for the command. Example: { type: "json", screenshot: true }
205
+ * @param world - Optional world context.
206
+ * @public
207
+ */
208
+ addCommandToReport(commandText: string, commandStatus: "PASSED" | "FAILED", content: string, options?: any, world?: any): Promise<void>;
166
209
  afterStep(world: any, step: any): Promise<void>;
167
210
  }
168
- type JsonTimestamp = number;
169
- type JsonResultPassed = {
170
- status: "PASSED";
171
- startTime: JsonTimestamp;
172
- endTime: JsonTimestamp;
173
- };
174
- type JsonResultFailed = {
175
- status: "FAILED";
176
- startTime: JsonTimestamp;
177
- endTime: JsonTimestamp;
178
- message?: string;
179
- };
180
- type JsonCommandResult = JsonResultPassed | JsonResultFailed;
181
- export type JsonCommandReport = {
182
- type: string;
183
- value?: string;
184
- text: string;
185
- screenshotId?: string;
186
- result: JsonCommandResult;
187
- };
188
211
  export { StableBrowser };