From e9045567fe24cd96256afd6d62c6eaedd0787707 Mon Sep 17 00:00:00 2001 From: juan-langa Date: Thu, 31 Oct 2024 13:35:54 +0100 Subject: [PATCH 1/2] Synpress v4 upgrade - Temporary fixes --- .../aaveV3/arbitrum/aavV3MultArbAutomations_1.spec.ts | 2 +- .../aaveV3/arbitrum/aavV3MultArbAutomations_2.spec.ts | 2 +- .../aaveV3/arbitrum/aaveV3BorrowArbitrum.spec.ts | 7 ------- .../aaveV3/arbitrum/aaveV3MultiplyArbitrum1.spec.ts | 11 ++--------- .../aaveV3/arbitrum/aaveV3MultiplyArbitrum2.spec.ts | 2 +- 5 files changed, 5 insertions(+), 19 deletions(-) diff --git a/tests/withWallet/aaveV3/arbitrum/aavV3MultArbAutomations_1.spec.ts b/tests/withWallet/aaveV3/arbitrum/aavV3MultArbAutomations_1.spec.ts index d23feb4..3135e6c 100644 --- a/tests/withWallet/aaveV3/arbitrum/aavV3MultArbAutomations_1.spec.ts +++ b/tests/withWallet/aaveV3/arbitrum/aavV3MultArbAutomations_1.spec.ts @@ -15,7 +15,7 @@ const test = testWithSynpress(metaMaskFixtures(arbitrumSetup)); test.describe.configure({ mode: 'serial' }); -test.describe('Aave V3 Borrow - Arbitrum - Wallet connected', async () => { +test.describe('Aave V3 Multiply - Arbitrum - Wallet connected', async () => { test.beforeEach(async ({ metamask, page }) => { test.setTimeout(longTestTimeout); diff --git a/tests/withWallet/aaveV3/arbitrum/aavV3MultArbAutomations_2.spec.ts b/tests/withWallet/aaveV3/arbitrum/aavV3MultArbAutomations_2.spec.ts index 54d1c24..e4a7da2 100644 --- a/tests/withWallet/aaveV3/arbitrum/aavV3MultArbAutomations_2.spec.ts +++ b/tests/withWallet/aaveV3/arbitrum/aavV3MultArbAutomations_2.spec.ts @@ -15,7 +15,7 @@ const test = testWithSynpress(metaMaskFixtures(arbitrumSetup)); test.describe.configure({ mode: 'serial' }); -test.describe('Aave V3 Borrow - Arbitrum - Wallet connected', async () => { +test.describe('Aave V3 Multiply - Arbitrum - Wallet connected', async () => { test.beforeEach(async ({ metamask, page }) => { test.setTimeout(longTestTimeout); diff --git a/tests/withWallet/aaveV3/arbitrum/aaveV3BorrowArbitrum.spec.ts b/tests/withWallet/aaveV3/arbitrum/aaveV3BorrowArbitrum.spec.ts index aad2dac..51779e5 100644 --- a/tests/withWallet/aaveV3/arbitrum/aaveV3BorrowArbitrum.spec.ts +++ b/tests/withWallet/aaveV3/arbitrum/aaveV3BorrowArbitrum.spec.ts @@ -12,8 +12,6 @@ let forkId: string; const test = testWithSynpress(metaMaskFixtures(arbitrumSetup)); -test.describe.configure({ mode: 'serial' }); - test.describe('Aave V3 Borrow - Arbitrum - Wallet connected', async () => { test.beforeEach(async ({ metamask, page }) => { test.setTimeout(longTestTimeout); @@ -30,11 +28,6 @@ test.describe('Aave V3 Borrow - Arbitrum - Wallet connected', async () => { test('It should open and manage an Aave V3 Borrow Arbitrum ETH/USDC position @regression', async ({ metamask, }) => { - test.info().annotations.push({ - type: 'Test case', - description: '12068', - }); - test.setTimeout(extremelyLongTestTimeout); await app.page.goto('/arbitrum/aave/v3/borrow/eth-usdc#setup'); diff --git a/tests/withWallet/aaveV3/arbitrum/aaveV3MultiplyArbitrum1.spec.ts b/tests/withWallet/aaveV3/arbitrum/aaveV3MultiplyArbitrum1.spec.ts index 883d829..b5e8bf3 100644 --- a/tests/withWallet/aaveV3/arbitrum/aaveV3MultiplyArbitrum1.spec.ts +++ b/tests/withWallet/aaveV3/arbitrum/aaveV3MultiplyArbitrum1.spec.ts @@ -12,9 +12,7 @@ let forkId: string; const test = testWithSynpress(metaMaskFixtures(arbitrumSetup)); -test.describe.configure({ mode: 'serial' }); - -test.describe('Aave V3 Borrow - Arbitrum - Wallet connected', async () => { +test.describe('Aave V3 Multiply - Arbitrum - Wallet connected', async () => { test.beforeEach(async ({ metamask, page }) => { test.setTimeout(longTestTimeout); @@ -30,14 +28,9 @@ test.describe('Aave V3 Borrow - Arbitrum - Wallet connected', async () => { test('It should open and manage an Aave V3 Multiply Arbitrum ETH/USDC position @regression', async ({ metamask, }) => { - test.info().annotations.push({ - type: 'Test case', - description: '12068', - }); - test.setTimeout(extremelyLongTestTimeout); - await app.page.goto('/arbitrum/aave/v3/multiply/eth-usdc'); + await app.page.goto('/arbitrum/aave/v3/multiply/ETH-USDC#setup'); await test.step('It should Open a position', async () => { await openPosition({ diff --git a/tests/withWallet/aaveV3/arbitrum/aaveV3MultiplyArbitrum2.spec.ts b/tests/withWallet/aaveV3/arbitrum/aaveV3MultiplyArbitrum2.spec.ts index 1669471..8ee6d4c 100644 --- a/tests/withWallet/aaveV3/arbitrum/aaveV3MultiplyArbitrum2.spec.ts +++ b/tests/withWallet/aaveV3/arbitrum/aaveV3MultiplyArbitrum2.spec.ts @@ -15,7 +15,7 @@ const test = testWithSynpress(metaMaskFixtures(arbitrumSetup)); test.describe.configure({ mode: 'serial' }); -test.describe('Aave V3 Borrow - Arbitrum - Wallet connected', async () => { +test.describe('Aave V3 Multiply - Arbitrum - Wallet connected', async () => { test.beforeEach(async ({ metamask, page }) => { test.setTimeout(longTestTimeout); From 4418631a3dc6561a13eecd8104efa881e52f91bf Mon Sep 17 00:00:00 2001 From: juan-langa Date: Thu, 31 Oct 2024 14:23:20 +0100 Subject: [PATCH 2/2] Synpress v4 upgrade - Temporary fixes --- .github/workflows/z_Reusable_RegressionWithRealWallet.yml | 1 - .github/workflows/z_Reusable_RegressionWithWallet.yml | 1 + .../aaveV3/arbitrum/aaveV3MultiplyArbitrum1.spec.ts | 5 +++-- .../aaveV3/arbitrum/aaveV3MultiplyArbitrum2.spec.ts | 3 +++ utils/synpress/test-wallet-setup/arbitrum.setup.ts | 5 +++++ 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/z_Reusable_RegressionWithRealWallet.yml b/.github/workflows/z_Reusable_RegressionWithRealWallet.yml index f0bcc02..efdf347 100644 --- a/.github/workflows/z_Reusable_RegressionWithRealWallet.yml +++ b/.github/workflows/z_Reusable_RegressionWithRealWallet.yml @@ -41,7 +41,6 @@ jobs: run: | BASE_URL=${{ inputs.base_url }} \ FLAGS_FEATURES=${{ inputs.flags_features}} \ - VERY_OLD_TEST_WALLET_PK=${{ secrets.VERY_OLD_TEST_WALLET_PK }} \ yarn ci:with-real-wallet - uses: actions/upload-artifact@v4 if: always() diff --git a/.github/workflows/z_Reusable_RegressionWithWallet.yml b/.github/workflows/z_Reusable_RegressionWithWallet.yml index 66177f2..6d796f5 100644 --- a/.github/workflows/z_Reusable_RegressionWithWallet.yml +++ b/.github/workflows/z_Reusable_RegressionWithWallet.yml @@ -50,6 +50,7 @@ jobs: run: | BASE_URL=${{ inputs.base_url }} \ FLAGS_FEATURES=${{ inputs.flags_features}} \ + EMPTY_TEST_WALLET_PK=${{ secrets.EMPTY_TEST_WALLET_PK }} \ yarn ci:synpress-build-cache:test-wallet - name: Run With wallet ${{ inputs.protocol }}-${{ inputs.network }} tests run: | diff --git a/tests/withWallet/aaveV3/arbitrum/aaveV3MultiplyArbitrum1.spec.ts b/tests/withWallet/aaveV3/arbitrum/aaveV3MultiplyArbitrum1.spec.ts index b5e8bf3..d58988e 100644 --- a/tests/withWallet/aaveV3/arbitrum/aaveV3MultiplyArbitrum1.spec.ts +++ b/tests/withWallet/aaveV3/arbitrum/aaveV3MultiplyArbitrum1.spec.ts @@ -32,6 +32,9 @@ test.describe('Aave V3 Multiply - Arbitrum - Wallet connected', async () => { await app.page.goto('/arbitrum/aave/v3/multiply/ETH-USDC#setup'); + // Pause to avoid random fails + await app.page.waitForTimeout(2_000); + await test.step('It should Open a position', async () => { await openPosition({ metamask, @@ -52,8 +55,6 @@ test.describe('Aave V3 Multiply - Arbitrum - Wallet connected', async () => { }); await test.step('It should Adjust risk - Down', async () => { - await app.position.manage.withdrawCollateral(); - await adjustRisk({ metamask, forkId, diff --git a/tests/withWallet/aaveV3/arbitrum/aaveV3MultiplyArbitrum2.spec.ts b/tests/withWallet/aaveV3/arbitrum/aaveV3MultiplyArbitrum2.spec.ts index 8ee6d4c..9409c53 100644 --- a/tests/withWallet/aaveV3/arbitrum/aaveV3MultiplyArbitrum2.spec.ts +++ b/tests/withWallet/aaveV3/arbitrum/aaveV3MultiplyArbitrum2.spec.ts @@ -48,6 +48,9 @@ test.describe('Aave V3 Multiply - Arbitrum - Wallet connected', async () => { await app.page.goto('/arbitrum/aave/v3/multiply/wsteth-dai'); + // Pause to avoid random fails + await app.page.waitForTimeout(2_000); + await test.step('It should Open a position', async () => { await openPosition({ metamask, diff --git a/utils/synpress/test-wallet-setup/arbitrum.setup.ts b/utils/synpress/test-wallet-setup/arbitrum.setup.ts index fd6622b..ff75bc9 100644 --- a/utils/synpress/test-wallet-setup/arbitrum.setup.ts +++ b/utils/synpress/test-wallet-setup/arbitrum.setup.ts @@ -1,8 +1,13 @@ import { defineWalletSetup } from '@synthetixio/synpress'; import { addNetwork, commonMetamaskSetup, PASSWORD } from '../commonWalletSetup'; +import 'dotenv/config'; + +const walletPK = process.env.EMPTY_TEST_WALLET_PK as string; export default defineWalletSetup(PASSWORD, async (context, walletPage) => { const metamask = await commonMetamaskSetup({ context, walletPage }); + await metamask.importWalletFromPrivateKey(walletPK); + await addNetwork({ metamask, network: 'arbitrum' }); });