askui 0.2.6 → 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.
@@ -75,7 +75,7 @@ export declare class UiControlClient extends FluentCommand {
75
75
  */
76
76
  waitFor(delayInMs: number): Executable;
77
77
  /**
78
- * closes the connection to the controlui-server`.
78
+ * Closes the connection to the askui UI Controller
79
79
  */
80
80
  close(): void;
81
81
  }
@@ -184,7 +184,7 @@ class UiControlClient extends dsl_1.FluentCommand {
184
184
  };
185
185
  }
186
186
  /**
187
- * closes the connection to the controlui-server`.
187
+ * Closes the connection to the askui UI Controller
188
188
  */
189
189
  close() {
190
190
  this.uiControllerClient.close();
@@ -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);
@@ -14,10 +14,10 @@ class UiControllerDarwin extends ui_controller_facade_1.UiControllerFacade {
14
14
  this.makeDiskImageExecutable();
15
15
  }
16
16
  getStartingCommand() {
17
- return `"${path_1.default.dirname(this.binaryPath)}/controlui-server.app/Contents/MacOS/controlui-server"`;
17
+ return `"${path_1.default.dirname(this.binaryPath)}/askui-ui-controller.app/Contents/MacOS/askui-ui-controller"`;
18
18
  }
19
19
  makeDiskImageExecutable() {
20
- const mountPoint = '/Volumes/controlui-server.dmg';
20
+ const mountPoint = '/Volumes/askui-ui-controller.dmg';
21
21
  (0, child_process_1.execSync)([
22
22
  'hdiutil attach',
23
23
  '-nobrowse',
@@ -27,7 +27,7 @@ class UiControllerDarwin extends ui_controller_facade_1.UiControllerFacade {
27
27
  `-mountpoint "${mountPoint}"`,
28
28
  `"${this.binaryPath}"`,
29
29
  ].join(' '));
30
- const appBaseName = 'controlui-server.app';
30
+ const appBaseName = 'askui-ui-controller.app';
31
31
  const appSrcPath = `${mountPoint}/${appBaseName}`;
32
32
  const appDestPath = `${path_1.default.dirname(this.binaryPath)}/${appBaseName}`;
33
33
  fs_extra_1.default.removeSync(appDestPath);
@@ -75,7 +75,7 @@ export declare class UiControlClient extends FluentCommand {
75
75
  */
76
76
  waitFor(delayInMs: number): Executable;
77
77
  /**
78
- * closes the connection to the controlui-server`.
78
+ * Closes the connection to the askui UI Controller
79
79
  */
80
80
  close(): void;
81
81
  }
@@ -181,7 +181,7 @@ export class UiControlClient extends FluentCommand {
181
181
  };
182
182
  }
183
183
  /**
184
- * closes the connection to the controlui-server`.
184
+ * Closes the connection to the askui UI Controller
185
185
  */
186
186
  close() {
187
187
  this.uiControllerClient.close();
@@ -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);
@@ -8,10 +8,10 @@ export class UiControllerDarwin extends UiControllerFacade {
8
8
  this.makeDiskImageExecutable();
9
9
  }
10
10
  getStartingCommand() {
11
- return `"${path.dirname(this.binaryPath)}/controlui-server.app/Contents/MacOS/controlui-server"`;
11
+ return `"${path.dirname(this.binaryPath)}/askui-ui-controller.app/Contents/MacOS/askui-ui-controller"`;
12
12
  }
13
13
  makeDiskImageExecutable() {
14
- const mountPoint = '/Volumes/controlui-server.dmg';
14
+ const mountPoint = '/Volumes/askui-ui-controller.dmg';
15
15
  execSync([
16
16
  'hdiutil attach',
17
17
  '-nobrowse',
@@ -21,7 +21,7 @@ export class UiControllerDarwin extends UiControllerFacade {
21
21
  `-mountpoint "${mountPoint}"`,
22
22
  `"${this.binaryPath}"`,
23
23
  ].join(' '));
24
- const appBaseName = 'controlui-server.app';
24
+ const appBaseName = 'askui-ui-controller.app';
25
25
  const appSrcPath = `${mountPoint}/${appBaseName}`;
26
26
  const appDestPath = `${path.dirname(this.binaryPath)}/${appBaseName}`;
27
27
  fs.removeSync(appDestPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "askui",
3
- "version": "0.2.6",
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",