Skip to content

New Crowdin updates #3275

New Crowdin updates

New Crowdin updates #3275

Workflow file for this run

name: E2E tests
on:
workflow_dispatch:
inputs:
test_type:
description: 'Type of e2e tests to run'
required: true
default: 'all'
type: choice
options:
- all
- extension
- dapp
- trezor
- ledger
pull_request_review:
types: [submitted]
jobs:
Build-Extension:
if: (github.event_name == 'workflow_dispatch' &&
(github.event.inputs.test_type == 'all' ||
github.event.inputs.test_type == 'extension' ||
github.event.inputs.test_type == 'dapp' ||
github.event.inputs.test_type == 'trezor' ||
github.event.inputs.test_type == 'ledger')) ||
(github.event.review &&
(github.event.review.state == 'approved' ||
contains(github.event.review.body, '/check')
))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Read .nvmrc
id: nvm
run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
cache: 'npm'
- name: Cache node modules
uses: actions/cache@v4
id: node-cache
with:
path: |
**/node_modules
~/.npm
key: ${{ runner.os }}-node-${{ steps.nvm.outputs.NVMRC }}-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ steps.nvm.outputs.NVMRC }}-modules-
${{ runner.os }}-node-modules-
- name: Install packages
if: steps.node-cache.outputs.cache-hit != 'true'
run: |
. install-all.sh
- name: Build the test mainnet version
working-directory: ./packages/yoroi-extension
run: npm run test:build
- name: Check if the app is built correctly
working-directory: ./packages/yoroi-extension/build/js
run: |
if [ ! -f inject.js ]; then
echo "Build failed: files not found"
exit 1
fi
- name: Archive built app
uses: actions/upload-artifact@v4
with:
name: builtApp
path: |
./packages/yoroi-extension/Yoroi-test.crx
retention-days: 1
overwrite: true
Extension:
if: (github.event_name == 'workflow_dispatch' &&
(github.event.inputs.test_type == 'all' ||
github.event.inputs.test_type == 'extension')) ||
(github.event.review &&
(
github.event.review.state == 'approved' ||
contains(github.event.review.body, '/check')
))
runs-on: ubuntu-latest
needs: [Build-Extension]
continue-on-error: true
strategy:
matrix:
suite: [cashback, general, governance, nft, portfolio, receive, send, settings, transactions]
steps:
- uses: browser-actions/setup-chrome@v2
id: setup-chrome
with:
chrome-version: 'stable'
- uses: actions/checkout@v4
- name: Read .nvmrc
id: nvm
run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
cache: 'npm'
- name: Cache e2e-tests node modules
uses: actions/cache@v4
id: node-modules-cache
with:
path: |
packages/e2e-tests/node_modules
~/.npm
key: ${{ runner.os }}-e2e-tests-node-${{ steps.nvm.outputs.NVMRC }}-${{ steps.setup-chrome.outputs.chrome-version }}-${{ hashFiles('packages/e2e-tests/package-lock.json') }}
restore-keys: |
${{ runner.os }}-e2e-tests-node-${{ steps.nvm.outputs.NVMRC }}-
${{ runner.os }}-e2e-tests-node-
- name: Install packages
if: steps.node-modules-cache.outputs.cache-hit != 'true'
working-directory: ./packages/e2e-tests
run: npm install
- name: Download app
uses: actions/download-artifact@v4
with:
name: builtApp
path: ./packages/yoroi-extension
- name: Run tests
working-directory: ./packages/e2e-tests
env:
CHROME_PATH: ${{ steps.setup-chrome.outputs.chrome-path }}
FIRST_SMOKE_TEST_WALLET: ${{ secrets.FIRST_SMOKE_TEST_WALLET }}
TEST_WALLET_MAINNET_1: ${{ secrets.TEST_WALLET_MAINNET_1 }}
SECOND_STATIC_TEST_WALLET: ${{ secrets.SECOND_STATIC_TEST_WALLET }}
SECOND_SMOKE_TEST_WALLET: ${{ secrets.SECOND_SMOKE_TEST_WALLET }}
SECOND_SMOKE_TEST_WALLET_FF: ${{ secrets.SECOND_SMOKE_TEST_WALLET_FF }}
run: npm run test:ext:${{ matrix.suite }}
- name: Archive tests screenshots and logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: testRunsData_E2E_tests_extension_${{ matrix.suite }}
path: |
./packages/e2e-tests/mochawesome-report
./packages/e2e-tests/testRunsData
DApp-General:
if: (github.event_name == 'workflow_dispatch' &&
(github.event.inputs.test_type == 'all' ||
github.event.inputs.test_type == 'dapp')) ||
(github.event.review &&
(
github.event.review.state == 'approved' ||
contains(github.event.review.body, '/check')
))
runs-on: ubuntu-latest
needs: [Build-Extension]
steps:
- uses: browser-actions/setup-chrome@v2
id: setup-chrome
with:
chrome-version: 'stable'
- uses: actions/checkout@v4
- name: Read .nvmrc
id: nvm
run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
cache: 'npm'
- name: Cache e2e-tests node modules
uses: actions/cache@v4
id: node-modules-cache
with:
path: |
packages/e2e-tests/node_modules
~/.npm
key: ${{ runner.os }}-e2e-tests-node-${{ steps.nvm.outputs.NVMRC }}-${{ steps.setup-chrome.outputs.chrome-version }}-${{ hashFiles('packages/e2e-tests/package-lock.json') }}
restore-keys: |
${{ runner.os }}-e2e-tests-node-${{ steps.nvm.outputs.NVMRC }}-
${{ runner.os }}-e2e-tests-node-
- name: Install packages
if: steps.node-modules-cache.outputs.cache-hit != 'true'
working-directory: ./packages/e2e-tests
run: npm install
- name: Download app
uses: actions/download-artifact@v4
with:
name: builtApp
path: ./packages/yoroi-extension
- name: Run tests
working-directory: ./packages/e2e-tests
env:
CHROME_PATH: ${{ steps.setup-chrome.outputs.chrome-path }}
FIRST_SMOKE_TEST_WALLET: ${{ secrets.FIRST_SMOKE_TEST_WALLET }}
TEST_WALLET_MAINNET_1: ${{ secrets.TEST_WALLET_MAINNET_1 }}
SECOND_STATIC_TEST_WALLET: ${{ secrets.SECOND_STATIC_TEST_WALLET }}
SECOND_SMOKE_TEST_WALLET: ${{ secrets.SECOND_SMOKE_TEST_WALLET }}
SECOND_SMOKE_TEST_WALLET_FF: ${{ secrets.SECOND_SMOKE_TEST_WALLET_FF }}
run: xvfb-run -a -e /dev/stdout -s "-screen 0 1600x900x24" npm run test:dapp
- name: Archive tests screenshots and logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: testRunsData_E2E_tests_dapp
path: |
./packages/e2e-tests/mochawesome-report
./packages/e2e-tests/testRunsData
Trezor:
if: (github.event_name == 'workflow_dispatch' &&
(github.event.inputs.test_type == 'all' ||
github.event.inputs.test_type == 'trezor')) ||
(github.event.review &&
(
github.event.review.state == 'approved' ||
contains(github.event.review.body, '/check')
))
runs-on: ubuntu-latest
needs: [Build-Extension]
steps:
- name: Run the trezor user environment
run: |
sudo docker run \
-p 9001:9001 \
-p 9002:9002 \
-p 21326:21326 \
-p 127.0.0.1:21325:21326 \
-d ghcr.io/trezor/trezor-user-env:4c194889610c3f21f1da3799e7ddb82004fd4e91
- uses: browser-actions/setup-chrome@v2
id: setup-chrome
with:
chrome-version: 'stable'
- uses: actions/checkout@v4
- name: Read .nvmrc
id: nvm
run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
cache: 'npm'
- name: Cache e2e-tests node modules
uses: actions/cache@v4
id: node-modules-cache
with:
path: |
packages/e2e-tests/node_modules
~/.npm
key: ${{ runner.os }}-e2e-tests-node-${{ steps.nvm.outputs.NVMRC }}-${{ steps.setup-chrome.outputs.chrome-version }}-${{ hashFiles('packages/e2e-tests/package-lock.json') }}
restore-keys: |
${{ runner.os }}-e2e-tests-node-${{ steps.nvm.outputs.NVMRC }}-
${{ runner.os }}-e2e-tests-node-
- name: Install packages
if: steps.node-modules-cache.outputs.cache-hit != 'true'
working-directory: ./packages/e2e-tests
run: npm install
- name: Download app
uses: actions/download-artifact@v4
with:
name: builtApp
path: ./packages/yoroi-extension
- name: Run tests
working-directory: ./packages/e2e-tests
env:
CHROME_PATH: ${{ steps.setup-chrome.outputs.chrome-path }}
run: xvfb-run -a -e /dev/stdout -s "-screen 0 1600x900x24" npm run test:trezor
- name: Archive tests screenshots and logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: testRunsData_E2E_tests_trezor
path: |
./packages/e2e-tests/mochawesome-report
./packages/e2e-tests/testRunsData
Ledger:
if: (github.event_name == 'workflow_dispatch' &&
(github.event.inputs.test_type == 'all' ||
github.event.inputs.test_type == 'ledger')) ||
(github.event.review &&
(
github.event.review.state == 'approved' ||
contains(github.event.review.body, '/check')
))
runs-on: ubuntu-latest
needs: [Build-Extension]
steps:
- name: Pull Speculos Docker image
run: docker pull ghcr.io/ledgerhq/speculos:0.25.9
- uses: browser-actions/setup-chrome@v2
id: setup-chrome
with:
chrome-version: 'stable'
- uses: actions/checkout@v4
- name: Read .nvmrc
id: nvm
run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
cache: 'npm'
- name: Cache e2e-tests node modules
uses: actions/cache@v4
id: node-modules-cache
with:
path: |
packages/e2e-tests/node_modules
~/.npm
key: ${{ runner.os }}-e2e-tests-node-${{ steps.nvm.outputs.NVMRC }}-${{ steps.setup-chrome.outputs.chrome-version }}-${{ hashFiles('packages/e2e-tests/package-lock.json') }}
restore-keys: |
${{ runner.os }}-e2e-tests-node-${{ steps.nvm.outputs.NVMRC }}-
${{ runner.os }}-e2e-tests-node-
- name: Install packages
if: steps.node-modules-cache.outputs.cache-hit != 'true'
working-directory: ./packages/e2e-tests
run: npm install
- name: Download app
uses: actions/download-artifact@v4
with:
name: builtApp
path: ./packages/yoroi-extension
- name: Run tests
working-directory: ./packages/e2e-tests
env:
CHROME_PATH: ${{ steps.setup-chrome.outputs.chrome-path }}
run: xvfb-run -a -e /dev/stdout -s "-screen 0 1600x900x24" npm run test:ledger
- name: Archive tests screenshots and logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: testRunsData_E2E_tests_ledger
path: |
./packages/e2e-tests/mochawesome-report
./packages/e2e-tests/testRunsData