Question

1
Replies
25
Views
AndzejS3 Member since 2019 7 posts
Swedbank
Posted: August 26, 2020
Last activity: October 8, 2020
Solved

Test Case for a When rule

Hi 

I need advice on how Test Cases for a When rule work.

My expectation was that while Test Case is created from a Run window of the When rule, it would receive the supplied context (clipboard page or data transform), so the the newly created Test Case will run with the same input. The setup for the test case would be automatically configured, just like it happens with decision strategies. But in reality, from what I see, Test Case is created with no context, no setup, and I cannot even supply the context manually. It is not clear which page is test case using for the run. I have tried RunRecordPrimaryPage and pyWorkPage but it seems like the Test Case for When rule is ignoring any input I provide.

The only way I can make test cases for When rules work is by supplying Multiple Input Combinations, which is sometimes OK, but only if a When rule is referencing properties directly. If When rule is invoking another function this approach will not work.

I have found very similar question in this forum but with no answer - https://collaborate.pega.com/question/when-rule-parameters-failing-unittest 

May someone advise please what is the suggested approach when creating Test Cases for When rules

Thanks and Regards

Andy

***Edited by Moderator: Pallavi to change category from General to Product, update platform capability tags***

Pega Platform Case Management
Share this page LinkedIn