test(e2e): port platform/policy_compliance/lockout_phase to Playwright#73658
Draft
stephenliang wants to merge 1 commit into
Draft
test(e2e): port platform/policy_compliance/lockout_phase to Playwright#73658stephenliang wants to merge 1 commit into
stephenliang wants to merge 1 commit into
Conversation
Port 10 scenarios from dashboard/test/ui/features/platform/policy_compliance/lockout_phase.feature. Green under the 5x/all-browser stress gate; original Cucumber feature tagged @playwright so the Cucumber suite skips it. Source: dashboard/test/ui/features/platform/policy_compliance/lockout_phase.feature
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.
Ports the 10 scenarios of
dashboard/test/ui/features/platform/policy_compliance/lockout_phase.feature(Child Account Policy "all-user lockout" phase) to Playwright/TypeScript infrontend/packages/e2e-tests, and tags the original Cucumber feature@playwrightso the Cucumber suite skips the now-ported scenarios.The scenarios assert that on
/users/editthe age and US-state selects are disabled for under-13 Colorado students in the lockout phase (email, Clever, or Google login) and enabled for everyone else (over-13, non-Colorado, or not yet in lockout).What's here
tests/policy-compliance/lockout-phase.spec.ts— the 10 scenarios, each mapped 1:1 to its Cucumber source with a Migration-status doc block.tests/pages/account-edit-page.ts— a small POM for/users/edit, locating the age/US-state selects inside the#account-informationReact mount.tests/shared/auth.ts—createUser/createStudentgain SSO (clever/google) provisioning that matches the Cucumbercreate_userstep (drops the password and forwards the OmniAuth provider + uid).tests/platform/header.spec.ts— one-line import fix for ateacher-dashboardmodule a prior PR relocated (it was a dead import on this branch base).Scenario coverage
Setup mechanics (parity with the step defs)
CPA all user lockout phasestep sets a client-side DCDO cookie; the port mockscap_CO_lockout_date_overridethrough the shareddcdofixture. Thecreated_atvalues for "before/after CAP start" accounts are pinned to the exact Ruby-derived instants (verified withbin/rails runner). Thecap_CO_start_date_overridethe Cucumber step also set is intentionally omitted — no app code reads that key.createStudentPOSTs to the test-only/api/test/create_userwithage,us_state,created_at, and SSO linkage, so the Clever/Google scenarios need no real OAuth handshake.#user_us_staterenders only for US-geolocated requests (RegistrationsController#editderives@is_usafromrequest.country_code), sobeforeEachpins the country to US via the sharedsetCountryOverridehelper — the same patternmanage-studentsuses. The original Cucumber relied implicitly on US CI IPs.Links
Testing story
Green under the zero-flake stress gate — 5× repeats × {chromium, firefox, webkit},
retries=0— run independently twice (150/150 clean each time) against test-studio.Reviewed for fidelity against the authoritative Cucumber feature and step definitions. Two latent test-validity issues surfaced by the review are fixed here: (1) the US-geolocation dependency above, and (2) scoping the
#user_us_state/#user_agelocators to the#account-informationedit form so the enabled-case assertions target the real control rather than the "finish creating your account" interstitial modal, which reuses the same element ids.