Closed premganz closed 9 years ago
Implemented in 1.2.5 in validator method
Mode some more changes, in the same release 1.2.5 , it is not wise to have the setState do the validation everytime, for every navigation across a page, it would be a waste.
So made the isValid(kw) method explicit on the Page and the validation itself is now called as the PageLayoutValidator.
This isValid is called from the kw.checkPageLayout* set of methods. Think that is fair enough
The isValid() is causing confusions, it works only when the checkPageLayout is used, whereas a more proper use case would be to validate it when the page loads. So validator interface now has two methods-> validate(kw) and validateOnLoad(kw). The Page no longer has validate() method, instead you will need to pull out the validator and call validate()
The Navigation library is modified to use validateOnLoad for every navigation . So its integrated with the navigation.
There are some cases where validation is required across pages, in a context. For instance of headers and footers. It was assumed that validation done once during the initial tests could cover this, but there are cases where one or two pages might get missed out in a cross application update.
The advantage of the second method would be that the validator can be configured into the factory at the time of building the SimpleScriptXXXX that would extend the JUnitScript. This allows for using all the pages with a different type of validator based on environment variable. For instance if the environment variable is "ACCEPT", one can check the version as "1.2" on each page.