Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
f985400
chore: ignore .cursor/ directory in git
blockqa Nov 14, 2025
70d2377
feat: add Next Gen extension E2E automation framework
blockqa Nov 17, 2025
877db99
chore: add wallet snapshots to .gitignore
blockqa Nov 17, 2025
20a9ee6
feat: add E2E test framework files
blockqa Nov 17, 2025
3520b69
Merge branch 'main' into e2e_playwright_tests
blockqa Nov 17, 2025
2667156
refactor: rename e2e_Playwright_Tests to e2e-playwright-tests
blockqa Nov 17, 2025
6ef2816
fix: add OIDC permissions and update AWS credentials action
blockqa Nov 17, 2025
6898576
chore: trigger CI
blockqa Nov 17, 2025
279c481
fix: move AWS S3 download outside Docker container
blockqa Nov 17, 2025
94d72d4
Merge branch 'main' into e2e_playwright_tests
blockqa Nov 17, 2025
0af5d77
Merge branch 'main' into e2e_playwright_tests
blockqa Nov 18, 2025
643dd7f
fix: install Python dependencies in container for TestRail upload
blockqa Nov 18, 2025
9c205b9
fix: add --break-system-packages flag for pip install
blockqa Nov 18, 2025
9d83019
fix: testrail upload path and improve smoke test filtering
blockqa Nov 18, 2025
f6f8c9b
fix: quote @smoke grep pattern in playwright test command
blockqa Nov 18, 2025
daa7ed1
refactor: align workflow with Core Web smoke tests pattern
blockqa Nov 19, 2025
95d7247
fix: set working directory for playwright test execution
blockqa Nov 19, 2025
9eacbdc
chore: add debug logging to diagnose test execution
blockqa Nov 19, 2025
faceeb0
chore: run playwright without xvfb to diagnose issue
blockqa Nov 19, 2025
0957689
chore: add test listing and explicit reporters
blockqa Nov 19, 2025
260e9e2
fix: use default export and defineConfig in base.config.ts
blockqa Nov 19, 2025
d02a2fa
fix: restore xvfb-run for test execution
blockqa Nov 19, 2025
c9565af
fix: make wallet snapshot imports dynamic with linting fixes
blockqa Nov 19, 2025
9c4a403
fix: correct eslint disable rule name for empty pattern
blockqa Nov 19, 2025
c4e90fe
fix: use correct snapshot name in contacts tests
blockqa Nov 19, 2025
062c86f
fix: add headless mode support for CI environment
blockqa Nov 19, 2025
cc1bd5d
fix: add wait for redirects in extensionPage fixture
blockqa Nov 19, 2025
0553828
fix: use auto-opened extension page instead of creating new one
blockqa Nov 19, 2025
31b2515
fix: add timeouts to prevent tests hanging indefinitely
blockqa Nov 19, 2025
0ac7f75
fix: handle already-unlocked wallet state gracefully
blockqa Nov 19, 2025
6677c1b
fix: add longer waits for extension UI to fully load with snapshot data
blockqa Nov 19, 2025
3b161aa
fix: add extensive logging to diagnose page state issues
blockqa Nov 19, 2025
444dce7
fix: restore popup.html navigation and remove unused snapshot
blockqa Nov 19, 2025
8c46555
fix: restore natural extension navigation for no-snapshot tests
blockqa Nov 19, 2025
c1bc6b3
fix: increase wallet creation timeout and improve phrase verification
blockqa Nov 19, 2025
9d76b6e
Merge branch 'main' into e2e_playwright_tests
blockqa Nov 19, 2025
5e57c3a
fix: increase wallet creation timeout to 2 minutes
blockqa Nov 19, 2025
da62776
feat: implement parallel testing for CI and local execution
blockqa Nov 20, 2025
1596042
fix: adjust parallel testing to 3 shards and increase wallet timeout
blockqa Nov 20, 2025
458c48a
chore: remove smoke tag from wallet creation tests
blockqa Nov 23, 2025
3231a12
fix: update TestRail project name and CI robustness
blockqa Nov 23, 2025
08480c6
fix: use secrets.TESTRAIL_EMAIL instead of vars.TESTRAIL_EMAIL
blockqa Nov 23, 2025
8ea7ab0
fix: update testrail custom field annotation format
blockqa Nov 23, 2025
cdc2757
fix: add environment alpha to playwright job and debug logging for trcli
blockqa Nov 23, 2025
17d5bed
fix: use testrail_case_field property for annotations
blockqa Nov 23, 2025
a9402aa
chore: add .venv and python artifacts to gitignore
blockqa Nov 23, 2025
7d956b0
fix: update TestRail annotations to match field name
blockqa Nov 23, 2025
5338317
refactor: align TestRail integration with Core Web structure
blockqa Nov 24, 2025
4870861
fix: use secrets.TESTRAIL_EMAIL instead of vars.TESTRAIL_EMAIL
blockqa Nov 24, 2025
1c368f4
fix: update TestRail annotations to match Core Web format
blockqa Nov 24, 2025
d1d2d6d
fix: add working directory and debug output for TestRail upload
blockqa Nov 24, 2025
099a0a1
fix: use correct TestRail custom field name automation_id
blockqa Nov 24, 2025
a7a91ab
fix: use automation_id as property name directly in annotations
blockqa Nov 24, 2025
074bbc4
fix: update TestRail annotations to use custom_automation_id field name
blockqa Nov 24, 2025
7f2aad5
fix: remove invalid --test-case-field flag from trcli command
blockqa Nov 24, 2025
1d8a6a7
fix: update TestRail annotations to use testrail_case_field format
blockqa Nov 24, 2025
e8cfb7c
fix: change trcli from -n to -y to allow auto-creation of test cases
blockqa Nov 24, 2025
6423f6f
fix: add case-matcher automation_id to trcli for TestRail matching
blockqa Nov 24, 2025
0adb7d8
fix: use --case-matcher property instead of automation_id
blockqa Nov 24, 2025
53b8095
fix: use custom_case_automation_id as TestRail field name
blockqa Nov 24, 2025
f907af2
fix: update test-results path to tests/test-results
blockqa Nov 24, 2025
79a3e28
refactor: apply Core Web annotation approach to all tests
blockqa Nov 25, 2025
cc78ce2
test(e2e): update TestRail annotations with hyphenated case IDs
blockqa Nov 25, 2025
e678127
ci: update trcli flags in TestRail upload step
blockqa Nov 25, 2025
81fae8c
test(e2e): update TestRail annotations to use custom_automation_id
blockqa Nov 25, 2025
0371416
ci: add --case-matcher property flag for TestRail matching
blockqa Nov 25, 2025
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
278 changes: 278 additions & 0 deletions .github/workflows/smoke_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,278 @@
name: Core Extension E2E Smoke Tests

on:
workflow_run:
workflows: ['CI for main']
types: [completed]
branches: [main]
workflow_dispatch:
inputs:
test-run-type:
type: choice
description: 'Run smoke tests or full regression?'
options:
- smoke
- full
required: true
default: 'smoke'
push:
branches:
- main
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
- ready_for_review

permissions:
id-token: write
contents: read

jobs:
build-extension:
name: Build Core Extension
runs-on: ubuntu-latest-16-cores-core-extension
if: '${{ !github.event.pull_request.draft }}'
environment: alpha
env:
RUNNER: CI
LOG_LEVEL: info
POST_TO_TESTRAIL: true
TESTRAIL_API_KEY: '${{ secrets.TESTRAIL_API_KEY }}'
outputs:
test_run_id: ${{ steps.trid.outputs.test_run_id }}
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.14.0
check-latest: true

- name: Enable corepack
run: corepack enable

- name: Checkout extension
uses: actions/checkout@v4
with:
ref: '${{ github.head_ref }}'
fetch-depth: 0

- name: Create .npmrc
run: echo '//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}' >> .npmrc

- name: Create env file
run: |
touch .env.production
echo RELEASE=alpha >> .env.production
echo POSTHOG_KEY=${{ secrets.POSTHOG_KEY }} >> .env.production
echo POSTHOG_URL=${{ secrets.POSTHOG_URL }} >> .env.production
echo COVALENT_API_KEY=${{ secrets.COVALENT_API_KEY }} >> .env.production
echo GLACIER_URL=${{ secrets.GLACIER_URL }} >> .env.production
echo PROXY_URL=${{ secrets.PROXY_URL }} >> .env.production
echo CORE_EXTENSION_LANDING_URL=${{ secrets.CORE_EXTENSION_LANDING_URL }} >> .env.production
echo SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> .env.production
echo COINBASE_APP_ID=${{ secrets.COINBASE_APP_ID }} >> .env.production
echo CORE_WEB_BASE_URL=${{ secrets.CORE_WEB_BASE_URL }} >> .env.production
echo GLACIER_API_KEY=${{ secrets.GLACIER_API_KEY }} >> .env.production
echo FIREBASE_CONFIG=${{ secrets.FIREBASE_CONFIG }} >> .env.production
echo ID_SERVICE_URL=${{ secrets.ID_SERVICE_URL }} >> .env.production
echo GASLESS_SERVICE_URL=${{ secrets.GASLESS_SERVICE_URL }} >> .env.production
echo EXTENSION_PUBLIC_KEY=${{ secrets.EXTENSION_PUBLIC_KEY_E2E }} >> .env.production
echo ID_SERVICE_API_KEY=${{ secrets.ID_SERVICE_API_KEY }} >> .env.production
echo NOTIFICATION_SENDER_SERVICE_URL=${{ secrets.NOTIFICATION_SENDER_SERVICE_URL }} >> .env.production

- name: Install dependencies
run: |
yarn install
yarn allow-scripts

- name: Build extension
run: yarn build:next:alpha

- name: Inject extension key
run: |
echo $(cat ./dist-next/manifest.json | jq '.key = "${{ secrets.EXTENSION_PUBLIC_KEY_E2E }}"') > ./dist-next/manifest.json

- name: Upload built extension
uses: actions/upload-artifact@v4
with:
name: extension
path: ./dist-next

- name: Install TestRail CLI
run: pip3 install trcli

- name: Create test run in TestRail
id: trid
run: |
TS=$(date -u +'%Y-%m-%d-%H:%M:%S')
TEST_RUN_ID=`trcli -y -h https://avalabs.testrail.io --project "New Gen Core Extension" --username ${{ secrets.TESTRAIL_EMAIL }} --key ${{ secrets.TESTRAIL_API_KEY }} add_run --title "New Gen Core Extension - $TS" --run-include-all | grep "run_id:" | awk '{print $2}'`
echo "test_run_id=$TEST_RUN_ID" >> $GITHUB_OUTPUT

download-snapshots:
name: Download Test Snapshots from S3
needs: build-extension
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
env:
AWS_REGION: us-east-1
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
role-to-assume: arn:aws:iam::975050371175:role/github-flow-sa-role
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ env.AWS_REGION }}

- name: Set Python for AWS CLI
uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: Install AWS dependencies
shell: bash
run: |
python3 -m venv ~/py_env
source ~/py_env/bin/activate
pip3 install awscli

- name: Download Extension snapshots from AWS S3
shell: bash
run: |
mkdir -p snapshots
source ~/py_env/bin/activate
aws s3 sync s3://core-qa-automation-snapshots/ext/ ./snapshots/ || echo "No snapshots found in S3, continuing..."
ls -la ./snapshots/

- name: Upload snapshots as artifact
uses: actions/upload-artifact@v4
with:
name: test-snapshots
path: ./snapshots/
if-no-files-found: warn

playwright-tests:
name: Run Extension E2E Tests - Shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
needs: [build-extension, download-snapshots]
runs-on: ubuntu-latest-16-cores-core-extension
permissions:
id-token: write
contents: read
environment: alpha
strategy:
fail-fast: false
matrix:
# Parallel execution with 3 shards on 16-core runner
# Each shard runs with 4 workers for optimal performance
# Adjust shardTotal to increase/decrease parallelism
shardIndex: [1, 2, 3]
shardTotal: [3]
env:
AWS_REGION: us-east-1
TEST_RUN_ID: ${{ needs.build-extension.outputs.test_run_id }}
RUNNER: CI
LOG_LEVEL: info
HEADLESS: 'true'
WORKERS: '4' # Number of parallel workers per shard (4 CPUs allocated per container)
WALLET_PASSWORD: '${{ secrets.WALLET_PASSWORD }}'
RECOVERY_PHRASE_12_WORDS: '${{ secrets.RECOVERY_PHRASE_12_WORDS }}'
RECOVERY_PHRASE_24_WORDS: '${{ secrets.RECOVERY_PHRASE_24_WORDS }}'
container:
image: mcr.microsoft.com/playwright:v1.52.0-noble
# Optimized for parallel execution: 4 CPUs + 4 workers per shard
options: --ipc=host --security-opt=seccomp=unconfined --cap-add=SYS_ADMIN --shm-size=2gb --memory=4g --cpus=4

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Chrome and Python
working-directory: e2e-playwright-tests
run: |
apt-get update
apt-get install -y wget gnupg python3-pip python3-venv
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list
apt-get update
apt-get install -y google-chrome-stable

- name: Download built extension
uses: actions/download-artifact@v4
with:
name: extension
path: ./e2e-playwright-tests/dist

- name: Download test snapshots
uses: actions/download-artifact@v4
with:
name: test-snapshots
path: ./e2e-playwright-tests/helpers/storage-snapshots

