diff --git a/tests/withWallet/maker/swap/makerToAave/toAny/0_borrEthDaiToany.spec.ts b/tests/withWallet/maker/swap/makerToAave/toAny/0_borrEthDaiToany.spec.ts deleted file mode 100644 index 4ba1e76..0000000 --- a/tests/withWallet/maker/swap/makerToAave/toAny/0_borrEthDaiToany.spec.ts +++ /dev/null @@ -1,341 +0,0 @@ -import { BrowserContext, test } from '@playwright/test'; -import { resetState } from '@synthetixio/synpress/commands/synpress'; -import { metamaskSetUp } from 'utils/setup'; -import * as tenderly from 'utils/tenderly'; -import { setup } from 'utils/setup'; -import { extremelyLongTestTimeout } from 'utils/config'; -import { App } from 'src/app'; -import { openMakerPosition, swapPosition } from 'tests/sharedTestSteps/positionManagement'; - -let context: BrowserContext; -let app: App; -let forkId: string; - -// ******************************************* -// Tests seems too heavy for running in github -// stopping the run randomly -// ******************************************* -( - [ - { - colToken: 'CBETH', - debtToken: 'ETH', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[2-9].[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'CBETH', - debtToken: 'USDC', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[2-9].[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'DAI', - debtToken: 'ETH', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[2-9].[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'DAI', - debtToken: 'MKR', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[2-9].[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'DAI', - debtToken: 'WBTC', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '0.[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'ETH', - debtToken: 'DAI', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'ETH', - debtToken: 'USDC', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'ETH', - debtToken: 'USDT', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'ETH', - debtToken: 'WBTC', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '0.[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'LDO', - debtToken: 'USDT', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'LINK', - debtToken: 'DAI', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'LINK', - debtToken: 'ETH', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[2-9].[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'LINK', - debtToken: 'USDC', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'LINK', - debtToken: 'USDT', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'MKR', - debtToken: 'DAI', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'RETH', - debtToken: 'DAI', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'RETH', - debtToken: 'ETH', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[2-9].[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'RETH', - debtToken: 'USDC', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'RETH', - debtToken: 'USDT', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'SDAI', - debtToken: 'ETH', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[2-9].[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'SDAI', - debtToken: 'FRAX', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'SDAI', - debtToken: 'LUSD', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'SDAI', - debtToken: 'USDC', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'SDAI', - debtToken: 'USDT', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'SDAI', - debtToken: 'WBTC', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '0.[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'USDC', - debtToken: 'ETH', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[2-9].[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'USDC', - debtToken: 'USDT', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'USDC', - debtToken: 'WBTC', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '0.[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'USDC', - debtToken: 'WSTETH', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[2-9].[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'USDT', - debtToken: 'ETH', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[2-9].[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'WBTC', - debtToken: 'DAI', - exposure: '0.[0-9]{2}([0-9]{1,2})?', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'WBTC', - debtToken: 'ETH', - exposure: '0.[0-9]{2}([0-9]{1,2})?', - debt: '[2-9].[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'WBTC', - debtToken: 'LUSD', - exposure: '0.[0-9]{2}([0-9]{1,2})?', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'WBTC', - debtToken: 'USDC', - exposure: '0.[0-9]{2}([0-9]{1,2})?', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'WBTC', - debtToken: 'USDT', - exposure: '0.[0-9]{2}([0-9]{1,2})?', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'WSTETH', - debtToken: 'CBETH', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[2-9].[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'WSTETH', - debtToken: 'DAI', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'WSTETH', - debtToken: 'ETH', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[2-9].[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'WSTETH', - debtToken: 'LUSD', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'WSTETH', - debtToken: 'RPL', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'WSTETH', - debtToken: 'USDC', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'WSTETH', - debtToken: 'USDT', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - ] as const -).forEach((targetPool) => - test.describe.skip( - `Maker Borrow - Swap to Aave V3 ${targetPool.colToken}/${targetPool.debtToken}`, - async () => { - test.afterAll(async () => { - await tenderly.deleteFork(forkId); - - await app.page.close(); - - await context.close(); - - await resetState(); - }); - - test.use({ - viewport: { width: 1400, height: 720 }, - }); - - test(`It should swap a Maker Borrow position (ETH/DAI) to Aave V3 Multiply ${targetPool.colToken}/${targetPool.debtToken})`, async () => { - test.info().annotations.push({ - type: 'Test case', - description: 'xxx', - }); - - test.setTimeout(extremelyLongTestTimeout); - - await test.step('Test setup', async () => { - ({ context } = await metamaskSetUp({ network: 'mainnet' })); - let page = await context.newPage(); - app = new App(page); - - ({ forkId } = await setup({ - app, - network: 'mainnet', - extraFeaturesFlags: 'MakerTenderly:true EnableRefinance:true', - })); - }); - - await app.page.goto('/vaults/open/ETH-C'); - - // Depositing collateral too quickly after loading page returns wrong simulation results - await app.position.overview.waitForComponentToBeStable({ positionType: 'Maker' }); - - await openMakerPosition({ - app, - forkId, - deposit: { token: 'ETH', amount: '10' }, - generate: { token: 'DAI', amount: '15000' }, - }); - - await swapPosition({ - app, - forkId, - reason: 'Switch to lower my cost', - originalProtocol: 'Maker', - targetProtocol: 'Aave V3', - targetPool: { colToken: targetPool.colToken, debtToken: targetPool.debtToken }, - verifyPositions: { - originalPosition: { type: 'Borrow', collateralToken: 'ETH', debtToken: 'DAI' }, - targetPosition: { - exposure: { amount: targetPool.exposure, token: targetPool.colToken }, - debt: { amount: targetPool.debt, token: targetPool.debtToken }, - }, - }, - }); - }); - } - ) -); diff --git a/tests/withWallet/maker/swap/makerToAave/toAny/borrWbtcDaiToAny1.spec.ts b/tests/withWallet/maker/swap/makerToAave/toAny/borrEthDaiToAny1.spec.ts similarity index 87% rename from tests/withWallet/maker/swap/makerToAave/toAny/borrWbtcDaiToAny1.spec.ts rename to tests/withWallet/maker/swap/makerToAave/toAny/borrEthDaiToAny1.spec.ts index c5b7e7d..b4b0b48 100644 --- a/tests/withWallet/maker/swap/makerToAave/toAny/borrWbtcDaiToAny1.spec.ts +++ b/tests/withWallet/maker/swap/makerToAave/toAny/borrEthDaiToAny1.spec.ts @@ -10,7 +10,6 @@ import { openMakerPosition, swapPosition } from 'tests/sharedTestSteps/positionM let context: BrowserContext; let app: App; let forkId: string; -let walletAddress: string; test.describe.configure({ mode: 'serial' }); @@ -43,22 +42,14 @@ test.describe('Maker Borrow - Swap to Aave V3', async () => { let page = await context.newPage(); app = new App(page); - ({ forkId, walletAddress } = await setup({ + ({ forkId } = await setup({ app, network: 'mainnet', extraFeaturesFlags: 'MakerTenderly:true', })); - - await tenderly.setTokenBalance({ - forkId, - walletAddress, - network: 'mainnet', - token: 'WBTC', - balance: '20', - }); }); - await app.page.goto('vaults/open/WBTC-C'); + await app.page.goto('vaults/open/ETH-C'); // Depositing collateral too quickly after loading page returns wrong simulation results await app.position.overview.waitForComponentToBeStable({ positionType: 'Maker' }); @@ -66,7 +57,7 @@ test.describe('Maker Borrow - Swap to Aave V3', async () => { await openMakerPosition({ app, forkId, - deposit: { token: 'WBTC', amount: '0.2' }, + deposit: { token: 'ETH', amount: '10' }, generate: { token: 'DAI', amount: '5000' }, }); @@ -96,7 +87,7 @@ test.describe('Maker Borrow - Swap to Aave V3', async () => { // { colToken: 'LDO', debtToken: 'USDT' }, // BUG - 15943 - NOT working ] as const ).forEach((targetPool) => - test(`It should swap a Maker Borrow position (WBTC/DAI) to Aave V3 Multiply (${targetPool.colToken}/${targetPool.debtToken})`, async () => { + test(`It should swap a Maker Borrow position (ETH/DAI) to Aave V3 Multiply (${targetPool.colToken}/${targetPool.debtToken})`, async () => { test.info().annotations.push({ type: 'Test case', description: 'xxx', diff --git a/tests/withWallet/maker/swap/makerToAave/toAny/borrWbtcDaiToAny2.spec.ts b/tests/withWallet/maker/swap/makerToAave/toAny/borrEthDaiToAny2.spec.ts similarity index 85% rename from tests/withWallet/maker/swap/makerToAave/toAny/borrWbtcDaiToAny2.spec.ts rename to tests/withWallet/maker/swap/makerToAave/toAny/borrEthDaiToAny2.spec.ts index fb233a9..f9c5413 100644 --- a/tests/withWallet/maker/swap/makerToAave/toAny/borrWbtcDaiToAny2.spec.ts +++ b/tests/withWallet/maker/swap/makerToAave/toAny/borrEthDaiToAny2.spec.ts @@ -10,7 +10,6 @@ import { openMakerPosition, swapPosition } from 'tests/sharedTestSteps/positionM let context: BrowserContext; let app: App; let forkId: string; -let walletAddress: string; test.describe.configure({ mode: 'serial' }); @@ -43,22 +42,14 @@ test.describe('Maker Borrow - Swap to Aave V3', async () => { let page = await context.newPage(); app = new App(page); - ({ forkId, walletAddress } = await setup({ + ({ forkId } = await setup({ app, network: 'mainnet', extraFeaturesFlags: 'MakerTenderly:true EnableRefinance:true', })); - - await tenderly.setTokenBalance({ - forkId, - walletAddress, - network: 'mainnet', - token: 'WBTC', - balance: '20', - }); }); - await app.page.goto('vaults/open/WBTC-C'); + await app.page.goto('vaults/open/ETH-C'); // Depositing collateral too quickly after loading page returns wrong simulation results await app.position.overview.waitForComponentToBeStable({ positionType: 'Maker' }); @@ -66,7 +57,7 @@ test.describe('Maker Borrow - Swap to Aave V3', async () => { await openMakerPosition({ app, forkId, - deposit: { token: 'WBTC', amount: '0.2' }, + deposit: { token: 'ETH', amount: '10' }, generate: { token: 'DAI', amount: '5000' }, }); @@ -89,14 +80,14 @@ test.describe('Maker Borrow - Swap to Aave V3', async () => { { colToken: 'LINK', debtToken: 'ETH' }, { colToken: 'LINK', debtToken: 'USDC' }, { colToken: 'LINK', debtToken: 'USDT' }, - { colToken: 'MKR', debtToken: 'DAI' }, { colToken: 'RETH', debtToken: 'DAI' }, { colToken: 'RETH', debtToken: 'USDC' }, { colToken: 'RETH', debtToken: 'USDT' }, { colToken: 'SDAI', debtToken: 'ETH' }, + // { colToken: 'MKR', debtToken: 'DAI' }, -- Aave MKR very close to supply cap ] as const ).forEach((targetPool) => - test(`It should swap a Maker Borrow position (WBTC/DAI) to Aave V3 Multiply (${targetPool.colToken}/${targetPool.debtToken})`, async () => { + test(`It should swap a Maker Borrow position (ETH/DAI) to Aave V3 Multiply (${targetPool.colToken}/${targetPool.debtToken})`, async () => { test.info().annotations.push({ type: 'Test case', description: 'xxx', diff --git a/tests/withWallet/maker/swap/makerToAave/toAny/borrWbtcDaiToAny3.spec.ts b/tests/withWallet/maker/swap/makerToAave/toAny/borrEthDaiToAny3.spec.ts similarity index 87% rename from tests/withWallet/maker/swap/makerToAave/toAny/borrWbtcDaiToAny3.spec.ts rename to tests/withWallet/maker/swap/makerToAave/toAny/borrEthDaiToAny3.spec.ts index 716d6e6..6bbc05c 100644 --- a/tests/withWallet/maker/swap/makerToAave/toAny/borrWbtcDaiToAny3.spec.ts +++ b/tests/withWallet/maker/swap/makerToAave/toAny/borrEthDaiToAny3.spec.ts @@ -10,7 +10,6 @@ import { openMakerPosition, swapPosition } from 'tests/sharedTestSteps/positionM let context: BrowserContext; let app: App; let forkId: string; -let walletAddress: string; test.describe.configure({ mode: 'serial' }); @@ -43,22 +42,14 @@ test.describe('Maker Borrow - Swap to Aave V3', async () => { let page = await context.newPage(); app = new App(page); - ({ forkId, walletAddress } = await setup({ + ({ forkId } = await setup({ app, network: 'mainnet', extraFeaturesFlags: 'MakerTenderly:true EnableRefinance:true', })); - - await tenderly.setTokenBalance({ - forkId, - walletAddress, - network: 'mainnet', - token: 'WBTC', - balance: '20', - }); }); - await app.page.goto('vaults/open/WBTC-C'); + await app.page.goto('vaults/open/ETH-C'); // Depositing collateral too quickly after loading page returns wrong simulation results await app.position.overview.waitForComponentToBeStable({ positionType: 'Maker' }); @@ -66,7 +57,7 @@ test.describe('Maker Borrow - Swap to Aave V3', async () => { await openMakerPosition({ app, forkId, - deposit: { token: 'WBTC', amount: '0.2' }, + deposit: { token: 'ETH', amount: '10' }, generate: { token: 'DAI', amount: '5000' }, }); @@ -96,7 +87,7 @@ test.describe('Maker Borrow - Swap to Aave V3', async () => { { colToken: 'USDC', debtToken: 'WSTETH' }, ] as const ).forEach((targetPool) => - test(`It should swap a Maker Borrow position (WBTC/DAI) to Aave V3 Multiply (${targetPool.colToken}/${targetPool.debtToken})`, async () => { + test(`It should swap a Maker Borrow position (ETH/DAI) to Aave V3 Multiply (${targetPool.colToken}/${targetPool.debtToken})`, async () => { test.info().annotations.push({ type: 'Test case', description: 'xxx', diff --git a/tests/withWallet/maker/swap/makerToAave/toAny/borrWbtcDaiToAny4.spec.ts b/tests/withWallet/maker/swap/makerToAave/toAny/borrEthDaiToAny4.spec.ts similarity index 86% rename from tests/withWallet/maker/swap/makerToAave/toAny/borrWbtcDaiToAny4.spec.ts rename to tests/withWallet/maker/swap/makerToAave/toAny/borrEthDaiToAny4.spec.ts index 836e0e7..74dddc9 100644 --- a/tests/withWallet/maker/swap/makerToAave/toAny/borrWbtcDaiToAny4.spec.ts +++ b/tests/withWallet/maker/swap/makerToAave/toAny/borrEthDaiToAny4.spec.ts @@ -10,7 +10,6 @@ import { openMakerPosition, swapPosition } from 'tests/sharedTestSteps/positionM let context: BrowserContext; let app: App; let forkId: string; -let walletAddress: string; test.describe.configure({ mode: 'serial' }); @@ -43,22 +42,14 @@ test.describe('Maker Borrow - Swap to Aave V3', async () => { let page = await context.newPage(); app = new App(page); - ({ forkId, walletAddress } = await setup({ + ({ forkId } = await setup({ app, network: 'mainnet', extraFeaturesFlags: 'MakerTenderly:true EnableRefinance:true', })); - - await tenderly.setTokenBalance({ - forkId, - walletAddress, - network: 'mainnet', - token: 'WBTC', - balance: '20', - }); }); - await app.page.goto('vaults/open/WBTC-C'); + await app.page.goto('vaults/open/ETH-C'); // Depositing collateral too quickly after loading page returns wrong simulation results await app.position.overview.waitForComponentToBeStable({ positionType: 'Maker' }); @@ -66,7 +57,7 @@ test.describe('Maker Borrow - Swap to Aave V3', async () => { await openMakerPosition({ app, forkId, - deposit: { token: 'WBTC', amount: '0.2' }, + deposit: { token: 'ETH', amount: '10' }, generate: { token: 'DAI', amount: '5000' }, }); @@ -86,13 +77,13 @@ test.describe('Maker Borrow - Swap to Aave V3', async () => { ( [ { colToken: 'WBTC', debtToken: 'DAI' }, - { colToken: 'WBTC', debtToken: 'ETH' }, { colToken: 'WBTC', debtToken: 'LUSD' }, { colToken: 'WBTC', debtToken: 'USDC' }, { colToken: 'WBTC', debtToken: 'USDT' }, + { colToken: 'WBTC', debtToken: 'ETH' }, ] as const ).forEach((targetPool) => - test(`It should swap a Maker Borrow position (WBTC/DAI) to Aave V3 Multiply (${targetPool.colToken}/${targetPool.debtToken})`, async () => { + test(`It should swap a Maker Borrow position (ETH/DAI) to Aave V3 Multiply (${targetPool.colToken}/${targetPool.debtToken})`, async () => { test.info().annotations.push({ type: 'Test case', description: 'xxx', diff --git a/tests/withWallet/maker/swap/makerToAave/toAny/borrWbtcDaiToAny5.spec.ts b/tests/withWallet/maker/swap/makerToAave/toAny/borrEthDaiToAny5.spec.ts similarity index 86% rename from tests/withWallet/maker/swap/makerToAave/toAny/borrWbtcDaiToAny5.spec.ts rename to tests/withWallet/maker/swap/makerToAave/toAny/borrEthDaiToAny5.spec.ts index 905cf40..ac4262b 100644 --- a/tests/withWallet/maker/swap/makerToAave/toAny/borrWbtcDaiToAny5.spec.ts +++ b/tests/withWallet/maker/swap/makerToAave/toAny/borrEthDaiToAny5.spec.ts @@ -10,7 +10,6 @@ import { openMakerPosition, swapPosition } from 'tests/sharedTestSteps/positionM let context: BrowserContext; let app: App; let forkId: string; -let walletAddress: string; test.describe.configure({ mode: 'serial' }); @@ -43,22 +42,14 @@ test.describe('Maker Borrow - Swap to Aave V3', async () => { let page = await context.newPage(); app = new App(page); - ({ forkId, walletAddress } = await setup({ + ({ forkId } = await setup({ app, network: 'mainnet', extraFeaturesFlags: 'MakerTenderly:true EnableRefinance:true', })); - - await tenderly.setTokenBalance({ - forkId, - walletAddress, - network: 'mainnet', - token: 'WBTC', - balance: '20', - }); }); - await app.page.goto('vaults/open/WBTC-C'); + await app.page.goto('vaults/open/ETH-C'); // Depositing collateral too quickly after loading page returns wrong simulation results await app.position.overview.waitForComponentToBeStable({ positionType: 'Maker' }); @@ -66,7 +57,7 @@ test.describe('Maker Borrow - Swap to Aave V3', async () => { await openMakerPosition({ app, forkId, - deposit: { token: 'WBTC', amount: '0.2' }, + deposit: { token: 'ETH', amount: '10' }, generate: { token: 'DAI', amount: '5000' }, }); @@ -94,7 +85,7 @@ test.describe('Maker Borrow - Swap to Aave V3', async () => { // { colToken: 'WSTETH', debtToken: 'GHO' }, - NO LIQUIDITY - GHO ] as const ).forEach((targetPool) => - test(`It should swap a Maker Borrow position (WBTC/DAI) to Aave V3 Multiply (${targetPool.colToken}/${targetPool.debtToken})`, async () => { + test(`It should swap a Maker Borrow position (ETH/DAI) to Aave V3 Multiply (${targetPool.colToken}/${targetPool.debtToken})`, async () => { test.info().annotations.push({ type: 'Test case', description: 'xxx', diff --git a/tests/withWallet/maker/swap/makerToAave/toAny/borrWstethDaiToAny.spec.ts b/tests/withWallet/maker/swap/makerToAave/toAny/borrWstethDaiToAny.spec.ts deleted file mode 100644 index 2a067da..0000000 --- a/tests/withWallet/maker/swap/makerToAave/toAny/borrWstethDaiToAny.spec.ts +++ /dev/null @@ -1,157 +0,0 @@ -import { BrowserContext, test } from '@playwright/test'; -import { resetState } from '@synthetixio/synpress/commands/synpress'; -import { metamaskSetUp } from 'utils/setup'; -import * as tenderly from 'utils/tenderly'; -import { setup } from 'utils/setup'; -import { extremelyLongTestTimeout, longTestTimeout } from 'utils/config'; -import { App } from 'src/app'; -import { openMakerPosition, swapPosition } from 'tests/sharedTestSteps/positionManagement'; - -let context: BrowserContext; -let app: App; -let forkId: string; -let walletAddress: string; - -test.describe.configure({ mode: 'serial' }); - -// TO BE SPLIT in 4x files -test.describe.skip('Maker Borrow - Swap to Aave V3', async () => { - test.afterAll(async () => { - await tenderly.deleteFork(forkId); - - await app.page.close(); - - await context.close(); - - await resetState(); - }); - - test.use({ - viewport: { width: 1400, height: 720 }, - }); - - // Create a Maker position as part of the Swap tests setup - test('It should open a Maker Borrow position', async () => { - test.info().annotations.push({ - type: 'Test case', - description: '11788, 11790', - }); - - test.setTimeout(extremelyLongTestTimeout); - - await test.step('Test setup', async () => { - ({ context } = await metamaskSetUp({ network: 'mainnet' })); - let page = await context.newPage(); - app = new App(page); - - ({ forkId, walletAddress } = await setup({ - app, - network: 'mainnet', - extraFeaturesFlags: 'MakerTenderly:true EnableRefinance:true', - })); - - await tenderly.setTokenBalance({ - forkId, - walletAddress, - network: 'mainnet', - token: 'WSTETH', - balance: '100', - }); - }); - - await app.page.goto('/vaults/open/WSTETH-B'); - - // Depositing collateral too quickly after loading page returns wrong simulation results - await app.position.overview.waitForComponentToBeStable({ positionType: 'Maker' }); - - await openMakerPosition({ - app, - forkId, - deposit: { token: 'WSTETH', amount: '10' }, - generate: { token: 'DAI', amount: '15000' }, - }); - - await app.page.waitForTimeout(3000); - - await swapPosition({ - app, - forkId, - reason: 'Change direction of my position', - originalProtocol: 'Maker', - targetProtocol: 'Aave V3', - targetPool: { colToken: 'SDAI', debtToken: 'ETH' }, - upToStep5: true, - }); - }); - - ( - [ - { colToken: 'CBETH', debtToken: 'ETH' }, - { colToken: 'CBETH', debtToken: 'USDC' }, - { colToken: 'DAI', debtToken: 'ETH' }, - { colToken: 'DAI', debtToken: 'MKR' }, - { colToken: 'DAI', debtToken: 'WBTC' }, - { colToken: 'ETH', debtToken: 'DAI' }, - { colToken: 'ETH', debtToken: 'USDC' }, - { colToken: 'ETH', debtToken: 'USDT' }, - { colToken: 'ETH', debtToken: 'WBTC' }, - { colToken: 'LDO', debtToken: 'USDT' }, - { colToken: 'LINK', debtToken: 'DAI' }, - { colToken: 'LINK', debtToken: 'ETH' }, - { colToken: 'LINK', debtToken: 'USDC' }, - { colToken: 'LINK', debtToken: 'USDT' }, - { colToken: 'MKR', debtToken: 'DAI' }, - { colToken: 'RETH', debtToken: 'DAI' }, - { colToken: 'RETH', debtToken: 'ETH' }, - { colToken: 'RETH', debtToken: 'USDC' }, - { colToken: 'RETH', debtToken: 'USDT' }, - { colToken: 'SDAI', debtToken: 'ETH' }, - { colToken: 'SDAI', debtToken: 'FRAX' }, - { colToken: 'SDAI', debtToken: 'LUSD' }, - { colToken: 'SDAI', debtToken: 'USDC' }, - { colToken: 'SDAI', debtToken: 'USDT' }, - { colToken: 'SDAI', debtToken: 'WBTC' }, - { colToken: 'USDC', debtToken: 'ETH' }, - { colToken: 'USDC', debtToken: 'USDT' }, - { colToken: 'USDC', debtToken: 'WBTC' }, - { colToken: 'USDC', debtToken: 'WSTETH' }, - { colToken: 'USDT', debtToken: 'ETH' }, - { colToken: 'WBTC', debtToken: 'DAI' }, - { colToken: 'WBTC', debtToken: 'ETH' }, - { colToken: 'WBTC', debtToken: 'LUSD' }, - { colToken: 'WBTC', debtToken: 'USDC' }, - { colToken: 'WBTC', debtToken: 'USDT' }, - { colToken: 'WSTETH', debtToken: 'CBETH' }, - { colToken: 'WSTETH', debtToken: 'DAI' }, - { colToken: 'WSTETH', debtToken: 'ETH' }, - { colToken: 'WSTETH', debtToken: 'LUSD' }, - { colToken: 'WSTETH', debtToken: 'RPL' }, - { colToken: 'WSTETH', debtToken: 'USDC' }, - { colToken: 'WSTETH', debtToken: 'USDT' }, - ] as const - ).forEach((targetPool) => - test(`It should swap a Maker Borrow position (WSTETH/DAI) to Aave V3 Multiply (${targetPool.colToken}/${targetPool.debtToken})`, async () => { - test.info().annotations.push({ - type: 'Test case', - description: 'xxx', - }); - - test.setTimeout(longTestTimeout); - - // Wait an reload to avoid flakiness - await app.page.waitForTimeout(1000); - await app.page.reload(); - - await swapPosition({ - app, - forkId, - reason: 'Switch to higher max Loan To Value', - originalProtocol: 'Maker', - targetProtocol: 'Aave V3', - targetPool: { colToken: targetPool.colToken, debtToken: targetPool.debtToken }, - existingDpmAndApproval: true, - rejectSwap: true, - }); - }) - ); -}); diff --git a/tests/withWallet/maker/swap/makerToAave/toAny/multEthDaiToAny.spec.ts b/tests/withWallet/maker/swap/makerToAave/toAny/multEthDaiToAny.spec.ts deleted file mode 100644 index 08adb6f..0000000 --- a/tests/withWallet/maker/swap/makerToAave/toAny/multEthDaiToAny.spec.ts +++ /dev/null @@ -1,151 +0,0 @@ -import { BrowserContext, test } from '@playwright/test'; -import { resetState } from '@synthetixio/synpress/commands/synpress'; -import { metamaskSetUp } from 'utils/setup'; -import * as tenderly from 'utils/tenderly'; -import { setup } from 'utils/setup'; -import { extremelyLongTestTimeout, longTestTimeout } from 'utils/config'; -import { App } from 'src/app'; -import { openMakerPosition, swapPosition } from 'tests/sharedTestSteps/positionManagement'; - -let context: BrowserContext; -let app: App; -let forkId: string; -let positionPage: string; - -test.describe.configure({ mode: 'serial' }); - -// TO BE SPLIT in 4x files -test.describe.skip('Maker Multiply - Swap to Aave V3', async () => { - test.afterAll(async () => { - await tenderly.deleteFork(forkId); - - await app.page.close(); - - await context.close(); - - await resetState(); - }); - - test.use({ - viewport: { width: 1400, height: 720 }, - }); - - // Create a Maker position as part of the Swap tests setup - test('Test setup - Open Maker Mutiply position and start Swap process', async () => { - test.info().annotations.push({ - type: 'Test case', - description: '11788, 11790', - }); - - test.setTimeout(extremelyLongTestTimeout); - - await test.step('Test setup', async () => { - ({ context } = await metamaskSetUp({ network: 'mainnet' })); - let page = await context.newPage(); - app = new App(page); - - ({ forkId } = await setup({ - app, - network: 'mainnet', - extraFeaturesFlags: 'MakerTenderly:true EnableRefinance:true', - })); - }); - - await app.position.openPage('/vaults/open-multiply/ETH-C', { positionType: 'Maker' }); - - // Depositing collateral too quickly after loading page returns wrong simulation results - await app.position.overview.waitForComponentToBeStable({ positionType: 'Maker' }); - - await openMakerPosition({ - app, - forkId, - deposit: { token: 'ETH', amount: '10' }, - }); - - await app.page.waitForTimeout(3000); - - await swapPosition({ - app, - forkId, - reason: 'Change direction of my position', - originalProtocol: 'Maker', - targetProtocol: 'Aave V3', - targetPool: { colToken: 'SDAI', debtToken: 'ETH' }, - upToStep5: true, - }); - - // Needed for 'next' swap test - positionPage = app.page.url(); - }); - - ( - [ - { colToken: 'CBETH', debtToken: 'ETH' }, - { colToken: 'CBETH', debtToken: 'USDC' }, - { colToken: 'DAI', debtToken: 'ETH' }, - { colToken: 'DAI', debtToken: 'MKR' }, - { colToken: 'DAI', debtToken: 'WBTC' }, - { colToken: 'ETH', debtToken: 'DAI' }, - { colToken: 'ETH', debtToken: 'USDC' }, - { colToken: 'ETH', debtToken: 'USDT' }, - { colToken: 'ETH', debtToken: 'WBTC' }, - { colToken: 'LDO', debtToken: 'USDT' }, - { colToken: 'LINK', debtToken: 'DAI' }, - { colToken: 'LINK', debtToken: 'ETH' }, - { colToken: 'LINK', debtToken: 'USDC' }, - { colToken: 'LINK', debtToken: 'USDT' }, - { colToken: 'MKR', debtToken: 'DAI' }, - { colToken: 'RETH', debtToken: 'DAI' }, - { colToken: 'RETH', debtToken: 'ETH' }, - { colToken: 'RETH', debtToken: 'USDC' }, - { colToken: 'RETH', debtToken: 'USDT' }, - { colToken: 'SDAI', debtToken: 'ETH' }, - { colToken: 'SDAI', debtToken: 'FRAX' }, - { colToken: 'SDAI', debtToken: 'LUSD' }, - { colToken: 'SDAI', debtToken: 'USDC' }, - { colToken: 'SDAI', debtToken: 'USDT' }, - { colToken: 'SDAI', debtToken: 'WBTC' }, - { colToken: 'USDC', debtToken: 'ETH' }, - { colToken: 'USDC', debtToken: 'USDT' }, - { colToken: 'USDC', debtToken: 'WBTC' }, - { colToken: 'USDC', debtToken: 'WSTETH' }, - { colToken: 'USDT', debtToken: 'ETH' }, - { colToken: 'WBTC', debtToken: 'DAI' }, - { colToken: 'WBTC', debtToken: 'ETH' }, - { colToken: 'WBTC', debtToken: 'LUSD' }, - { colToken: 'WBTC', debtToken: 'USDC' }, - { colToken: 'WBTC', debtToken: 'USDT' }, - { colToken: 'WSTETH', debtToken: 'CBETH' }, - { colToken: 'WSTETH', debtToken: 'DAI' }, - { colToken: 'WSTETH', debtToken: 'ETH' }, - { colToken: 'WSTETH', debtToken: 'LUSD' }, - { colToken: 'WSTETH', debtToken: 'RPL' }, - { colToken: 'WSTETH', debtToken: 'USDC' }, - { colToken: 'WSTETH', debtToken: 'USDT' }, - ] as const - ).forEach((targetPool) => - test(`It should swap a Maker Multiply position (ETH/DAI) to Aave V3 Multiply (${targetPool.colToken}/${targetPool.debtToken})`, async () => { - test.info().annotations.push({ - type: 'Test case', - description: 'xxx', - }); - - test.setTimeout(longTestTimeout); - - // Wait an reload to avoid flakiness - await app.page.waitForTimeout(1000); - await app.position.openPage(positionPage, { tab: 'Overview' }); - - await swapPosition({ - app, - forkId, - reason: 'Switch to higher max Loan To Value', - originalProtocol: 'Maker', - targetProtocol: 'Aave V3', - targetPool: { colToken: targetPool.colToken, debtToken: targetPool.debtToken }, - existingDpmAndApproval: true, - rejectSwap: true, - }); - }) - ); -}); diff --git a/tests/withWallet/maker/swap/makerToMorpho/toAny/0_borrEthDaiToany.spec.ts b/tests/withWallet/maker/swap/makerToMorpho/toAny/0_borrEthDaiToany.spec.ts deleted file mode 100644 index b41fd8c..0000000 --- a/tests/withWallet/maker/swap/makerToMorpho/toAny/0_borrEthDaiToany.spec.ts +++ /dev/null @@ -1,203 +0,0 @@ -import { BrowserContext, test } from '@playwright/test'; -import { resetState } from '@synthetixio/synpress/commands/synpress'; -import { metamaskSetUp } from 'utils/setup'; -import * as tenderly from 'utils/tenderly'; -import { setup } from 'utils/setup'; -import { extremelyLongTestTimeout } from 'utils/config'; -import { App } from 'src/app'; -import { openMakerPosition, swapPosition } from 'tests/sharedTestSteps/positionManagement'; - -let context: BrowserContext; -let app: App; -let forkId: string; - -// ************************************************* -// Tests seems to be too heavy for running in github -// stopping the run randomly -// ************************************************* -( - [ - { - colToken: 'EZETH', - debtToken: 'ETH', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[2-9].[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'OSETH', - debtToken: 'ETH', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[2-9].[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'SUSDE', - debtToken: 'DAI-1', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'SUSDE', - debtToken: 'DAI-2', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'SUSDE', - debtToken: 'DAI-3', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'SUSDE', - debtToken: 'DAI-4', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'SUSDE', - debtToken: 'USDT', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'USDE', - debtToken: 'DAI-1', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'USDE', - debtToken: 'DAI-2', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'USDE', - debtToken: 'DAI-3', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'USDE', - debtToken: 'DAI-4', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'WBTC', - debtToken: 'USDC', - exposure: '0.[0-9]{2}([0-9]{1,2})?', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'WBTC', - debtToken: 'USDT', - exposure: '0.[0-9]{2}([0-9]{1,2})?', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'WEETH', - debtToken: 'ETH', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[2-9].[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'WSTETH', - debtToken: 'ETH-1', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[2-9].[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'WSTETH', - debtToken: 'ETH-2', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[2-9].[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'WSTETH', - debtToken: 'ETH-3', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[2-9].[0-9]{2}([0-9]{1,2})?', - }, - { - colToken: 'WSTETH', - debtToken: 'USDC', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'WSTETH', - debtToken: 'USDT', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - ] as const -).forEach((targetPool) => - test.describe.skip( - `Maker Borrow - Swap to Morpho ${targetPool.colToken}/${targetPool.debtToken}`, - async () => { - test.afterAll(async () => { - await tenderly.deleteFork(forkId); - - await app.page.close(); - - await context.close(); - - await resetState(); - }); - - test.use({ - viewport: { width: 1400, height: 720 }, - }); - - test(`It should swap a Maker Borrow position (ETH/DAI) to Morpho Multiply ${targetPool.colToken}/${targetPool.debtToken})`, async () => { - test.info().annotations.push({ - type: 'Test case', - description: 'xxx', - }); - - test.setTimeout(extremelyLongTestTimeout); - - await test.step('Test setup', async () => { - ({ context } = await metamaskSetUp({ network: 'mainnet' })); - let page = await context.newPage(); - app = new App(page); - - ({ forkId } = await setup({ - app, - network: 'mainnet', - extraFeaturesFlags: 'MakerTenderly:true EnableRefinance:true', - })); - }); - - await app.page.goto('/vaults/open/ETH-C'); - - // Depositing collateral too quickly after loading page returns wrong simulation results - await app.position.overview.waitForComponentToBeStable({ positionType: 'Maker' }); - - await openMakerPosition({ - app, - forkId, - deposit: { token: 'ETH', amount: '10' }, - generate: { token: 'DAI', amount: '15000' }, - }); - - await swapPosition({ - app, - forkId, - reason: 'Switch to lower my cost', - originalProtocol: 'Maker', - targetProtocol: 'Morpho', - targetPool: { colToken: targetPool.colToken, debtToken: targetPool.debtToken }, - verifyPositions: { - originalPosition: { type: 'Borrow', collateralToken: 'ETH', debtToken: 'DAI' }, - targetPosition: { - exposure: { amount: targetPool.exposure, token: targetPool.colToken }, - debt: { amount: targetPool.debt, token: targetPool.debtToken }, - }, - }, - }); - }); - } - ) -); diff --git a/tests/withWallet/maker/swap/makerToMorpho/toAny/borrWbtcDaiToAny.spec.ts b/tests/withWallet/maker/swap/makerToMorpho/toAny/borrWbtcDaiToAny.spec.ts deleted file mode 100644 index 0e73416..0000000 --- a/tests/withWallet/maker/swap/makerToMorpho/toAny/borrWbtcDaiToAny.spec.ts +++ /dev/null @@ -1,124 +0,0 @@ -import { BrowserContext, test } from '@playwright/test'; -import { resetState } from '@synthetixio/synpress/commands/synpress'; -import { metamaskSetUp } from 'utils/setup'; -import * as tenderly from 'utils/tenderly'; -import { setup } from 'utils/setup'; -import { extremelyLongTestTimeout, longTestTimeout } from 'utils/config'; -import { App } from 'src/app'; -import { openMakerPosition, swapPosition } from 'tests/sharedTestSteps/positionManagement'; - -let context: BrowserContext; -let app: App; -let forkId: string; -let walletAddress: string; - -test.describe.configure({ mode: 'serial' }); - -test.describe('Maker Borrow - Swap to Morpho', async () => { - test.afterAll(async () => { - await tenderly.deleteFork(forkId); - - await app.page.close(); - - await context.close(); - - await resetState(); - }); - - test.use({ - viewport: { width: 1400, height: 720 }, - }); - - // Create a Maker position as part of the Swap tests setup - test('Test setup - Open Maker Borrow position and start Swap process', async () => { - test.info().annotations.push({ - type: 'Test case', - description: '11788, 11790', - }); - - test.setTimeout(extremelyLongTestTimeout); - - await test.step('Test setup', async () => { - ({ context } = await metamaskSetUp({ network: 'mainnet' })); - let page = await context.newPage(); - app = new App(page); - - ({ forkId, walletAddress } = await setup({ - app, - network: 'mainnet', - extraFeaturesFlags: 'MakerTenderly:true EnableRefinance:true', - })); - - await tenderly.setTokenBalance({ - forkId, - walletAddress, - network: 'mainnet', - token: 'WBTC', - balance: '20', - }); - }); - - await app.page.goto('vaults/open/WBTC-C'); - - // Depositing collateral too quickly after loading page returns wrong simulation results - await app.position.overview.waitForComponentToBeStable({ positionType: 'Maker' }); - - await openMakerPosition({ - app, - forkId, - deposit: { token: 'WBTC', amount: '0.2' }, - generate: { token: 'DAI', amount: '5000' }, - }); - - await app.page.waitForTimeout(3000); - - await swapPosition({ - app, - forkId, - reason: 'Switch to higher max Loan To Value', - originalProtocol: 'Maker', - targetProtocol: 'Morpho', - targetPool: { colToken: 'WSTETH', debtToken: 'USDC' }, - upToStep5: true, - }); - }); - - ( - [ - { colToken: 'EZETH', debtToken: 'ETH' }, - { colToken: 'SUSDE', debtToken: 'DAI-1' }, - { colToken: 'SUSDE', debtToken: 'DAI-2' }, - { colToken: 'SUSDE', debtToken: 'USDT' }, - { colToken: 'USDE', debtToken: 'DAI-3' }, - // { colToken: 'USDE', debtToken: 'DAI-4' }, - { colToken: 'WBTC', debtToken: 'USDC' }, - { colToken: 'WSTETH', debtToken: 'ETH-1' }, - { colToken: 'WSTETH', debtToken: 'ETH-3' }, - { colToken: 'WSTETH', debtToken: 'USDC' }, - ] as const - ).forEach((targetPool) => - test(`It should swap a Maker Borrow position (WBTC/DAI) to Morpho Multiply (${targetPool.colToken}/${targetPool.debtToken})`, async () => { - test.info().annotations.push({ - type: 'Test case', - description: 'xxx', - }); - - test.setTimeout(longTestTimeout); - - // Wait an reload to avoid flakiness - await app.page.waitForTimeout(1000); - await app.page.reload(); - - await swapPosition({ - app, - forkId, - reason: 'Switch to higher max Loan To Value', - originalProtocol: 'Maker', - targetProtocol: 'Morpho', - targetPool: { colToken: targetPool.colToken, debtToken: targetPool.debtToken }, - existingDpmAndApproval: true, - rejectSwap: true, - }); - }) - ); -}); diff --git a/tests/withWallet/maker/swap/makerToSpark/toAny/0_borrEthDaiToany.spec.ts b/tests/withWallet/maker/swap/makerToSpark/toAny/0_borrEthDaiToany.spec.ts deleted file mode 100644 index 4254919..0000000 --- a/tests/withWallet/maker/swap/makerToSpark/toAny/0_borrEthDaiToany.spec.ts +++ /dev/null @@ -1,112 +0,0 @@ -import { BrowserContext, test } from '@playwright/test'; -import { resetState } from '@synthetixio/synpress/commands/synpress'; -import { metamaskSetUp } from 'utils/setup'; -import * as tenderly from 'utils/tenderly'; -import { setup } from 'utils/setup'; -import { extremelyLongTestTimeout } from 'utils/config'; -import { App } from 'src/app'; -import { openMakerPosition, swapPosition } from 'tests/sharedTestSteps/positionManagement'; - -let context: BrowserContext; -let app: App; -let forkId: string; - -( - [ - { - colToken: 'ETH', - debtToken: 'DAI', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'WBTC', - debtToken: 'DAI', - exposure: '0.[0-9]{2}([0-9]{1,2})?', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'WSTETH', - debtToken: 'DAI', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'RETH', - debtToken: 'DAI', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'SDAI', - debtToken: 'ETH', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[2-9].[0-9]{2}([0-9]{1,2})?', - }, - ] as const -).forEach((targetPool) => - test.describe(`Maker Borrow - Swap to Spark ${targetPool.colToken}/${targetPool.debtToken}`, async () => { - test.afterAll(async () => { - await tenderly.deleteFork(forkId); - - await app.page.close(); - - await context.close(); - - await resetState(); - }); - - test.use({ - viewport: { width: 1400, height: 720 }, - }); - - test(`It should swap a Maker Borrow position (ETH/DAI) to Spark Multiply ${targetPool.colToken}/${targetPool.debtToken})`, async () => { - test.info().annotations.push({ - type: 'Test case', - description: 'xxx', - }); - - test.setTimeout(extremelyLongTestTimeout); - - await test.step('Test setup', async () => { - ({ context } = await metamaskSetUp({ network: 'mainnet' })); - let page = await context.newPage(); - app = new App(page); - - ({ forkId } = await setup({ - app, - network: 'mainnet', - extraFeaturesFlags: 'MakerTenderly:true EnableRefinance:true', - })); - }); - - await app.page.goto('/vaults/open/ETH-C'); - - // Depositing collateral too quickly after loading page returns wrong simulation results - await app.position.overview.waitForComponentToBeStable({ positionType: 'Maker' }); - - await openMakerPosition({ - app, - forkId, - deposit: { token: 'ETH', amount: '10' }, - generate: { token: 'DAI', amount: '15000' }, - }); - - await swapPosition({ - app, - forkId, - reason: 'Switch to lower my cost', - originalProtocol: 'Maker', - targetProtocol: 'Spark', - targetPool: { colToken: targetPool.colToken, debtToken: targetPool.debtToken }, - verifyPositions: { - originalPosition: { type: 'Borrow', collateralToken: 'ETH', debtToken: 'DAI' }, - targetPosition: { - exposure: { amount: targetPool.exposure, token: targetPool.colToken }, - debt: { amount: targetPool.debt, token: targetPool.debtToken }, - }, - }, - }); - }); - }) -); diff --git a/tests/withWallet/maker/swap/makerToSpark/toAny/0_borrWbtcDaiToany.spec.ts b/tests/withWallet/maker/swap/makerToSpark/toAny/0_borrWbtcDaiToany.spec.ts deleted file mode 100644 index 3f3b55f..0000000 --- a/tests/withWallet/maker/swap/makerToSpark/toAny/0_borrWbtcDaiToany.spec.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { BrowserContext, test } from '@playwright/test'; -import { resetState } from '@synthetixio/synpress/commands/synpress'; -import { metamaskSetUp } from 'utils/setup'; -import * as tenderly from 'utils/tenderly'; -import { setup } from 'utils/setup'; -import { extremelyLongTestTimeout } from 'utils/config'; -import { App } from 'src/app'; -import { openMakerPosition, swapPosition } from 'tests/sharedTestSteps/positionManagement'; - -let context: BrowserContext; -let app: App; -let forkId: string; -let walletAddress: string; - -( - [ - { - colToken: 'ETH', - debtToken: 'DAI', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'WBTC', - debtToken: 'DAI', - exposure: '0.[0-9]{2}([0-9]{1,2})?', - debt: '[4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'WSTETH', - debtToken: 'DAI', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'RETH', - debtToken: 'DAI', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'SDAI', - debtToken: 'ETH', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[0-5].[0-9]{2}([0-9]{1,2})?', - }, - ] as const -).forEach((targetPool) => - test.describe(`Maker Borrow - Swap to Spark ${targetPool.colToken}/${targetPool.debtToken}`, async () => { - test.afterAll(async () => { - await tenderly.deleteFork(forkId); - - await app.page.close(); - - await context.close(); - - await resetState(); - }); - - test.use({ - viewport: { width: 1400, height: 720 }, - }); - - test(`It should swap a Maker Borrow position (WBTC/DAI) to Spark Multiply ${targetPool.colToken}/${targetPool.debtToken})`, async () => { - test.info().annotations.push({ - type: 'Test case', - description: 'xxx', - }); - - test.setTimeout(extremelyLongTestTimeout); - - await test.step('Test setup', async () => { - ({ context } = await metamaskSetUp({ network: 'mainnet' })); - let page = await context.newPage(); - app = new App(page); - - ({ forkId, walletAddress } = await setup({ - app, - network: 'mainnet', - extraFeaturesFlags: 'MakerTenderly:true EnableRefinance:true', - })); - - await tenderly.setTokenBalance({ - forkId, - walletAddress, - network: 'mainnet', - token: 'WBTC', - balance: '20', - }); - }); - - await app.page.goto('vaults/open/WBTC-C'); - - // Depositing collateral too quickly after loading page returns wrong simulation results - await app.position.overview.waitForComponentToBeStable({ positionType: 'Maker' }); - - await openMakerPosition({ - app, - forkId, - deposit: { token: 'WBTC', amount: '0.2' }, - generate: { token: 'DAI', amount: '5000' }, - }); - - await swapPosition({ - app, - forkId, - reason: 'Switch to lower my cost', - originalProtocol: 'Maker', - targetProtocol: 'Spark', - targetPool: { colToken: targetPool.colToken, debtToken: targetPool.debtToken }, - verifyPositions: { - originalPosition: { type: 'Borrow', collateralToken: 'WBTC', debtToken: 'DAI' }, - targetPosition: { - exposure: { amount: targetPool.exposure, token: targetPool.colToken }, - debt: { amount: targetPool.debt, token: targetPool.debtToken }, - }, - }, - }); - }); - }) -); diff --git a/tests/withWallet/maker/swap/makerToSpark/toAny/0_borrWstethDaiToany.spec.ts b/tests/withWallet/maker/swap/makerToSpark/toAny/0_borrWstethDaiToany.spec.ts deleted file mode 100644 index af7aae8..0000000 --- a/tests/withWallet/maker/swap/makerToSpark/toAny/0_borrWstethDaiToany.spec.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { BrowserContext, test } from '@playwright/test'; -import { resetState } from '@synthetixio/synpress/commands/synpress'; -import { metamaskSetUp } from 'utils/setup'; -import * as tenderly from 'utils/tenderly'; -import { setup } from 'utils/setup'; -import { extremelyLongTestTimeout } from 'utils/config'; -import { App } from 'src/app'; -import { openMakerPosition, swapPosition } from 'tests/sharedTestSteps/positionManagement'; - -let context: BrowserContext; -let app: App; -let forkId: string; -let walletAddress: string; - -( - [ - { - colToken: 'ETH', - debtToken: 'DAI', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'WBTC', - debtToken: 'DAI', - exposure: '0.[0-9]{2}([0-9]{1,2})?', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'WSTETH', - debtToken: 'DAI', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'RETH', - debtToken: 'DAI', - exposure: '[0-9]{1,2}.[0-9]{2}', - debt: '[1][4-7],[0-9]{3}.[0-9]{2}', - }, - { - colToken: 'SDAI', - debtToken: 'ETH', - exposure: '[0-9]{2},[0-9]{3}.[0-9]{2}', - debt: '[2-9].[0-9]{2}([0-9]{1,2})?', - }, - ] as const -).forEach((targetPool) => - test.describe(`Maker Borrow - Swap to Spark ${targetPool.colToken}/${targetPool.debtToken}`, async () => { - test.afterAll(async () => { - await tenderly.deleteFork(forkId); - - await app.page.close(); - - await context.close(); - - await resetState(); - }); - - test.use({ - viewport: { width: 1400, height: 720 }, - }); - - test(`It should swap a Maker Borrow position (WSTETH/DAI) to Spark Multiply ${targetPool.colToken}/${targetPool.debtToken})`, async () => { - test.info().annotations.push({ - type: 'Test case', - description: 'xxx', - }); - - test.setTimeout(extremelyLongTestTimeout); - - await test.step('Test setup', async () => { - ({ context } = await metamaskSetUp({ network: 'mainnet' })); - let page = await context.newPage(); - app = new App(page); - - ({ forkId, walletAddress } = await setup({ - app, - network: 'mainnet', - extraFeaturesFlags: 'MakerTenderly:true EnableRefinance:true', - })); - - await tenderly.setTokenBalance({ - forkId, - walletAddress, - network: 'mainnet', - token: 'WSTETH', - balance: '100', - }); - }); - - await app.page.goto('/vaults/open/WSTETH-B'); - - // Depositing collateral too quickly after loading page returns wrong simulation results - await app.position.overview.waitForComponentToBeStable({ positionType: 'Maker' }); - - await openMakerPosition({ - app, - forkId, - deposit: { token: 'WSTETH', amount: '10' }, - generate: { token: 'DAI', amount: '15000' }, - }); - - await swapPosition({ - app, - forkId, - reason: 'Switch to lower my cost', - originalProtocol: 'Maker', - targetProtocol: 'Spark', - targetPool: { colToken: targetPool.colToken, debtToken: targetPool.debtToken }, - verifyPositions: { - originalPosition: { type: 'Borrow', collateralToken: 'WSTETH', debtToken: 'DAI' }, - targetPosition: { - exposure: { amount: targetPool.exposure, token: targetPool.colToken }, - debt: { amount: targetPool.debt, token: targetPool.debtToken }, - }, - }, - }); - }); - }) -); diff --git a/tests/withWallet/maker/swap/makerToSpark/toAny/borrWstethDaiToAny.spec.ts b/tests/withWallet/maker/swap/makerToSpark/toAny/borrWstethDaiToAny.spec.ts index eaf5f73..8446250 100644 --- a/tests/withWallet/maker/swap/makerToSpark/toAny/borrWstethDaiToAny.spec.ts +++ b/tests/withWallet/maker/swap/makerToSpark/toAny/borrWstethDaiToAny.spec.ts @@ -15,7 +15,7 @@ let walletAddress: string; test.describe.configure({ mode: 'serial' }); // New spec file that allows running all target pools even if previous ones fail -test.describe.skip('Maker Borrow - Swap to Spark', async () => { +test.describe('Maker Borrow - Swap to Spark', async () => { test.afterAll(async () => { await tenderly.deleteFork(forkId); @@ -89,8 +89,8 @@ test.describe.skip('Maker Borrow - Swap to Spark', async () => { { colToken: 'ETH', debtToken: 'DAI' }, { colToken: 'RETH', debtToken: 'DAI' }, { colToken: 'SDAI', debtToken: 'ETH' }, - { colToken: 'WBTC', debtToken: 'DAI' }, { colToken: 'WSTETH', debtToken: 'DAI' }, + // { colToken: 'WBTC', debtToken: 'DAI' }, -- Maker WBTC ceiling ] as const ).forEach((targetPool) => test(`It should swap a Maker Borrow position (WSTETH/DAI) to Spark Multiply (${targetPool.colToken}/${targetPool.debtToken})`, async () => { diff --git a/tests/withWallet/maker/swap/makerToSpark/toAny/multEthDaiToAny.spec.ts b/tests/withWallet/maker/swap/makerToSpark/toAny/multEthDaiToAny.spec.ts index 6579cd8..bf43336 100644 --- a/tests/withWallet/maker/swap/makerToSpark/toAny/multEthDaiToAny.spec.ts +++ b/tests/withWallet/maker/swap/makerToSpark/toAny/multEthDaiToAny.spec.ts @@ -14,7 +14,7 @@ let forkId: string; test.describe.configure({ mode: 'serial' }); // New spec file that allows running all target pools even if previous ones fail -test.describe.skip('Maker Multiply - Swap to Spark', async () => { +test.describe('Maker Multiply - Swap to Spark', async () => { test.afterAll(async () => { await tenderly.deleteFork(forkId); @@ -79,8 +79,8 @@ test.describe.skip('Maker Multiply - Swap to Spark', async () => { { colToken: 'ETH', debtToken: 'DAI' }, { colToken: 'RETH', debtToken: 'DAI' }, { colToken: 'SDAI', debtToken: 'ETH' }, - { colToken: 'WBTC', debtToken: 'DAI' }, { colToken: 'WSTETH', debtToken: 'DAI' }, + // { colToken: 'WBTC', debtToken: 'DAI' }, -- Maker WBTC ceiling ] as const ).forEach((targetPool) => test(`It should swap a Maker Multiply position (ETH/DAI) to Spark Multiply (${targetPool.colToken}/${targetPool.debtToken})`, async () => {