Skip to content

Conversation

@InFiNiTy0639
Copy link

@InFiNiTy0639 InFiNiTy0639 commented Feb 10, 2026

Issue: #1531

Description

Fixed the flaky E2E test e2e/tests/settings/administrator/workspace.spec.ts.

Problem

The e2e test allows updating workspace settings in workspace.spec.ts is flaky. After clicking "Save changes" and confirming the "Changes saved" toast, the test immediately queries the database to verify the update. However, the toast appearing does not guarantee the database transaction has fully committed, causing a race condition where assertions fail intermittently.

Solution

Wrapped the database assertions in Playwright's expect(async () => { ... }).toPass() retry mechanism. This polls the database until the expected values match or the configured timeout (30s) is reached, eliminating the race condition between the UI confirmation and the database commit.


Before/After

No UI changes — this is a test-only fix.


Test Results

Run pnpm playwright test e2e/tests/settings/administrator/workspace.spec.ts --workers=1 --repeat-each=5

Screenshot 2026-02-10 115309

Checklist


AI Disclosure

Claude Opus 4.5 was used to analyze the flaky test.

@InFiNiTy0639
Copy link
Author

@ershad sir please review this

@InFiNiTy0639
Copy link
Author

@ershad @nyomanjyotisa , I also checked e2e/tests/settings/administrator/payment-details.spec.ts. when I run
pnpm exec playwright test e2e/tests/settings/administrator/payment-details.spec.ts,

skips 2 tests.
Screenshot 2026-02-10 185821

In backend/config/initializers/stripe.rb, the stripe_api_key is set to a dummy value, and the Stripe key in the .env file is also a dummy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant