automation_model 1.0.415-dev → 1.0.415

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 (53) hide show
  1. package/lib/api.d.ts +43 -1
  2. package/lib/api.js +228 -41
  3. package/lib/api.js.map +1 -1
  4. package/lib/auto_page.d.ts +5 -2
  5. package/lib/auto_page.js +141 -19
  6. package/lib/auto_page.js.map +1 -1
  7. package/lib/browser_manager.d.ts +7 -3
  8. package/lib/browser_manager.js +117 -40
  9. package/lib/browser_manager.js.map +1 -1
  10. package/lib/command_common.d.ts +6 -0
  11. package/lib/command_common.js +180 -0
  12. package/lib/command_common.js.map +1 -0
  13. package/lib/environment.d.ts +3 -0
  14. package/lib/environment.js +5 -2
  15. package/lib/environment.js.map +1 -1
  16. package/lib/error-messages.d.ts +6 -0
  17. package/lib/error-messages.js +206 -0
  18. package/lib/error-messages.js.map +1 -0
  19. package/lib/generation_scripts.d.ts +4 -0
  20. package/lib/generation_scripts.js +2 -0
  21. package/lib/generation_scripts.js.map +1 -0
  22. package/lib/index.d.ts +1 -0
  23. package/lib/index.js +1 -0
  24. package/lib/index.js.map +1 -1
  25. package/lib/init_browser.d.ts +5 -2
  26. package/lib/init_browser.js +117 -7
  27. package/lib/init_browser.js.map +1 -1
  28. package/lib/locate_element.d.ts +7 -0
  29. package/lib/locate_element.js +215 -0
  30. package/lib/locate_element.js.map +1 -0
  31. package/lib/locator.d.ts +36 -0
  32. package/lib/locator.js +165 -0
  33. package/lib/locator.js.map +1 -1
  34. package/lib/locator_log.d.ts +26 -0
  35. package/lib/locator_log.js +69 -0
  36. package/lib/locator_log.js.map +1 -0
  37. package/lib/network.d.ts +3 -0
  38. package/lib/network.js +183 -0
  39. package/lib/network.js.map +1 -0
  40. package/lib/scripts/axe.mini.js +12 -0
  41. package/lib/stable_browser.d.ts +86 -36
  42. package/lib/stable_browser.js +1423 -1275
  43. package/lib/stable_browser.js.map +1 -1
  44. package/lib/table.d.ts +13 -0
  45. package/lib/table.js +187 -0
  46. package/lib/table.js.map +1 -0
  47. package/lib/test_context.d.ts +6 -0
  48. package/lib/test_context.js +13 -9
  49. package/lib/test_context.js.map +1 -1
  50. package/lib/utils.d.ts +16 -1
  51. package/lib/utils.js +410 -5
  52. package/lib/utils.js.map +1 -1
  53. package/package.json +13 -8
@@ -1,44 +1,84 @@
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
+ 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
+ VERIFY_PAGE_CONTAINS_TEXT: string;
15
+ VERIFY_PAGE_CONTAINS_NO_TEXT: string;
16
+ ANALYZE_TABLE: string;
17
+ SELECT: string;
18
+ VERIFY_PAGE_PATH: string;
19
+ TYPE_PRESS: string;
20
+ PRESS: string;
21
+ HOVER: string;
22
+ CHECK: string;
23
+ UNCHECK: string;
24
+ EXTRACT: string;
25
+ CLOSE_PAGE: string;
26
+ SET_DATE_TIME: string;
27
+ SET_VIEWPORT: string;
28
+ VERIFY_VISUAL: string;
29
+ LOAD_DATA: string;
30
+ SET_INPUT: string;
31
+ WAIT_FOR_TEXT_TO_DISAPPEAR: string;
32
+ VERIFY_ATTRIBUTE: string;
33
+ VERIFY_TEXT_WITH_RELATION: string;
34
+ };
35
+ export declare const apps: {};
3
36
  declare class StableBrowser {
4
37
  browser: Browser;
5
38
  page: Page;
6
39
  logger: any;
7
40
  context: any;
41
+ world?: any;
8
42
  project_path: null;
9
43
  webLogFile: null;
44
+ networkLogger: null;
10
45
  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: Params): any;
46
+ appName: string;
47
+ tags: null;
48
+ constructor(browser: Browser, page: Page, logger?: any, context?: any, world?: any);
49
+ registerEventListeners(context: any): void;
50
+ switchApp(appName: any): Promise<void>;
51
+ registerConsoleLogListener(page: Page, context: any): void;
52
+ registerRequestListener(page: Page, context: any, logFile: string): void;
53
+ goto(url: string, world?: null): Promise<void>;
54
+ _getLocator(locator: any, scope: any, _params: any): Promise<any>;
22
55
  _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>;
56
+ _locateElementByText(scope: any, text1: any, tag1: any, regex1: boolean | undefined, partial1: any, ignoreCase: boolean | undefined, _params: Params): Promise<{
57
+ elementCount: number;
58
+ randomToken: string;
59
+ }>;
60
+ _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
61
  closeUnexpectedPopups(info: any, _params: any): Promise<{
26
62
  rerun: boolean;
27
63
  }>;
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<{
64
+ _locate(selectors: any, info: any, _params?: Params, timeout: any, allowDisabled?: boolean | undefined): Promise<any>;
65
+ _findFrameScope(selectors: any, timeout: number | undefined, info: any): Promise<any>;
66
+ _getDocumentBody(selectors: any, timeout: number | undefined, info: any): Promise<any>;
67
+ _locate_internal(selectors: any, info: any, _params?: Params, timeout?: number, allowDisabled?: boolean | undefined): Promise<any>;
68
+ _scanLocatorsGroup(locatorsGroup: any, scope: any, _params: any, info: any, visibleOnly: any, allowDisabled?: boolean | undefined, element_name: any): Promise<{
31
69
  foundElements: any[];
32
70
  }>;
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<{}>;
71
+ simpleClick(elementDescription: any, _params?: Params, options?: {}, world?: null): Promise<void>;
72
+ simpleClickType(elementDescription: any, value: any, _params?: Params, options?: {}, world?: null): Promise<void>;
73
+ click(selectors: any, _params?: Params, options?: {}, world?: null): Promise<any>;
74
+ setCheck(selectors: any, checked?: boolean, _params?: Params, options?: {}, world?: null): Promise<any>;
75
+ hover(selectors: any, _params?: Params, options?: {}, world?: null): Promise<any>;
76
+ selectOption(selectors: any, values: any, _params?: null, options?: {}, world?: null): Promise<any>;
77
+ type(_value: any, _params?: null, options?: {}, world?: null): Promise<any>;
38
78
  setInputValue(selectors: any, value: any, _params?: null, options?: {}, world?: null): Promise<void>;
39
79
  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<{}>;
80
+ clickType(selectors: any, _value: any, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<any>;
81
+ fill(selectors: any, value: any, enter?: boolean, _params?: null, options?: {}, world?: null): Promise<any>;
42
82
  getText(selectors: any, _params?: null, options?: {}, info?: {}, world?: null): Promise<{
43
83
  text: any;
44
84
  screenshotId: any;
@@ -65,9 +105,9 @@ declare class StableBrowser {
65
105
  value: any;
66
106
  element?: undefined;
67
107
  }>;
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;
108
+ containsPattern(selectors: any, pattern: any, text: any, _params?: null, options?: {}, world?: null): Promise<any>;
109
+ containsText(selectors: any, text: any, climb: any, _params?: null, options?: {}, world?: null): Promise<any>;
110
+ waitForUserInput(message: any, world?: null): Promise<void>;
71
111
  setTestData(testData: any, world?: null): void;
72
112
  _getDataFilePath(fileName: any): string;
73
113
  _parseCSVSync(filePath: any): Promise<unknown>;
@@ -80,28 +120,38 @@ declare class StableBrowser {
80
120
  getTestData(world?: null): {};
81
121
  _screenShot(options?: {}, world?: null, info?: null): Promise<{}>;
82
122
  takeScreenshot(screenshotPath: any): Promise<any>;
83
- verifyElementExistInPage(selectors: any, _params?: null, options?: {}, world?: null): Promise<{}>;
84
- extractAttribute(selectors: any, attribute: any, variable: any, _params?: null, options?: {}, world?: null): Promise<{}>;
123
+ verifyElementExistInPage(selectors: any, _params?: null, options?: {}, world?: null): Promise<any>;
124
+ extractAttribute(selectors: any, attribute: any, variable: any, _params?: null, options?: {}, world?: null): Promise<any>;
125
+ verifyAttribute(selectors: any, attribute: any, value: any, _params?: null, options?: {}, world?: null): Promise<any>;
85
126
  extractEmailData(emailAddress: any, options: any, world: any): Promise<{
86
127
  emailUrl: any;
87
128
  emailCode: any;
88
129
  }>;
89
130
  _highlightElements(scope: any, css: any): Promise<void>;
90
131
  verifyPagePath(pathPart: any, options?: {}, world?: null): Promise<{} | undefined>;
91
- verifyTextExistInPage(text: any, options?: {}, world?: null): Promise<{}>;
92
- _getServerUrl(): string;
93
- visualVerification(text: any, options?: {}, world?: null): Promise<{}>;
132
+ findTextInAllFrames(dateAlternatives: any, numberAlternatives: any, text: any, state: any): Promise<{
133
+ elementCount: number;
134
+ randomToken: string;
135
+ }[]>;
136
+ verifyTextExistInPage(text: any, options?: {}, world?: null): Promise<any>;
137
+ waitForTextToDisappear(text: any, options?: {}, world?: null): Promise<any>;
138
+ verifyTextRelatedToText(textAnchor: string, climb: number, textToVerify: string, options?: {}, world?: any): Promise<any>;
139
+ visualVerification(text: any, options?: {}, world?: null): Promise<{} | undefined>;
94
140
  verifyTableData(selectors: any, data: any, _params?: null, options?: {}, world?: null): Promise<void>;
95
141
  getTableData(selectors: any, _params?: null, options?: {}, world?: null): Promise<any>;
96
- analyzeTable(selectors: any, query: any, operator: any, value: any, _params?: null, options?: {}, world?: null): Promise<{}>;
97
- _replaceWithLocalData(value: any, world: any, _decrypt?: boolean, totpWait?: boolean): Promise<any>;
142
+ analyzeTable(selectors: any, query: any, operator: any, value: any, _params?: null, options?: {}, world?: null): Promise<{} | undefined>;
143
+ _replaceWithLocalData(value: any, world: any, _decrypt?: boolean, totpWait?: boolean): Promise<string>;
98
144
  _getLoadTimeout(options: any): number;
145
+ saveStoreState(path?: string | null, world?: any): Promise<void>;
146
+ restoreSaveState(path?: string | null, world?: any): Promise<void>;
99
147
  waitForPageLoad(options?: {}, world?: null): Promise<void>;
100
148
  closePage(options?: {}, world?: null): Promise<void>;
149
+ saveTestDataAsGlobal(options: any, world: any): void;
101
150
  setViewportSize(width: number, hight: number, options?: {}, world?: null): Promise<void>;
102
151
  reloadPage(options?: {}, world?: null): Promise<void>;
103
152
  scrollIfNeeded(element: any, info: any): Promise<void>;
104
- _reportToWorld(world: any, properties: JsonCommandReport): void;
153
+ beforeStep(world: any, step: any): Promise<void>;
154
+ afterStep(world: any, step: any): Promise<void>;
105
155
  }
106
156
  type JsonTimestamp = number;
107
157
  type JsonResultPassed = {
@@ -116,7 +166,7 @@ type JsonResultFailed = {
116
166
  message?: string;
117
167
  };
118
168
  type JsonCommandResult = JsonResultPassed | JsonResultFailed;
119
- type JsonCommandReport = {
169
+ export type JsonCommandReport = {
120
170
  type: string;
121
171
  value?: string;
122
172
  text: string;