BDD Framework wrong json response by test case
Question

Hi everyone,

we are currently working with the bdd framework and we came accross the following issue:

We wrote a simple API Test as described in this blog post https://www.outsystems.com/blog/posts/bdd-testing/

If we publish our test we see a successful run in our browser.

For automated testing we tried to get the test result with a rest call but we get the following json response back:

{                                                                                                                                                                                                                                              
  "SuiteSuccess": false,                                                                                                                                                                                                                       
  "SuccessfulScenarios": 0,                                                                                                                                                                                                                    
  "FailedScenarios": 0,                                                                                                                                                                                                                        
  "SkippedScenarios": 0,                                                                                                                                                                                                                       
  "FailureReports": [],                                                                                                                                                                                                                        
  "ErrorMessage": ""                                                                                                                                                                                                                           
}                                                                                                                                                                                                                                              

We expected something like

"SuiteSuccess": true and "SuccessfulScenarios": 1


When we implemented an error it was shown also correctly in our browser but the json response stays the same!

Does anyone know where we went wrong?

Thank you!

Kind regards



Solution

Hello Efstathios,

Please make sure that you have added the FinalResult block at the bottom of all the scenarios on your page (the “No Scenarios Executed” block). If you don't see it you may have to add it as a dependency from 'Manage Dependencies'.

If you already are using the FinalResult block correctly, could you please share a screenshot that shows how the bdd framework blocks are arranged on your test screen.

Regards,

AJ

 

Thank you AJ!

Although we included the FinalResult block you gave us an idea what we did wrong.

And now everything works fine.

{                                                                                                                                                                                                       
  "SuiteSuccess": true,                                                                                                                                                                                 
  "SuccessfulScenarios": 1,                                                                                                                                                                             
  "FailedScenarios": 0,                                                                                                                                                                                 
  "SkippedScenarios": 0,                                                                                                                                                                                
  "FailureReports": [],                                                                                                                                                                                 
  "ErrorMessage": ""                                                                                                                                                                                    
}                                                                                                                                                                                                       


Regards,

Efstathios

PS: At the end we just put the FinalResultBlock in the wrong place;-)



 


Glad it worked out! :)

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