Files
xverse-web-extension/.github/workflows/playwright.yml
Duska.T 8821afd607 Dusana/eng 5909 fix for workflow upload playwright report to develop (#811)
* release: v0.46.0

* Fix: Duplicate artifact name causing 409 Conflict in GH Actions and fix failing e2e tests (#808)

* Fix: Duplicate artifact name causing 409 Conflict in GitHub Actions

* fix for unstable locators

* removed a commented line in swapSip10Velar.spec.ts

* Fix for workflow Upload Playwright report in ci/cd

* Terence/add min balance decimals (#810)

* add formatBalance to final quote display

* add formatBalance to quoteSummaryTile.tsx

* remove invalid code (its comparing the rate to the minimum received)

* fix remove wrapping

* Fix for failing test

* Fix for failing tests

---------

Co-authored-by: DuskaT021 <aleksa2601@gmail.com>

* updated the build-rc.yml post-comment

---------

Co-authored-by: GitHub Actions Bot <>
Co-authored-by: Terence Ng <ngtere@live.com.sg>
2024-12-05 16:36:59 +01:00

128 lines
4.1 KiB
YAML

name: E2E Test Suite
on:
pull_request:
branches:
- develop
workflow_dispatch:
jobs:
build:
if: ${{ (startsWith(github.head_ref, 'e2etest/') && github.event.pull_request && github.event.pull_request.draft == false) || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
always-auth: true
node-version: 18
registry-url: https://npm.pkg.github.com
scope: '@secretkeylabs'
cache: npm
- name: Install dependencies
env:
NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGE_REGISTRY_TOKEN }}
run: npm ci
- name: Test
run: |
npm run knip
npx eslint .
npx tsc --noEmit
- name: Build
env:
TRANSAC_API_KEY: ${{ secrets.TRANSAC_API_KEY }}
MOON_PAY_API_KEY: ${{ secrets.MOON_PAY_API_KEY }}
MIX_PANEL_TOKEN: ${{ secrets.MIX_PANEL_TOKEN }}
MIX_PANEL_EXPLORE_APP_TOKEN: ${{ secrets.MIX_PANEL_EXPLORE_APP_TOKEN }}
SKIP_ANIMATION_WALLET_STARTUP: 'true'
run: npm run build --if-present
- name: Upload Archive
uses: actions/upload-artifact@v4
with:
name: web-extension1
path: ./build
retention-days: 4
if-no-files-found: error
overwrite: true
UItest:
needs: [build]
name: E2E Test ${{ matrix.shardIndex }} of ${{ matrix.shardTotal }}
timeout-minutes: 10
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3, 4, 5, 6]
shardTotal: [6]
steps:
- uses: actions/checkout@v4
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: web-extension1
path: ./build
- name: Use Node.js
uses: actions/setup-node@v4
with:
always-auth: true
node-version: 18
registry-url: https://npm.pkg.github.com
scope: '@secretkeylabs'
cache: npm
- name: Install dependencies
env:
NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGE_REGISTRY_TOKEN }}
run: npm install playwright
- name: Install Playwright Browsers
run: npx playwright install chromium --with-deps
- name: Run E2E test suite
env:
SEED_WORDS1: ${{ secrets.SEED_WORDS1 }}
SEED_WORDS2: ${{ secrets.SEED_WORDS2 }}
run: xvfb-run --auto-servernum --server-args="-screen 0 360x360x24" npx playwright test --grep-invert "#localexecution" --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
- name: Upload Playwright report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: blob-report-${{ matrix.shardIndex }}-of-${{ matrix.shardTotal }}
path: blob-report
retention-days: 1
overwrite: true
merge-reports:
# Merge reports after playwright-tests, even if some shards have failed
if: ${{ always() && needs.UItest.result != 'skipped' }}
needs: [UItest]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
always-auth: true
node-version: 18
registry-url: https://npm.pkg.github.com
scope: '@secretkeylabs'
cache: npm
- name: Install dependencies
env:
NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGE_REGISTRY_TOKEN }}
run: npm install playwright
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
pattern: blob-report-*
path: all-blob-reports
merge-multiple: true
- name: Merge into HTML Report
run: npx playwright merge-reports --reporter html ./all-blob-reports
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: html-report--attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 4
overwrite: true