-
Notifications
You must be signed in to change notification settings - Fork 0
Add SED mottak E2E tests with proper assertions #44
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
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
New test suites: - Search & Navigation (sok-og-navigasjon.spec.ts) - 5 tests - Oppgaver/Tasks flow (oppgaver.spec.ts) - 5 tests - Journalføring/Document registration (journalforing.spec.ts) - 5 tests - SED Intake via Kafka (sed-mottak.spec.ts) - 6 tests - FTRL Klage/Appeal (ftrl-klage.spec.ts) - 5 tests - EU/EØS Article 16 Exception Request (artikkel-16-anmodning.spec.ts) - 6 tests New Page Objects: - SokPage - Search results interaction - OppgaverPage - Task list on forside - JournalforingPage - Document registration workflow - KlagePage - Appeal handling - AnmodningUnntakPage - EU/EØS exception requests New Helper: - SedHelper - Trigger SED events via mock service for hybrid API+DB testing These tests cover the most critical user flows identified in the test expansion strategy.
- Add EuEosBehandlingPage to fill required period and country during EU/EØS case creation - Fix saksnummer extraction to handle MEL-XX format - Improve verifiserSideLaster assertion to check URL instead of strict element matching - Fix menypanel test to not re-navigate since we're already on behandling page - All 6 unntak tests now pass
- Make oppgaver assertion more resilient by checking for multiple page elements - Refactor search tests to use Vis behandling button instead of separate /sok page - Remove unused SokPage and SokAssertions imports - Fix saksnummer extraction to handle MEL-XX format
- Add createJournalforingOppgaver helper to mock-helper.ts Uses /testdata/jfr-oppgave endpoint to create test journalposter - Update journalforing tests to create oppgaver before running - Fix selectOption calls to use values instead of RegExp labels - Make assertions more resilient for different UI behaviors - All 5 journalforing tests now pass
Documents: - Current test status (21 tests passing) - Infrastructure added (mock helper, page objects) - Missing JFR_* process types and why they're not triggered - Next steps to complete the full submission flow - Commands for local testing and debugging
Fix the journalføring test to actually complete form submission and
trigger the JFR_NY_SAK_BRUKER process type.
Changes:
- Fix sakstype dropdown to use correct label values ("EU/EØS-land")
- Add velgLand() method for country combobox selection
- Add fyllSoknadsperiode() method for required date fields
- Auto-fill country and dates in opprettNySakOgJournalfør()
- Update documentation with form structure and solution
The test now successfully:
- Creates journalføring oppgave via mock
- Fills all required form fields
- Submits the form
- Triggers JFR_NY_SAK_BRUKER process type
Document production process type usage from Prometheus metrics and investigate how to trigger the top 3 most-used process types: - MOTTAK_SED (841): Found broken payload format in sed-helper.ts - Documented correct format with working curl command - Added exact code fix required - REGISTRERING_UNNTAK_GODKJENN (574): Documented API endpoint and prerequisites - ARBEID_FLERE_LAND_NY_SAK (501): Triggered via A003 SED (same fix as MOTTAK_SED) Key finding: Fixing sed-helper.ts will unlock 58% of production traffic coverage.
The melosys-mock /testdata/lagsak endpoint expects a sedHendelseDto
wrapper object, not flat fields. Updated:
- SedConfig interface: avsenderLand/mottakerLand → avsenderId/avsenderNavn
- sendSed(): Now wraps payload in { sedHendelseDto: {...} }
- Added getDefaultSenderName() helper for common EU country names
- Updated SED_SCENARIOS with correct field names
- Fixed sed-mottak.spec.ts tests to use new format
API payload now matches:
{
"sedHendelseDto": {
"bucType": "LA_BUC_02",
"sedType": "A003",
"avsenderId": "SE:FK",
"avsenderNavn": "Försäkringskassan",
"mottakerId": "NO:NAV",
"mottakerNavn": "NAV",
"rinaDokumentId": "...",
"rinaDokumentVersjon": "1",
"sektorKode": "LA"
}
}
- MOTTAK_SED triggers successfully via new mock endpoint - Branch feature/melosys-eessi-melding-producer in melosys-docker-compose - New endpoint: POST /testdata/lag-melosys-eessi-melding - Documents completed tasks and remaining work
- Update sed-helper.ts to use /testdata/lag-melosys-eessi-melding endpoint - Simplify SedConfig interface (all fields optional, endpoint provides defaults) - Add new SED_SCENARIOS: A003_MINIMAL, A003_MED_PERSON - Update sed-mottak.spec.ts with proper assertions using E2E Support API - Add database verification for PROSESSINSTANS and FAGSAK tables - Fix table names (PROSESSINSTANS not PROSESS_INSTANS) - All 8 tests pass, triggering MOTTAK_SED and related processes
2773a3d to
fa1d2c1
Compare
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
/testdata/lag-melosys-eessi-meldingTest coverage
Triggers these process types:
Dependencies
Requires
feature/melosys-eessi-melding-producerbranch in melosys-docker-compose