askui 0.20.3 → 0.20.4
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.
- package/dist/cjs/core/ui-control-commands/action.d.ts +5 -1
- package/dist/cjs/core/ui-control-commands/action.js +3 -2
- package/dist/cjs/core/ui-control-commands/control-command.js +1 -1
- package/dist/cjs/execution/dsl.d.ts +3 -2
- package/dist/cjs/execution/dsl.js +7 -3
- package/dist/esm/core/ui-control-commands/action.d.ts +5 -1
- package/dist/esm/core/ui-control-commands/action.js +3 -2
- package/dist/esm/core/ui-control-commands/control-command.js +1 -1
- package/dist/esm/execution/dsl.d.ts +3 -2
- package/dist/esm/execution/dsl.js +7 -3
- package/package.json +1 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { InputEvent } from './input-event';
|
|
2
|
+
export declare type ActionParameters = {
|
|
3
|
+
[key: string]: string | number | boolean | string[] | ActionParameters;
|
|
4
|
+
};
|
|
2
5
|
export declare class Action {
|
|
3
6
|
inputEvent: InputEvent;
|
|
4
7
|
position: {
|
|
@@ -6,9 +9,10 @@ export declare class Action {
|
|
|
6
9
|
y: number;
|
|
7
10
|
};
|
|
8
11
|
text: string;
|
|
12
|
+
parameters: ActionParameters;
|
|
9
13
|
constructor(inputEvent: InputEvent, position: {
|
|
10
14
|
x: number;
|
|
11
15
|
y: number;
|
|
12
|
-
}, text: string);
|
|
16
|
+
}, text: string, parameters?: ActionParameters);
|
|
13
17
|
static fromJson(action: Action, resizeRatio?: number): Action;
|
|
14
18
|
}
|
|
@@ -3,16 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Action = void 0;
|
|
4
4
|
const input_event_1 = require("./input-event");
|
|
5
5
|
class Action {
|
|
6
|
-
constructor(inputEvent, position, text) {
|
|
6
|
+
constructor(inputEvent, position, text, parameters = {}) {
|
|
7
7
|
this.inputEvent = inputEvent;
|
|
8
8
|
this.position = position;
|
|
9
9
|
this.text = text;
|
|
10
|
+
this.parameters = parameters;
|
|
10
11
|
}
|
|
11
12
|
static fromJson(action, resizeRatio = 1) {
|
|
12
13
|
return new Action(input_event_1.InputEvent[action.inputEvent], {
|
|
13
14
|
x: action.position.x * resizeRatio,
|
|
14
15
|
y: action.position.y * resizeRatio,
|
|
15
|
-
}, action.text);
|
|
16
|
+
}, action.text, action.parameters ? action.parameters : {});
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
19
|
exports.Action = Action;
|
|
@@ -16,7 +16,7 @@ class ControlCommand {
|
|
|
16
16
|
}
|
|
17
17
|
setTextToBeTyped(text) {
|
|
18
18
|
this.actions = this.actions.map((action) => ([input_event_1.InputEvent.TYPE, input_event_1.InputEvent.TYPE_TEXT].includes(action.inputEvent)
|
|
19
|
-
? new action_1.Action(action.inputEvent, action.position, text) : action));
|
|
19
|
+
? new action_1.Action(action.inputEvent, action.position, text, action.parameters) : action));
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
exports.ControlCommand = ControlCommand;
|
|
@@ -1913,11 +1913,12 @@ export declare abstract class FluentCommand extends FluentBase {
|
|
|
1913
1913
|
* await aui.execOnShell("chrome").exec();
|
|
1914
1914
|
* ```
|
|
1915
1915
|
*
|
|
1916
|
-
* @param {string}
|
|
1916
|
+
* @param {string} shellCommand - A shell command which is executed.
|
|
1917
|
+
* @param {number} [timeoutInMilliseconds=1] - A timeout in milliseconds.
|
|
1917
1918
|
*
|
|
1918
1919
|
* @return {Exec}
|
|
1919
1920
|
*/
|
|
1920
|
-
execOnShell(
|
|
1921
|
+
execOnShell(shellCommand: string, timeoutInMilliseconds?: number): Exec;
|
|
1921
1922
|
/**
|
|
1922
1923
|
* Clicks with left mouse key.
|
|
1923
1924
|
*
|
|
@@ -2433,16 +2433,20 @@ class FluentCommand extends FluentBase {
|
|
|
2433
2433
|
* await aui.execOnShell("chrome").exec();
|
|
2434
2434
|
* ```
|
|
2435
2435
|
*
|
|
2436
|
-
* @param {string}
|
|
2436
|
+
* @param {string} shellCommand - A shell command which is executed.
|
|
2437
|
+
* @param {number} [timeoutInMilliseconds=1] - A timeout in milliseconds.
|
|
2437
2438
|
*
|
|
2438
2439
|
* @return {Exec}
|
|
2439
2440
|
*/
|
|
2440
|
-
execOnShell(
|
|
2441
|
+
execOnShell(shellCommand, timeoutInMilliseconds = 1) {
|
|
2441
2442
|
this._textStr = '';
|
|
2442
2443
|
this._textStr += 'Execute';
|
|
2443
2444
|
this._textStr += ' shell';
|
|
2444
2445
|
this._textStr += ' command';
|
|
2445
|
-
this._textStr += ` ${Separators.STRING}${
|
|
2446
|
+
this._textStr += ` ${Separators.STRING}${shellCommand}${Separators.STRING}`;
|
|
2447
|
+
if (timeoutInMilliseconds !== undefined) {
|
|
2448
|
+
this._textStr += ` with ${timeoutInMilliseconds} milliseconds timeout`;
|
|
2449
|
+
}
|
|
2446
2450
|
return new Exec(this);
|
|
2447
2451
|
}
|
|
2448
2452
|
/**
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { InputEvent } from './input-event';
|
|
2
|
+
export declare type ActionParameters = {
|
|
3
|
+
[key: string]: string | number | boolean | string[] | ActionParameters;
|
|
4
|
+
};
|
|
2
5
|
export declare class Action {
|
|
3
6
|
inputEvent: InputEvent;
|
|
4
7
|
position: {
|
|
@@ -6,9 +9,10 @@ export declare class Action {
|
|
|
6
9
|
y: number;
|
|
7
10
|
};
|
|
8
11
|
text: string;
|
|
12
|
+
parameters: ActionParameters;
|
|
9
13
|
constructor(inputEvent: InputEvent, position: {
|
|
10
14
|
x: number;
|
|
11
15
|
y: number;
|
|
12
|
-
}, text: string);
|
|
16
|
+
}, text: string, parameters?: ActionParameters);
|
|
13
17
|
static fromJson(action: Action, resizeRatio?: number): Action;
|
|
14
18
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { InputEvent } from './input-event';
|
|
2
2
|
export class Action {
|
|
3
|
-
constructor(inputEvent, position, text) {
|
|
3
|
+
constructor(inputEvent, position, text, parameters = {}) {
|
|
4
4
|
this.inputEvent = inputEvent;
|
|
5
5
|
this.position = position;
|
|
6
6
|
this.text = text;
|
|
7
|
+
this.parameters = parameters;
|
|
7
8
|
}
|
|
8
9
|
static fromJson(action, resizeRatio = 1) {
|
|
9
10
|
return new Action(InputEvent[action.inputEvent], {
|
|
10
11
|
x: action.position.x * resizeRatio,
|
|
11
12
|
y: action.position.y * resizeRatio,
|
|
12
|
-
}, action.text);
|
|
13
|
+
}, action.text, action.parameters ? action.parameters : {});
|
|
13
14
|
}
|
|
14
15
|
}
|
|
@@ -13,6 +13,6 @@ export class ControlCommand {
|
|
|
13
13
|
}
|
|
14
14
|
setTextToBeTyped(text) {
|
|
15
15
|
this.actions = this.actions.map((action) => ([InputEvent.TYPE, InputEvent.TYPE_TEXT].includes(action.inputEvent)
|
|
16
|
-
? new Action(action.inputEvent, action.position, text) : action));
|
|
16
|
+
? new Action(action.inputEvent, action.position, text, action.parameters) : action));
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -1913,11 +1913,12 @@ export declare abstract class FluentCommand extends FluentBase {
|
|
|
1913
1913
|
* await aui.execOnShell("chrome").exec();
|
|
1914
1914
|
* ```
|
|
1915
1915
|
*
|
|
1916
|
-
* @param {string}
|
|
1916
|
+
* @param {string} shellCommand - A shell command which is executed.
|
|
1917
|
+
* @param {number} [timeoutInMilliseconds=1] - A timeout in milliseconds.
|
|
1917
1918
|
*
|
|
1918
1919
|
* @return {Exec}
|
|
1919
1920
|
*/
|
|
1920
|
-
execOnShell(
|
|
1921
|
+
execOnShell(shellCommand: string, timeoutInMilliseconds?: number): Exec;
|
|
1921
1922
|
/**
|
|
1922
1923
|
* Clicks with left mouse key.
|
|
1923
1924
|
*
|
|
@@ -2425,16 +2425,20 @@ export class FluentCommand extends FluentBase {
|
|
|
2425
2425
|
* await aui.execOnShell("chrome").exec();
|
|
2426
2426
|
* ```
|
|
2427
2427
|
*
|
|
2428
|
-
* @param {string}
|
|
2428
|
+
* @param {string} shellCommand - A shell command which is executed.
|
|
2429
|
+
* @param {number} [timeoutInMilliseconds=1] - A timeout in milliseconds.
|
|
2429
2430
|
*
|
|
2430
2431
|
* @return {Exec}
|
|
2431
2432
|
*/
|
|
2432
|
-
execOnShell(
|
|
2433
|
+
execOnShell(shellCommand, timeoutInMilliseconds = 1) {
|
|
2433
2434
|
this._textStr = '';
|
|
2434
2435
|
this._textStr += 'Execute';
|
|
2435
2436
|
this._textStr += ' shell';
|
|
2436
2437
|
this._textStr += ' command';
|
|
2437
|
-
this._textStr += ` ${Separators.STRING}${
|
|
2438
|
+
this._textStr += ` ${Separators.STRING}${shellCommand}${Separators.STRING}`;
|
|
2439
|
+
if (timeoutInMilliseconds !== undefined) {
|
|
2440
|
+
this._textStr += ` with ${timeoutInMilliseconds} milliseconds timeout`;
|
|
2441
|
+
}
|
|
2438
2442
|
return new Exec(this);
|
|
2439
2443
|
}
|
|
2440
2444
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "askui",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "askui GmbH <info@askui.com> (http://www.askui.com/)",
|
|
6
6
|
"description": "Reliable, automated end-to-end-testing that depends on what is shown on your screen instead of the technology you are running on",
|