[BDDFramework] Tools for BDD Development - Creating an Assign from a Table record
Forge component by João Proença
Application Type
Traditional Web

Bit of a long shot, but when developing setups for BDD tests often we are build assigns to hold records of data to applied created.  When a table is quite wide filling out the test values for the record can be quite laborious. Often the developers have also created a version of the test record(s) in the tables as part of there dev/test process.  What I was wondering is whether someone has a method for taking values in a record in an entity/table and create an Assign with the values from that record?    

Recognising that it is a fairly niche, but something like being able to right click on a row/record when viewing data in an entity and being able to select create an assign from this record.


Hi Paul, happy new year to you!


Thanks for bringing up this question, perhaps it might help other interested parties also sharing experiences in test data setup using the BDDFramework. 

If I read your post correctly, believe you're looking for some sort of code reflection which the OutSystems platform does not offer by default, is that it? Something similar to how this component inspects fields and their data from a record but with the additional functionality of also allowing their automatic assignment without having to pick each attribute and define the test value individually in an Assign node - is that it? If so, you have additional examples on how to achieve this extra functionality on the XML Records component (just use Integration Studio to inspect the implementation).

Another aspect perhaps related to your question (but please do confirm) may regard a data-driven testing approach; in this case, one maps the test values in an excel and then reuses it to feed each of the test scenario values and also validate each test's expected result; please have a look at the 3rd exercise demonstrated in the Complete Guide To BDD Testing In OutSystems (although this one shows a REST API instead of an excel as the source of the test values but the idea is pretty much the same) and let me know if this is what you had in mind.


Cheers,

Pedro


Hi Paul!

If I understood correctly, you were looking for a way to automatically create the assign node during test setup, using an existing record in the database, through the View Data pane in Service Studio. Unfortunately, that is not possible.

Now, as you probably are already aware, we do promote the reusability of test code, which includes setup actions. This means that the test data created for a specific test should be encapsulated in its own OutSystems action, and that action can be reused by other tests in the future (you still need to create the assign first time, though). Also, if you need to setup a different record in the same entity, you can just copy-paste the action and change only the attributes you need in the new action.

If you haven't seen these yet, here's a link to a short video about Component Testing in OutSystems. It is part of the "Becoming a Tester in OutSystems" guided path


Hope this helps.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.