Posted: 27 Jun 2018 17:11 EDT Last activity: 17 Jul 2018 16:43 EDT
Testing a read-only property doesn't work
I created a When rule that tests the value of a property that happens to be read-only. It's a value that gets written once when the user logs in, but is read-only after that.
I'm trying to test the when rule using several values. However, because the property is read-only it does not get set during the test case. And so when I do the following tests, it fails on the second step with Expected true, Actual false.
Is there a way around this situation or should there be an enhancement request or is it working as designed?
@Bopstal I did not add a setup / teardown for the test. I did create a new when rule, used another property that could be written to and it worked fine.
@Asif_Hasan I didn't setup the property, so I'm not exactly sure. The use case is, the user logs in and these static properties are initialized. Of course, once initialized, they can't be changed, even for testing.
He created a When rule IsAPMUser. The rule IsAPMUser has an expression that is checking the value of a property in a Page, however, the page is pointing to a Data Page that is readonly. The When rule works but his TestCase was failing when testing for true condition.
In working with him on the issue, we found out that the TestCase behave as expected if the property being tested is not on a readonly data page.
He just wanted to know if there are other suggestion(s) for his situation?