Skip to content

Fix client delegation tests after PR changes - #2431

Merged
allinox merged 3 commits into
mainfrom
test/fix-tests-after-pr
Aug 18, 2026
Merged

Fix client delegation tests after PR changes#2431
allinox merged 3 commits into
mainfrom
test/fix-tests-after-pr

Conversation

@allinox

@allinox allinox commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes the instabilities in the tests that were revealed after #2426 was merged. All tests should now run green

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

Copilot AI lite review requested due to automatic review settings August 18, 2026 12:02
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bbde6f07-b26d-4256-bbdd-5c48897e3145


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread playwright/pages/tilgangsstyring/KlientAdministrasjonPage.ts Outdated
Comment thread playwright/e2eTests/altinn3/klientadministrasjon/klientadministrasjon.spec.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() in KlientAdministrasjonPage already 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();

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@allinox
allinox requested a review from sonwit August 18, 2026 12:38

@sonwit sonwit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

@allinox
allinox merged commit 018dc8b into main Aug 18, 2026
6 checks passed
@allinox
allinox deleted the test/fix-tests-after-pr branch August 18, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants