Quarantine engine and Java SPI extensibility
The last part of the series covers two features aimed at long-term maintenance: flakiness quarantine and Java SPI extension points.
Flakiness quarantine (testfly-quarantine.yml)
You can quarantine a flaky test instead of deleting it or commenting it out, and the CI pipeline keeps moving. List the test in testfly-quarantine.yml in the project root:
# testfly-quarantine.yml (Project Root)
quarantine:
enabled: true
tests:
- className: io.testfly.examples.PaymentTest
methodName: testStripeWebhook
reason: "Waiting for third-party webhook fix (JIRA-4021)"
owner: "@payment-team"
CI still runs quarantined tests. When one fails, TestFly flags it as QUARANTINED and the build does not fail.
Java SPI extension points
You can extend TestFly without forking it or changing framework internals. Each extension point is registered through its registry class or through SPI:
| Extension Point | Interface | Registration |
|---|---|---|
| Custom Driver Provider | NamedDriverProvider |
DriverProviderRegistry.register() or META-INF/services
|
| Report Adapter | ReportAdapter |
ReportAdapterRegistry.register() or SPI |
| Lifecycle Hook | ExecutionHook |
HookRegistry.register() or SPI |
| Full Plugin | TestFlyPlugin |
PluginRegistry.register() or SPI |
Example: a Slack report adapter
package io.testfly.examples.plugins;
import io.testfly.reporting.ReportAdapter;
import io.testfly.metrics.ExecutionMetrics;
public class SlackReportAdapter implements ReportAdapter {
@Override
public String getName() {
return "slack";
}
@Override
public void onSuiteFinish(ExecutionMetrics metrics) {
// Send Slack webhook with pass rate and failed test summaries
}
}
Series summary
The eight parts covered:
- Part 1: zero-boilerplate setup with
BaseTestandtestfly.yml - Part 2: semantic locators (
getByRole),BasePageandWaitEngine - Part 3: CI/CD quality gates (
BuildThresholdEnforcer) and parallel execution - Part 4: AI test generation and self-healing with
testfly-mcp - Part 5: BDD with Cucumber 7,
BaseCucumberStepsand@retryable - Part 6: the built-in
ApiClient,BaseApiTestand hybrid workflows - Part 7: bundled axe-core accessibility checks (
accessibility()) andVisualAssert - Part 8: the flakiness quarantine engine and Java SPI extensibility
The source code is on GitHub.
Top comments (0)