35
Views
4
Comments
Unit testing options (alternatives to BDD Framework?)
Question

I'm wondering if anyone is doing unit testing at scale in their OutSystems applications?  We've been creating tests with the BDD Framework but there are significant issues getting it to scale and making it useful in our development/deployment process.  It's been ok as a development tool - writing a handful of tests for each user story, grouping the test web blocks on a page, verifying that they're all green before closing the story.  But now we need to automate the test runs, and we've hit several roadblocks there.

  • To use the Test Runner API, the BDD tests have to be available via anonymous page, which is a pretty big security issue. For now I've hacked around this by checking the request headers in the OnInit but it doesn't feel great.
  • A bigger issue is that the API loads the tests in a headless browser, so all of our back-end authorization checks fail. I have hacked around this by replacing GetUserId() in the BL and CS with a custom method that uses a default UserId in the dev environment only, but this interferes with authorization tests that verify certain types of users can or cannot perform certain actions.

So, is anyone doing unit tests at scale - testing business logic, without the front end, in a true TDD/BDD compatible style?  I have done the CI/CD training, but I haven't found anyone inside or outside the organization that can point to an enterprise-level application of the BDD framework.  Does such a thing exist?  

2022-12-30 07-28-09
Navneet Garg

Our team also facing same issue unfortunately we didn't find any answer

There are couple of  discussion already available in the forum.

https://www.outsystems.com/forums/discussion/74240/easy-way-to-perform-unit-testing/

Please let me know if you found concrete solution for this problem.


2023-05-16 15-02-15
Douglas Aldridge

Thanks for responding, it's good to know that someone else has these questions at least.  I will follow up here if I find answers elsewhere, or develop some solutions internally.


2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Unfortunately outsystems is so not up to par with competition (Traditional code stacks) in regards to unit testing. It is embarrassing.

2023-05-16 15-02-15
Douglas Aldridge

Haha yeah, unfortunately I have convinced my team that it's irresponsible to build an enterprise solution with no automated unit testing so now I have to deliver it.  Thanks for confirming I have been hoist with my own petard. :) 

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