Fix client delegation tests after PR changes - #2431
Conversation
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Stabilizes Playwright E2E tests for the client delegation (klientadministrasjon) flow after behavior/DOM changes introduced in PR #2426, aiming to ensure the suite runs consistently green.
Changes:
- Disambiguates Playwright locators by selecting the first matching “Gi fullmakt” / “Slett fullmakt” action when multiple matches exist.
- Updates klientadministrasjon E2E assertions to avoid Playwright strict-mode failures caused by non-unique locators.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| playwright/pages/tilgangsstyring/KlientAdministrasjonPage.ts | Adjusts page-object actions to click the first matching action button to prevent strict-mode locator conflicts. |
| playwright/e2eTests/altinn3/klientadministrasjon/klientadministrasjon.spec.ts | Updates assertions to use .first() for delete-button visibility checks to avoid strict-mode failures. |
Suppressed comments (1)
playwright/e2eTests/altinn3/klientadministrasjon/klientadministrasjon.spec.ts:235
- Same as above: prefer keeping locator disambiguation inside the page object instead of sprinkling
.first()through the test body.
await expect(
klientAdministrasjonPage.slettFullmaktKnapp('Posttjenester').first(),
).toBeVisible();
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
playwright/e2eTests/altinn3/klientadministrasjon/klientadministrasjon.spec.ts:233
slettFullmaktKnapp()inKlientAdministrasjonPagealready returns a.first()-scoped locator. Calling.first()again here is redundant and makes the assertion noisier/inconsistent with the similar assertion earlier in this spec.
await expect(
klientAdministrasjonPage.slettFullmaktKnapp('Posttjenester').first(),
).toBeVisible();
Description
Fixes the instabilities in the tests that were revealed after #2426 was merged. All tests should now run green
Verification
Documentation