From cb96085efa56f0dfade155a7fb66deb723bc331a Mon Sep 17 00:00:00 2001 From: juan-langa Date: Thu, 11 Jul 2024 18:09:57 +0200 Subject: [PATCH] Open positions - Open position for all available pools - Part 13 --- tests/sharedTestSteps/openNewPosition.ts | 5 +- tests/sharedTestSteps/positionManagement.ts | 2 +- .../aaveV3/ethereum/aavev3Borrow_1.spec.ts | 14 ++++ .../aaveV3/ethereum/aavev3Borrow_2.spec.ts | 14 ++++ .../aaveV3/ethereum/aavev3Borrow_3.spec.ts | 14 ++++ .../aaveV3/ethereum/aavev3Borrow_4.spec.ts | 14 ++++ .../aaveV3/ethereum/aavev3Borrow_5.spec.ts | 14 ++++ .../aaveV3/ethereum/aavev3Borrow_6.spec.ts | 14 ++++ .../aaveV3/ethereum/aavev3Borrow_7.spec.ts | 14 ++++ .../aaveV3/ethereum/aavev3Borrow_8.spec.ts | 14 ++++ utils/testData.ts | 75 ++++++++++++++++++- 11 files changed, 189 insertions(+), 5 deletions(-) create mode 100644 tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_1.spec.ts create mode 100644 tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_2.spec.ts create mode 100644 tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_3.spec.ts create mode 100644 tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_4.spec.ts create mode 100644 tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_5.spec.ts create mode 100644 tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_6.spec.ts create mode 100644 tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_7.spec.ts create mode 100644 tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_8.spec.ts diff --git a/tests/sharedTestSteps/openNewPosition.ts b/tests/sharedTestSteps/openNewPosition.ts index 0da14c1..705bcbd 100644 --- a/tests/sharedTestSteps/openNewPosition.ts +++ b/tests/sharedTestSteps/openNewPosition.ts @@ -44,7 +44,10 @@ export const openNewPosition = async ({ let collToken: string = pool.split('-')[ - (network === 'ethereum' && protocol === 'aave/v3' && pool === 'WSTETH-ETH') || + (network === 'ethereum' && + protocol === 'aave/v3' && + pool === 'WSTETH-ETH' && + positionType !== 'borrow') || pool.includes('flagship') || pool.includes('steakhouse') ? 1 diff --git a/tests/sharedTestSteps/positionManagement.ts b/tests/sharedTestSteps/positionManagement.ts index e32c689..46bc24a 100644 --- a/tests/sharedTestSteps/positionManagement.ts +++ b/tests/sharedTestSteps/positionManagement.ts @@ -61,7 +61,7 @@ export const openPosition = async ({ // Setting up allowance randomly fails - Retry until it's set. await expect(async () => { - await app.position.setup.approveAllowance(); + await app.position.setup.approveAllowanceOrRetry(); await tx.confirmAndVerifySuccess({ forkId, metamaskAction: 'confirmAddToken' }); await app.position.setup.continueShouldBeVisible(); }).toPass({ timeout: longTestTimeout }); diff --git a/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_1.spec.ts b/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_1.spec.ts new file mode 100644 index 0000000..c3f7942 --- /dev/null +++ b/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_1.spec.ts @@ -0,0 +1,14 @@ +import { test } from '@playwright/test'; +import { aaveV3EthereumBorrowPools_1 } from 'utils/testData'; +import { openNewPosition } from 'tests/sharedTestSteps/openNewPosition'; + +aaveV3EthereumBorrowPools_1.forEach((pool) => { + test.describe('Aave V3 Borrow - Wallet connected', async () => { + await openNewPosition({ + network: 'ethereum', + protocol: 'aave/v3', + pool, + positionType: 'borrow', + }); + }); +}); diff --git a/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_2.spec.ts b/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_2.spec.ts new file mode 100644 index 0000000..d5dc1a8 --- /dev/null +++ b/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_2.spec.ts @@ -0,0 +1,14 @@ +import { test } from '@playwright/test'; +import { aaveV3EthereumBorrowPools_2 } from 'utils/testData'; +import { openNewPosition } from 'tests/sharedTestSteps/openNewPosition'; + +aaveV3EthereumBorrowPools_2.forEach((pool) => { + test.describe('Aave V3 Borrow - Wallet connected', async () => { + await openNewPosition({ + network: 'ethereum', + protocol: 'aave/v3', + pool, + positionType: 'borrow', + }); + }); +}); diff --git a/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_3.spec.ts b/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_3.spec.ts new file mode 100644 index 0000000..7a84a2c --- /dev/null +++ b/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_3.spec.ts @@ -0,0 +1,14 @@ +import { test } from '@playwright/test'; +import { aaveV3EthereumBorrowPools_3 } from 'utils/testData'; +import { openNewPosition } from 'tests/sharedTestSteps/openNewPosition'; + +aaveV3EthereumBorrowPools_3.forEach((pool) => { + test.describe('Aave V3 Borrow - Wallet connected', async () => { + await openNewPosition({ + network: 'ethereum', + protocol: 'aave/v3', + pool, + positionType: 'borrow', + }); + }); +}); diff --git a/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_4.spec.ts b/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_4.spec.ts new file mode 100644 index 0000000..1d74df8 --- /dev/null +++ b/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_4.spec.ts @@ -0,0 +1,14 @@ +import { test } from '@playwright/test'; +import { aaveV3EthereumBorrowPools_4 } from 'utils/testData'; +import { openNewPosition } from 'tests/sharedTestSteps/openNewPosition'; + +aaveV3EthereumBorrowPools_4.forEach((pool) => { + test.describe('Aave V3 Borrow - Wallet connected', async () => { + await openNewPosition({ + network: 'ethereum', + protocol: 'aave/v3', + pool, + positionType: 'borrow', + }); + }); +}); diff --git a/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_5.spec.ts b/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_5.spec.ts new file mode 100644 index 0000000..8a50a7f --- /dev/null +++ b/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_5.spec.ts @@ -0,0 +1,14 @@ +import { test } from '@playwright/test'; +import { aaveV3EthereumBorrowPools_5 } from 'utils/testData'; +import { openNewPosition } from 'tests/sharedTestSteps/openNewPosition'; + +aaveV3EthereumBorrowPools_5.forEach((pool) => { + test.describe('Aave V3 Borrow - Wallet connected', async () => { + await openNewPosition({ + network: 'ethereum', + protocol: 'aave/v3', + pool, + positionType: 'borrow', + }); + }); +}); diff --git a/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_6.spec.ts b/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_6.spec.ts new file mode 100644 index 0000000..e891947 --- /dev/null +++ b/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_6.spec.ts @@ -0,0 +1,14 @@ +import { test } from '@playwright/test'; +import { aaveV3EthereumBorrowPools_6 } from 'utils/testData'; +import { openNewPosition } from 'tests/sharedTestSteps/openNewPosition'; + +aaveV3EthereumBorrowPools_6.forEach((pool) => { + test.describe('Aave V3 Borrow - Wallet connected', async () => { + await openNewPosition({ + network: 'ethereum', + protocol: 'aave/v3', + pool, + positionType: 'borrow', + }); + }); +}); diff --git a/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_7.spec.ts b/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_7.spec.ts new file mode 100644 index 0000000..be15da6 --- /dev/null +++ b/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_7.spec.ts @@ -0,0 +1,14 @@ +import { test } from '@playwright/test'; +import { aaveV3EthereumBorrowPools_7 } from 'utils/testData'; +import { openNewPosition } from 'tests/sharedTestSteps/openNewPosition'; + +aaveV3EthereumBorrowPools_7.forEach((pool) => { + test.describe('Aave V3 Borrow - Wallet connected', async () => { + await openNewPosition({ + network: 'ethereum', + protocol: 'aave/v3', + pool, + positionType: 'borrow', + }); + }); +}); diff --git a/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_8.spec.ts b/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_8.spec.ts new file mode 100644 index 0000000..5ab0fa0 --- /dev/null +++ b/tests/withWallet/z_openPositions/aaveV3/ethereum/aavev3Borrow_8.spec.ts @@ -0,0 +1,14 @@ +import { test } from '@playwright/test'; +import { aaveV3EthereumBorrowPools_8 } from 'utils/testData'; +import { openNewPosition } from 'tests/sharedTestSteps/openNewPosition'; + +aaveV3EthereumBorrowPools_8.forEach((pool) => { + test.describe('Aave V3 Borrow - Wallet connected', async () => { + await openNewPosition({ + network: 'ethereum', + protocol: 'aave/v3', + pool, + positionType: 'borrow', + }); + }); +}); diff --git a/utils/testData.ts b/utils/testData.ts index 67affe3..1a8cbd7 100644 --- a/utils/testData.ts +++ b/utils/testData.ts @@ -181,6 +181,75 @@ export const aaveV3EthereumMultiplyPools_7 = [ export const aaveV3EthereumMultiplyPools_8 = ['USDC-ETH', 'USDC-WSTETH', 'USDC-WBTC', 'USDT-ETH']; +export const aaveV3EthereumBorrowPools_1 = [ + 'ETH-DAI', + 'ETH-USDC', + 'ETH-USDT', + 'ETH-GHO', + 'ETH-WBTC', +]; + +export const aaveV3EthereumBorrowPools_2 = [ + 'WBTC-DAI', + 'WBTC-USDC', + 'WBTC-USDT', + 'WBTC-LUSD', + 'WBTC-GHO', + 'WBTC-ETH', +]; + +export const aaveV3EthereumBorrowPools_3 = [ + 'WSTETH-DAI', + 'WSTETH-USDC', + 'WSTETH-USDT', + 'WSTETH-LUSD', + 'WSTETH-GHO', + 'WSTETH-RPL', + 'WSTETH-CBETH', + 'WSTETH-ETH', // Failing -> BUG - 16039 +]; + +export const aaveV3EthereumBorrowPools_4 = [ + 'RETH-DAI', + 'RETH-USDC', + 'RETH-USDT', + 'RETH-GHO', + 'RETH-ETH', + 'WEETH-GHO', +]; + +export const aaveV3EthereumBorrowPools_5 = ['CBETH-ETH', 'CBETH-USDC', 'CBETH-GHO', 'LDO-USDT']; + +export const aaveV3EthereumBorrowPools_6 = [ + 'LINK-DAI', + 'LINK-USDC', + 'LINK-USDT', + 'LINK-GHO', + 'LINK-ETH', + 'DAI-ETH', + 'DAI-MKR', + 'DAI-WBTC', +]; + +export const aaveV3EthereumBorrowPools_7 = [ + 'SDAI-WBTC', + 'SDAI-ETH', + 'SDAI-USDC', + 'SDAI-USDT', + 'SDAI-LUSD', + 'SDAI-GHO', + 'SDAI-FRAX', +]; + +export const aaveV3EthereumBorrowPools_8 = [ + 'USDC-WBTC', + 'USDC-ETH', + 'USDC-WSTETH', + 'USDC-USDT', + 'USDC-GHO', + 'USDT-ETH', +]; + export const aaveV3ArbitrumEarnPools = ['WSTETH-ETH', 'RETH-ETH', 'WEETH-ETH']; // BUG - 16013 export const aaveV3ArbitrumMultiplyPools_1 = [ @@ -297,11 +366,11 @@ export const depositAmount = { ETH: '2', EZETH: '2', FRAX: '4000', - GHO: '100', + GHO: '4000', LDO: '4000', LINK: '1000', LUSD: '4000', - MKR: '20', + MKR: '2', OP: '1000', OSETH: '2', PYUSD: '4000', @@ -315,7 +384,7 @@ export const depositAmount = { USDC_E: '4000', USDE: '4000', USDT: '4000', - WBTC: '0.3', + WBTC: '0.15', WEETH: '2', WETH: '2', WOETH: '2',