Skip to content

Commit

Permalink
Merge pull request #20 from etherspot/transactionFund
Browse files Browse the repository at this point in the history
Added retry function, customized mochawesome report, linked automatio…
  • Loading branch information
Jineshdarjee authored Oct 30, 2023
2 parents e856d9c + dab9634 commit 9fe11e4
Show file tree
Hide file tree
Showing 16 changed files with 13,886 additions and 7,298 deletions.
13,444 changes: 8,617 additions & 4,827 deletions package-lock.json

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@
"type": "module",
"scripts": {
"test": "mocha --timeout 600000 --spec test/specs/mainnet-api/arka/mumbai.spec.js",
"test-mainnet": "mocha --timeout 600000 --spec test/specs/mainnet/*/Arbitrum.spec.js --spec test/specs/mainnet/*/Matic.spec.js --reporter mochawesome --reporter-options charts=true,code=false",
"test-mainnet-transfertoken-arbitrum": "mocha --timeout 600000 --spec test/specs/mainnet/01_TransferringFunds/Arbitrum.spec.js --reporter mochawesome --reporter-options charts=true,code=false",
"test-mainnet-transfertoken-matic": "mocha --timeout 600000 --spec test/specs/mainnet/01_TransferringFunds/Matic.spec.js --reporter mochawesome --reporter-options charts=true,code=false",
"test-mainnet-transfertoken-optimism": "mocha --timeout 600000 --spec test/specs/mainnet/01_TransferringFunds/Optimism.spec.js --reporter mochawesome --reporter-options charts=true,code=false",
"test-mainnet-transfertoken-xdai": "mocha --timeout 600000 --spec test/specs/mainnet/01_TransferringFunds/Xdai.spec.js --reporter mochawesome --reporter-options charts=true,code=false",
"test-mainnet-transfertoken": "mocha --timeout 600000 --spec test/specs/mainnet/01_TransferringFunds/*.spec.js --reporter mochawesome --reporter-options charts=true,code=false",
"test-mainnet-transactionhistory-arbitrum": "mocha --timeout 600000 --spec test/specs/mainnet/02_TransactionHistory/Arbitrum.spec.js --reporter mochawesome --reporter-options charts=true,code=false",
"test-mainnet-transactionhistory-matic": "mocha --timeout 600000 --spec test/specs/mainnet/02_TransactionHistory/Matic.spec.js --reporter mochawesome --reporter-options charts=true,code=false",
"test-mainnet-transactionhistory-optimism": "mocha --timeout 600000 --spec test/specs/mainnet/02_TransactionHistory/Optimism.spec.js --reporter mochawesome --reporter-options charts=true,code=false",
"test-mainnet-transactionhistory-xdai": "mocha --timeout 600000 --spec test/specs/mainnet/02_TransactionHistory/Xdai.spec.js --reporter mochawesome --reporter-options charts=true,code=false",
"test-mainnet-transactionhistory": "mocha --timeout 600000 --spec test/specs/mainnet/02_TransactionHistory/*.spec.js --reporter mochawesome --reporter-options charts=true,code=false",
"test-mainnet-swap-arbitrum": "mocha --timeout 600000 --spec test/specs/mainnet/03_Swap/Arbitrum.spec.js --reporter mochawesome --reporter-options charts=true,code=false",
"test-mainnet-swap-matic": "mocha --timeout 600000 --spec test/specs/mainnet/03_Swap/Matic.spec.js --reporter mochawesome --reporter-options charts=true,code=false",
"test-mainnet-swap-optimism": "mocha --timeout 600000 --spec test/specs/mainnet/03_Swap/Optimism.spec.js --reporter mochawesome --reporter-options charts=true,code=false",
"test-mainnet-swap-xdai": "mocha --timeout 600000 --spec test/specs/mainnet/03_Swap/Xdai.spec.js --reporter mochawesome --reporter-options charts=true,code=false",
"test-mainnet-swap": "mocha --timeout 600000 --spec test/specs/mainnet/03_Swap/*.spec.js --reporter mochawesome --reporter-options charts=true,code=false",
"test_arka": "mocha --timeout 600000 --spec test/specs/mainnet-api/arka/*.spec.js",
"test_skandha": "mocha --timeout 600000 --spec test/specs/mainnet-api/skandha/*.spec.js"
"test-mainnet": "mocha --timeout 600000 --spec test/specs/mainnet/00_Version/Version.spec.js --spec test/specs/mainnet/*/Matic.spec.js --spec test/specs/mainnet/*/Xdai.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test-mainnet-transfertoken-arbitrum": "mocha --timeout 600000 --spec test/specs/mainnet/00_Version/Version.spec.js --spec test/specs/mainnet/01_TransferringFunds/Arbitrum.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test-mainnet-transfertoken-matic": "mocha --timeout 600000 --spec test/specs/mainnet/00_Version/Version.spec.js --spec test/specs/mainnet/01_TransferringFunds/Matic.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test-mainnet-transfertoken-optimism": "mocha --timeout 600000 --spec test/specs/mainnet/00_Version/Version.spec.js --spec test/specs/mainnet/01_TransferringFunds/Optimism.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test-mainnet-transfertoken-xdai": "mocha --timeout 600000 --spec test/specs/mainnet/00_Version/Version.spec.js --spec test/specs/mainnet/01_TransferringFunds/Xdai.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test-mainnet-transfertoken": "mocha --timeout 600000 --spec test/specs/mainnet/00_Version/Version.spec.js --spec test/specs/mainnet/01_TransferringFunds/*.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test-mainnet-transactionhistory-arbitrum": "mocha --timeout 600000 --spec test/specs/mainnet/00_Version/Version.spec.js --spec test/specs/mainnet/02_TransactionHistory/Arbitrum.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test-mainnet-transactionhistory-matic": "mocha --timeout 600000 --spec test/specs/mainnet/00_Version/Version.spec.js --spec test/specs/mainnet/02_TransactionHistory/Matic.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test-mainnet-transactionhistory-optimism": "mocha --timeout 600000 --spec test/specs/mainnet/00_Version/Version.spec.js --spec test/specs/mainnet/02_TransactionHistory/Optimism.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test-mainnet-transactionhistory-xdai": "mocha --timeout 600000 --spec test/specs/mainnet/00_Version/Version.spec.js --spec test/specs/mainnet/02_TransactionHistory/Xdai.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test-mainnet-transactionhistory": "mocha --timeout 600000 --spec test/specs/mainnet/00_Version/Version.spec.js --spec test/specs/mainnet/02_TransactionHistory/*.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test-mainnet-swap-arbitrum": "mocha --timeout 600000 --spec test/specs/mainnet/00_Version/Version.spec.js --spec test/specs/mainnet/03_Swap/Arbitrum.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test-mainnet-swap-matic": "mocha --timeout 600000 --spec test/specs/mainnet/00_Version/Version.spec.js --spec test/specs/mainnet/03_Swap/Matic.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test-mainnet-swap-optimism": "mocha --timeout 600000 --spec test/specs/mainnet/00_Version/Version.spec.js --spec test/specs/mainnet/03_Swap/Optimism.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test-mainnet-swap-xdai": "mocha --timeout 600000 --spec test/specs/mainnet/00_Version/Version.spec.js --spec test/specs/mainnet/03_Swap/Xdai.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test-mainnet-swap": "mocha --timeout 600000 --spec test/specs/mainnet/00_Version/Version.spec.js --spec test/specs/mainnet/03_Swap/*.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test_arka": "mocha --timeout 600000 --spec test/specs/mainnet-api/arka/*.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test_skandha": "mocha --timeout 600000 --spec test/specs/mainnet-api/skandha/*.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always"
},
"author": "",
"license": "ISC",
"dependencies": {
"@babel/eslint-parser": "^7.22.9",
"@babel/plugin-syntax-import-assertions": "^7.22.5",
"@etherspot/contracts": "^2.0.1",
"@etherspot/prime-sdk": "file:../etherspot-prime-sdk/dist/index.js",
"@etherspot/prime-sdk": "file:./etherspot-prime-sdk",
"@reactivex/rxjs": "^6.6.7",
"axios": "^1.4.0",
"chai": "^4.3.7",
Expand Down
6 changes: 3 additions & 3 deletions test/data/testData.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"invalidTokenAddress_xdaiUSDC": "0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A8",
"providerNetwork_xdai": "https://gnosis-bundler.etherspot.io",
"invalidProviderNetwork_xdai": "http://gnosis-bundler.etherspot.io",
"otherProviderNetwork_xdai": "https://xdai-bundler.etherspot.io",
"otherProviderNetwork_xdai": "https://polygon-bundler.etherspot.io",
"incorrect_hash": "0x3df9fe91b29f4b2bf1b148baf2f9E207e98137F8318ccf39eDc930d1ceA551df",
"invalid_hash": "0x3df9fe91b29f4b2bf1b148baf2f9E207e98137F8z18ccf39eDc930d1ceA551df",
"arbitrum_chainid": 42161,
Expand All @@ -55,6 +55,6 @@
"invalid_matic_chainid": 19,
"invalid_optimism_chainid": 158,
"invalid_xdai_chainid": 105,
"minimum_token_balance": 0.00001,
"minimum_native_balance": 0.00001
"minimum_token_balance": 0.001,
"minimum_native_balance": 0.001
}
20 changes: 20 additions & 0 deletions test/specs/mainnet/00_Version/Version.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import fs from 'fs';
import addContext from 'mochawesome/addContext.js';

before('Validate the version of the Etherspot PrimeSDK', function () {
var test = this;

// Specify the path to the package.json file of etherspot-prime-sdk
const packageJsonPath = './etherspot-prime-sdk/package.json';

// Read and parse the package.json file
fs.readFile(packageJsonPath, 'utf8', function (err, data) {
if (err) {
console.error('Error reading package.json:', err);
} else {
const packageInfo = JSON.parse(data);
console.log('etherspot-prime-sdk version:', packageInfo.version);
addContext(test, 'etherspot-prime-sdk version: ' + packageInfo.version);
}
});
});
Loading

0 comments on commit 9fe11e4

Please sign in to comment.