Skip to main content
Version: 9.0.0

Busy State Auto-track

The Is App Busy Evaluator feature facilitates the monitoring and observation of the Pega element's value with a document-statetracker class. If the Pega application is engaged in activities such as injecting an AJAX call, creating a new screen, sending an API request, generating a report, etc., the data-state-busy-status attribute is set to 'busy' (or 'none' if there are no internal processes).

It's important to note that this element is consistently accessible within the main frame of the primary browser tab. Even if you open a new tab within the Pega application, the statetracker continues to exist in the parent tab.

The Test Maker platform simplifies the complexities associated with iframes or tabs. In this context, the busy status is effortlessly tracked across any iframe or tab, automatically handling scenarios where the evaluation is unnecessary (e.g., when not in the Pega application context or when using the UNIT adapter for the test case). By default, the evaluator checks the status before each action, but this behavior can be customized in the configuration file.

How to add Busy State Auto-track to your project:

The primary configuration for the evaluator resides within the runner section of the config file:

Enable isAppBusy

runner: {
isAppBusyEvaluator: isAppBusyEvaluator,
}

Set up or change options

You have the flexibility to modify three key options either directly from the config file or within your code:

Soft Failure: Awaiting the condition to be met without causing a test execution failure. Instead, it displays a warning in the terminal reporter.

Retry Timeout: The duration the system should wait before considering a retry attempt as timed out.

Retry Interval: The timelapse between individual retry attempts.

NameParameter(s)TypeDescription
setIsAppBusyEvaluatorSoftFailurevaluebooleanDefines sofFailure property state
setIsAppBusyEvaluatorTimeoutvaluenumberDefines retry timeout
setIsAppBusyEvaluatorIntervalvaluenumberDefines interval timeout
setIsAppBusyEvaluatorOptionsoptions{ softFailure?: boolean, timeout?: number, interval?: number }Allows to define softFailure state, timeout and interval

Get actual values

NameParameter(s)TypeDescription
getIsAppBusyEvaluatorSoftFailurebooleanReturns actual sofFailure property state
getIsAppBusyEvaluatorTimeoutnumberReturns actual retry timeout
getIsAppBusyEvaluatorIntervalnumberReturns actual interval timeout
important

If you need to change other parameters, you can override the default isAppBusyEvaluator function in the config file.

IsAppBusy Logs

The bypasslogging terminal reporter option excludes all the messages about the steps performed by the evaluator but shows the info about the status and retries:

{
...reporters.terminal,
...{
options: <TerminalReporterOptions>{
bypass: bypassLogging,
},
},
},

When to consider test as failed

If you want to make your application FAIL when the statetracker is busy for more than default timeout (60 seconds) ot your custom timeout, you need to add this part of the configuration:

failure: {
feature: {
skipRemainingScenariosOnScenarioFail: async (runInfo: TestRunInfo) => runInfo.appIsBusy,
},
},

If you DO NOT need it, you can use any other configuration, for example:

failure: {
feature: {
skipRemainingScenariosOnScenarioFail: true, //skips all the next scenarios of the feature
exitProcessOnFirstFail: false, //terminates the process after the first fail
skipRemainingStepsOnStepFail: true, //skips all the next steps if one of the steps in the scenario failed
},

How to skip

To make the evaluator SKIP your unit tests pass the adapter type in this way:

Feature(`SAC-1-1 Create the case via API`)
.adapters([AdapterType.UNIT])

An example of configuration with reporting (includes terminal, allure and text reporters):

reporting: {
reporters: [
{
...reporters.terminal,
...{
options: <TerminalReporterOptions>{
ignoreLogLevel: false,
bypass: bypassLogging,
feature: { start: true, done: true },
scenario: { start: true, done: true },
step: { start: true, done: true },
subStep: { start: false, done: false },
hook: { start: false, done: false },
controllerAction: { start: true, done: true },
selectorAction: { start: true, done: true, retries: false },
assertionAction: { start: false, done: true, retries: false },
scoreBase: 'feature',
},
},
},
{
...reporters.allure,
...{
options: <AllureReporterOptions>{
scoreBase: 'feature',
},
},
},
{...reporters.text}
],
},