Skip to content

Commit eae0045

Browse files
fionnachanclaude
andcommitted
ci(bridge): run e2e tests with Playwright
Replace the Cypress GitHub Action with a Playwright run (start app, wait, then `pnpm test:e2e <spec>`, orbit variants via env), update the spec matrix to Playwright filenames, and drop the unused cctp.json. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 0fa742f commit eae0045

4 files changed

Lines changed: 30 additions & 100 deletions

File tree

.github/workflows/e2e-tests.yml

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ jobs:
8181
- name: Restore build artifacts
8282
uses: ./.github/actions/restore-build-artifacts
8383

84-
- name: Install cypress
85-
run: pnpm cypress install
84+
- name: Install Playwright chromium
85+
run: pnpm --filter arb-token-bridge-ui exec playwright install --with-deps chromium
8686

8787
- name: Install linux dependencies
8888
run: |
@@ -115,25 +115,20 @@ jobs:
115115
''
116116
}}
117117
118-
- name: Run e2e tests via cypress-io/github-action
119-
uses: cypress-io/github-action@0da3c06ed8217b912deea9d8ee69630baed1737e # pin@v6.7.6
120-
with:
121-
start: pnpm start
122-
command: >-
123-
${{
124-
(matrix.test.type == 'orbit-eth') && 'pnpm test:e2e:orbit' ||
125-
(matrix.test.type == 'orbit-custom-6dec' && 'pnpm test:e2e:orbit:custom-gas-token') ||
126-
(matrix.test.type == 'orbit-custom-18dec' && 'pnpm test:e2e:orbit:custom-gas-token') ||
127-
(matrix.test.type == 'orbit-custom-20dec' && 'pnpm test:e2e:orbit:custom-gas-token') ||
128-
(matrix.test.type == 'cctp' && 'pnpm test:e2e:cctp') ||
129-
'pnpm test:e2e'
130-
}}
131-
wait-on: http://127.0.0.1:3000
132-
wait-on-timeout: 120
133-
spec: ./packages/arb-token-bridge-ui/tests/e2e/specs/*
118+
- name: Run e2e tests (Playwright)
119+
run: |
120+
pnpm start &
121+
npx --yes wait-on http://127.0.0.1:3000 --timeout 120000
122+
${{
123+
(matrix.test.type == 'cctp') && 'pnpm test:e2e:cctp' ||
124+
format('pnpm test:e2e {0}', matrix.test.file)
125+
}}
134126
env:
135127
DISPLAY: :0.0
136-
TEST_FILE: ${{ matrix.test.file }}
128+
E2E_ORBIT: ${{ matrix.test.type == 'orbit-eth' }}
129+
E2E_ORBIT_CUSTOM_GAS_TOKEN: ${{ startsWith(matrix.test.type, 'orbit-custom') }}
130+
ORBIT_CUSTOM_GAS_TOKEN: ${{ startsWith(matrix.test.type, 'orbit-custom') }}
131+
METAMASK_VERSION: 11.15.0
137132
SKIP_METAMASK_SETUP: true
138133
CYPRESS_RECORD_VIDEO: ${{ matrix.test.recordVideo }}
139134
PRIVATE_KEY_CUSTOM: ${{ secrets.E2E_PRIVATE_KEY }}
@@ -153,8 +148,8 @@ jobs:
153148
with:
154149
name: e2e-artifacts-${{ github.sha }}-${{ matrix.test.name }}-${{ matrix.test.type }}
155150
path: |
156-
./packages/arb-token-bridge-ui/cypress/videos
157-
./packages/arb-token-bridge-ui/cypress/screenshots
151+
./packages/arb-token-bridge-ui/test-results
152+
./packages/arb-token-bridge-ui/playwright-report
158153
if-no-files-found: 'ignore'
159154
continue-on-error: true
160155

.github/workflows/formatSpecfiles.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env node
22
const specFiles = require('../../packages/arb-token-bridge-ui/tests/e2e/specfiles.json');
3-
const cctpFiles = require('../../packages/arb-token-bridge-ui/tests/e2e/cctp.json');
43

54
const tests = [];
65

@@ -41,7 +40,7 @@ switch (testType) {
4140
tests.push({
4241
name: 'cctp',
4342
typeName: '',
44-
file: 'tests/e2e/specs/**/*Cctp.cy.{js,jsx,ts,tsx}',
43+
file: '*Cctp.spec.ts',
4544
recordVideo: false,
4645
type: 'cctp',
4746
});

