askui 0.2.7 → 0.3.1

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.
@@ -9,6 +9,8 @@ import { LogLevels } from '../shared/log-levels';
9
9
  * the value to `1` (`2` for your third monitor etc.).
10
10
  * @param {string} binaryVersion - Default: `'latest'`
11
11
  * Choose the version of the askui UI Controller Server.
12
+ * @param {number} actionDelayInMs - Default: `1000`
13
+ * Waits x milliseconds after each action. This can be used to slow down or speed up the execution
12
14
  * @param {number} port - Default: `6769`
13
15
  * The port the askui UI Controller is running on.
14
16
  * @param {string} host - Default: `'127.0.0.1'`
@@ -27,6 +29,7 @@ import { LogLevels } from '../shared/log-levels';
27
29
  */
28
30
  export interface UiControllerArgs {
29
31
  readonly display?: number;
32
+ readonly actionDelayInMs?: number;
30
33
  readonly binaryVersion?: string;
31
34
  readonly port?: number;
32
35
  readonly host?: string;
@@ -37,6 +40,7 @@ export interface UiControllerArgs {
37
40
  }
38
41
  export interface UiControllerArgsWithDefaults extends UiControllerArgs {
39
42
  readonly display: number;
43
+ readonly actionDelayInMs: number;
40
44
  readonly binaryVersion: string;
41
45
  readonly overWriteBinary: boolean;
42
46
  readonly port: number;
@@ -5,6 +5,7 @@ function createArgsWithDefaults(args) {
5
5
  const defaults = {
6
6
  binaryVersion: 'latest',
7
7
  display: 0,
8
+ actionDelayInMs: 1000,
8
9
  overWriteBinary: false,
9
10
  minimize: true,
10
11
  port: 6769,
@@ -18,6 +19,7 @@ function createCliFlagsFromArgs(args) {
18
19
  return [
19
20
  `-d ${args.display.toString()}`,
20
21
  (args === null || args === void 0 ? void 0 : args.port) ? `-p ${args.port.toString()}` : '',
22
+ (args === null || args === void 0 ? void 0 : args.actionDelayInMs) ? `--action_wait_time ${args.actionDelayInMs.toString()}` : '',
21
23
  (args === null || args === void 0 ? void 0 : args.host) ? `--host ${args.host}` : '',
22
24
  (args === null || args === void 0 ? void 0 : args.minimize) ? '-m ' : '',
23
25
  (args === null || args === void 0 ? void 0 : args.logLevel) ? `--log-level ${args.logLevel}` : '',
@@ -3,19 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const ui_controller_args_1 = require("./ui-controller-args");
4
4
  describe('createCliFlagsFromArgs()', () => {
5
5
  test('test createCliFlagsFromArgs should return -d 0 as default output', () => {
6
- const expected = ['-d 0', '-p 6769', '--host 127.0.0.1', '-m ', '--log-level debug'];
6
+ const expected = ['-d 0', '-p 6769', '--action_wait_time 1000', '--host 127.0.0.1', '-m ', '--log-level debug'];
7
7
  const argsWithDefaults = (0, ui_controller_args_1.createArgsWithDefaults)();
8
8
  const actual = (0, ui_controller_args_1.createCliFlagsFromArgs)(argsWithDefaults);
9
9
  expect(actual).toStrictEqual(expected);
10
10
  });
11
11
  test('test createCliFlagsFromArgs output should include -d 0 when no display was selected', () => {
12
- const expected = ['-d 0', '-p 6777', '--host 0.0.0.0', '-m ', '--log-level debug'];
12
+ const expected = ['-d 0', '-p 6777', '--action_wait_time 1000', '--host 0.0.0.0', '-m ', '--log-level debug'];
13
13
  const argsWithDefaults = (0, ui_controller_args_1.createArgsWithDefaults)({ port: 6777, host: '0.0.0.0' });
14
14
  const actual = (0, ui_controller_args_1.createCliFlagsFromArgs)(argsWithDefaults);
15
15
  expect(actual).toStrictEqual(expected);
16
16
  });
17
17
  test('test createCliFlagsFromArgs output should include the display that was selected ', () => {
18
- const expected = ['-d 99', '-p 6777', '--host 0.0.0.0', '-m ', '--log-level debug'];
18
+ const expected = ['-d 99', '-p 6777', '--action_wait_time 1000', '--host 0.0.0.0', '-m ', '--log-level debug'];
19
19
  const argsWithDefaults = (0, ui_controller_args_1.createArgsWithDefaults)({ port: 6777, host: '0.0.0.0', display: 99 });
20
20
  const actual = (0, ui_controller_args_1.createCliFlagsFromArgs)(argsWithDefaults);
21
21
  expect(actual).toStrictEqual(expected);
@@ -9,6 +9,8 @@ import { LogLevels } from '../shared/log-levels';
9
9
  * the value to `1` (`2` for your third monitor etc.).
10
10
  * @param {string} binaryVersion - Default: `'latest'`
11
11
  * Choose the version of the askui UI Controller Server.
12
+ * @param {number} actionDelayInMs - Default: `1000`
13
+ * Waits x milliseconds after each action. This can be used to slow down or speed up the execution
12
14
  * @param {number} port - Default: `6769`
13
15
  * The port the askui UI Controller is running on.
14
16
  * @param {string} host - Default: `'127.0.0.1'`
@@ -27,6 +29,7 @@ import { LogLevels } from '../shared/log-levels';
27
29
  */
28
30
  export interface UiControllerArgs {
29
31
  readonly display?: number;
32
+ readonly actionDelayInMs?: number;
30
33
  readonly binaryVersion?: string;
31
34
  readonly port?: number;
32
35
  readonly host?: string;
@@ -37,6 +40,7 @@ export interface UiControllerArgs {
37
40
  }
38
41
  export interface UiControllerArgsWithDefaults extends UiControllerArgs {
39
42
  readonly display: number;
43
+ readonly actionDelayInMs: number;
40
44
  readonly binaryVersion: string;
41
45
  readonly overWriteBinary: boolean;
42
46
  readonly port: number;
@@ -2,6 +2,7 @@ export function createArgsWithDefaults(args) {
2
2
  const defaults = {
3
3
  binaryVersion: 'latest',
4
4
  display: 0,
5
+ actionDelayInMs: 1000,
5
6
  overWriteBinary: false,
6
7
  minimize: true,
7
8
  port: 6769,
@@ -14,6 +15,7 @@ export function createCliFlagsFromArgs(args) {
14
15
  return [
15
16
  `-d ${args.display.toString()}`,
16
17
  (args === null || args === void 0 ? void 0 : args.port) ? `-p ${args.port.toString()}` : '',
18
+ (args === null || args === void 0 ? void 0 : args.actionDelayInMs) ? `--action_wait_time ${args.actionDelayInMs.toString()}` : '',
17
19
  (args === null || args === void 0 ? void 0 : args.host) ? `--host ${args.host}` : '',
18
20
  (args === null || args === void 0 ? void 0 : args.minimize) ? '-m ' : '',
19
21
  (args === null || args === void 0 ? void 0 : args.logLevel) ? `--log-level ${args.logLevel}` : '',
@@ -1,19 +1,19 @@
1
1
  import { createArgsWithDefaults, createCliFlagsFromArgs } from './ui-controller-args';
2
2
  describe('createCliFlagsFromArgs()', () => {
3
3
  test('test createCliFlagsFromArgs should return -d 0 as default output', () => {
4
- const expected = ['-d 0', '-p 6769', '--host 127.0.0.1', '-m ', '--log-level debug'];
4
+ const expected = ['-d 0', '-p 6769', '--action_wait_time 1000', '--host 127.0.0.1', '-m ', '--log-level debug'];
5
5
  const argsWithDefaults = createArgsWithDefaults();
6
6
  const actual = createCliFlagsFromArgs(argsWithDefaults);
7
7
  expect(actual).toStrictEqual(expected);
8
8
  });
9
9
  test('test createCliFlagsFromArgs output should include -d 0 when no display was selected', () => {
10
- const expected = ['-d 0', '-p 6777', '--host 0.0.0.0', '-m ', '--log-level debug'];
10
+ const expected = ['-d 0', '-p 6777', '--action_wait_time 1000', '--host 0.0.0.0', '-m ', '--log-level debug'];
11
11
  const argsWithDefaults = createArgsWithDefaults({ port: 6777, host: '0.0.0.0' });
12
12
  const actual = createCliFlagsFromArgs(argsWithDefaults);
13
13
  expect(actual).toStrictEqual(expected);
14
14
  });
15
15
  test('test createCliFlagsFromArgs output should include the display that was selected ', () => {
16
- const expected = ['-d 99', '-p 6777', '--host 0.0.0.0', '-m ', '--log-level debug'];
16
+ const expected = ['-d 99', '-p 6777', '--action_wait_time 1000', '--host 0.0.0.0', '-m ', '--log-level debug'];
17
17
  const argsWithDefaults = createArgsWithDefaults({ port: 6777, host: '0.0.0.0', display: 99 });
18
18
  const actual = createCliFlagsFromArgs(argsWithDefaults);
19
19
  expect(actual).toStrictEqual(expected);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "askui",
3
- "version": "0.2.7",
3
+ "version": "0.3.1",
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",