Question

What is the difference in Pages when Unit Testing Activities

I am attempting to Unit Test an activity and in this activity I have

  1. Data Transform
  2. Trying to assert that a property equals a value set by the above Data Transform in the Test Case

For 1, this DT is going to trying to get a hold of the page (specified in the pages and parameters) where the actual activity calls it and sets the property. However, when I try to search for the properties where I set from the DT, I only see them on the D_pzRunRecord Page off a TABTHREAD# page. The RunRecordPrimaryPage has the subpage but the property remains blank and I thought this is where the properties should be.

I don't understand if the Test_Case has its own hierarchy of pages different from the activity or if I am not looking at the pages correctly.

***Edited by Moderator Marissa to update platform capability tags****

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

November 5, 2018 - 11:01am

Which version of Pega are you using here?

Could you post some screen shots of the Activity and Data transform (including pages and classes tab)?

November 5, 2018 - 12:28pm

@Marc Alderman:

Pega Version: Pega 7.3.1

 

November 6, 2018 - 7:43am
Response to AkashS22

Ok, so the data transform is being used as a Setup for the test case right?  I was thinking you were calling the DT from the activity that you were testing.

In this case I think you just need to make sure to set the value on the RunRecordPrimaryPage in the DT like this:

November 6, 2018 - 12:41pm
Response to Marc Alderman

Hi Marc Alderman so I changed the Target field and source field to match your screenshot however when I construct the property I do not find the any pages on the RunRecordPrimaryPage ( I am expecting to see CaseDetails that we created during our DT). 

Additional Questions: On the clipboard, the "run" pages are red and only appear after your run the activity so I assume these are the pages where the data in our test case lie? (D_pzRunRecord and RunRecordPrimaryPage)

 

November 8, 2018 - 5:39am
Response to AkashS22

The red pages are where you have used the property-set-message method to set an error on the property.  The red just shows there is an error / message there.

The setup data transform only runs when you run the test case itself.  How did you get to this point in the no results screen shot?  Is it a new recorded test case, or have you just run the one you created previously?

November 8, 2018 - 11:27am
Response to Marc Alderman
  1. How did you get to this point in the no results screen shot?
  • ​​So After the data transform has been placed in the setup, I got back to the definitions in the Test Case to configure the Property Assertion. 
    • ​Assertion Type: Property
    • Page: RunRecordPrimaryPage
    • Page Class: This I tried with the current class of the test case (CIBC-RetBnk-SM-Work) and Pega-RunRecord - No pages2. 

On the activity itself, when I go to the property (.CaseDetails.IsActionRequired) where the Property-Set step is it says At Run time, the user adds data to this property through the UI. Data transforms and other rules maybe required to support this workflow. 

What does the above mean like are you are not able to fill in that property through data transforms on test cases only through the whole application flow?

 

November 13, 2018 - 1:54pm
Response to Marc Alderman

So the RunRecordPrimaryPage setting does work when I assign a value of "Yes" to

RunRecordPrimaryPage.CaseDetails.IsActionRequired

However, when I try to make another Data Transform and assign the above property to "No" in another Data Transform it fails for another Test Case. It is still retaining its previous value of "Yes". Wouldn't a new Data Transform overwrite the property?

 

Pega
November 27, 2018 - 6:42am
Response to AkashS22

Could you share tracer session for your scenario? Also could you give more details on when and how this "another Data Transform" is invoked?

Pega
November 27, 2018 - 6:40am

Hi Akash,

As per your screenshot unexpectedResults.PNG , and comments provided by Marc, you test case should work correctly.

Few points that might help you resolve the issue by yourself:

1) A set up Data transform/activity always runs a unnamed page. So if one wants to modify the data on RunRecordPrimaryPage then that should be mentioned explicitely.

2) When one clicks on "Add property" , then system searches for step page(here RunRecordPrimaryPage) in all threads and stops search when atleast one thread is found with such page name. However user can change the thread name if he wants to select another thread.

3) Even if data is not ready on any thread : user can click "Add row" on RHS and add expected property path manually; and then fill the RHS with expected value.

 

Hope that helps.