feat: add 9 comprehensive E2E specs - #239
Open
JemimahEkong wants to merge 12 commits into
Open
Conversation
Add payout-flow, withdraw-flow, member-management, pause-unpause, pool-join, notifications, explore-filters, pool-comparison, and dashboard-tabs spec files covering remaining user flows. Update README coverage table to reflect 14 total specs.
…waitForLoadState - explore-filters.spec.ts: mock /api/recommendations, add waitForLoadState - pool-comparison.spec.ts: mock /api/recommendations, add waitForLoadState - pool-join.spec.ts: move /api/join-requests mock to beforeEach, add waitForLoadState - dashboard-tabs.spec.ts: mock /api/portfolio/summary, /api/analytics, Supabase REST calls, add waitForLoadState
… /api/pools
All four failing spec files (explore-filters, pool-comparison, pool-join,
dashboard-tabs) used waitForLoadState('networkidle') which is unreliable in
CI because Supabase placeholder URLs can hang and polling timers prevent idle.
Replace with page.waitForResponse() matching /api/pools responses. This waits
for the specific API call that populates the page content, making tests both
faster and deterministic.
Fix Prettier formatting violations in explore-filters, pool-comparison, pool-join, and dashboard-tabs spec files to satisfy format:check in CI.
…ocks - Remove all waitForResponse/waitForPools calls for /api/pools from explore-filters, pool-comparison, pool-join, and dashboard-tabs specs. The first /api/pools response comes from PoolDataProvider in the root layout, not from page-level components. waitForResponse resolves on that first response before page content renders. Playwright's expect().toBeVisible() auto-retry (10s timeout) handles timing correctly. - Fix Portfolio tab test to check aria-selected attribute (same pattern as Transactions, Analytics, and Profile tabs) instead of fragile getByText matching. - Add missing /api/admin/audit-log, /api/admin/actions, and Supabase REST mocks to member-management, pause-unpause, and payout-flow specs. Group detail page child components (AdminAuditLog, AdminActionsLog) make these API calls which previously went unmocked.
Add waitForPoolsResponse helper and call it after every page.goto() across all E2E specs to eliminate timing failures where assertions run before the mocked /api/pools data is rendered. Also: - Convert exact-string selectors to regex for robustness (e.g. "My Groups" → /My Groups/) - Bump Playwright expect timeout from 10s to 20s in CI to reduce flakiness - Apply the fix to all 13 spec files (not just the 4 that were actively failing) 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
…ition
The previous fix called waitForPoolsResponse AFTER page.goto() resolved,
but the /api/pools response may have already been received during navigation
so the listener never caught it. Now:
- waitForPoolsResponse returns the promise (not awaited) so callers can
register the listener before navigation starts
- All specs: const poolsResponse = waitForPoolsResponse(page) BEFORE goto
- All goto calls: add { waitUntil: "networkidle" } for defense-in-depth
- All regex selectors: add /i flag for case-insensitive matching
- navigation.spec.ts: set up listener before each client-side link click
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
…s in CI The previous fixes (waitForPoolsResponse + networkidle) were still failing because unmocked server-side routes like /api/notifications, /api/analytics, /api/portfolio/summary, /api/user-profile, and /rest/v1/** were hitting the real Next.js handlers, which try to connect to Supabase. This caused either slow failures or hanging requests that prevented Playwright's networkidle from ever resolving. Add a centralized mockCommonApis() helper that catches all non-pools API endpoints and returns safe defaults. Every spec now calls this in beforeEach before page.goto(), eliminating the root cause of the CI timeouts. Also removes duplicated per-spec route mocks (admin audit-log, admin actions, rest/v1, recommendations, analytics, portfolio) that are now handled centrally. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Contributor
|
Hey @JemimahEkong, the Playwright E2E tests are failing — 17 out of 27 tests fail. The root cause is that mock pool data ("Alpha Rotational" etc.) isn't rendering on the |
- Add ReactQueryProvider to app layout for Portfolio/Analytics tabs - Fix SelectItem empty value crash in explore page - Seed onboarding wizard completion in connectWallet to unblock dashboard - Add sub-path guard to mockPoolsApi to prevent intercepting /api/pools/messages - Tighten waitForPoolsResponse to exact pathname check - Add E2E early return to useAddPoolMember for consistent tx hash flow - Fix strict mode violations with .first() for toast and heading selectors - Fix CardTitle selectors to use getByText instead of getByRole(heading) - Fix pause-unpause button selectors for strict mode - Fix payout-flow fee breakdown text selector for strict mode - Use channel: chrome in playwright config for system browser
… directives The explore page was refactored to use dynamic import from explore-view.tsx but the old ExploreContent/ExploreFallback definitions were left behind. Also removed eslint-disable comments for rules already set to off (no-console, react-hooks/exhaustive-deps). 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds 9 new Playwright E2E spec files covering all remaining user-facing flows
that were not previously tested. This brings total E2E coverage from 5 specs
to 14 specs across the full application lifecycle.
closes #206
What's covered
payout-flow.spec.tswithdraw-flow.spec.tsmember-management.spec.tspause-unpause.spec.tspool-join.spec.tsnotifications.spec.tsexplore-filters.spec.tspool-comparison.spec.tsdashboard-tabs.spec.tsTotal: 32 new test cases across 9 spec files.
How it works
All specs reuse the existing E2E seam (
NEXT_PUBLIC_E2E=true), which stubsweb3 provider calls through
web3-provider.tsxanduseJointSaveContracts.ts.No production application code was modified. Mocks use:
connectWallet/seedChainStatefor wallet and on-chain statemockPoolsApi/makePoolfor pool listing and detail APIspage.routefor notifications, join-requests, and other API endpointsFixes included
admin: E2E_MEMBER_2so the connectedwallet (
E2E_ADDRESS) is correctly identified as a non-member. Previouslythe admin field defaulted to the connected wallet, making non-admin assertions
unreliable.
Verification
pnpm exec playwright testcannot be run in this environment due to OOM(machine has 8GB RAM total, Chromium download fails). CI will validate.