21
Views
6
Comments
Solved by AI
[BDD Framework] BDD on ODC
BDD Framework
Forge asset by OutSystems Labs

Hi experts of ODC,

We’re eager to adopt BDD as a core practice in our ODC development workflow—but getting started has proven to be more difficult than expected. Despite installing the available ODC Forge components developed by OutSystems, following official documentation, and reviewing various community posts, videos, and tutorials, I’ve yet to get a single BDD test running successfully on ODC.

Despite repeated efforts, including reaching out to OutSystems Support, it’s become clear that there is no workable guidance or documentation for implementing the BDD Framework on ODC. 

While the component is published by OutSystems, it is marked as “non-supported,” and lacks even the basics to get started (no examples, no docs, no ODC-specific guidance). This is particularly frustrating given the public promotion of testing frameworks at OutSystems events. I’m reaching out here in the hope that someone from the community has successfully implemented BDD on ODC or can clarify whether this is realistically achievable at this stage.

Questions:

  1. [Critical] Which app to install the "BDDFrameworkTestRunLib" and how to install/configure it? 
    1. Documentation suggests this needs to be installed "where the BDD test is to be executed", but this is unclear to me whether it is the app we are performing tests on or the app we are building the tests on.
    2. the same documentation outlines how the API can be added to the app via swagger file or by the single method, e.g. "https://<server url>/BDDFrameworkAPI/rest/TestTrigger/BDDTestRunner/{TestESpace}/{TestSuiteScreen}". But I do not know what to put for each of the <serverurl> / {TestESpace} / {TestSuiteScreen} placeholders.
  2. [Critical] How to configure GWT statements via BDDsteps to trigger sequentially for each part of the acceptance criteria? 
  3. Any way to to configure the tests to run for either on each "publish of the app to be tested" / "user triggered on the testing app" or "on schedule" (if possible)

Any help and/or guidance will be very much appreciated - even just addressing part of the questions. 

---

References I have referred to, to no avail:

  1. A Complete Guide To BDD Testing in the OutSystems Low-Code Platform [O11]
  2. TDD by Example - Creating a Loan App [O11]
  3. Guide to BDD testing in OutSystems - Virtual Roadtrip OutSystems [O11]
  4. Test Driven Development in OutSystems - Introduction [O11]
  5. How to Automate Unit Testing and API Testing [O11]
  6. Component testing with BDDFramework tools [O11]
  7. Component testing with BDDFramework tools [ODC]
UserImage.jpg
iWinAll
Solution

Issue solved by trial-and-error. NEO (Outsystem AI) has provided the most useful tip, albeit incomplete.

See steps outlined on the Notion page in the "Getting BDD Working on ODC – Call for Guidance and Shared Learnings" Discussion. 

2023-12-26 10-35-28
OutSystems Neo
Staff
AI Generated

Hi,

Your frustrations are entirely valid, especially because there is a gap in detailed documentation for using the BDD Framework specifically with ODC (OutSystems Developer Cloud). The framework is better documented for traditional OutSystems environments, but adapting it to ODC clearly requires some additional effort.

I'll try to address your critical questions based on the information available:


1. Installation and Configuration of BDDFrameworkTestRunLib

According to the OutSystems documentation, the BDDFrameworkTestRunLib should be included in the testing app, i.e., the app where your tests are defined, rather than the app being tested. This library provides the API endpoints required for triggering and managing tests.

To configure it:

  • Install the BDDFramework component from the Forge in your ODC environment, as outlined in Component Testing with BDDFramework Tools.
  • Ensure the BDDFrameworkTestRunLib is made public in your testing app so that its services can be invoked.

For the API placeholders:

  • <serverurl> should point to your ODC environment URL. Example: https://your-environment.outsystemscloud.com.
  • {TestESpace} is the module name of your test suite (e.g., MyApp_Tests).
  • {TestSuiteScreen} is the name of the Test Suite screen you've constructed in the test module (e.g., MyFirst_TestSuite).

2. Configuring GWT (Given-When-Then) Statements Using BDDSteps in a Sequence

The BDD Framework uses Gherkin-like syntax for tests, implemented through BDDScenario, BDDStep, and other web blocks on your Test Suite screen. Here’s the general approach:

  1. For each acceptance criterion, create a BDDScenario web block to represent the scenario.
  2. For each step of the criterion, add a BDDStep web block inside the BDDScenario.
  3. In each BDDStep, implement the logic (in Actions) necessary to perform and verify the step.

To ensure sequential execution:

  • Link the steps logically in the action flows tied to each BDDStep. Usually, once a BDDStep completes execution, control passes to the next step in the scenario.

Referencing Component Testing may help you understand the block organization and how to use reusable patterns effectively.


3. Configurations for Triggering Tests

Testing triggers can be implemented in three ways:

  • Manually Triggered: Add a button or endpoint in your testing app that calls the APIs provided by BDDFrameworkTestRunLib to execute specific test suites.
  • On App Publish: Use LifeTime's API to hook into the application deployment process and trigger the tests automatically as part of a CI/CD pipeline. However, detailed steps for this on ODC are not yet well-documented.
  • On Schedule: Use the built-in Timers functionality in OutSystems to schedule recurring test runs. Create a timer in the testing app, and within it, invoke the BDD APIs to execute desired test cases automatically.

I would strongly recommend reading Component Testing with BDDFramework Tools for guidance specific to ODC environments, even though the documentation may not yet be as comprehensive as needed for advanced setups.

If you’ve exhausted these steps and are still encountering issues, an alternative approach might involve leveraging a custom-built framework or extending the current BDD tools to better align with your ODC requirements. The community or OutSystems Support might be able to assist with those specialized adaptations.


Hopefully, this information helps clarify your next steps for implementing BDD with ODC. Let me know if you need further assistance with any specific part of the setup.

This answer was AI-generated. Please read it carefully and use the forums for clarifications
UserImage.jpg
iWinAll
For part 1, concept of "Module" to derive Module name does not exist in ODC, what does this represent on ODC context?
2023-12-26 10-35-28
OutSystems Neo
Staff
AI Generated

In ODC (OutSystems Developer Cloud), the traditional concept of a "Module" from OutSystems 11 has been replaced by Applications and Libraries. To derive the equivalent of a "module name," particularly in scenarios such as configuring {TestESpace} in the BDD Framework, you should use the Application or Library Name that encapsulates the logic or screens being referenced.

For example:

  1. If you're referencing a test application, {TestESpace} would correspond to the name of the application where your test scenarios are defined.
  2. If the test involves elements from a library (e.g., reusable logic), that library's name should be used for {TestESpace}, depending on the specific API call context.

OutSystems ODC currently advises embedding test screens and logic within the same application that you're testing, to ensure compatibility and execution within a single transaction. The names of these applications or libraries act as the equivalent to what "Modules" were in OS 11 when configuring the BDDFramework.

For additional guidance on structuring and consuming the BDD Framework within ODC, you can refer to High Performance Continuous Delivery with ODC.

This answer was AI-generated. Please read it carefully and use the forums for clarifications
UserImage.jpg
iWinAll
what if the App name has spaces?
2023-12-26 10-35-28
OutSystems Neo
Staff
AI Generated

When configuring the BDDFramework's API for application names that contain spaces in ODC, you need to replace spaces in the application name with %20, which represents a space in a URL (URL encoding). For example:

  • If your application name is "My App Test", you should format it as "My%20App%20Test" when setting it in the TestESpace parameter in the API's configuration.

This approach is consistent with handling application names in any URL-based configuration, as spaces must be encoded to ensure compatibility with APIs.

Since none of the provided articles directly reference this question, feel free to confirm this information with OutSystems documentation or support for specific details on API usage.

This answer was AI-generated. Please read it carefully and use the forums for clarifications
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.