Skip to content

[codex] Add end-to-end testing workflow#1239

Draft
rossgalloway wants to merge 30 commits into
mainfrom
codex/end-to-end-testing
Draft

[codex] Add end-to-end testing workflow#1239
rossgalloway wants to merge 30 commits into
mainfrom
codex/end-to-end-testing

Conversation

@rossgalloway

@rossgalloway rossgalloway commented May 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds Playwright smoke coverage and GitHub Actions wiring for end-to-end testing.
  • Reworks test organization around durable src/test coverage, culling reports, and pre-commit safeguards.
  • Expands holdings/portfolio/vault API and UI flows covered by the end-to-end testing branch.
  • Adds Human readable HTML tags to main elements to make it easier to browse code in console and for agents to find components in the tree.

Important note: This commit adds a pre-commit script that insists that tests are located in the /src/test/ folder.

This branch supersedes #1153

Test organization and process

This branch moves long-lived frontend/domain tests into a curated src/test/ tree instead of leaving them scattered beside components and hooks. The durable buckets are:

  • src/test/math/ for calculations, bigint/share conversions, APY/APR, slippage, valuations, cooldowns, and other independently checkable math.
  • src/test/transactions/ for transaction state, overlays, Safe batching, approval/deposit/withdraw behavior, and wallet-flow helpers.
  • src/test/api-contracts/ for route contracts, Kong/yDaemon response shapes, selectors, and URL/schema expectations.
  • src/test/formatting/ for formatting behavior that has meaningful expected values.
  • src/test/vaults/ for durable vault-domain behavior.

Temporary colocated tests are still allowed while building. Before handoff or commit, each touched colocated frontend/domain test should be deliberately handled: move it into src/test/ if it protects durable behavior, convert it into an E2E smoke path if it protects a user-visible flow, or delete it if it only helped build the PR.

The branch adds bun run test:cull as a review aid for touched tests. It reports keep/cull/E2E candidates but does not auto-delete anything. The Husky pre-commit hook now runs scripts/check-test-location.mjs, which blocks staged src/**/*.test.* and src/**/*.spec.* files unless they live under src/test/. API tests, script tests, and Playwright tests keep their own homes under api/, scripts/, and e2e/.

Added end-to-end tests

The PR adds Playwright as the repo-level smoke test layer via e2e/public-smoke.spec.ts, playwright.config.ts, and .github/workflows/e2e.yml. These tests are intentionally small and public-route focused; they are not meant to replace domain unit tests or become component tests.

The initial smoke coverage checks:

  • / loads as Yearn and can navigate through the Explore Vaults link.
  • /vaults renders the vault search/table surface.
  • /portfolio renders without a connected wallet.

The goal is quick confidence that the app boots, public routes render, primary navigation works, and the unauthenticated portfolio path does not blank-screen. Future UI/flow-heavy PRs should add one similarly stable smoke path when they change a critical public workflow.

Playwright smoke coverage in CI

The new .github/workflows/e2e.yml workflow runs on pull_request and workflow_dispatch. It checks out the repo, sets up Node 20 and Bun, installs dependencies with bun install, installs Chromium with bunx playwright install --with-deps chromium, runs bun run test:e2e, and always uploads the Playwright HTML report for 7 days.

playwright.config.ts points at e2e/, runs Desktop Chromium with one worker, retries twice in CI, keeps traces/videos on failure, and starts the app with HOST=127.0.0.1 PORT=3000 bun run dev unless PLAYWRIGHT_BASE_URL is provided.

These are deliberately cheap boot/navigation checks rather than deep behavioral tests. Their job is to catch blank screens, route breaks, and basic public UI regressions.

Validation

  • bun run build
  • bun run test:e2e

rossgalloway and others added 28 commits April 26, 2026 22:50
)

* feat: init portfolio history

* fix: build

* fix: getEnv

* fix: env

* fix: localhost connection attempt

* chore: debug

* chore: attempt

* feat: add v2 support

* fix: transfers calculation

* chore: rm clearCache

* feat: calculate gauge

* fix: loading state

* fix: optimize pps fetch

* chore: rename

* feat: add breakdown

* feat: store aggregated data

* chore: upd docs

* feat: add seenTokens

* feat: always recalculate today

* fix: use only 12:00:00 AM timestamps

* feat: add 1y option

* feat: cache prices

* feat: doc

* feat: add batching for queries

