Skip to content

Commit

Permalink
feat: staking testing (#165)
Browse files Browse the repository at this point in the history
* init staking testing

* fix

* fix

* fix address

* fix CI

* clean up logs

* fix MANA test

* one more fix

Co-authored-by: NikitaQA <[email protected]>
  • Loading branch information
MareskoY and NikitaQA authored Nov 18, 2021
1 parent b9ea983 commit b985d34
Show file tree
Hide file tree
Showing 17 changed files with 815 additions and 365 deletions.
6 changes: 3 additions & 3 deletions tests/configs/debug.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ exports.config = {
'./e2e/specs/mainMarket/assets/tusd.test.js',
'./e2e/specs/mainMarket/assets/mkr.test.js',
'./e2e/specs/mainMarket/assets/ren.test.js',
'./e2e/specs/mainMarket/assets/mana.test.js',
// './e2e/specs/mainMarket/assets/mana.test.js',
'./e2e/specs/mainMarket/reward.test.js',
'./e2e/specs/mainMarket/swap.test.js',
'./e2e/specs/mainMarket/stake.test.js',

'./e2e/specs/polygonMarket/assets/matic.polygon.test.js',
'./e2e/specs/polygonMarket/assets/dai.polygon.test.js',
Expand All @@ -53,7 +54,7 @@ exports.config = {
'./e2e/specs/polygonMarket/swap.polygon.test.js',

'./e2e/specs/ammMarket/assets/eth.test.js',
// './e2e/specs/ammMarket/assets/usdc.test.js',
'./e2e/specs/ammMarket/assets/usdc.test.js',
'./e2e/specs/ammMarket/assets/dai.test.js',
'./e2e/specs/ammMarket/assets/usdt.test.js',

Expand All @@ -69,7 +70,6 @@ exports.config = {
'./e2e/specs/mainMarket/stake.kovan.test.js',
],
maxInstances: 1,
specFileRetries: 1,
capabilities: [{
maxInstances: 1,
browserName: 'chrome',
Expand Down
4 changes: 2 additions & 2 deletions tests/configs/lambdaTest.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const SPEC_LIST = {
'./e2e/specs/mainMarket/assets/bat.test.js',
],
reward: './e2e/specs/mainMarket/reward.test.js',
stake: './e2e/specs/mainMarket/stake.kovan.test.js',
stake: './e2e/specs/mainMarket/stake.test.js',
swap: './e2e/specs/mainMarket/swap.test.js'
},
polygonMarket: {
Expand Down Expand Up @@ -67,7 +67,7 @@ let executionList = () => {
_specs.push(SPEC_LIST.aaveMarket.variableAssets[random(SPEC_LIST.aaveMarket.variableAssets.length)])
_specs.push(SPEC_LIST.aaveMarket.reward)
_specs.push(SPEC_LIST.aaveMarket.swap)
// _specs.push(SPEC_LIST.aaveMarket.stake) - bugged
_specs.push(SPEC_LIST.aaveMarket.stake)
_specs.push(SPEC_LIST.polygonMarket.baseAsset)
_specs.push(SPEC_LIST.polygonMarket.otherAssets[random(SPEC_LIST.polygonMarket.otherAssets.length)])
_specs.push(SPEC_LIST.polygonMarket.reward)
Expand Down
101 changes: 101 additions & 0 deletions tests/configs/lambdaTestDebug.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
const chai = require('chai');
require('dotenv').config();
const build = process.env.BUILD || 'Empty build'
const LAMBDATEST_ACCOUNT = process.env.LAMBDATEST_ACCOUNT
const LAMBDATEST_KEY = process.env.LAMBDATEST_KEY

exports.config = {
updateJob: false,
user: LAMBDATEST_ACCOUNT,
key: LAMBDATEST_KEY,
specs: [
'./e2e/specs/**/*.test.js',
],
exclude: [
'./e2e/specs/mainMarket/assets/eth.test.js',
'./e2e/specs/mainMarket/assets/usdc.test.js',
'./e2e/specs/mainMarket/assets/dai.test.js',
// './e2e/specs/mainMarket/assets/bat.test.js',
'./e2e/specs/mainMarket/assets/usdt.test.js',
'./e2e/specs/mainMarket/assets/tusd.test.js',
'./e2e/specs/mainMarket/assets/mkr.test.js',
'./e2e/specs/mainMarket/assets/ren.test.js',
'./e2e/specs/mainMarket/assets/mana.test.js',
'./e2e/specs/mainMarket/reward.test.js',
'./e2e/specs/mainMarket/swap.test.js',
'./e2e/specs/mainMarket/stake.test.js',

'./e2e/specs/polygonMarket/assets/matic.polygon.test.js',
'./e2e/specs/polygonMarket/assets/dai.polygon.test.js',
'./e2e/specs/polygonMarket/assets/usdc.polygon.test.js',
'./e2e/specs/polygonMarket/assets/usdt.polygon.test.js',
'./e2e/specs/polygonMarket/assets/weth.polygon.test.js',
'./e2e/specs/polygonMarket/assets/wbtc.polygon.test.js',
'./e2e/specs/polygonMarket/reward.polygon.test.js',
'./e2e/specs/polygonMarket/swap.polygon.test.js',

'./e2e/specs/ammMarket/assets/eth.test.js',
'./e2e/specs/ammMarket/assets/usdc.test.js',
'./e2e/specs/ammMarket/assets/dai.test.js',
'./e2e/specs/ammMarket/assets/usdt.test.js',

'./e2e/specs/avalancheMarket/assets/avax.avalanche.test.js',
'./e2e/specs/avalancheMarket/assets/dai.avalanche.test.js',
'./e2e/specs/avalancheMarket/assets/usdc.avalanche.test.js',
'./e2e/specs/avalancheMarket/assets/usdt.avalanche.test.js',
'./e2e/specs/avalancheMarket/assets/weth.avalanche.test.js',
'./e2e/specs/avalancheMarket/assets/wbtc.avalanche.test.js',
'./e2e/specs/avalancheMarket/reward.avalanche.test.js',
'./e2e/specs/avalancheMarket/swap.avalanche.test.js',

'./e2e/specs/mainMarket/stake.kovan.test.js',
],
maxInstances: 5,
specFileRetries: 2,
capabilities: [{
alwaysMatch: {
browserName: "Chrome",
build: build,
platform: "Windows 10",
version: "88.0",
resolution: "1680x1050",
console: true,
'lambda:loadExtension': ["https://automation-prod-user-files.s3.amazonaws.com/extensions/orgId-466615/metamaskChrome.zip"],
'goog:chromeOptions': {
'args': [
'--window-size=1680x1050',
],
},
}
}],
sync: true,
logLevel: 'error',
coloredLogs: true,
baseUrl: '',
waitforTimeout: 600000,
connectionRetryTimeout: 300000,
connectionRetryCount: 5,
path: '/wd/hub',
hostname: 'hub.lambdatest.com',
port: 80,

beforeSession: function (config, capabilities, specs) {
capabilities.alwaysMatch.name=specs[0].split(/(\\|\/)/g).pop() || undefined
},

beforeTest: function () {
const chai = require('chai')
global.assert = chai.assert
global.should = chai.should
global.expect = chai.expect
},
after: function (result, capabilities, specs) {
driver.execute("lambda-status=".concat(result==0?"passed":"failed"),undefined);
},
reporters: ['spec'],
framework: 'mocha',
mochaOpts: {
ui: 'bdd',
timeout: 500000
}
}
40 changes: 0 additions & 40 deletions tests/configs/local.conf.js

This file was deleted.

13 changes: 13 additions & 0 deletions tests/e2e/fixtures/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,18 @@
"shortName": "TUSD",
"collateral": true
}
},
"staking": {
"AAVE": {
"fullName": "AAVE",
"shortName": "AAVE",
"address": "0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9"
},
"ABPT": {
"fullName": "AAVE/ETH BPT",
"shortName": "ABPT",
"address": "0x41A08648C3766F9F9d85598fF102a08f4ef84F84"

}
}
}
Loading

0 comments on commit b985d34

Please sign in to comment.