Repository navigation
test(e2e): extend Germany onboarding flow through Pre-Onboarding Requirements - #1370
Merged
Merged
Conversation
Replaces the bare "Benefits" title assertion with a real fill: intercepts the benefit-offers schema response and drives createHeadlessForm (the same engine the app runs) to discover visible radio/select fields round by round, so conditionally-revealed fields (e.g. a benefit's "value" after its "filter" is picked) get filled without hardcoding a country's benefit-group UUIDs, unlike the existing Spain-only helper. Extends the assertion through the Review step. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
watchForBenefitsSchema silently fell back to an empty schema on a non-2xx response, turning a real API failure into a confusing downstream submit/validation failure instead of a clear error at the point of interception. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Register the benefit-offers schema listener before Introduction submits (creates the employment), not before Contract Details: useBenefitOffersSchema is enabled as soon as employmentId exists, so the request had already resolved by the time the old listener was registered, and waitForResponse hung until timeout. - Feed createHeadlessForm a real nested initialValues object instead of a flat one keyed by the dotted data-field string. The dotted string is only valid as a DOM lookup key; the schema's own if/then conditionals read a nested object, so a benefit's "value" field never appeared once its "filter" was picked. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Replaces fillOnboardingStep4SpainForm's hardcoded sandbox-company benefit-group UUIDs with the same schema-driven helper the Germany spec now uses, so both onboarding e2e tests fill Benefits generically instead of one of them being tied to one company's fixed field names. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…eHeadlessForm createHeadlessForm is called once and handleValidation is used to re-evaluate conditionals each round: both jsf v0 and v1 mutate the same `fields` array in place rather than returning a new one, so recomputing the whole form from scratch every round was redundant. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Documents the pattern discovered while building the dynamic Benefits e2e helper: call createHeadlessForm once and recompute conditionals via handleValidation (which mutates the same fields array in place for both jsf v0 and v1) instead of re-calling createHeadlessForm on every value change. Notes the existing src/flows/*/api.ts hooks that do the latter as accepted legacy debt, not the pattern for new code. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…irements Fills the gap after Benefits: acknowledges the Time Tracking Policy checkbox, reviews and signs the ILA, then verifies the review step's edit buttons become disabled (employment data frozen) and the invite button is no longer blocked, now that every requirement is finished. Also fixes the prior assertion that the Review step followed Benefits directly — the flow actually surfaces a Preview Employment Agreement step first, which the test now submits. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
|
Deploy preview for remote-flows ready!
Deployed with vercel-action |
Contributor
|
Deploy preview for adp-cost-calculator ready!
Deployed with vercel-action |
Contributor
📊 Coverage Report⚪ Coverage unchanged
Detailed BreakdownLines Coverage
Statements Coverage
Functions Coverage
Branches Coverage
✅ Coverage check passed |
Replaces the round-based loop with a flat, sequential check-then-sign, since this sandbox company always returns the same fixed shape (one acknowledgement, then one document). Revisit if a company with a different requirement shape needs coverage. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CI's sandbox company goes straight from Benefits to Review — the Preview Employment Agreement step isn't universal, it depends on the company's account configuration, not the country. My local run's sandbox account happened to have it enabled; CI's doesn't. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CI's sandbox company doesn't have this step enabled, so asserting 'Review' directly after Benefits matches today's reality. If the account config changes and the step gets enabled, this test should break — that's the signal to update it, not something to paper over preemptively. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
jordividaller
approved these changes
Sep 23, 2026
This was referenced Sep 23, 2026
Merged
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.
Summary
Extends the Germany onboarding e2e test (stacked on #1361) to cover the Pre-Onboarding Requirements step: acknowledging the required policy, then reviewing and signing the Individual Labor Agreement (ILA).
Why
#1361 fills the Benefits step but the test still stopped at the Review step title with the Pre-Onboarding Requirements section untested. That step gates the invite: the employee can't be invited until every requirement (e.g. the ILA) is signed, and signing freezes the employment data so it can no longer be edited. Neither behavior had e2e coverage.
What changed
Toggle details
example/e2e/helpers/preOnboardingRequirements.ts:completePreOnboardingRequirements(page, signature)checks each acknowledgement checkbox and signs each document requirement (e.g. the ILA), looping a few rounds since requirements can depend on each other (the ILA is blocked until the acknowledgement is checked). Disambiguates the two dialogs involved (the full-screen document preview and the signature dialog, both RadixDialogs that portal independently todocument.body) via theirdata-slotattributes.onboard-germany-employee.spec.ts: after Benefits, asserts the invite button is disabled, completes the pre-onboarding requirements, then asserts every review-step "Edit ..." button is now disabled (employment data frozen) and the invite button is enabled.Screenshots
N/A
Related Resources
Testing
example/app in a browser — ran twice against the real sandbox via the local dev server, both passed.Note
Low Risk
Playwright e2e coverage only; no production application or API behavior changes.
Overview
Extends the Germany employee onboarding Playwright test through the Review step’s Pre-Onboarding Requirements, which gate inviting the employee.
A new helper
completePreOnboardingRequirementsskips gracefully when the section is absent (with a test annotation), otherwise checks the acknowledgement checkbox, opens the full-screen document dialog, signs with the employee’s full name, and waits for the dialog to close. The spec reuses the generatedfullnamefor the signature, asserts Invite Employee is disabled until requirements are done, runs the helper, then asserts all review Edit controls are disabled and the invite button is enabled with the expected label.Reviewed by Cursor Bugbot for commit 81851a3. Bugbot is set up for automated code reviews on this repo. Configure here.