-
Notifications
You must be signed in to change notification settings - Fork 391
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
248 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { defineConfig } from 'cypress'; | ||
|
||
import { defaultConfig } from '../base.cypress'; | ||
|
||
const folder = `./cypress/e2e/1-v3-markets/7-gnosis-v3-market/`; | ||
|
||
export default defineConfig({ | ||
...defaultConfig, | ||
e2e: { | ||
specPattern: [ | ||
folder + '0-assets/usdc.gnosis-v3.cy.ts', | ||
folder + '0-assets/sdai.gnosis-v3.cy.ts', | ||
], | ||
}, | ||
}); |
85 changes: 85 additions & 0 deletions
85
cypress/e2e/1-v3-markets/7-gnosis-v3-market/0-assets/usdc.gnosis-v3.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import assets from '../../../../fixtures/assets.json'; | ||
import constants from '../../../../fixtures/constans.json'; | ||
import { skipState } from '../../../../support/steps/common'; | ||
import { configEnvWithTenderlyGnosisFork } from '../../../../support/steps/configuration.steps'; | ||
import { borrow, repay, supply, withdraw } from '../../../../support/steps/main.steps'; | ||
import { dashboardAssetValuesVerification } from '../../../../support/steps/verification.steps'; | ||
|
||
const testData = { | ||
depositBaseAmount: { | ||
asset: assets.gnosisV3Market.xDAI, | ||
amount: 9000, | ||
hasApproval: true, | ||
}, | ||
testCases: { | ||
borrow: [ | ||
{ | ||
asset: assets.gnosisV3Market.USDC, | ||
amount: 50, | ||
apyType: constants.borrowAPYType.default, | ||
hasApproval: true, | ||
}, | ||
], | ||
deposit: { | ||
asset: assets.gnosisV3Market.USDC, | ||
amount: 10.1, | ||
hasApproval: false, | ||
}, | ||
repay: [ | ||
{ | ||
asset: assets.gnosisV3Market.USDC, | ||
apyType: constants.apyType.variable, | ||
amount: 2, | ||
hasApproval: true, | ||
repayOption: constants.repayType.default, | ||
}, | ||
{ | ||
asset: assets.gnosisV3Market.USDC, | ||
apyType: constants.apyType.variable, | ||
repayableAsset: assets.gnosisV3Market.aUSDC, | ||
amount: 2, | ||
hasApproval: true, | ||
repayOption: constants.repayType.default, | ||
}, | ||
], | ||
withdraw: { | ||
asset: assets.gnosisV3Market.USDC, | ||
isCollateral: true, | ||
amount: 1, | ||
hasApproval: true, | ||
}, | ||
}, | ||
verifications: { | ||
finalDashboard: [ | ||
{ | ||
type: constants.dashboardTypes.deposit, | ||
assetName: assets.gnosisV3Market.USDC.shortName, | ||
amount: 7.0, | ||
collateralType: constants.collateralType.isCollateral, | ||
isCollateral: true, | ||
}, | ||
{ | ||
type: constants.dashboardTypes.borrow, | ||
assetName: assets.gnosisV3Market.USDC.shortName, | ||
amount: 46.0, | ||
apyType: constants.borrowAPYType.variable, | ||
}, | ||
], | ||
}, | ||
}; | ||
|
||
describe('USDC INTEGRATION SPEC, GNOSIS V3 MARKET', () => { | ||
const skipTestState = skipState(false); | ||
configEnvWithTenderlyGnosisFork({ v3: true }); | ||
|
||
supply(testData.depositBaseAmount, skipTestState, true); | ||
testData.testCases.borrow.forEach((borrowCase) => { | ||
borrow(borrowCase, skipTestState, true); | ||
}); | ||
supply(testData.testCases.deposit, skipTestState, true); | ||
testData.testCases.repay.forEach((repayCase) => { | ||
repay(repayCase, skipTestState, false); | ||
}); | ||
withdraw(testData.testCases.withdraw, skipTestState, false); | ||
dashboardAssetValuesVerification(testData.verifications.finalDashboard, skipTestState); | ||
}); |
115 changes: 115 additions & 0 deletions
115
cypress/e2e/1-v3-markets/7-gnosis-v3-market/0-assets/xdai.gnosis-v3.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
import assets from '../../../../fixtures/assets.json'; | ||
import constants from '../../../../fixtures/constans.json'; | ||
import { skipState } from '../../../../support/steps/common'; | ||
import { configEnvWithTenderlyGnosisFork } from '../../../../support/steps/configuration.steps'; | ||
import { | ||
borrow, | ||
changeCollateral, | ||
changeCollateralNegative, | ||
repay, | ||
supply, | ||
withdraw, | ||
} from '../../../../support/steps/main.steps'; | ||
import { | ||
borrowsUnavailable, | ||
dashboardAssetValuesVerification, | ||
} from '../../../../support/steps/verification.steps'; | ||
|
||
const testData = { | ||
testCases: { | ||
deposit: { | ||
asset: assets.gnosisV3Market.xDAI, | ||
amount: 500, | ||
hasApproval: true, | ||
}, | ||
collateral: { | ||
switchOff: { | ||
asset: assets.gnosisV3Market.xDAI, | ||
isCollateralType: true, | ||
hasApproval: true, | ||
}, | ||
switchOn: { | ||
asset: assets.gnosisV3Market.xDAI, | ||
isCollateralType: false, | ||
hasApproval: true, | ||
}, | ||
switchNegative: { | ||
asset: assets.gnosisV3Market.xDAI, | ||
isCollateralType: true, | ||
}, | ||
}, | ||
borrow: [ | ||
{ | ||
asset: assets.gnosisV3Market.xDAI, | ||
amount: 100, | ||
apyType: constants.borrowAPYType.default, | ||
hasApproval: false, | ||
}, | ||
], | ||
withdraw: [ | ||
{ | ||
asset: assets.gnosisV3Market.xDAI, | ||
isCollateral: true, | ||
amount: 50, | ||
hasApproval: false, | ||
}, | ||
], | ||
repay: [ | ||
{ | ||
asset: assets.gnosisV3Market.xDAI, | ||
apyType: constants.apyType.variable, | ||
amount: 10, | ||
hasApproval: true, | ||
repayOption: constants.repayType.default, | ||
}, | ||
{ | ||
asset: assets.gnosisV3Market.xDAI, | ||
apyType: constants.apyType.variable, | ||
repayableAsset: assets.gnosisV3Market.aWXDAI, | ||
amount: 10, | ||
hasApproval: false, | ||
repayOption: constants.repayType.default, | ||
}, | ||
], | ||
}, | ||
verifications: { | ||
finalDashboard: [ | ||
{ | ||
type: constants.dashboardTypes.deposit, | ||
assetName: assets.gnosisV3Market.xDAI.shortName, | ||
amount: 450, | ||
collateralType: constants.collateralType.isCollateral, | ||
isCollateral: true, | ||
}, | ||
{ | ||
type: constants.dashboardTypes.borrow, | ||
assetName: assets.gnosisV3Market.xDAI.shortName, | ||
amount: 90, | ||
apyType: constants.borrowAPYType.variable, | ||
}, | ||
], | ||
}, | ||
}; | ||
|
||
describe('xDAI INTEGRATION SPEC, GNOSIS V3 MARKET', () => { | ||
const skipTestState = skipState(false); | ||
configEnvWithTenderlyGnosisFork({ v3: true }); | ||
|
||
supply(testData.testCases.deposit, skipTestState, true); | ||
describe('Check Collateral switching', () => { | ||
changeCollateral(testData.testCases.collateral.switchOff, skipTestState, false); | ||
borrowsUnavailable(skipTestState); | ||
changeCollateral(testData.testCases.collateral.switchOn, skipTestState, false); | ||
}); | ||
testData.testCases.borrow.forEach((borrowCase) => { | ||
borrow(borrowCase, skipTestState, true); | ||
}); | ||
changeCollateralNegative(testData.testCases.collateral.switchNegative, skipTestState, false); | ||
testData.testCases.withdraw.forEach((withdrawCase) => { | ||
withdraw(withdrawCase, skipTestState, false); | ||
}); | ||
testData.testCases.repay.forEach((repayCase) => { | ||
repay(repayCase, skipTestState, false); | ||
}); | ||
dashboardAssetValuesVerification(testData.verifications.finalDashboard, skipTestState); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cdb3afa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit was deployed on ipfs
cdb3afa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit was deployed on ipfs