bdd-web-block-framework
Reactive icon

BDD Web Block Framework

Stable version 1.0.0 (Compatible with OutSystems 11)
Uploaded
 on 10 June 2024
 by 
0.0
 (0 ratings)
bdd-web-block-framework

BDD Web Block Framework

Documentation
1.0.0

Building a test

If you've never created a BDD test, it might be worth reading the "Your complete guide to BDD testing with OutSystems" (https://www.outsystems.com/blog/posts/bdd-testing/) before continuing.

Client Actions

Element Selection

By default, all tests will be run against the entire web block. This means that if you do not use any of the Element Selector actions, all of the Elemment Manipulation actions will apply to the entire web block. In order to test the content of a web block, you should to be able to select a specific element in the web block.

All element selectors output "IsNotFound" as a boolean. which allows you to test the existance of an element.

Once an element is found, it becomes the "current selected element", and all Element Manipulations will be inside of this.

Selector: Child

Selects the first child of the currently selected element using a CSS selector. If the selector matches more than 1 element, the first is chsoen.

For example: The following flow will select the first Input element inside of the web block.

Selector: Contains

This searches the entire web block for an element containing the specified text.

In cases where the web block is large, you can set how many elements upwards to check (Default: 10)

The following example will find an element that contains the test "Field Label"

Selector: Element

This is will select the specific element specified using the CSS selector inside of the web block. If the selector matches more than 1 element, the first is chsoen.

The following example will find all radio input elements and select the first one.

Selector: Parent

Selects the parent of the currently selected element. If no elements has been selected, or the currently selected element is the web block itself, nothing happens.

Element Manipulation

All Element manipulation actions are executed against the currently selected element.

Action: ClearInput

Clears the value of an input. Only works with Input elements and does not work with any other element.

Action: Click

Clicks the currently selected element. This can be run against any element, and will act like a regular mouse click (left button, single click).

Action: Select

Allows you to change the value of a dropdown/select box. If the dropdown allows the selection of multiple values, simply add the values to be selected into the ValueList input parameter.

Action: Type:

Types in a string the same way a human would. This will not clear the field, and always start typing from the end of any existing values.

Tagging

Using the same method as BDDFramework Client Side, you can use URL parameters and Tags to specify which tests should be run, and which should be excluded.

To add a tag, create a test and add a Tag block in to the Tags placeholder:

The following URL parameters can be used:

  • SkipTags= - A comma-seperated list of tags to skip. this acts as a deny-list, and so any matching test will not be executed. If the same tag is included in ExecuteTags= , the tag will be skipped.
  • ExecuteTags= - A comma-seperated list of tags to execute. This acts as an allow list, and so any tags that do not match are skipped.


URL Parameter examples

To execute only tests with a tag "NameInputField", you could use the URL: https://my-outsystems/MyBDDFrameworkModule/MyTestsuite/?ExecuteTags=NameInputField

To skip tests with a tag "LastNameField", you could use the URL: https://my-outsystems/MyBDDFrameworkModule/MyTestsuite/?SkipTags=LastNameField

To execute only Tests with tag "Box" but skip tests that include the tag "Red-Box", you could use the URL: https://my-outsystems/MyBDDFrameworkModule/MyTestsuite/?SkipTags=Red-Box&ExecuteTags=Box

API

This module does not include API functionality, but is fully compatible with BDDFramework Client side. For more information, visit https://www.outsystems.com/forge/component-documentation/10917/bddframework-client-side-o11/0