From 405f73a0f70ebbba8fb79b11926be8b772ba890b Mon Sep 17 00:00:00 2001 From: juan-langa Date: Tue, 7 May 2024 13:52:55 +0200 Subject: [PATCH] Adding 'Refinance' GitHub action --- .github/workflows/refinance.yml | 40 +++++++++++++++++++ package.json | 6 +++ tests/withWallet/maker/makerBorrow.spec.ts | 2 +- .../refinance/wbtcDaiToBorrowSdaiEth.spec.ts | 6 +-- 4 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/refinance.yml diff --git a/.github/workflows/refinance.yml b/.github/workflows/refinance.yml new file mode 100644 index 00000000..39a4ad6e --- /dev/null +++ b/.github/workflows/refinance.yml @@ -0,0 +1,40 @@ +name: Refinance + +on: + schedule: + - cron: '0 1 * * 1-5' + +jobs: + with-wallet-refinance: + name: 'With wallet - Refinance' + runs-on: ubuntu-latest + env: + TENDERLY_PROJECT: ${{ secrets.TENDERLY_PROJECT }} + TENDERLY_USER: ${{ secrets.TENDERLY_USER }} + TENDERLY_ACCESS_KEY: ${{ secrets.TENDERLY_ACCESS_KEY }} + container: + image: synthetixio/docker-node:18.16-ubuntu + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Install dependencies + run: yarn + - name: Install playwright + run: npx playwright install && npx playwright install-deps + - name: Install xvfb + run: apt-get update -y && apt-get -y install xvfb && rm -rf /var/lib/apt/lists/* /var/cache/apt/* + - name: Run With wallet Aave Ethereum tests + run: | + TENDERLY_PROJECT=${{ secrets.TENDERLY_PROJECT }} \ + TENDERLY_USER=${{ secrets.TENDERLY_USER }} \ + TENDERLY_ACCESS_KEY=${{ secrets.TENDERLY_ACCESS_KEY }} \ + yarn ci:with-wallet:refinance + - uses: actions/upload-artifact@v3 + if: always() + with: + name: playwright-report-with-wallet-refinance + path: playwright-reports/with-wallet-refinance + retention-days: 30 + \ No newline at end of file diff --git a/package.json b/package.json index 9b322c5d..3af5f36e 100644 --- a/package.json +++ b/package.json @@ -83,6 +83,11 @@ "//-4b": "---------- PORTFOLIO (Staging vs Production) TESTS ------------", "//-4c": "---------------------------------------------------------------", "portfolio:staging-vs-production": "WORKERS='3' FULLY_PARALLEL='true' RETRIES='2' yarn no-wallet:portfolio", + "//-5a": "---------------------------------------------------------------", + "//-5b": "---------- REFINANCE TESTS ------------", + "//-5c": "---------------------------------------------------------------", + "with-wallet:refinance": "REPORT_FOLDER=with-wallet-refinance npx playwright test --grep @refinance --workers=1", + "ci:with-wallet:refinance": "RETRIES='2' xvfb-run yarn with-wallet:refinance", "//-9a": "---------------------------------------------------------------", "//-9b": "---------------------- REPORTS --------------------------------", "//-9c": "---------------------------------------------------------------", @@ -102,6 +107,7 @@ "test:report:with-wallet:ajna:optimism": "npx playwright show-report playwright-reports/with-wallet-ajna-optimism", "test:report:with-wallet:morphoblue": "npx playwright show-report playwright-reports/with-wallet-morphoblue", "test:report:with-wallet:maker-and-spark": "npx playwright show-report playwright-reports/with-wallet-maker-and-spark", + "test:report:with-wallet:refinance": "npx playwright show-report playwright-reports/with-wallet-refinance", "//-10a": "---------------------------------------------------------------", "//-10b": "---------------------- MANUAL TESTING UTILS --------------------------------", "//-10c": "---------------------------------------------------------------", diff --git a/tests/withWallet/maker/makerBorrow.spec.ts b/tests/withWallet/maker/makerBorrow.spec.ts index 6b4880b1..e35aa966 100644 --- a/tests/withWallet/maker/makerBorrow.spec.ts +++ b/tests/withWallet/maker/makerBorrow.spec.ts @@ -1,7 +1,7 @@ import { BrowserContext, test } from '@playwright/test'; -import { metamaskSetUp } from 'utils/setup'; import { resetState } from '@synthetixio/synpress/commands/synpress'; import * as metamask from '@synthetixio/synpress/commands/metamask'; +import { metamaskSetUp } from 'utils/setup'; import * as tenderly from 'utils/tenderly'; import { setup } from 'utils/setup'; import { extremelyLongTestTimeout, veryLongTestTimeout } from 'utils/config'; diff --git a/tests/withWallet/maker/refinance/wbtcDaiToBorrowSdaiEth.spec.ts b/tests/withWallet/maker/refinance/wbtcDaiToBorrowSdaiEth.spec.ts index c31e804f..e6ad1ce7 100644 --- a/tests/withWallet/maker/refinance/wbtcDaiToBorrowSdaiEth.spec.ts +++ b/tests/withWallet/maker/refinance/wbtcDaiToBorrowSdaiEth.spec.ts @@ -27,11 +27,11 @@ test.describe('Maker Borrow - Wallet connected', async () => { }); test.use({ - viewport: { width: 1600, height: 850 }, + viewport: { width: 1400, height: 720 }, }); // Create a Maker position as part of the Refinance tests setup - test('It should open a Maker Borrow position', async () => { + test('It should open a Maker Borrow position @refinance', async () => { test.info().annotations.push({ type: 'Test case', description: '11788, 11790', @@ -101,7 +101,7 @@ test.describe('Maker Borrow - Wallet connected', async () => { await app.position.manage.shouldHaveButton({ label: 'WBTC' }); }); - test('It should refinance a Maker Borrow position (WBTC/DAI) to Spark Borrow (sDAI/ETH)', async () => { + test('It should refinance a Maker Borrow position (WBTC/DAI) to Spark Borrow (sDAI/ETH) @refinance', async () => { test.info().annotations.push({ type: 'Test case', description: '11788, 11790',