askui 0.23.1 → 0.24.0
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/execution/execution-runtime.d.ts +1 -1
- package/dist/cjs/execution/retry-strategies/index.d.ts +1 -0
- package/dist/cjs/execution/retry-strategies/index.js +1 -0
- package/dist/cjs/execution/retry-strategies/no-retry-strategy.d.ts +16 -0
- package/dist/cjs/execution/retry-strategies/no-retry-strategy.js +23 -0
- package/dist/cjs/execution/ui-control-client.js +4 -0
- package/dist/esm/execution/execution-runtime.d.ts +1 -1
- package/dist/esm/execution/retry-strategies/index.d.ts +1 -0
- package/dist/esm/execution/retry-strategies/index.js +1 -0
- package/dist/esm/execution/retry-strategies/no-retry-strategy.d.ts +16 -0
- package/dist/esm/execution/retry-strategies/no-retry-strategy.js +19 -0
- package/dist/esm/execution/ui-control-client.js +4 -0
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ export declare class ExecutionRuntime {
|
|
|
11
11
|
private uiControllerClient;
|
|
12
12
|
private inferenceClient;
|
|
13
13
|
private stepReporter;
|
|
14
|
-
|
|
14
|
+
retryStrategy: RetryStrategy;
|
|
15
15
|
constructor(uiControllerClient: UiControllerClient, inferenceClient: InferenceClient, stepReporter: StepReporter, retryStrategy: RetryStrategy);
|
|
16
16
|
connect(): Promise<UiControllerClientConnectionState>;
|
|
17
17
|
disconnect(): void;
|
|
@@ -18,3 +18,4 @@ __exportStar(require("./exponential-retry-strategy"), exports);
|
|
|
18
18
|
__exportStar(require("./linear-retry-strategy"), exports);
|
|
19
19
|
__exportStar(require("./fixed-retry-strategy"), exports);
|
|
20
20
|
__exportStar(require("./retry-strategy"), exports);
|
|
21
|
+
__exportStar(require("./no-retry-strategy"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RetryStrategy } from './retry-strategy';
|
|
2
|
+
/**
|
|
3
|
+
* NoRetryStrategy implements a retry strategy that does not perform any retries.
|
|
4
|
+
* It is useful when you want to disable retries for certain operations.
|
|
5
|
+
*/
|
|
6
|
+
export declare class NoRetryStrategy implements RetryStrategy {
|
|
7
|
+
baseDelayMs: number;
|
|
8
|
+
retryCount: number;
|
|
9
|
+
/**
|
|
10
|
+
* Always returns 0 delay, as no retries are performed.
|
|
11
|
+
* @param _attempt - The current retry attempt number (not used in this strategy)
|
|
12
|
+
* @returns The delay in milliseconds for the current attempt (always 0)
|
|
13
|
+
* @remarks This method is not used, but it's required by the RetryStrategy interface.
|
|
14
|
+
*/
|
|
15
|
+
getDelay(_attempt: number): number;
|
|
16
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NoRetryStrategy = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* NoRetryStrategy implements a retry strategy that does not perform any retries.
|
|
6
|
+
* It is useful when you want to disable retries for certain operations.
|
|
7
|
+
*/
|
|
8
|
+
class NoRetryStrategy {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.baseDelayMs = 0;
|
|
11
|
+
this.retryCount = 0;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Always returns 0 delay, as no retries are performed.
|
|
15
|
+
* @param _attempt - The current retry attempt number (not used in this strategy)
|
|
16
|
+
* @returns The delay in milliseconds for the current attempt (always 0)
|
|
17
|
+
* @remarks This method is not used, but it's required by the RetryStrategy interface.
|
|
18
|
+
*/
|
|
19
|
+
getDelay(_attempt) {
|
|
20
|
+
return this.baseDelayMs;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.NoRetryStrategy = NoRetryStrategy;
|
|
@@ -17,6 +17,7 @@ const annotation_writer_1 = require("../core/annotation/annotation-writer");
|
|
|
17
17
|
const logger_1 = require("../lib/logger");
|
|
18
18
|
const ui_control_client_dependency_builder_1 = require("./ui-control-client-dependency-builder");
|
|
19
19
|
const ai_element_collection_1 = require("../core/ai-element/ai-element-collection");
|
|
20
|
+
const retry_strategies_1 = require("./retry-strategies");
|
|
20
21
|
class UiControlClient extends dsl_1.ApiCommands {
|
|
21
22
|
constructor(workspaceId, executionRuntime, stepReporter, aiElementArgs) {
|
|
22
23
|
super();
|
|
@@ -425,8 +426,11 @@ class UiControlClient extends dsl_1.ApiCommands {
|
|
|
425
426
|
*/
|
|
426
427
|
waitUntil(AskUICommand_1) {
|
|
427
428
|
return __awaiter(this, arguments, void 0, function* (AskUICommand, maxTry = 5, waitTime = 2000) {
|
|
429
|
+
const userDefinedStrategy = this.executionRuntime.retryStrategy;
|
|
428
430
|
try {
|
|
431
|
+
this.executionRuntime.retryStrategy = new retry_strategies_1.NoRetryStrategy();
|
|
429
432
|
yield AskUICommand.exec();
|
|
433
|
+
this.executionRuntime.retryStrategy = userDefinedStrategy;
|
|
430
434
|
}
|
|
431
435
|
catch (error) {
|
|
432
436
|
if (maxTry === 0) {
|
|
@@ -11,7 +11,7 @@ export declare class ExecutionRuntime {
|
|
|
11
11
|
private uiControllerClient;
|
|
12
12
|
private inferenceClient;
|
|
13
13
|
private stepReporter;
|
|
14
|
-
|
|
14
|
+
retryStrategy: RetryStrategy;
|
|
15
15
|
constructor(uiControllerClient: UiControllerClient, inferenceClient: InferenceClient, stepReporter: StepReporter, retryStrategy: RetryStrategy);
|
|
16
16
|
connect(): Promise<UiControllerClientConnectionState>;
|
|
17
17
|
disconnect(): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RetryStrategy } from './retry-strategy';
|
|
2
|
+
/**
|
|
3
|
+
* NoRetryStrategy implements a retry strategy that does not perform any retries.
|
|
4
|
+
* It is useful when you want to disable retries for certain operations.
|
|
5
|
+
*/
|
|
6
|
+
export declare class NoRetryStrategy implements RetryStrategy {
|
|
7
|
+
baseDelayMs: number;
|
|
8
|
+
retryCount: number;
|
|
9
|
+
/**
|
|
10
|
+
* Always returns 0 delay, as no retries are performed.
|
|
11
|
+
* @param _attempt - The current retry attempt number (not used in this strategy)
|
|
12
|
+
* @returns The delay in milliseconds for the current attempt (always 0)
|
|
13
|
+
* @remarks This method is not used, but it's required by the RetryStrategy interface.
|
|
14
|
+
*/
|
|
15
|
+
getDelay(_attempt: number): number;
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NoRetryStrategy implements a retry strategy that does not perform any retries.
|
|
3
|
+
* It is useful when you want to disable retries for certain operations.
|
|
4
|
+
*/
|
|
5
|
+
export class NoRetryStrategy {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.baseDelayMs = 0;
|
|
8
|
+
this.retryCount = 0;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Always returns 0 delay, as no retries are performed.
|
|
12
|
+
* @param _attempt - The current retry attempt number (not used in this strategy)
|
|
13
|
+
* @returns The delay in milliseconds for the current attempt (always 0)
|
|
14
|
+
* @remarks This method is not used, but it's required by the RetryStrategy interface.
|
|
15
|
+
*/
|
|
16
|
+
getDelay(_attempt) {
|
|
17
|
+
return this.baseDelayMs;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -14,6 +14,7 @@ import { AnnotationWriter } from '../core/annotation/annotation-writer';
|
|
|
14
14
|
import { logger } from '../lib/logger';
|
|
15
15
|
import { UiControlClientDependencyBuilder } from './ui-control-client-dependency-builder';
|
|
16
16
|
import { AIElementCollection } from '../core/ai-element/ai-element-collection';
|
|
17
|
+
import { NoRetryStrategy } from './retry-strategies';
|
|
17
18
|
export class UiControlClient extends ApiCommands {
|
|
18
19
|
constructor(workspaceId, executionRuntime, stepReporter, aiElementArgs) {
|
|
19
20
|
super();
|
|
@@ -422,8 +423,11 @@ export class UiControlClient extends ApiCommands {
|
|
|
422
423
|
*/
|
|
423
424
|
waitUntil(AskUICommand_1) {
|
|
424
425
|
return __awaiter(this, arguments, void 0, function* (AskUICommand, maxTry = 5, waitTime = 2000) {
|
|
426
|
+
const userDefinedStrategy = this.executionRuntime.retryStrategy;
|
|
425
427
|
try {
|
|
428
|
+
this.executionRuntime.retryStrategy = new NoRetryStrategy();
|
|
426
429
|
yield AskUICommand.exec();
|
|
430
|
+
this.executionRuntime.retryStrategy = userDefinedStrategy;
|
|
427
431
|
}
|
|
428
432
|
catch (error) {
|
|
429
433
|
if (maxTry === 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "askui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
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",
|