E2E | os: Windows | browser: chrome | tags: empty | network: | #151 #151
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: E2E Tests Win | |
on: | |
schedule: | |
- cron: '0 2 * * *' | |
push: | |
branches: | |
- 'release/**' | |
workflow_dispatch: | |
inputs: | |
tags: | |
description: 'Test scenario tags (will run all tests if empty)' | |
required: false | |
browser: | |
description: 'Browser to use' | |
required: true | |
default: 'edge' | |
type: choice | |
options: | |
- chrome | |
- edge | |
network: | |
type: choice | |
description: network to use | |
options: | |
- preprod | |
- mainnet | |
run-name: "E2E | os: Windows | browser: ${{ github.event.inputs.browser || 'chrome' }} | tags: ${{ github.event.inputs.tags || 'empty' }} | network: ${{ github.event.inputs.network }} | #${{ github.run_number }}" | |
env: | |
TAGS: ${{ github.event.inputs.tags || 'empty' }} | |
BROWSER: ${{ github.event.inputs.browser || 'edge' }} | |
NETWORK: ${{ github.event.inputs.network || 'preprod' }} | |
RUN: ${{ github.run_number }} | |
jobs: | |
build-extension-linux: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Decrypt test data | |
working-directory: ./packages/e2e-tests | |
run: ./decrypt_secret.sh | |
env: | |
WALLET_1_PASSWORD: ${{ secrets.WALLET_PASSWORD_TESTNET }} | |
- name: Build dist version of Lace | |
uses: ./.github/shared/build | |
with: | |
LACE_EXTENSION_KEY: ${{ secrets.MANIFEST_PUBLIC_KEY }} | |
- name: Save Lace extension build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: lace-build | |
path: ./apps/browser-extension-wallet/dist | |
- name: Save Core build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: core-build | |
path: ./packages/core/dist | |
run-tests-windows: | |
needs: build-extension-linux | |
runs-on: windows-2022 | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Set screen resolution | |
shell: pwsh | |
run: Set-DisplayResolution -Width 1920 -Height 1080 -Force | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Decrypt test data | |
working-directory: ./packages/e2e-tests | |
run: ./decrypt_secret.sh | |
env: | |
WALLET_1_PASSWORD: ${{ secrets.WALLET_PASSWORD_TESTNET }} | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'yarn' | |
- name: Get built extension | |
uses: actions/download-artifact@v3 | |
with: | |
name: lace-build | |
path: ./apps/browser-extension-wallet/dist | |
- name: Get Core build | |
uses: actions/download-artifact@v3 | |
with: | |
name: core-build | |
path: ./packages/core/dist | |
- name: Node modules cache | |
uses: actions/cache@v3 | |
with: | |
path: ./packages/e2e-tests/node_modules | |
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }} | |
- name: Install dependencies | |
working-directory: ./packages/e2e-tests | |
run: yarn config set httpTimeout 300000 && yarn install --check-cache --immutable | |
- name: Start Chrome driver | |
run: | | |
if [ ${BROWSER} == "chrome" ]; then | |
${CHROMEWEBDRIVER}\chromedriver.exe -port=4444 & | |
else | |
echo "Skipping start of ChromeDriver" | |
fi | |
- name: Start Edge driver | |
run: | | |
if [ ${BROWSER} == "edge" ]; then | |
${EDGEWEBDRIVER}\msedgedriver.exe -port=4444 & | |
else | |
echo "Skipping start of EdgeDriver" | |
fi | |
- name: Execute E2E tests | |
working-directory: ./packages/e2e-tests | |
id: e2e-tests | |
env: | |
WALLET_1_PASSWORD: ${{ secrets.WALLET_PASSWORD_TESTNET }} | |
TEST_DAPP_URL: ${{ secrets.TEST_DAPP_URL }} | |
ENV: ${{ env.NETWORK }} | |
run: | | |
if [ "$TAGS" == "empty" ]; then | |
TAGS_TO_RUN=""; | |
else | |
TAGS_TO_RUN="--cucumberOpts.tagExpression='${{ env.TAGS }}'"; | |
fi | |
yarn wdio run wdio.conf.${BROWSER}.ts $TAGS_TO_RUN | |
runCommand="yarn wdio run wdio.conf.${BROWSER}.ts ${TAGS_TO_RUN}" | |
eval "$runCommand"; | |
- name: Create allure properties | |
if: always() | |
working-directory: ./packages/e2e-tests/reports/allure/results | |
run: | | |
pendingCount=`grep -r "@Pending" ../../../src/features | wc -l | xargs` | |
pending=`grep -r -h "@Pending" ../../../src/features -A 2 | grep -v -- "^--$" | sed "s/@Pending//g" | awk '{$1=$1};1' | sed "/^@/s/ /./g;/^#/s/ /./g" | xargs | sed "s/@[^ ]*/\n&/g" | sed "s/ /./"` | |
echo " | |
env=${NETWORK} | |
browser=${BROWSER} | |
tags=${TAGS} | |
platform=Windows | |
Pending.Count=${pendingCount} | |
@Pending.Scenarios= | |
${pending} | |
" > environment.properties | |
- name: Publish artifacts (logs, reports, screenshots) | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: test-artifacts | |
path: | | |
./packages/e2e-tests/screenshots | |
./packages/e2e-tests/logs | |
./packages/e2e-tests/reports | |
retention-days: 10 | |
outputs: | |
job-status: ${{ job.status }} | |
publish-reports-linux: | |
if: always() | |
needs: run-tests-windows | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Download reports | |
uses: actions/download-artifact@v3 | |
with: | |
name: test-artifacts | |
path: ./packages/e2e-tests | |
- name: Publish allure report to S3 | |
uses: andrcuns/allure-publish-action@v1.0.1 | |
if: always() | |
env: | |
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.E2E_AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.E2E_AWS_SECRET_ACCESS_KEY }} | |
with: | |
storageType: s3 | |
resultsGlob: './packages/e2e-tests/reports/allure/results/*' | |
bucket: lace-e2e-test-results | |
prefix: 'windows/${BROWSER}/${RUN}' | |
copyLatest: true | |
ignoreMissingResults: true | |
- name: Add link to summary | |
if: always() | |
run: | | |
echo "TEST RESULTS:" | |
echo "https://${{ secrets.E2E_REPORTS_USER }}:${{ secrets.E2E_REPORTS_PASSWORD }}@${{ secrets.E2E_REPORTS_URL }}/windows/${{ env.BROWSER }}/${{ env.RUN }}/index.html | tags: ${{ env.TAGS }} | browser: ${{ env.BROWSER }} | network: ${{ env.NETWORK }} | platform: windows" >> $GITHUB_STEP_SUMMARY | |
- name: Slack Notification | |
uses: rtCamp/action-slack-notify@v2.2.0 | |
if: always() | |
env: | |
SLACK_COLOR: ${{ needs.run-tests-windows.outputs.job-status }} | |
SLACK_ICON_EMOJI: ':lace:' | |
SLACK_MESSAGE: 'https://${{ secrets.E2E_REPORTS_USER }}:${{ secrets.E2E_REPORTS_PASSWORD }}@${{ secrets.E2E_REPORTS_URL }}/windows/${{ env.BROWSER }}/${{ env.RUN }}/index.html | tags: ${{ env.TAGS }} | browser: ${{ env.BROWSER }} | network: ${{ env.NETWORK }} | platform: windows' | |
SLACK_TITLE: 'Test automation results :rocket:' | |
SLACK_USERNAME: lace-qa-bot | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |