Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ NEXT_PUBLIC_BASE_SEPOLIA=
NEXT_PUBLIC_TENDERLY_VNETS_ENABLED=
NEXT_PUBLIC_TENDERLY_VNET_ID=
NEXT_PUBLIC_TENDERLY_VNET_RPC=
NEXT_PUBLIC_TENDERLY_VNET_EXPLORER=
NEXT_PUBLIC_TENDERLY_VNET_EXPLORER=

NEXT_PUBLIC_E2E_TEST_ENABLED=
41 changes: 41 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Playwright Tests
on:
push:
branches: [ main ]
pull_request:
types: [opened, synchronize]

env:
NEXT_PUBLIC_BASE_SEPOLIA: ${{ secrets.NEXT_PUBLIC_BASE_SEPOLIA }}
NEXT_PUBLIC_E2E_TEST_ENABLED: "true"

jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Set up foundry (includes anvil)
uses: foundry-rs/foundry-toolchain@v1
- name: Start anvil fork in base sepolia
run: anvil --fork-url "${{ env.NEXT_PUBLIC_BASE_SEPOLIA || 'https://sepolia.base.org' }}" --port 8545 --disable-block-gas-limit &
- name: Warm up anvil
run: npm run warmup:anvil
- name: Build application
run: npm run build:turbo
- name: Install Playwright Browsers
run: npm run playwright:install:chromium # CI only tests in chromium
- name: Run Playwright tests
run: npm run test:e2e
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,10 @@ yarn-error.log*
*.tsbuildinfo

# idea files
.idea
.idea

# Playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ To start the production server:
npm run start
```

### End-to-End Tests (Playwright)

The E2E tests are located in [`/e2e`](./e2e).
For details on how to install, configure, and run them, check the [dedicated README](./e2e/README.md).

## Deploy your own Vercel instance

Deploy your own instance of the application effortlessly through Vercel by simply clicking the button below and following the guided setup process:
Expand Down
19 changes: 19 additions & 0 deletions e2e/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# End-to-End Tests with Playwright

## Requirements

- Node.js >= 18
- Playwright installed: `npm run playwright:install`
- App running: you can chose running it in dev mode (`npm run dev`) or building it first (and running `npm run start`) like it is done in Github actions.

## Run tests in CI mode

```bash
nr run test:e2e
```

## Run tests in UI mode (recommended for development env)

```bash
nr run test:e2e:ui
```
Loading