EasyTest.Plugins.Retry
1.0.1
dotnet add package EasyTest.Plugins.Retry --version 1.0.1
NuGet\Install-Package EasyTest.Plugins.Retry -Version 1.0.1
<PackageReference Include="EasyTest.Plugins.Retry" Version="1.0.1" />
<PackageVersion Include="EasyTest.Plugins.Retry" Version="1.0.1" />
<PackageReference Include="EasyTest.Plugins.Retry" />
paket add EasyTest.Plugins.Retry --version 1.0.1
#r "nuget: EasyTest.Plugins.Retry, 1.0.1"
#:package EasyTest.Plugins.Retry@1.0.1
#addin nuget:?package=EasyTest.Plugins.Retry&version=1.0.1
#tool nuget:?package=EasyTest.Plugins.Retry&version=1.0.1
EasyTest.Plugins.Retry
Overview
EasyTest.Plugins.Retry is a foundational helper plugin integrated into the EasyTest suite aimed specifically at resolving test instability, famously known as "flakiness". When interacting with dynamic web applications, unstable network connections, or asynchronous database transactions, strict sequential commands often fail unexpectedly.
This plugin resolves this by injecting a highly configurable Retry and Polling mechanism directly into the JavaScript Execution state, abstracting away complex setInterval or nested try-catch structures.
Core Capabilities
- Configurable Retry Policies: Allows script developers to dictate explicitly how many times a code block should be attempted, and the rest period (Backoff Strategy) between attempts.
- Semantic Exception Filtering: Prevents blind retries by allowing configuration rules—for example, retry on
ElementNotVisibleExceptionbut fail immediately onAuthenticationFailedException. - Telemetry Emitting: Deeply integrated with
EasyTest.Sdk.Logging. During every failed attempt, it emits aWarnlevel pipe message detailing the attempt number and reason, so QA supervisors can trace instability directly from the graphical UI console.
Architecture & Integration
Unlike the Oracle plugin which interfaces with external systems, the Retry plugin interfaces directly with the V8 JavaScript Execution Context.
- It leverages the Microsoft ClearScript capability to pass Anonymous JavaScript Functions (Callbacks) back into C#.
- The
RetryHelperC# class executes the anonymous JS function wrapped inside a managed C#try-catchblock inside a customwhileloop. - If an exception is thrown, it evaluates the policy, utilizes
Thread.Sleep(orTask.Delayequivalent) to pause execution securely, and tries again. - If the max attempts are exhausted, the original JS stack trace is preserved and re-thrown instantly back to the
Engineto cleanly halt the test.
Usage in Scripts
The syntax is designed to be highly readable and elegant, preventing "spaghetti code" inside the test cases.
import { RetryHelper } from 'EasyTest.Plugins.Retry';
// The function to retry, retry count (3), delay in milliseconds (2000)
var result = RetryHelper.execute(() => {
// Simulate UI interaction
var isReady = UI.checkElementVisible("#dashboard-view");
if (!isReady) {
// Throwing an error indicates to the C# plugin that the attempt failed
throw new Error("Dashboard not yet painted on screen.");
}
return UI.getInnerText("#user-balance");
}, 3, 2000);
log.success("Extracted balance successfully after loading: " + result);
Benefits
By moving complex polling logic down into the highly efficient .NET Core C# layer rather than writing slow JavaScript .delay() helper wrappers, the CPU overhead is drastically minimized, and thread-blocking scenarios inside V8 are mitigated.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0-windows7.0 is compatible. net10.0-windows was computed. |
-
net9.0-windows7.0
- EasyTest.Sdk (>= 1.0.0)
- Humanizer (>= 3.0.10)
- Polly (>= 8.6.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.1 | 106 | 4/27/2026 |