- name: Output Github runner
run: |
curl ifconfig.io

- name: Create test environment file
run: |
cd e2e-playwright-tests
touch .env
echo "WALLET_PASSWORD=${{ secrets.WALLET_PASSWORD }}" >> .env
echo "RECOVERY_PHRASE_12_WORDS=${{ secrets.RECOVERY_PHRASE_12_WORDS }}" >> .env
echo "RECOVERY_PHRASE_24_WORDS=${{ secrets.RECOVERY_PHRASE_24_WORDS }}" >> .env

- name: Install Playwright dependencies
working-directory: e2e-playwright-tests
run: |
npm install
npx playwright install --with-deps chromium

- name: Run Playwright smoke tests
if: github.event.inputs.test-run-type == 'smoke' || github.event.inputs.test-run-type == '' || github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_run'
working-directory: e2e-playwright-tests
env:
CI: true
run: |
GREP_FILTER=$([ -z "${{ github.event.inputs.test-run-type }}" ] || [ "${{ github.event.inputs.test-run-type }}" = "smoke" ] && echo "--grep=@smoke" || echo "")
PLAYWRIGHT_SHARD=${{ matrix.shardIndex }} xvfb-run --auto-servernum --server-args='-screen 0 1280x1024x24' npx playwright test --config=config/base.config.ts --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} $GREP_FILTER

- name: Run Playwright full regression tests
if: github.event.inputs.test-run-type == 'full'
working-directory: e2e-playwright-tests
env:
CI: true
run: |
PLAYWRIGHT_SHARD=${{ matrix.shardIndex }} xvfb-run --auto-servernum --server-args='-screen 0 1280x1024x24' npx playwright test --config=config/base.config.ts --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}

- name: Upload results to TestRail
if: always()
shell: bash
working-directory: e2e-playwright-tests
run: |
python3 -m venv ~/py_env
source ~/py_env/bin/activate
pip3 install trcli
trcli -y -h https://avalabs.testrail.io --project "New Gen Core Extension" --username ${{ secrets.TESTRAIL_EMAIL }} --key ${{ secrets.TESTRAIL_API_KEY }} parse_junit -f ./tests/test-results/junit-report-${{ matrix.shardIndex }}.xml --run-id=${{ env.TEST_RUN_ID }} --case-matcher property

- name: Output TestRail run link
if: always()
run: echo https://avalabs.testrail.io/index.php?/runs/view/${{ env.TEST_RUN_ID }}

- name: Upload files as artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.shardIndex }}
path: |
e2e-playwright-tests/tests/test-results
e2e-playwright-tests/playwright-report
retention-days: 30
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,8 @@ dist-next

# CLI
.sentryclirc

# Python
.venv/
__pycache__/
*.pyc
16 changes: 16 additions & 0 deletions e2e-playwright-tests/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# E2E Test Configuration
# Copy this file to .env and update with your actual values

# Wallet Configuration
WALLET_PASSWORD="your-wallet-password"

# Valid recovery phrases for successful onboarding tests
# These should be valid BIP39 mnemonics
RECOVERY_PHRASE_12_WORDS="your 12 word recovery phrase here"
RECOVERY_PHRASE_24_WORDS="your 24 word recovery phrase here"

# Test Execution
HEADLESS=false
CI=false
EXTENSION_ID=
EXTENSION_PATH=
41 changes: 41 additions & 0 deletions e2e-playwright-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Dependencies
node_modules/
package-lock.json

# Test results
test-results/
playwright-report/
playwright/.cache/

# Screenshots
test-results/screenshots/

# User data
user-data-dir/

# Wallet snapshots (stored in S3, not in repo)
helpers/storage-snapshots/*.ts

# Environment
.env
.env.local

# Build output
dist/
tsconfig.tsbuildinfo

# OS
.DS_Store
Thumbs.db

# IDE
.vscode/
.idea/
*.swp
*.swo
*.mdc

# Cursor IDE
.cursor/
.cursor/**

35 changes: 35 additions & 0 deletions e2e-playwright-tests/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"bracketSameLine": true,
"arrowParens": "always",
"endOfLine": "lf",
"proseWrap": "preserve",
"overrides": [
{
"files": ["*.md"],
"options": {
"printWidth": 80
}
},
{
"files": ["*.yml", "*.yaml", "*.json", "*.json5", "package.json"],
"options": {
"tabWidth": 2,
"singleQuote": false
}
},
{
"files": ["*.ts", "*.tsx"],
"options": {
"singleQuote": true
}
}
]
}
Loading
Loading