* feat: doc

* feat: sequential + batching

* upd: doc

* fix: db spam

* feat: rate limit & clear stale cache

* debug: add logs

* fix: query

* chore: do not expose internals

* chore: remove logging

* chore: misc

* chore: cleanup

* chore: rm dead code

* feat: invalidate cache

* chore: address comments

* chore: remove refresh for safety

* chore: return clear cache for local

* chore: lint

* Feat/portfolio pnl 2 (#1125)

* feat: init pnl

* feat: consider staking

* feat: omit migrate

* chore: support migrate

* feat: 3 calc types

* feat: add totalEconomicGainUsd

* chore: docs

* chore: refactor

* feat: actually consider price at deposit time

* chore: optimize price fetch

* fix: cache

* chore: make fetching more aggressive

* feat: test params

* feat: improve totalCurrentValueUsd

* feat: share events & kong

* feat: fe + history fix

* fix: defillama batching

* feat: tooltips

* feat: handle cow

* feat: tune defillama

* chore: tune a bit more

* feat: add missing prices cache

* feat: docs

* fix: timeout

* chore: copy

* feat: stable vs volatile

* Feat/portfolio pnl excessive (#1148)

* feat: init excessive

* chore: naming

* feat: actually add drilldown

* fix: v2/v3 filter

* fix: version

* fix: env

* feat: cover crvusd rewards

* feat: vault to vault migrate via enso

* feat: init katana rewards

* chore: upd receiver address

* feat: fix bold

* feat: add fetchType + paginationMode

* feat: support fetchtype + pagination on vercel

* feat: hash user address

* feat: ensure schema is initialized

* chore: lint

* fix: katana pricing

* feat: dummy chart

* feat: breakdown

* feat: breakdown for timestamp

* feat: merge yvUSD

* fix: nasty scroll

* chore: lint

* chore: hide if isHidden=true

* feat: make it case insensitive

* feat: init simple

* feat: display

* add annualized return and ETH denominated charting

* Styling and add all time duration

* add charts

* fix staked asset withdrawal issue

* fix issues with staked shares

* fix simple return accounting and growth index charts

* add simple return chart explainers

* add growth chart numeraire spec

* Finalize growth display modes

* Split growth index chart modes

* Keep ETH growth history when partial vaults exist

* remove overall cumulative chart

* improve charts and add to portfolio rows

* Feat/chart tweaks (#1193)

* fix: rescale growth

* fix: prevent flickering

* style: flickering & mobile

* feat: sort overlay by index

* feat: add growth position & index

* fix: growth index empty values

* feat: connect the dots

* feat: consistent chart

* Add position charts to vault pages with balance and to portfolio expanded views. other minor tweaks

* fix review comments

* fix review issues and dark mode tooltip

* feat: dedupe transfer and stake

* feat: improve aggregator (#1195)

* feat: improve aggregator

* chore: lint

* Feat/indexed history (#1198)

* feat: init activity

* feat: enrich

* chore: rm address

---------

Co-authored-by: w84april <donyaschefer@gmail.com>
Co-authored-by: w84april <32621609+w84april@users.noreply.github.com>
* Fix pending transaction overlay copy

* commit lock file
* fix: disable enso balance caching

* fix: refetch wallet balances on focus

* fix: refresh balances on portfolio entry
* make tenderly mode a toggle. add API port picker flow to build and preview steps

* fix issues with port selection scripts

* additional review and hardening

* fix review issues

* fix confetti

* fix: autoswitch chain on tenderly disengage
* Fix Merkl rewards filtering and refresh

* lint
* fix: classify yvBTC as a yearn vault

* feat: pin yvBTC at the top of vaults

* fix: surface yvBTC in the default vault list

* update filtering

* init

* adjust spacing

* improve vault list row chips and expanded info

* add etherscan link to compressed header

* add hover effect and more vault info

* better styling

* improved compressed header title

* improve widget clarity

* check for swap in zap and display info differently accordingly

* Improve lock icon in vault page header

* update risk section

* more yvBTC prep

* Show yvUSD cooldown status in deposits header

* fix: show yvUSD cooldown status in mobile header

* add cooldown info to deposits panel

* generalize cooldown changes to yvBTC

* fix issue with neon password

* Hide yvBTC from vault lists before launch

* lint and update docs

* hide dust under $0.01

* fix: clean up more yvBTC stuff

* improve chip and yvUSD widget alert styling
* fix: breakdown pricing

* fix: flicker

* chore: rm hook and use chart data

* test: share data

* fix: utc price

* fix: annual %

* fix: balance calc

Co-Authored-By: w84april <donyaschefer@gmail.com>

* chore: cleanup

Co-Authored-By: w84april <donyaschefer@gmail.com>

* add yvusd portfolio charts (#1209)

* add yvUSD charts

* improve yvUSD charts and other fixes

* fix dependency

* feat: yearn-prices (#1211)

* feat: yearn-prices

* chore: lint

* init

* update chart layout and breakpoints

* update suggested cards

* update placeholder card for chart and chart loading spinners

* improve loading input with progress bar

* fix chart data error and lint

* improve labelling and margins

* add timeframe dropdown to vault page charts

* consolidate loading spinner types

* chore: rm price caching

* fix portfolio holdings history consistency

* fix staking edge cases

* fix misc small review issues

* feat: activity style update

Co-Authored-By: w84april <donyaschefer@gmail.com>

* feat: support router/zap

Co-Authored-By: w84april <donyaschefer@gmail.com>

* fix: symbol

Co-Authored-By: w84april <donyaschefer@gmail.com>

* style: icons

Co-Authored-By: w84april <donyaschefer@gmail.com>

* feat: filters

Co-Authored-By: w84april <donyaschefer@gmail.com>

* fix: mobile

Co-Authored-By: w84april <donyaschefer@gmail.com>

* lint

* update activity row styling

* more styling updates

* update dev server startup message

* fix list styling, update icons, improve date picker

* remove image

* fix review issues

* back off fetches to prevent 429s

* increase rate limit

* surface transfers without other events

* feat: better decode zaps & fix date range

* feat: add mobile

* add locker reward claims, ycrv zaps, and better v2 enrichement

* improve yBOLD transaction resolution

* style: move chain selector

* update icons

* style: mobile

* add zap swaps and old zapper zaps,

* fix duplicate keys

* clean up build warnings and errors

* update mobile styling for activity list

* reward claim styling

* Feat/progress (#1220)

* feat: progress

* feat: kill chores

* feat: rm fake progress

* chore: copy

* feat: hash address

* chore: cache 1h & do not disable db

* Prep for yvBTC (#1185)

* fix: classify yvBTC as a yearn vault

* feat: pin yvBTC at the top of vaults

* fix: surface yvBTC in the default vault list

* update filtering

* init

* adjust spacing

* improve vault list row chips and expanded info

* add etherscan link to compressed header

* add hover effect and more vault info

* better styling

* improved compressed header title

* improve widget clarity

* check for swap in zap and display info differently accordingly

* Improve lock icon in vault page header

* update risk section

* more yvBTC prep

* Show yvUSD cooldown status in deposits header

* fix: show yvUSD cooldown status in mobile header

* add cooldown info to deposits panel

* generalize cooldown changes to yvBTC

* fix issue with neon password

* Hide yvBTC from vault lists before launch

* lint and update docs

* hide dust under $0.01

* fix: clean up more yvBTC stuff

* improve chip and yvUSD widget alert styling

* fix: stale loading

* update gitignore

* make vaults and portfolio eager loaded

* clean up unconnected and no balance pages and add yvUSD card to suggested

* prevent refetch from re-initializing loading

* fix mobile styling

* fix styling that no one will notice

---------

Co-authored-by: rossgalloway <58150151+rossgalloway@users.noreply.github.com>

* feat: render controls even with 0 current balance

* feat: restore position based growth

* fix: hide selector if 1 option

---------

Co-authored-by: rossgalloway <58150151+rossgalloway@users.noreply.github.com>
…rlays and flows (#1186)

* fix: support safe katana approval overlay

* fix: handle safe transaction overlay submission

* fix: handle safe approval overlay submission

* fix: prefer safe target chain for overlays

* fix: poll safe overlay execution

* feat: show pending safe execution in wallet panel

* fix: refresh vault state after safe execution

* fix: track safe tx lifecycle from safe hashes

* fix: refresh safe state before settling success

* fix: keep safe approve flow moving

* fix: pause before safe step auto-continue

* fix: slow safe interstep progression

* feat: safe batching (#1210)

* feat: safe batching

Co-Authored-By: w84april <donyaschefer@gmail.com>

* fix test

---------

Co-authored-by: rossgalloway <58150151+rossgalloway@users.noreply.github.com>

* lint

---------

Co-authored-by: w84april <32621609+w84april@users.noreply.github.com>
* chore: remove kat haircut schedule info

* update steer text size
Add a small Playwright smoke suite for public routes and wire it into PR CI.

- Add Playwright config, E2E scripts, and browser artifact handling

- Cover landing-to-vaults, vaults, and portfolio smoke paths

- Document the testing split between durable unit tests and E2E smoke checks
@vercel

vercel Bot commented May 19, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
yearnfi Ready Ready Preview, Comment May 20, 2026 1:09pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
yearnfi-nextjs Ignored Ignored Preview May 20, 2026 1:09pm

Request Review

@github-actions

github-actions Bot commented May 19, 2026

Copy link
Copy Markdown

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 3 package(s) with unknown licenses.
See the Details below.

License Issues

.github/workflows/e2e.yml

PackageVersionLicenseIssue Type
actions/checkout4.*.*NullUnknown License
actions/setup-node4.*.*NullUnknown License
actions/upload-artifact4.*.*NullUnknown License
Allowed Licenses: MIT, Apache-2.0, BSD-3-Clause, BSD-2-Clause, ISC, CC0-1.0, CC-BY-3.0, CC-BY-4.0, Unlicense

OpenSSF Scorecard

PackageVersionScoreDetails
actions/actions/checkout 4.*.* 🟢 5.7
Details
CheckScoreReason
Code-Review🟢 10all changesets reviewed
Maintained⚠️ 01 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Binary-Artifacts🟢 10no binaries found in the repo
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Packaging⚠️ -1packaging workflow not detected
Pinned-Dependencies🟢 3dependency not pinned by hash detected -- score normalized to 3
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
SAST🟢 8SAST tool detected but not run on all commits
actions/actions/setup-node 4.*.* 🟢 5.7
Details
CheckScoreReason
Maintained🟢 68 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 6
Code-Review🟢 10all changesets reviewed
Binary-Artifacts🟢 9binaries present in source code
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
Branch-Protection⚠️ 1branch protection is not maximal on development and all release branches
SAST🟢 9SAST tool is not run on all commits -- score normalized to 9
actions/actions/upload-artifact 4.*.* 🟢 5.6
Details
CheckScoreReason
Maintained🟢 66 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 6
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Code-Review🟢 8Found 8/9 approved changesets -- score normalized to 8
Packaging⚠️ -1packaging workflow not detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies⚠️ 1dependency not pinned by hash detected -- score normalized to 1
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
SAST🟢 10SAST tool is run on all commits
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
npm/@playwright/test 1.60.0 🟢 6.5
Details
CheckScoreReason
Maintained🟢 1030 commit(s) out of 30 and 6 issue activity out of 30 found in the last 90 days -- score normalized to 10
Code-Review🟢 9GitHub code reviews found for 29 commits out of the last 30 -- score normalized to 9
CII-Best-Practices⚠️ 0no badge detected
Vulnerabilities🟢 10no vulnerabilities detected
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 10security policy file detected
License🟢 10license file detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1no published package detected
Token-Permissions⚠️ 0non read-only tokens detected in GitHub workflows
Binary-Artifacts🟢 6binaries present in source code
Dependency-Update-Tool🟢 10update tool detected
Fuzzing⚠️ 0project is not fuzzed
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Branch-Protection🟢 3branch protection is not maximal on development and all release branches

Scanned Files

  • .github/workflows/e2e.yml
  • package.json

@rossgalloway rossgalloway changed the base branch from main to release/26-04-17 May 19, 2026 18:18
@socket-security

socket-security Bot commented May 19, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​playwright/​test@​1.60.010010010099100

View full report

* Add stable test selectors

Add a generic data-testid selector contract for durable user-facing surfaces across header, vault, transaction, portfolio, and rewards flows.

- Tag core navigation, wallet, vault list, vault detail, action widget, transaction, portfolio, and rewards surfaces

- Add pass-through test id props for shared controls where needed

- Document selector naming and dynamic identifier conventions in TESTING.md

* Lint

* Lint

* Add readable custom page tags

* Fix custom tag display cascade

* Add custom tags for test targets

* Add custom tags for portfolio reward tabs
Base automatically changed from release/26-04-17 to main May 29, 2026 13:12
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.

2 participants