tomation 0.0.10 → 0.0.11

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.
@@ -0,0 +1,9 @@
1
+ import { TestSpeed } from './engine/runner';
2
+ interface TomationOptions {
3
+ matches: string | RegExp;
4
+ tests: any[];
5
+ speed?: keyof typeof TestSpeed;
6
+ debug?: boolean;
7
+ }
8
+ declare function tomation(options: TomationOptions): void;
9
+ export { tomation, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tomation",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,137 +0,0 @@
1
- import { AbstractAction, Action, KEY_MAP, ACTION_STATUS } from './actions';
2
- import { UIUtils } from "./ui-utils";
3
- import { UIElement } from './ui-element-builder';
4
- import DateUtils from './date-utils';
5
- declare const setAutomationLogs: (enabled: boolean) => void;
6
- declare enum EVENT_NAMES {
7
- ACTION_UPDATE = "tomation-action-update",
8
- SAVE_VALUE = "tomation-save-value",
9
- REGISTER_TEST = "tomation-register-test",
10
- TEST_STARTED = "tomation-test-started",
11
- TEST_PASSED = "tomation-test-passed",
12
- TEST_FAILED = "tomation-test-failed",
13
- TEST_END = "tomation-test-end",
14
- TEST_STOP = "tomation-test-stop",
15
- TEST_PAUSE = "tomation-test-pause",
16
- TEST_PLAY = "tomation-test-play",
17
- USER_ACCEPT = "tomation-user-accept",
18
- USER_REJECT = "tomation-user-reject",
19
- SESSION_INIT = "tomation-session-init",
20
- ACTION_ERROR = "tomation-action-error"
21
- }
22
- type AutomationEventHandlerType = ((action?: any) => void);
23
- declare class EventDispatcher {
24
- events: Map<EVENT_NAMES, Array<AutomationEventHandlerType>>;
25
- constructor();
26
- on(eventName: EVENT_NAMES, callback: AutomationEventHandlerType): void;
27
- off(eventName: EVENT_NAMES, callback: AutomationEventHandlerType): void;
28
- dispatch(eventName: EVENT_NAMES, data?: any): void;
29
- }
30
- declare const AutomationEvents: EventDispatcher;
31
- declare enum TestSpeed {
32
- SLOW = 2000,
33
- NORMAL = 1000,
34
- FAST = 200
35
- }
36
- declare enum TestPlayStatus {
37
- PLAYING = "Playing",
38
- STOPPED = "Stopped",
39
- PAUSED = "Paused"
40
- }
41
- declare enum RunMode {
42
- NORMAL = "Normal",
43
- STEPBYSTEP = "Step By Step"
44
- }
45
- declare const Test: (id: string, steps: () => void) => void;
46
- declare const RunTest: (id: string) => void;
47
- declare const Task: <T>(id: string, steps: (params: T) => void) => (params?: T | undefined) => Promise<void>;
48
- declare const Click: (uiElement: UIElement) => void;
49
- declare const Assert: (uiElement: UIElement) => {
50
- textIs: (text: string) => void;
51
- containsText: (text: string) => void;
52
- valueIs: (value: string) => void;
53
- exists: () => void;
54
- notExists: () => void;
55
- };
56
- declare const Select: (value: string) => {
57
- in: (uiElement: UIElement) => void;
58
- };
59
- declare const Type: (value: string) => {
60
- in: (uiElement: UIElement) => void;
61
- };
62
- declare const ClearValue: () => {
63
- in: (uiElement: UIElement) => void;
64
- };
65
- declare const PressEscKey: () => {
66
- in: (uiElement: UIElement) => void;
67
- };
68
- declare const PressDownKey: () => {
69
- in: (uiElement: UIElement) => void;
70
- };
71
- declare const PressTabKey: () => {
72
- in: (uiElement: UIElement) => void;
73
- };
74
- declare const PressEnterKey: () => {
75
- in: (uiElement: UIElement) => void;
76
- };
77
- declare const PressKey: (key: KEY_MAP) => {
78
- in: (uiElement: UIElement) => void;
79
- };
80
- declare const TypePassword: (value: string) => {
81
- in: (uiElement: UIElement) => void;
82
- };
83
- declare const UploadFile: (file: File) => {
84
- in: (uiElement: UIElement) => void;
85
- };
86
- declare const SaveValue: (uiElement: UIElement) => {
87
- in: (memorySlotName: string) => void;
88
- };
89
- declare const Wait: {
90
- (miliseconds: number): void;
91
- untilElement(uiElement: UIElement): {
92
- isRemoved: () => void;
93
- };
94
- };
95
- declare const Pause: () => void;
96
- declare const ManualTask: (description: string) => void;
97
- declare const ReloadPage: () => void;
98
- declare const If: (description: string, condition: () => boolean) => {
99
- then: (thenSteps: Action) => {
100
- else: (elseSteps: Action) => void;
101
- };
102
- };
103
- declare class Automation {
104
- private _document;
105
- debug: Boolean;
106
- private _uiUtils;
107
- speed: TestSpeed;
108
- status: TestPlayStatus;
109
- runMode: RunMode;
110
- currentActionCallback: ((action: AbstractAction) => {}) | undefined;
111
- currentAction: AbstractAction | undefined;
112
- constructor(window: Window);
113
- get document(): Document;
114
- get uiUtils(): UIUtils;
115
- get isStepByStepMode(): boolean;
116
- get isStopped(): boolean;
117
- get isPlaying(): boolean;
118
- get isPaused(): boolean;
119
- pause(): void;
120
- continue(): void;
121
- next(): void;
122
- stop(): void;
123
- retryAction(): void;
124
- skipAction(): void;
125
- saveCurrentAction(callback: (action: AbstractAction) => {}, action: AbstractAction): void;
126
- setDebug(value: boolean): void;
127
- }
128
- declare let AutomationInstance: Automation;
129
- declare const Setup: (window: Window, tests?: Array<any>) => Automation;
130
- interface TomationOptions {
131
- matches: string | RegExp;
132
- tests: any[];
133
- speed?: keyof typeof TestSpeed;
134
- debug?: boolean;
135
- }
136
- export declare function tomation(options: TomationOptions): void;
137
- export { Setup, AutomationInstance, Test, RunTest, Task, Click, Assert, Select, Type, TypePassword, ClearValue, PressEscKey, PressDownKey, PressTabKey, PressKey, PressEnterKey, KEY_MAP, UploadFile, SaveValue, Wait, Pause, ManualTask, ReloadPage, If, DateUtils, AutomationEvents, EVENT_NAMES, TestSpeed, ACTION_STATUS, setAutomationLogs, };
File without changes
File without changes