Skip to content

Add testnet E2E workflow and testnet config support#655

Draft
nelitow wants to merge 13 commits intomainfrom
nj/feat/e2e-cromn
Draft

Add testnet E2E workflow and testnet config support#655
nelitow wants to merge 13 commits intomainfrom
nj/feat/e2e-cromn

Conversation

@nelitow
Copy link
Copy Markdown
Contributor

@nelitow nelitow commented Dec 26, 2025

Introduces a scheduled GitHub Actions workflow for running E2E tests against Fuel testnet, with support for both soft and hard test suites. Adds Playwright testnet config, environment variable overrides for testnet credentials, and utility functions to detect and configure testnet/local environments. Updates README with workflow badge and .env.example with testnet config instructions.

Summary

Checklist

  • I've added error handling for all actions/requests, and verified how this error will show on UI. (or there was no error handling)
  • I've reviewed all the copy changed/added in this PR, using AI if needed. (or there was no copy changes)
  • I've included the reference to the issues being closed from Github and/or Linear (or there was no issues)
  • I've changed the Docs to reflect my changes (or it was not needed)
  • I've put docs links where it may be helpful (or it was not needed)
  • I checked the resulting UI both in Light and Dark mode (or no UI changes were made)
  • I reviewed the entire PR myself (preferably, on GH UI)

Introduces a scheduled GitHub Actions workflow for running E2E tests against Fuel testnet, with support for both soft and hard test suites. Adds Playwright testnet config, environment variable overrides for testnet credentials, and utility functions to detect and configure testnet/local environments. Updates README with workflow badge and .env.example with testnet config instructions.
@vercel
Copy link
Copy Markdown

vercel Bot commented Dec 26, 2025

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

Project Deployment Actions Updated (UTC)
fuel-explorer-v2-vite Ready Ready Preview Feb 24, 2026 5:16pm

Request Review

Comment thread .github/workflows/testnet-e2e-cron.yml Fixed
Comment thread .github/workflows/testnet-e2e-cron.yml Fixed
Introduces a new workflow for running end-to-end tests against the testnet environment. This workflow sets up environment variables, builds the project, installs Playwright browsers, runs soft E2E tests, and uploads test artifacts. Intended for testing and marked for deletion after evaluation.
Wraps the soft E2E test command with xvfb-run in both test-testnet-e2e and testnet-e2e-cron workflows to ensure proper execution of browser-based tests in headless CI environments.
Set VITE_FUEL_CHAIN_NAME, VITE_FUEL_INDEXER_API, VITE_STAKING_ENV, and VITE_ECOSYSTEM_PROJECTS_URL environment variables in test-testnet-e2e.yml and testnet-e2e-cron.yml to ensure correct configuration for testnet builds.
Introduces a dedicated Playwright config for soft testnet E2E tests and updates GitHub workflows to use this config. This improves test isolation and reporting, and excludes problematic ecosystem tests from the soft testnet runs.
@cursor
Copy link
Copy Markdown

cursor Bot commented Feb 24, 2026

PR Summary

Medium Risk
Primarily CI/test infrastructure changes, but it introduces scheduled runs and secret-driven wallet/testnet configuration that could fail noisily or incur resource usage if misconfigured.

Overview
Adds a new GitHub Actions workflow (testnet-e2e-cron.yml) that runs testnet E2E Playwright suites on a 6-hour cron (soft tests) and supports manual dispatch for soft/hard runs, building the app with testnet .env files and uploading test artifacts.

Updates the E2E harness to support testnet execution: introduces testnet-specific Playwright configs (soft reporter output + hard timeouts), adds environment-based detection/utilities (getProviderUrl, getMetaMaskNetwork), and allows overriding hard-test wallet credentials via secrets/environment variables. Documentation is updated with a workflow badge, testnet .env.example notes, and a new pre-merge testing guide (TESTING_TESTNET_E2E.md).

Written by Cursor Bugbot for commit c1871b4. This will update automatically on new commits. Configure here.

Comment thread .github/workflows/test-testnet-e2e.yml Outdated
Comment thread packages/e2e-tests/playwright-soft-testnet.config.ts
Comment thread packages/e2e-tests/tests/hard/bridge/fixtures/index.ts Outdated
Comment thread packages/e2e-tests/tests/hard/bridge/utils/env.ts Outdated
- Remove temporary test-testnet-e2e.yml workflow
- Remove auto-issue creation (too flaky for automated issues)
- Fix env.ts to read FUEL_PROVIDER_URL from env var instead of hardcoding
- Use isTestnetEnvironment() from env.ts in fixtures instead of inline check
- Add MetaMask try/catch fix for approveNewNetwork/approveSwitchNetwork
- Add stabilization delays in connectToMetamask
Comment thread .github/workflows/testnet-e2e-cron.yml
Comment thread packages/e2e-tests/tests/hard/bridge/fixtures/index.ts Outdated
Comment thread packages/e2e-tests/tests/hard/bridge/utils/env.ts Outdated
Comment thread packages/e2e-tests/tests/hard/bridge/fixtures/index.ts Outdated
Comment thread packages/e2e-tests/playwright.config.testnet.ts
Update Testnet E2E workflow to only run soft tests on schedule or when inputs request them and change uploaded artifact path for soft test HTML reports.

Streamline hard/bridge fixtures: remove extra CI-only browser flags, reduce dynamic waits to a fixed short wait, and simplify MetaMask setup by removing retry loops and extra CI stabilization sleeps; still attempt network switch but ignore failures.

Refactor env utils: remove isLocalEnvironment and related helpers; make getProviderUrl prefer FUEL_PROVIDER_URL when set and otherwise return testnet or local provider URLs based on isTestnetEnvironment; simplify getMetaMaskNetwork to a ternary. These changes reduce CI-specific heuristics and centralize provider configuration via env vars.
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

E2E_TARGET_ENV: testnet
# Testnet wallet credentials (to be added as secrets)
E2E_ETH_MNEMONIC: ${{ secrets.E2E_TESTNET_ETH_MNEMONIC }}
E2E_FUEL_MNEMONIC: ${{ secrets.E2E_TESTNET_FUEL_MNEMONIC }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fuel mnemonic environment variable not used

High Severity

The workflow sets E2E_FUEL_MNEMONIC from secrets but the code never reads this environment variable. The test code calls getFuelMnemonic() which returns a hardcoded constant from @fuels/playwright-utils, not an environment variable. Hard tests will use the default mnemonic instead of the testnet-specific one, causing wallet setup to fail with unfunded accounts.

Fix in Cursor Fix in Web

VITE_FUEL_INDEXER_API=https://explorer-indexer-testnet.fuel.network
VITE_STAKING_ENV=TESTNET
VITE_ECOSYSTEM_PROJECTS_URL=https://raw.githubusercontent.com/FuelLabs/fuel-ecosystem/refs/heads/main/projects.json
EOF
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing required VITE_FUEL_PROVIDER environment variable

High Severity

The workflow doesn't set VITE_FUEL_PROVIDER in the .env file or build environment variables, but packages/app-explorer/src/services/graphqlClient.ts throws an error if this variable is missing. The build step will fail with "Missing VITE_FUEL_PROVIDER environment variable", preventing any tests from running.

Additional Locations (1)

Fix in Cursor Fix in Web

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