BDD Framework

BDD Framework (ODC)

Stable version 1.4.0 (Compatible with ODC)
Uploaded on 04 November 2024 by OutSystems Labs
BDD Framework

BDD Framework (ODC)

Documentation
1.4.0

Once the library is installed is ready to be used.

For you to understand how you can compose your tests read this article: Your Complete Guide To BDD Testing In the OutSystems Low-Code Platform (note: the article uses traditional applications, but the principles are the same when using it for reactive/mobile)

Along with the BDD Framework, we also provide an application that has templates to accelerate the implementation of the tests and to help you understand how to use the framework.

Before start creating tests, install the template application:

Now the strategy to implement the tests depends if the features rely on the actions inside of your application or if they rely on components from a library. So, follow below the strategy that applies better to your use case.

Strategy A - Create a Test for a feature relying on the actions inside your application:

  1. Inside your application create a new flow to hold your test suite screens and tests scenarios
  2. On the logic, create a folder to hold the auxiliary actions to support your test scenarios
  3. Open the BDD Framework template app to copy the screen template to accelerate the implementation of your test

Strategy B - Create a Test for a feature relying on components inside a library or if you want to test your exposed APIs or Integrations being consumed by your application:

  1. When creating a new application, you will have available a template for the BDD Framework, click on it to create your test app based on the template.
  2. Once the application is created you should have the template screens on it and all the references from the BDD Framework that you will require to proceed with the implementation of the tests
  3. Reference the elements (public actions, RESTs, service actions) that you want to test and start building your test using the template as a guide


Security of the screens:

The BDD Framework provides layouts that need to receive an auth token and its value will be validated against the value of the setting that you can define on the app where you have your tests built:


Layouts:

App Settings:



Configure the security of your test screens:

  1. The test screens need to be without roles defined, however, to add security to screens, the tests need to run using a valid token, this is what provides security to test screens (it's explained in the above section), so, the first step should be to define an authentication token that all the requests should pass
  2. Go to ODC Portal > Apps > select your app with the tests and change the setting "AuthenticationSecretToken" with a token
  3. Now, that you have defined the token make sure that your test pages have an input parameter to hold an auth token
  4. Similar to this: (the template app already provides sample pages with the field on them)
  5. Now pass that value to the layout block that holds your tests
  6. Now publish and run your tests passing in the parameter of the URL the token defined


How to run your tests:

  • Open on the browser the test page and define in the URL the valid token, so, it should be something similar to this: .../page_TestSuite?AuthToken=

Disable the token:

  • A setting called "DisableScreensAuth", to disable the token validation. By default, the token validation is enabled. IMPORTANT: this should be turned on, only in specific cases where your tests don't affect business data, or work with mock data or your applications are running inside private networks.


Adding Tags to Scenarios

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.

The new Tags placeholder in the BDDScenario block, highlighted in yellow

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!

Adding a Tag to a Scenario