Skip to content

[WIP] test(Identities): Cover the identities list, identity page, traits and overrides - #9011

Open
talissoncosta wants to merge 1 commit into
mainfrom
test/identities-e2e
Open

talissoncosta wants to merge 1 commit into
mainfrom
test/identities-e2e

Conversation

@talissoncosta

Copy link
Copy Markdown
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Adds E2E coverage for identities ahead of moving the identity page from Flux to RTK Query, so the migration has a safety net.

  • Create, search, direct load and delete identities
  • Identity page direct load, add and remove a trait
  • Override a flag for an identity, then reset it

Each test uses its own project and accessible selectors (no new data-test).

How did you test this code?

  • Passed 3/3 against staging, plus 2 repeats with no flakes
  • Not covered: Edge-only behaviour (aliases), as CI's API isn't Edge

…d overrides

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@talissoncosta
talissoncosta requested a review from a team as a code owner November 18, 2026 16:11
@talissoncosta
talissoncosta requested review from kyle-ssg and removed request for a team November 18, 2026 16:11
@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
flagsmith-frontend-preview Ready Ready Preview Nov 18, 2026 4:12pm UTC
flagsmith-frontend-staging Ready Ready Preview Nov 18, 2026 4:12pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
docs Ignored Ignored Preview Nov 18, 2026 4:12pm UTC

Request Review

@talissoncosta talissoncosta changed the title test(Identities): Cover the identities list, identity page, traits and overrides [WIP] test(Identities): Cover the identities list, identity page, traits and overrides Nov 18, 2026
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

Walkthrough

Adds Playwright end-to-end tests for identity creation, search, and deletion. The tests also cover direct identity page loads, trait editing, and per-identity feature-flag overrides. Each test logs in and creates a uniquely named project.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: Minimal · up to 5dbad

This PR adds end-to-end test coverage for identities and makes no production code changes. It carries no meaningful merge risk, though the PR title should be fixed to satisfy the conventional commit check.

Finishing Touches

Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions github-actions Bot added the front-end Issue related to the React Front End Dashboard label Nov 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-9011 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-9011 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-9011 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith:pr-9011 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith-private-cloud:pr-9011 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith-frontend:pr-9011 Finished ✅ Results ✅

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

2 issues found across 1 file

Confidence score: 4/5

  • In identities-test.pw.ts, checking only that the effective value is off can miss an override that is still active. Also verify the override description or Reset control disappears after reset.
  • The tests in identities-test.pw.ts omit the required # Given, # When, and # Then sections. Add them to make setup, actions, and outcomes explicit.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="frontend/e2e/tests/identities-test.pw.ts">

<violation number="1" location="frontend/e2e/tests/identities-test.pw.ts:40">
P3: These tests omit the required `# Given`, `# When`, and `# Then` sections. Add those sections to each test body to make setup, actions, and outcomes explicit.</violation>

<violation number="2" location="frontend/e2e/tests/identities-test.pw.ts:109">
P2: This only confirms the effective value is off; an off-valued identity override would pass while still overriding the environment. Also assert that the override description or Reset control disappears after reset.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

await identityLink(page, 'dave_e2e').click()

log('The flag starts off, as in the environment')
await helpers.waitForUserFeatureSwitch('identity_flag', 'off')

@cubic-dev-ai cubic-dev-ai Bot Nov 18, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: This only confirms the effective value is off; an off-valued identity override would pass while still overriding the environment. Also assert that the override description or Reset control disappears after reset.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At frontend/e2e/tests/identities-test.pw.ts, line 109:

<comment>This only confirms the effective value is off; an off-valued identity override would pass while still overriding the environment. Also assert that the override description or Reset control disappears after reset.</comment>

<file context>
@@ -0,0 +1,126 @@
+    await identityLink(page, 'dave_e2e').click()
+
+    log('The flag starts off, as in the environment')
+    await helpers.waitForUserFeatureSwitch('identity_flag', 'off')
+
+    log('Turn it on for this identity only')
</file context>
Fix with cubic

@@ -0,0 +1,126 @@
import type { Page } from '@playwright/test'

@cubic-dev-ai cubic-dev-ai Bot Nov 18, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: These tests omit the required # Given, # When, and # Then sections. Add those sections to each test body to make setup, actions, and outcomes explicit.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At frontend/e2e/tests/identities-test.pw.ts, line 40:

<comment>These tests omit the required `# Given`, `# When`, and `# Then` sections. Add those sections to each test body to make setup, actions, and outcomes explicit.</comment>

<file context>
@@ -0,0 +1,126 @@
+  }
+}
+
+test.describe('Identities', () => {
+  test('Identities can be created, searched and deleted @oss', async ({
+    page,
</file context>
Fix with cubic

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 440b63fd-71ad-4b71-b19e-c78204c1cb47
Commits

Reviewing files that changed from the base of the PR and between d465e74 and 5dbad22.

Files selected for processing: 1

  • frontend/e2e/tests/identities-test.pw.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

const confirm = page.locator('#confirm-remove-feature-modal')
await confirm.getByRole('textbox').fill('identity_flag')
await confirm.getByRole('button', { name: 'Confirm' }).click()
await helpers.waitForUserFeatureSwitch('identity_flag', 'off')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Trivial · Maintainability & Code Quality · Quick win

Also check that reset removes the override.

The final assertion also passes if reset leaves a disabled identity override. The override description depends on override ownership, not the enabled value. (raw.githubusercontent.com)

After the switch becomes off, assert that This feature is being overridden for this identity is hidden. This strengthens the reset coverage before the migration.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor
✅ private-cloud · depot-ubuntu-latest-16 — run #23421 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  5 passed

Details

stats  5 tests across 3 suites
duration  45.6 seconds
commit  5dbad22
info  🔄 Run: #23421 (attempt 1)

🗂️ Previous results
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #23421 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 2 suites
duration  9.4 seconds
commit  5dbad22
info  🔄 Run: #23421 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #23421 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  33.1 seconds
commit  5dbad22
info  🔄 Run: #23421 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #23421 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  37.1 seconds
commit  5dbad22
info  🔄 Run: #23421 (attempt 1)

@github-actions

Copy link
Copy Markdown
Contributor

Visual Regression

25 screenshots compared. See report for details.
View full report

This branch was successfully deployed

2 active deployments
Preview – flagsmith-frontend-staging — 5dbad221 Deployed Nov 18, 2026 by vercel[bot]
Preview – flagsmith-frontend-preview — 5dbad221 Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant