test(keycloak): cover the sign-in/sign-up redesign against its design - #138
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Source
CivicDataLab/DataSpaceKeycloakTheme#28 (merged into
devas34fa299), released to production by #29 (a695d9c, deployed 2026-09-25). Design reference: the sign-in / sign-up auth-flow prototype.What changed in the product
#28 replaced the Login and Register pages and added custom Info, Error, LoginResetPassword, IdpReviewUserProfile, LoginIdpLinkConfirm(Override) and SignedIn pages, all with design copy ("Welcome back", "Reset your password", "Create your account", …), a password show/hide toggle, a new Google button, and a new footer.
What this adds
The existing auth-page tests only checked wiring (Google link, register link, privacy links, consent checkbox). They now check the design as well.
Passing today: 9 new tests, 16 in the file. These guard the redesign against regressions.
accounts.google.com. It follows the redirect only and never signs in.Strict xfail: 12 tests, each linked to its issue. They assert the design where production doesn't match it yet. When a fix ships, the test XPASSes,
strict=Trueturns that into a failure, and the marker has to come off.EXPECTED_REGISTER_FIELDS = (email, firstName, lastName)check, which asserted the opposite of the design.Page objects gain a shared
_KeycloakPagebase (heading, subtitle, field errors, legal links, viewport, document-replaced check). Three helpers that were duplicated in both classes moved into it. NewKeycloakResetPageandKeycloakErrorPage. The locators file has matching entries. No raw selectors in tests.keycloak-tests.yml: the job summary now listsxfailed. The skip gate is unchanged: pytest-json-report counts xfails asxfailed, notskipped.Why read-only, and why it's safe on production
Everything stays
smoke+readonly, because the workflow runs this file against auth.civicdatalab.in after every theme deploy and every 6h. The only submissions are a failed sign-in and a reset request for a random@example.invalidaddress with no account, so Keycloak writes nothing and sends nothing. The register form is only submitted with consent unticked, which the theme blocks in the browser.functional/test_con_registration.pyis untouched.Proof (local, against production auth.civicdatalab.in)
Green:
xfails fail on the design assertion, not on a timeout (
--runxfail):Red: a throwaway copy with one expected value flipped per class (not committed):
Gaps, not covered here
functional/test_con_registration.pystill fills first/last name and no password, matching today's realm. It has to change together with fix: sitemap tests were pagination-blind on dev #44.parakhrealm, which isn't on this server, and its login selectors are generic fallbacks the new theme still matches.Targets
CI, the branch whose workflows run.Closes #139