From 4418631a3dc6561a13eecd8104efa881e52f91bf Mon Sep 17 00:00:00 2001 From: juan-langa Date: Thu, 31 Oct 2024 14:23:20 +0100 Subject: [PATCH] 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' }); });