From 476230d471aa468ce707ecfa9cb9e59f8bdca778 Mon Sep 17 00:00:00 2001 From: Christophe Deveaux Date: Mon, 2 Sep 2024 16:13:15 +0200 Subject: [PATCH] test: add CCTP synpress config (#1861) --- package.json | 2 +- packages/arb-token-bridge-ui/.e2e.env.sample | 2 + .../TransferPanel/AdvancedSettings.tsx | 1 + .../synpress.cctp.config.ts | 162 ++++++++++++++++++ .../arb-token-bridge-ui/synpress.config.ts | 91 ++-------- .../tests/e2e/cypress.d.ts | 10 +- .../tests/e2e/getCommonSynpressConfig.ts | 21 +++ .../tests/e2e/specs/approveToken.cy.ts | 4 +- .../tests/support/commands.ts | 109 +++--------- .../tests/support/common.ts | 114 +++++++----- .../tests/support/index.ts | 3 +- tsconfig.eslint.json | 3 +- 12 files changed, 313 insertions(+), 209 deletions(-) create mode 100644 packages/arb-token-bridge-ui/synpress.cctp.config.ts create mode 100644 packages/arb-token-bridge-ui/tests/e2e/getCommonSynpressConfig.ts diff --git a/package.json b/package.json index 74e39a32d6..c60ae31523 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "lint": "yarn workspace arb-token-bridge-ui lint", "lint:fix": "yarn workspace arb-token-bridge-ui lint:fix", "test:e2e": "yarn workspace arb-token-bridge-ui env-cmd --silent --file .e2e.env yarn synpress run --configFile synpress.config.ts", - "test:e2e:cctp": "E2E_CCTP=true yarn test:e2e", + "test:e2e:cctp": "yarn test:e2e --configFile synpress.cctp.config.ts", "test:e2e:orbit": "E2E_ORBIT=true yarn test:e2e" }, "resolutions": { diff --git a/packages/arb-token-bridge-ui/.e2e.env.sample b/packages/arb-token-bridge-ui/.e2e.env.sample index 573ce3d690..28ca742afc 100644 --- a/packages/arb-token-bridge-ui/.e2e.env.sample +++ b/packages/arb-token-bridge-ui/.e2e.env.sample @@ -12,6 +12,8 @@ CYPRESS_RECORD_VIDEO=false # Below key is only used to fund the newly created wallet PRIVATE_KEY_CUSTOM=b6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659 +PRIVATE_KEY_CCTP= + # We set up MetaMask ourselves SKIP_METAMASK_SETUP=true diff --git a/packages/arb-token-bridge-ui/src/components/TransferPanel/AdvancedSettings.tsx b/packages/arb-token-bridge-ui/src/components/TransferPanel/AdvancedSettings.tsx index ca44aef3ff..a6fb791c63 100644 --- a/packages/arb-token-bridge-ui/src/components/TransferPanel/AdvancedSettings.tsx +++ b/packages/arb-token-bridge-ui/src/components/TransferPanel/AdvancedSettings.tsx @@ -263,6 +263,7 @@ export const AdvancedSettings = () => { onChange={e => setDestinationAddress(e.target.value?.toLowerCase().trim()) } + aria-label="Custom Destination Address Input" /> {isEOA && (