Question
How do I unit test error messages on the primary page?
I have a Data Page that generates a page message when it is passed invalid parameters - This page message is set on the Data Page itself (as primary).
I have written some 'happy' Pega Unit Test rules and they work fine. However, my unit test that checks for the error scenario fails. In fact, the only way I can get the test to work is to change the logic of the data page itself, and I don't want that!
I have attached a couple of screenshots showing what I have in my unit test and the result.
Does anyone know how to get the test to pass on the data page containing the error message?
Have you tried using a Page Name of RunRecordPrimaryPage (instead of Primary). This the actual page name that the Data Page rule-runner (in 8.4) creates to stage the Data Page.
It is possible the "Primary" is too ambiguous for the Test Case. Did it work for your other happy path test cases or were they all Property assertions?