Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page object refactoring for two additional tests #2490

Merged
merged 5 commits into from
Sep 20, 2023

Conversation

swalchemist
Copy link
Contributor

@swalchemist swalchemist commented Sep 16, 2023

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.

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/186054965

The labels on this github issue will be updated when the story is started.

* Based on review feedback, there's a need for the method names to make it easier to understand where a test is navigating to and what it's doing.
* Also removed the begin() method in the Page class, which was bad OO design since it referenced a child class.
@swalchemist swalchemist merged commit dc6b728 into develop Sep 20, 2023
20 checks passed
@swalchemist swalchemist deleted the pageObjectsContinued branch September 20, 2023 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants