Page object refactoring for two additional tests #2490
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This brings two more tests into the page object pattern. As is typical when adding more tests using the page objects, some functionality is added to the page objects, but it wasn't much.
For testSimpleSamlPhpLoginDisplaysLastLogin, this replaces what was already a basic procedural method design for login() and logout() with an object-oriented one. Also, an interaction with webdriver in an assertion is extracted to the appropriate object for possible reuse.
For testSingleLogoutWithNoLogoutUrlOnIDP, it violated the DRY principle fairly thoroughly and the page objects fix that for the webdriver-related interactions. Also, the introduction of the clickSamlLink_goToHomePage() method makes the purpose of the test easier to understand.
Several magic strings for test credentials are replaced with constants, though further refactoring is probably warranted to use a similar mechanism as with test accounts used in other tests in this class and elsewhere.