Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
206 commits
Select commit Hold shift + click to select a range
3134068
Add segment page
kyle-ssg Aug 5, 2025
5d97da7
Add segment page
kyle-ssg Aug 5, 2025
ea9eef4
add my to breadcrumb
kyle-ssg Aug 5, 2025
df8de68
Migrate feature override row to component
kyle-ssg Aug 12, 2025
c953bec
Update frontend/web/components/Breadcrumb.tsx
kyle-ssg Aug 26, 2025
c77bb77
safe handle url push
kyle-ssg Aug 26, 2025
da52a0d
Merge remote-tracking branch 'origin/feat/segment-page' into feat/seg…
kyle-ssg Aug 26, 2025
a9d3d33
Offset 2
kyle-ssg Aug 26, 2025
ab16a33
Merge branch 'refs/heads/main' into feat/segment-page
matthewelwell Aug 29, 2025
00c331f
Merge branch 'main' into feat/segment-page
kyle-ssg Sep 16, 2025
a438251
Merge remote-tracking branch 'origin/feat/segment-page' into feat/seg…
kyle-ssg Sep 16, 2025
f4fdcf6
Merge branch 'main' into chore/componentise-feature-override-row
kyle-ssg Sep 16, 2025
5fa2c8f
fix feature override import
kyle-ssg Sep 16, 2025
b526540
Fix tests
kyle-ssg Sep 16, 2025
36d5c78
Merge branch 'feat/segment-page' into chore/componentise-feature-over…
kyle-ssg Sep 16, 2025
3b246bd
Fix segment tab classes
kyle-ssg Sep 23, 2025
53f967a
Fix segment tab classes
kyle-ssg Sep 23, 2025
73d31a1
Add toast
kyle-ssg Sep 23, 2025
6e19718
Add manageSegmentsPermission to create segment
kyle-ssg Sep 23, 2025
3c90c18
Refactor remove segment
kyle-ssg Sep 23, 2025
b7826e9
Merge branch 'feat/segment-page' into chore/componentise-feature-over…
kyle-ssg Sep 23, 2025
5bf0aac
Merge branch 'main' into chore/componentise-feature-override-row
kyle-ssg Sep 23, 2025
3d51e9c
Merge branch 'main' into chore/componentise-feature-override-row
kyle-ssg Sep 23, 2025
0633e23
fix identity override
kyle-ssg Sep 23, 2025
b8f706a
Componentise overrides
kyle-ssg Sep 23, 2025
c7fd718
Componentise overrides
kyle-ssg Sep 23, 2025
c5d433a
Refactor
kyle-ssg Sep 30, 2025
ec576fb
Improve feature override row refactoring
kyle-ssg Sep 30, 2025
149fc8c
CTA Feature override
kyle-ssg Sep 30, 2025
596f736
re-add tests
kyle-ssg Sep 30, 2025
022c27d
Refactor
kyle-ssg Sep 30, 2025
480a0a8
Chore/componentise feature override row improved (#6118)
kyle-ssg Sep 30, 2025
9d6f43a
Refactor
kyle-ssg Sep 30, 2025
f91a243
Merge branch 'chore/componentise-feature-override-row-improved' into …
kyle-ssg Sep 30, 2025
661872f
Permission fix
kyle-ssg Sep 30, 2025
162fceb
fix identifier
kyle-ssg Sep 30, 2025
e52f9f9
Fix identityName param
kyle-ssg Sep 30, 2025
0ba5c15
Fix edit permission check
kyle-ssg Sep 30, 2025
80811d5
Componentise feature filters
kyle-ssg Sep 30, 2025
a5dc772
Fix segment override logic
kyle-ssg Sep 30, 2025
4d340e3
Fix identity override logic
kyle-ssg Sep 30, 2025
3ee508e
Fix identity override logic
kyle-ssg Sep 30, 2025
7971ac7
Merge branch 'chore/componentise-feature-override-row' into chore/com…
kyle-ssg Sep 30, 2025
657fd59
QA
kyle-ssg Oct 7, 2025
ce67965
Merge branch 'chore/componentise-feature-override-row' into chore/com…
kyle-ssg Oct 7, 2025
12eee3a
Make filtering consistent across user and features page
kyle-ssg Oct 7, 2025
f061a48
simplify filters
kyle-ssg Oct 7, 2025
2939e21
Merge branch 'main' into chore/componentise-feature-override-row
kyle-ssg Oct 7, 2025
e441e03
Merge branch 'chore/componentise-feature-override-row' into chore/com…
kyle-ssg Oct 7, 2025
10719cb
re-add loading logic
kyle-ssg Oct 7, 2025
b790d58
Simplify loading logic
kyle-ssg Oct 7, 2025
17ea4ba
Don't assume code references exist
kyle-ssg Oct 7, 2025
772e147
Don't assume code references exist
kyle-ssg Oct 7, 2025
f3ba094
fix text wrapping
kyle-ssg Oct 7, 2025
7b18f28
Fix tag filter in url
kyle-ssg Oct 7, 2025
b4724ca
Merge branch 'chore/componentise-feature-filters' into feat/segment-f…
kyle-ssg Oct 7, 2025
eb0be4b
Update frontend/web/components/feature-page/FeatureFilters.tsx
kyle-ssg Oct 14, 2025
6174bd5
Remove releasePipelines
kyle-ssg Oct 14, 2025
9b562f6
Merge remote-tracking branch 'origin/chore/componentise-feature-filte…
kyle-ssg Oct 14, 2025
dbb085a
remove sortToHeader
kyle-ssg Oct 14, 2025
f7e3cff
Merge branch 'main' into chore/componentise-feature-override-row
kyle-ssg Oct 14, 2025
ba3b42e
Claude context
kyle-ssg Oct 14, 2025
9746d13
Claude context
kyle-ssg Oct 14, 2025
5955f25
Claude context
kyle-ssg Oct 14, 2025
efedbdc
Add api-sync / optmimise contexts
kyle-ssg Oct 21, 2025
cae73d7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 21, 2025
23a6495
Add api-sync / optimise contexts
kyle-ssg Oct 21, 2025
af5bfda
Merge remote-tracking branch 'origin/chore/claude-context' into chore…
kyle-ssg Oct 21, 2025
acd5420
Merge branch 'main' into chore/componentise-feature-override-row
kyle-ssg Oct 21, 2025
29bae85
Merge branch 'chore/componentise-feature-override-row' into chore/com…
kyle-ssg Oct 21, 2025
162daef
Fix table value filter
kyle-ssg Oct 21, 2025
8b6d03d
Merge branch 'chore/componentise-feature-filters' into feat/segment-f…
kyle-ssg Oct 21, 2025
2058123
Fixes
kyle-ssg Oct 21, 2025
a1c5d83
Use unified endpoint for segment feature states
kyle-ssg Oct 21, 2025
143f02e
namespace segment tab
kyle-ssg Oct 21, 2025
dcb6632
Merge branch 'feat/segment-feature-state-view' into feat/segment-feat…
kyle-ssg Oct 21, 2025
6934c5f
Tests
kyle-ssg Oct 21, 2025
72e8214
Clean up types
kyle-ssg Oct 21, 2025
21697fe
chore: componentise feature filters (#6119)
kyle-ssg Oct 28, 2025
ee90b70
Merge branch 'chore/componentise-feature-override-row' into feat/segm…
kyle-ssg Oct 28, 2025
ac641db
Update contexts
kyle-ssg Nov 4, 2025
0c03b8f
Update contexts
kyle-ssg Nov 4, 2025
fb2df65
Update contexts
kyle-ssg Nov 4, 2025
b064e81
Update contexts
kyle-ssg Nov 4, 2025
27019de
Update contexts
kyle-ssg Nov 4, 2025
96c81d6
Update contexts
kyle-ssg Nov 4, 2025
4a3bafa
Update contexts
kyle-ssg Nov 4, 2025
4b846d9
Update contexts
kyle-ssg Nov 4, 2025
6cbde85
Merge branch 'main' into chore/claude-context
kyle-ssg Nov 4, 2025
dd7b743
Update contexts
kyle-ssg Nov 10, 2025
6a8f202
Update frontend/web/components/feature-page/FeatureFilters.tsx
kyle-ssg Nov 11, 2025
ad8a35d
Update frontend/web/components/feature-page/FeatureFilters.tsx
kyle-ssg Nov 11, 2025
659abf1
return early if key fields are null
kyle-ssg Nov 11, 2025
a00269e
Merge branch 'main' into chore/componentise-feature-override-row
kyle-ssg Nov 11, 2025
ae76a46
Merge branch 'chore/componentise-feature-override-row' into feat/segm…
kyle-ssg Nov 11, 2025
1b90569
Remove !
kyle-ssg Nov 11, 2025
43e32ad
Remove !
kyle-ssg Nov 11, 2025
7dcb60c
Merge branch 'chore/componentise-feature-override-row' into feat/segm…
kyle-ssg Nov 11, 2025
0ed455b
Unused import
kyle-ssg Nov 11, 2025
1381fb0
Fix sort order types
kyle-ssg Nov 11, 2025
0ac5ded
Re-add remove segment button
kyle-ssg Nov 11, 2025
df85873
Update claude contexts
kyle-ssg Nov 11, 2025
a26b39a
Update claude contexts
kyle-ssg Nov 11, 2025
9ef5383
Fix sortorder functionality
kyle-ssg Nov 11, 2025
2ed1777
QA feedback
kyle-ssg Nov 11, 2025
e800bcc
QA feedback
kyle-ssg Nov 11, 2025
24572d7
Adjust environment select
kyle-ssg Nov 11, 2025
212de78
Adjust fetching and loading logic
kyle-ssg Nov 11, 2025
f55b8ef
Adjust fetching and loading logic
kyle-ssg Nov 11, 2025
4974a76
Prevent toggle feature from segment page
kyle-ssg Nov 16, 2025
68c09cb
Merge branch 'main' into chore/componentise-feature-override-row
kyle-ssg Nov 18, 2025
1a6b706
Merge branch 'chore/componentise-feature-override-row' into feat/segm…
kyle-ssg Nov 18, 2025
62262c1
clean up confirm toggle function
kyle-ssg Nov 18, 2025
5b9588a
fix vertical alignment for feature row
kyle-ssg Nov 18, 2025
189b701
Merge branch 'feat/segment-feature-state-view' into chore/create-flag…
kyle-ssg Nov 18, 2025
102d47a
Create flag migration
kyle-ssg Dec 2, 2025
f443064
Highlight segment when opening a feature
kyle-ssg Dec 2, 2025
aae4428
Merge branch 'main' into chore/componentise-feature-override-row
kyle-ssg Dec 2, 2025
454d9b7
Highlight segment when opening a feature
kyle-ssg Dec 2, 2025
a734a6c
Merge branch 'chore/componentise-feature-override-row' into feat/segm…
kyle-ssg Dec 2, 2025
d4d2f0b
Merge branch 'main' into chore/create-flag-migration
kyle-ssg Dec 2, 2025
01393b4
Merge branch 'refs/heads/feat/segment-feature-state-view' into chore/…
kyle-ssg Dec 2, 2025
142c32e
Migrate tabs
kyle-ssg Dec 2, 2025
752ce06
Add settings and value tabs
kyle-ssg Dec 2, 2025
a4c4c55
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 2, 2025
aec8e29
Revert claude changes
kyle-ssg Dec 2, 2025
8c40502
Merge remote-tracking branch 'origin/chore/create-flag-migration' int…
kyle-ssg Dec 2, 2025
fd08db6
Migrate components
kyle-ssg Dec 2, 2025
2732306
Revert changes
kyle-ssg Dec 2, 2025
1c117d7
feat: segment feature state view (#6137)
kyle-ssg Dec 2, 2025
c3ad50e
Fixes
kyle-ssg Dec 3, 2025
b9f4933
Merge branch 'main' into chore/componentise-feature-override-row
kyle-ssg Dec 3, 2025
cf3119b
Fixes
kyle-ssg Dec 3, 2025
14f7c5b
Merge branch 'chore/componentise-feature-override-row' into chore/cre…
kyle-ssg Dec 3, 2025
b2b275b
Fixes
kyle-ssg Dec 3, 2025
984e6e3
Fix merge hell
kyle-ssg Dec 3, 2025
51860b9
Merge branch 'chore/componentise-feature-override-row' into chore/cre…
kyle-ssg Dec 3, 2025
52a2dc7
Fix merge hell
kyle-ssg Dec 3, 2025
2a4a8a5
Fix segment override permission check and project flag cache keys
kyle-ssg Dec 3, 2025
83c5a9f
Merge branch 'chore/componentise-feature-override-row' into chore/cre…
kyle-ssg Dec 3, 2025
13b67d0
Fix has changed check for overrides
kyle-ssg Dec 3, 2025
99a69bb
Fix has changed check for overrides
kyle-ssg Dec 3, 2025
76251b2
Revert unecessary import changes
kyle-ssg Dec 3, 2025
c39b418
chore: Rename CreateFlag (#6388)
kyle-ssg Dec 9, 2025
fa183df
Merge branch 'main' into chore/create-flag-migration
kyle-ssg Dec 9, 2025
9cb2da0
Merge remote-tracking branch 'origin/chore/create-flag-migration' int…
kyle-ssg Dec 9, 2025
932be79
Merge branch 'main' into chore/create-flag-migration
kyle-ssg Dec 16, 2025
a81aad6
Fix merge import
kyle-ssg Dec 16, 2025
42704e8
Merge main into chore/create-flag-migration
kyle-ssg Jan 6, 2026
a6e4bf5
Fix import
kyle-ssg Jan 6, 2026
f23186d
Fix conflict
kyle-ssg Jan 6, 2026
6bbf06a
Merge branch 'main' into chore/create-flag-migration
kyle-ssg Jan 13, 2026
4011328
Typo
kyle-ssg Jan 13, 2026
4e3f18e
Fix alert infinite callback
kyle-ssg Jan 13, 2026
08b2d34
feat: edit versioned change request (#6368)
kyle-ssg Jan 16, 2026
a9d9be3
Merge branch 'main' into chore/create-flag-migration
kyle-ssg Jan 16, 2026
a0960f3
Fix conflict
kyle-ssg Jan 16, 2026
272cce3
Pass identity override to variation options
kyle-ssg Jan 20, 2026
2a5ce5c
Adjust feature state prop
kyle-ssg Jan 20, 2026
474689b
Merge branch 'main' into chore/create-flag-migration
kyle-ssg Jan 20, 2026
74b83fa
Simplify create feature for identity/environment
kyle-ssg Jan 20, 2026
56d52ed
Playwright
kyle-ssg Jan 20, 2026
c9f792e
Playwright
kyle-ssg Jan 20, 2026
a50bb05
Remove unused tests
kyle-ssg Jan 20, 2026
155a2c6
Merge branch 'main' into chore/playwright
kyle-ssg Jan 20, 2026
184194e
Merge package lock
kyle-ssg Jan 20, 2026
6448d43
Use playwright's firefox in dockerfile
kyle-ssg Jan 20, 2026
00ef9f7
Add frontend makefile logging, remove apt-get line
kyle-ssg Jan 20, 2026
0606454
re-add "tags" to tests
kyle-ssg Jan 20, 2026
5ccaa96
Add health check prior to teardown
kyle-ssg Jan 20, 2026
145056b
Add health check prior to teardown
kyle-ssg Jan 20, 2026
bab12a1
Add health check prior to teardown
kyle-ssg Jan 20, 2026
97adfcb
Improve logging, add sticky comment, add artifcats
kyle-ssg Jan 20, 2026
9bcb51d
Fix duplicate artifacts / race conditions
kyle-ssg Jan 20, 2026
3058590
improve artifacts
kyle-ssg Jan 21, 2026
8bfd940
improve artifacts
kyle-ssg Jan 21, 2026
ae098f8
improve tests
kyle-ssg Jan 21, 2026
36e733e
fix duplicate artifact names, only upload artifacts on failure
kyle-ssg Jan 21, 2026
72e262e
Remove testcafe stuff
kyle-ssg Jan 21, 2026
c28be83
Fix piping
kyle-ssg Jan 21, 2026
7397500
Cut down noise
kyle-ssg Jan 21, 2026
72a9a42
Revert teardown token logic
kyle-ssg Jan 21, 2026
a7ad899
Cut down noise, add success comment
kyle-ssg Jan 21, 2026
42c03de
Cut down noise / stability
kyle-ssg Jan 21, 2026
484ee15
Merge branch 'main' into chore/playwright
kyle-ssg Jan 21, 2026
8d9290f
Better retrying / add quiet mode and skip bundle
kyle-ssg Jan 21, 2026
ea337d6
Better retrying / add quiet mode and skip bundle
kyle-ssg Jan 21, 2026
4b6c08a
Fix piping
kyle-ssg Jan 21, 2026
74f3c4d
Fix piping
kyle-ssg Jan 21, 2026
b751344
Fix piping
kyle-ssg Jan 21, 2026
365e8cb
Replace index based lookups with text
kyle-ssg Jan 21, 2026
848435d
refactor(e2e): Replace index-based feature lookups with name-based lo…
kyle-ssg Jan 22, 2026
da2535a
Replace index based lookups with text
kyle-ssg Jan 22, 2026
4b498cb
add ee tests
kyle-ssg Jan 22, 2026
20381b5
Improve commands
kyle-ssg Jan 22, 2026
720f05e
Add better context and a REPEAT mode
kyle-ssg Jan 28, 2026
3ae6241
Refactor
kyle-ssg Jan 28, 2026
10ae51e
improve segment test
kyle-ssg Jan 28, 2026
c633e48
Improve readme and commands so that you can do /e2e 10 to run 10x
kyle-ssg Jan 28, 2026
7d1e121
Improve readmes, add test:report script
kyle-ssg Jan 28, 2026
7a800f4
Bump retries to 2
kyle-ssg Jan 28, 2026
d099d98
Don't run test:report in ci on failures
kyle-ssg Jan 28, 2026
b6a60ce
Only show report on failure outside of ci
kyle-ssg Jan 28, 2026
b3151e7
Remove interactive elements from run-with-retry, clean up context dup…
kyle-ssg Jan 28, 2026
6f2fb4b
revert docker-compose
kyle-ssg Jan 28, 2026
892198f
disable modal transitions in e2e
kyle-ssg Jan 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .claude/commands/e2e-create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# E2E Test Creator

Create a new E2E test following the existing patterns in the codebase.

## Arguments

- `$ARGUMENTS` = "" → Ask the user what to test
- `$ARGUMENTS` = "segment creation flow" → Create a test for that feature

## CRITICAL: Read Context First

**You MUST read `.claude/context/e2e.md` before proceeding.** It contains essential configuration, test structure, and debugging guides.

## Workflow

1. **Determine what to test:**
- If `$ARGUMENTS` is provided, use that as the test description
- Otherwise, ask the user what feature/page/flow to test

2. **Determine if OSS or Enterprise:**
- Check if the feature exists in enterprise-only code paths
- Tag the test with `@oss` or `@enterprise` accordingly

3. **Review existing patterns:**
- Read 2-3 similar test files from `frontend/e2e/tests/`
- Read `frontend/e2e/helpers.playwright.ts` for available utilities

4. **Scan application code:**
- Find components being tested in `frontend/web/components/` or `frontend/common/`
- Add `data-test` attributes if missing

5. **Create the test file:**
- Follow naming convention: `*-test.pw.ts` or `*-tests.pw.ts`
- Use helper functions from `helpers.playwright.ts`

6. **Verify the test works:**
```bash
cd frontend
SKIP_BUNDLE=1 E2E_CONCURRENCY=1 npm run test -- tests/new-test.pw.ts --quiet
```
Run twice to check for flakiness. On failure, follow the analysis workflow in context/e2e.md.

7. **Report what was created:**
- Test file path
- Any `data-test` attributes added
- Test stability results

## Important Notes

- Always use `data-test` attributes for selectors
- Use existing helper functions instead of raw Playwright APIs
- Tests should be independent and not rely on execution order
33 changes: 33 additions & 0 deletions .claude/commands/e2e-ee.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# E2E Enterprise Test Runner

Run enterprise E2E tests (tagged with @enterprise), analyze failures, fix them, and re-run until all pass.

## Arguments

- `$ARGUMENTS` = "" → Run tests once (default)
- `$ARGUMENTS` = "5" → Run tests 5 times, stopping on first failure

## CRITICAL: Read Context First

**You MUST read `.claude/context/e2e.md` before proceeding.** It contains essential configuration, failure analysis workflows, and fix patterns.

## Run Command

```bash
cd frontend
E2E_RETRIES=0 SKIP_BUNDLE=1 E2E_CONCURRENCY=20 npm run test -- --grep @enterprise --quiet
```

## Re-running Failed Enterprise Tests

When re-running specific failed tests, include the grep flag:
```bash
cd frontend
E2E_RETRIES=0 SKIP_BUNDLE=1 E2E_CONCURRENCY=1 npm run test -- tests/specific-test.pw.ts --grep @enterprise
```

## Workflow

1. Run tests (one iteration at a time if multiple requested)
2. On failure: follow the failure analysis workflow in context/e2e.md
3. Report results
25 changes: 25 additions & 0 deletions .claude/commands/e2e-oss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# E2E OSS Test Runner

Run OSS (non-enterprise) E2E tests, analyze failures, fix them, and re-run until all pass.

## Arguments

- `$ARGUMENTS` = "" → Run tests once (default)
- `$ARGUMENTS` = "5" → Run tests 5 times, stopping on first failure

## CRITICAL: Read Context First

**You MUST read `.claude/context/e2e.md` before proceeding.** It contains essential configuration, failure analysis workflows, and fix patterns.

## Run Command

```bash
cd frontend
E2E_RETRIES=0 SKIP_BUNDLE=1 E2E_CONCURRENCY=20 npm run test -- --grep @oss --quiet
```

## Workflow

1. Run tests (one iteration at a time if multiple requested)
2. On failure: follow the failure analysis workflow in context/e2e.md
3. Report results
25 changes: 25 additions & 0 deletions .claude/commands/e2e.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# E2E Test Runner (All Tests)

Run all E2E tests (both OSS and enterprise), analyze failures, fix them, and re-run until all pass.

## Arguments

- `$ARGUMENTS` = "" → Run tests once (default)
- `$ARGUMENTS` = "5" → Run tests 5 times, stopping on first failure

## CRITICAL: Read Context First

**You MUST read `.claude/context/e2e.md` before proceeding.** It contains essential configuration, failure analysis workflows, and fix patterns.

## Run Command

```bash
cd frontend
E2E_RETRIES=0 SKIP_BUNDLE=1 E2E_CONCURRENCY=20 npm run test -- --grep "@oss|@enterprise" --quiet
```

## Workflow

1. Run tests (one iteration at a time if multiple requested)
2. On failure: follow the failure analysis workflow in context/e2e.md
3. Report results with pass/fail counts for OSS and enterprise tests
161 changes: 161 additions & 0 deletions .claude/context/e2e.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# E2E Testing Configuration and Context

**CRITICAL: This file MUST be read before running any E2E commands. It contains essential configuration, debugging guides, and workflow instructions that all E2E commands depend on.**

## Docker Configuration

To run E2E tests, the following environment variables must be set in `docker-compose.yml` for the `flagsmith` service:

```yaml
# E2E Testing
E2E_TEST_AUTH_TOKEN: 'some-token' # Authentication token for E2E teardown endpoint
ENABLE_FE_E2E: 'true' # Enables the E2E testing endpoints in the backend
```

## Frontend Configuration

The frontend `.env` file should contain tokens for different environments:

```bash
E2E_TEST_TOKEN_DEV=some-token
E2E_TEST_TOKEN_LOCAL=some-token
E2E_TEST_TOKEN_STAGING=<staging-token>
E2E_TEST_TOKEN_PROD=<prod-token>
```

## Test Organization

### Test Files
- Location: `frontend/e2e/tests/*.pw.ts`
- Test categories:
- OSS tests: Tagged with `@oss` (use `--grep @oss`)
- Enterprise tests: Tagged with `@enterprise` (use `--grep @enterprise`)
- All tests: `--grep "@oss|@enterprise"`

### Test Results
- Results directory: `frontend/e2e/test-results/`
- Failed test artifacts:
- `failed.json` - Summary of only failed tests
- `results.json` - Complete test results (all tests)
- Individual test directories containing:
- `error-context.md` - DOM snapshot at failure point
- `trace.zip` - Detailed execution trace
- Screenshots of failures

### HTML Report
- Location: `frontend/e2e/playwright-report/`
- View with: `npm run test:report`

## Environment Variables

- `SKIP_BUNDLE=1` - Skip webpack bundle build for faster iteration
- `E2E_CONCURRENCY=20` - Number of parallel test workers (reduce to 1 for debugging)
- `E2E_RETRIES=0` - Disable retries and enable fail-fast mode (stop on first failure)
- `--quiet` - Minimal output
- `--grep @enterprise` - Run only enterprise tests
- `--grep @oss` - Run only OSS tests
- `--grep "@oss|@enterprise"` - Run all tests
- `-x` - Stop after first failure (automatically added when `E2E_RETRIES=0`)

## CRITICAL: Multiple Iterations

**NEVER use `E2E_REPEAT` environment variable.** It runs tests automatically without control and clears reports on each iteration, destroying error context needed for debugging.

When running multiple iterations:
1. Run tests **one iteration at a time** using separate bash commands
2. **STOP IMMEDIATELY** on any failure - do not continue to next iteration
3. Analyze error-context.md and report the failure
4. **Ask user for consent** before running additional iterations
5. Track iteration count: "Iteration X of Y passed"

## CRITICAL: Failure Analysis Workflow

**On ANY test failure, you MUST:**
1. Read error-context.md for the failed test
2. **STOP and report the failure summary to the user**
3. **Ask for user consent before doing ANYTHING else** (no investigating, no fixing, no additional iterations)

Only proceed with investigation/fixes after the user explicitly approves.

### Reading Order for Failed Tests

1. **`error-context.md`** - Start here for DOM snapshot showing exact page state
2. **`failed.json`** - Error summary
3. **`trace.zip`** - Detailed trace if needed

### Analyzing Traces

```bash
cd frontend/e2e/test-results/<failed-test-directory>
unzip -q trace.zip
grep -i "error\|failed" 0-trace.network # Check for network errors
```

### Common Fix Patterns

- **Wrong selector** → Update to match actual DOM from error-context.md
- **Missing `data-test` attribute** → Add it to the component
- **Element hidden** → Filter for visible elements or wait for visibility
- **Missing wait** → Add appropriate `waitFor*` calls
- **Race condition** → Add network waits, increase timeouts, or use more specific waits
- **Flaky element interaction** → Add `scrollIntoView` or `waitForVisible` before clicking

### Re-running Failed Tests

After making fixes, re-run ONLY the failed tests:
```bash
cd frontend
E2E_RETRIES=0 SKIP_BUNDLE=1 E2E_CONCURRENCY=1 npm run test -- tests/specific-test.pw.ts
```

Maximum 3 fix/re-run cycles per test before reporting as unfixable.

## CRITICAL: Flaky Test Policy

Tests that fail initially but pass on retry are FLAKY and MUST be investigated, even if the final result shows all tests passed.

- **DO NOT** just report that retries passed
- **DO** investigate and fix the root cause
- The built-in retry mechanism is a safety net, not a substitute for fixing flaky tests

## Important Rules

- **DO** modify test files to fix timing issues, missing waits, or broken selectors
- **DO** add `data-test` attributes to components if they're missing
- **DON'T** modify test assertions or business logic unless the test is clearly wrong
- If the failure is in application code (not test code), report it as a bug but don't try to fix it
- Always explain what fixes you're attempting and why

## Test Infrastructure

### Playwright Configuration
- Browser: Firefox
- Test runner: `frontend/e2e/run-with-retry.ts`
- Helper functions: `frontend/e2e/helpers.playwright.ts`
- Global setup: `frontend/e2e/global-setup.playwright.ts`
- Global teardown: `frontend/e2e/global-teardown.playwright.ts`

### Backend E2E Implementation

#### Teardown Endpoint
- URL: `/api/v1/e2etests/teardown/`
- Method: POST
- Authentication: Via `X-E2E-Test-Auth-Token` header
- Purpose: Clears test data and re-seeds database between test runs

#### Middleware
The backend uses `E2ETestMiddleware` to:
1. Check for `X-E2E-Test-Auth-Token` header
2. Compare against `E2E_TEST_AUTH_TOKEN` environment variable
3. Set `request.is_e2e = True` if authenticated

## Common Issues and Solutions

### Authentication Errors (401)
- Verify `E2E_TEST_AUTH_TOKEN` is set in docker-compose.yml
- Check token matches in frontend `.env` file
- Restart containers after configuration changes

### Bad Request Errors (400)
- Ensure `ENABLE_FE_E2E: 'true'` is set in docker-compose.yml
- Restart containers to apply settings
15 changes: 14 additions & 1 deletion .github/actions/e2e-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,26 @@ runs:
node-version-file: frontend/.nvmrc
cache-dependency-path: frontend/package-lock.json

- name: Cache Playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-playwright-

- name: NPM Install
working-directory: frontend
run: |
npm ci
shell: bash

- name: Test with Chromedriver
- name: Install Playwright browsers
working-directory: frontend
run: npm run test:install
shell: bash

- name: Run E2E tests
uses: nick-fields/retry@v3
with:
shell: bash
Expand Down
Loading
Loading