packages/arb-token-bridge-ui/tests/e2e/cctp.json

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 13 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,15 @@
11
[
2-
{
3-
"name": "Login and balance check",
4-
"file": "tests/e2e/specs/**/login.cy.{js,jsx,ts,tsx}",
5-
"recordVideo": "false"
6-
},
7-
{
8-
"name": "Deposit native token",
9-
"file": "tests/e2e/specs/**/depositNativeToken.cy.{js,jsx,ts,tsx}",
10-
"recordVideo": "false"
11-
},
12-
{
13-
"name": "Withdraw native token",
14-
"file": "tests/e2e/specs/**/withdrawNativeToken.cy.{js,jsx,ts,tsx}",
15-
"recordVideo": "false"
16-
},
17-
{
18-
"name": "Deposit ERC20",
19-
"file": "tests/e2e/specs/**/depositERC20.cy.{js,jsx,ts,tsx}",
20-
"recordVideo": "false"
21-
},
22-
{
23-
"name": "Withdraw ERC20",
24-
"file": "tests/e2e/specs/**/withdrawERC20.cy.{js,jsx,ts,tsx}",
25-
"recordVideo": "false"
26-
},
27-
{
28-
"name": "Batch deposit",
29-
"file": "tests/e2e/specs/**/batchDeposit.cy.{js,jsx,ts,tsx}",
30-
"recordVideo": "false"
31-
},
32-
{
33-
"name": "TX history",
34-
"file": "tests/e2e/specs/**/txHistory.cy.{js,jsx,ts,tsx}",
35-
"recordVideo": "false"
36-
},
37-
{
38-
"name": "Approve ERC20",
39-
"file": "tests/e2e/specs/**/approveToken.cy.{js,jsx,ts,tsx}",
40-
"recordVideo": "false"
41-
},
42-
{
43-
"name": "Import test ERC20",
44-
"file": "tests/e2e/specs/**/importToken.cy.{js,jsx,ts,tsx}",
45-
"recordVideo": "false"
46-
},
47-
{
48-
"name": "Read classic deposits",
49-
"file": "tests/e2e/specs/**/readClassicDeposits.cy.{js,jsx,ts,tsx}",
50-
"recordVideo": "false"
51-
},
52-
{
53-
"name": "Redeem Retryable",
54-
"file": "tests/e2e/specs/**/redeemRetryable.cy.{js,jsx,ts,tsx}",
55-
"recordVideo": "false"
56-
},
57-
{
58-
"name": "Switch network",
59-
"file": "tests/e2e/specs/**/switchNetworks.cy.{js,jsx,ts,tsx}",
60-
"recordVideo": "false"
61-
},
62-
{
63-
"name": "URL query param",
64-
"file": "tests/e2e/specs/**/urlQueryParam.cy.{js,jsx,ts,tsx}",
65-
"recordVideo": "false"
66-
}
2+
{ "name": "Login and balance check", "file": "login.spec.ts" },
3+
{ "name": "Deposit native token", "file": "depositNativeToken.spec.ts" },
4+
{ "name": "Withdraw native token", "file": "withdrawNativeToken.spec.ts" },
5+
{ "name": "Deposit ERC20", "file": "depositERC20.spec.ts" },
6+
{ "name": "Withdraw ERC20", "file": "withdrawERC20.spec.ts" },
7+
{ "name": "Batch deposit", "file": "batchDeposit.spec.ts" },
8+
{ "name": "TX history", "file": "txHistory.spec.ts" },
9+
{ "name": "Approve ERC20", "file": "approveToken.spec.ts" },
10+
{ "name": "Import test ERC20", "file": "importToken.spec.ts" },
11+
{ "name": "Read classic deposits", "file": "readClassicDeposits.spec.ts" },
12+
{ "name": "Redeem Retryable", "file": "redeemRetryable.spec.ts" },
13+
{ "name": "Switch network", "file": "switchNetworks.spec.ts" },
14+
{ "name": "URL query param", "file": "urlQueryParam.spec.ts" }
6715
]

0 commit comments

Comments
 (0)