This section details features and limitations specific to the BDDFramework client-side tool. For general information about BDD testing with OutSystems, see the Overview tab.
We'll further detail these topics, which are specific to the BDDFramework client-side tool:
New functionality allows you to create tags, and then during development you can associate one or more tags with test scenarios. These user-defined tags allow you more granular control of your test portfolio. You can use tags to identify test characteristics such as:
Tags are a new block in the BDDFramework. When using the BDDFramework application template, a tag template is included in your initial module. Tags should be generic and reusable. Define each tag in its own block and then add it to relevant tests. Additionally, create tags in a separate UI Flow (for example in TestTags in the following example).
We recommend creating a new tag from the template. To do so:
The BDD Scenario screen has a Tags placeholder, to which you can drag tags for a test scenario. The Tags placeholder is between the scenario Description and Setup placeholder files. You can add one or more tags to the Tags placeholder.
Adding tags to scenarios is easy. You simply search for the tag in the TestTags flow and drag it to the Tag placeholder in your scenario block. And you're done!
You can use tags to specify tests to execute or skip. The new API accepts two new optional parameters in the header:
Tests execute based on the following logic.
A test executes when:
A test is skipped when:
Based on server-side tool feedback, we've added a new version of the execution API that provides more information about test execution. The existing API (v1) is still compatible as well. Let's take a look at what's new with API v2.
The API v2 supports these two new header parameters, which are described earlier in this article:
The API v2 output includes the new output attributes defined here:
{ "SuiteScreen": "string", "IsSuccess": true, "SuccessfulScenarios": 0, "FailedScenarios": 0, "SkippedScenarios": 0, // number of tests skipped, as specified in the SkipTags parameter "TestScenarioResults": [ // list of tests that exist inside the test screen (executed or not) { "ScenarioId": "string", // scenario ID, as specified in the "Scenario Identifier" placeholder "Description": "string", // scenario description, as specified in the "Scenario Description" placeholder "IsSuccess": true, // indicates if this scenario was successful or not "IsSkipped": true, // indicates if the scenario was skipped, as specified in the SkipTags parameter "FailureReport": "string", // given-when-then detail, which appears only if a scenario fails "Tags": [ // list of all the tags associated with the scenario "string" ] } ], "ErrorMessage": "string"}
{
"SuiteScreen": "string",
"IsSuccess": true,
"SuccessfulScenarios": 0,
"FailedScenarios": 0,
"SkippedScenarios": 0, // number of tests skipped, as specified in the SkipTags parameter
"TestScenarioResults": [ // list of tests that exist inside the test screen (executed or not)
"ScenarioId": "string", // scenario ID, as specified in the "Scenario Identifier" placeholder
"Description": "string", // scenario description, as specified in the "Scenario Description" placeholder
"IsSuccess": true, // indicates if this scenario was successful or not
"IsSkipped": true, // indicates if the scenario was skipped, as specified in the SkipTags parameter
"FailureReport": "string", // given-when-then detail, which appears only if a scenario fails
"Tags": [ // list of all the tags associated with the scenario
"string"
]
}
],
"ErrorMessage": "string"
The client-side tool requires that you enable the API by installing a chromium instance on your OutSystems server. This post-installation step is not required for the server-side tool.
After installing your BDDFramework client-side tool, install chromium:
Go to https://<your_server_name>/BDDFrameworkMobile/Welcome, where <your_server_name> is the name of your OutSystems server
Confirm whether chromium is installed. Initially, it should not be.
Optionally, change the folder where chromium is installed. You do this in the ChromiumInstallPath site property in the TestRunner_API module.
Click Install Chromium.
Chromium is required on the server to execute tests through the API because the execution flow of the BDDFramework client-side tool is javascript-based. It requires a javascript engine on which to execute.
When the BDDFramework client-side API is called, internally it uses Puppeteer to interact with the browser, execute tests, and then read test results. Puppeteer, which requires chromium, enables test execution through APIs. In the client-side BDDFramework tool, we use the .NET port of the Puppeteer node library, Puppeteer Sharp (.NET port used by the tool).
Though technically possible, we opted not to embed a chromium image as a DLL in an OutSystems extension because the chromium image size (~140Mb) would make the BDDFramework tool too large.
Initially, our goal was to use the new tool to cover both server-side and client-side testing. However, we found significantly slower performance (up to 19x slower) for server-side testing with this new tool. Performance for client-side testing, however, is comparable with other javascript testing platforms. Use this tool for clent-side testing, and continue to use the separate server-side tool for server-side testing.
Performance degradation for server-side testing occurred for these reasons:
Yes. Internally, BDDFramework for client-side testing is built as a mobile application. Through inheritance, your test applications are also mobile applications. In OutSystems, mobile applications can reference client-side actions and entities from both mobile and Reactive Web Apps. Consequently, you can test both mobile and Reactive Web client-side logic.
The client-side testing tool has a few limitations compared with the server-side tool, as noted in this section.
Though an edge case, note that iterating a BDDStep block with a ListRecords widget inside the BDDScenario block is not supported. Unpredictable results, including interrupting test execution, may occur. Here’s an example of the unsupported structure:
| BDDScenario| - BDDStep | - BDDStep | - | ListRecords <-- Not Supported | - | - BDDStep | - BDDStep
| BDDScenario
| - BDDStep
| - | ListRecords <-- Not Supported
| - | - BDDStep
This scenario differs from a data-driven one, where you iterate one BDDScenario block with a ListRecords widget. This type of data-driven scenario is supported.
You can’t have one test screen with both simple and data-driven scenarios. If you create a test with a data-driven scenario, it should have its own screen. We recommend the same approach with server-side testing, though technically the server-side can support mixing these two scenarios.
In a personal environment, executing tests through the API is not supported. This limitation exists because personal environments do not include necessary permissions to install chromium on the server.