Skip to content

Add Playwright end-to-end test for full deposit → countdown → unlock flow on testnet #29

Description

@prodbycorne

Problem

There are no end-to-end tests. The full user journey — connect wallet → deposit assets → wait for lock countdown → unlock — has never been exercised in CI. Regressions in the Freighter integration, transaction building, or countdown logic can ship undetected.

Expected Behaviour

A Playwright test suite (e2e/farm.spec.ts) exercises the core happy path against a local Soroban testnet (using stellar-cli to start soroban-dev) with a pre-funded test wallet injected via a Freighter-compatible stub.

Acceptance Criteria

  • e2e/ directory created with playwright.config.ts targeting http://localhost:3000
  • e2e/mocks/freighter.ts exports a Playwright page fixture that intercepts window.__freighter and provides a deterministic signing key (test keypair, never a real key)
  • e2e/farm.spec.ts test cases:
    1. Connect wallet — click Connect, mock Freighter returns test public key, header updates to show truncated address
    2. Deposit — fill deposit modal with 10 XLM, mock simulation returns fee 100 stroops, sign and submit mock tx, farm row shows stake "10.0000 XLM"
    3. Countdown visible — farm row shows a non-zero countdown and the Unlock button is disabled
    4. Unlock available — fast-forward the system clock 7 days (page.clock.setFixedTime), reload, Unlock button is enabled
    5. Unlock — fill unlock modal, sign, submit, farm row shows stake "0.0000"
  • Tests run in CI via pnpm playwright test in the GitHub Actions workflow (.github/workflows/e2e.yml)
  • All five tests pass on the Playwright Chromium headless runner

Relevant Files

  • e2e/ — create directory and all test files
  • .github/workflows/ — add e2e.yml
  • package.json — add @playwright/test devDependency

Metadata

Metadata

Labels

Official CampaignCampaign: Official CampaignfarmFarming/staking flow — deposit, lock, unlock, creditshardRequires deep domain knowledge — Soroban, Stellar SDK, or complex statesorobanSoroban smart-contract integration (XDR, RPC, transaction building)testingUnit, integration, or e2e test coverage

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions