Posted: 28 Dec 2018 3:48 EST Last activity: 1 Feb 2019 12:06 EST
Creating Test Cases for Activity rules and other Parameterised Rules
I want to create a unit test cases for the Pega rules (which allows to create unit test cases).
I am able to create the test cases as well. My question is - if today I am creating a test case for say Activity A (which is having Params) and the test case get recorded to the activity rule with status as "Passed".
However, if I run the same test case it is getting failed !
I want to know how can we create the dynamic test cases so that it should not get failed when we run them after initial run ?
***Edited by Moderator: Pallavi to update platform capability tags***
I don't understand the sentence "test case getting recorded to the activity with status as passed".
Test will pass only when it is run manually. Do you mean, first time when it runs it passes & subsequently it fails?
Any parameterized rule should work properly with unit test cases. It is not possible to run the same test with different set of parameters but the test will pass with same parameters and same assertions every time if it passed the first time, unless there are changes to the rule itself.
Please let me know what's your case here & we can analyze further.
Posted: 3 years ago
Posted: 1 Feb 2019 11:20 EST
Siddhant Suryakant Jivane (SiddhantJivane)
Can you show which activity you are unittesting and which input parameters you use? I've seen tests pass with the initial parameters, but fail when ran again. I'm not sure if it's similar to your situation, but what helped me is editting the unittest and passing the parameters with additional quotes around it.