[BDDFramework] Rollback of loaded data in teardown
bddframework
Forge component by Platform Maintenace
Application Type
Traditional Web
Service Studio Version
11.11.3 (Build 42969)

Recently I explored the benefits of BDDFramework after using UTF for a long time. So far I really like it. But now trying to implement a bit more complex tests which loads lots of data in the setup action.

In UTF it was VERY convenient to have the abortTransaction as last element in the action to clean up all the loaded data, but that is to no avail in BDDFramework, since a commit is happening after every screenaction. Say I load a lot of data in the Given action then that data is already committed at the end-element of Given. If I then try to call abortTranasction in the Teardown screenaction, then nothing will be rolled back, since all has been committed already. 

How can I do the same in BDDFramework as I was used to do in UTF? 

If that is not possible I then have to stick with UTF for the more data-prone tests and I really want to move all tests to BDD. Also because of the nice integration with Azure DevOps.

I also have a question about the multiple transactions that happen during a test. Is there any guarantee that data has not been manipulated by a 3rd process in the background between the Given phase and the Then phase? So when asserting a specific value in the Then section fails because some process had manipulated the data in the meantime. I think this was/is better handled in the UTF unit test framework where you only work with 1 transaction.

Hello, 

Could you explain what you mean by multiple transactions? Are your test data have a commit transaction server action?  Or does your production code have the transaction? 

I have done some significant effort previously to use commit transaction in my test data, but with the latest version of BDD back in June 2021, they provide the option to rollback using abort transaction server action.  I refactor my test projects by removing every commit transaction and using abort transactions within a the teardown of the test.  

When the test is executing, the entire test is wrapped within a transaction.  If I attempt to access the table from either a SQL Client (SSMS) or a separate outsystem IDE window, the data/result will not be available to access.  

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