Skip to content

Commit

Permalink
Merge pull request #405 from OasisDEX/open-positions-13
Browse files Browse the repository at this point in the history
Open positions - Open position for all available pools - Part 13
  • Loading branch information
juan-langa authored Jul 11, 2024
2 parents 215933d + cb96085 commit 8f7cf9d
Show file tree
Hide file tree
Showing 11 changed files with 189 additions and 5 deletions.
5 changes: 4 additions & 1 deletion tests/sharedTestSteps/openNewPosition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/sharedTestSteps/positionManagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
Original file line number Diff line number Diff line change
@@ -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',
});
});
});
Original file line number Diff line number Diff line change
@@ -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',
});
});
});
Original file line number Diff line number Diff line change
@@ -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',
});
});
});
Original file line number Diff line number Diff line change
@@ -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',
});
});
});
Original file line number Diff line number Diff line change
@@ -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',
});
});
});
Original file line number Diff line number Diff line change
@@ -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',
});
});
});
Original file line number Diff line number Diff line change
@@ -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',
});
});
});
Original file line number Diff line number Diff line change
@@ -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',
});
});
});
75 changes: 72 additions & 3 deletions utils/testData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand Down

0 comments on commit 8f7cf9d

Please sign in to comment.