acceptance-test-harness
acceptance-test-harness copied to clipboard
`FormValidation` API should allow asserting for text in expected location rather than attempting to retrieve the validation area
What feature do you want to see added?
The FormValidation
API attempts to select the text in the validation area.
https://github.com/jenkinsci/acceptance-test-harness/blob/2524148139e273d035619950ae68a99772b1ecf7/src/main/java/org/jenkinsci/test/acceptance/po/FormValidation.java#L67
But nothing in the API says whether it expects content to be there.
If the JavaScript hasn't fired by the time the selenium code executes then it can sometimes fail to find the content causing flakey tests, one such example was worked around in https://github.com/jenkinsci/acceptance-test-harness/pull/814/commits/650531a4ca12343252c07c7a539263e4801c392d
My suggested fix would be either:
a) Matchers query element directly for expected text, that way they can retry if text is not what is expected
b) minor change to API to say whether validation content is expected or not, that way it can retry if getText()
doesn't return what it should
Upstream changes
No response