diff --git a/.gitignore b/.gitignore index 9346c74..8c7d2bb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules etherspot-prime-sdk .eslintrc.json -.prettierrc \ No newline at end of file +.prettierrc +mochawesome-report \ No newline at end of file diff --git a/test/data/messages.json b/test/data/messages.json index fa13b83..9271511 100644 --- a/test/data/messages.json +++ b/test/data/messages.json @@ -7,6 +7,7 @@ "fail_data_service": "The Data service is not initialled successfully.", "fail_arka_initialize": "An error is displayed while initializating ArkaPaymaster.", "fail_wallet_balance": "Validation of the balance of the wallet is not performed.", + "skip_transaction_error": "An error is displayed due to multiple transactions in short period, So skipping the test case.", "_comment2": "Get Address", "vali_zero_dev": "The Zero Dev Address is not calculated correctly.", "fail_zero_dev": "The Zero Dev Address is not displayed successfully.", diff --git a/test/specs/mainnet/connext/arbitrum.spec.js b/test/specs/mainnet/connext/arbitrum.spec.js index cced6f0..898afcc 100644 --- a/test/specs/mainnet/connext/arbitrum.spec.js +++ b/test/specs/mainnet/connext/arbitrum.spec.js @@ -23,7 +23,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -132,7 +132,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); try { allSupportedAssets = @@ -210,7 +210,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); try { supportedAssets = @@ -292,7 +292,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); try { quotes = await arbitrumDataService.getQuotes({ @@ -355,7 +355,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -408,8 +408,14 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // get transaction hash diff --git a/test/specs/mainnet/connext/matic.spec.js b/test/specs/mainnet/connext/matic.spec.js index ef000a7..8b659ae 100644 --- a/test/specs/mainnet/connext/matic.spec.js +++ b/test/specs/mainnet/connext/matic.spec.js @@ -23,7 +23,7 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -132,7 +132,7 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); try { allSupportedAssets = @@ -210,7 +210,7 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); try { supportedAssets = @@ -292,7 +292,7 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); try { quotes = await maticDataService.getQuotes({ @@ -355,7 +355,7 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -408,8 +408,14 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // get transaction hash diff --git a/test/specs/mainnet/connext/optimism.spec.js b/test/specs/mainnet/connext/optimism.spec.js index 87afd72..9b2483c 100644 --- a/test/specs/mainnet/connext/optimism.spec.js +++ b/test/specs/mainnet/connext/optimism.spec.js @@ -23,7 +23,7 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -132,7 +132,7 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); try { allSupportedAssets = @@ -210,7 +210,7 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); try { supportedAssets = @@ -292,7 +292,7 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); try { quotes = await optimismDataService.getQuotes({ @@ -355,7 +355,7 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -408,8 +408,14 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // get transaction hash diff --git a/test/specs/mainnet/connext/xdai.spec.js b/test/specs/mainnet/connext/xdai.spec.js index ddaa8e9..8c13ae9 100644 --- a/test/specs/mainnet/connext/xdai.spec.js +++ b/test/specs/mainnet/connext/xdai.spec.js @@ -23,7 +23,7 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -132,7 +132,7 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); try { allSupportedAssets = @@ -210,7 +210,7 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); try { supportedAssets = @@ -292,7 +292,7 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); try { quotes = await xdaiDataService.getQuotes({ @@ -355,7 +355,7 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -408,8 +408,14 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // get transaction hash @@ -1225,10 +1231,10 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the assert.fail(message.fail_connext_25); } } catch (e) { - console.error(e); - const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_connext_25); + console.error(e); + const eString = e.toString(); + addContext(test, eString); + assert.fail(message.fail_connext_25); } }, data.retry); // Retry this async test up to 5 times } else { diff --git a/test/specs/mainnet/getAddresses/arbitrum.spec.js b/test/specs/mainnet/getAddresses/arbitrum.spec.js index 59274a5..767747b 100644 --- a/test/specs/mainnet/getAddresses/arbitrum.spec.js +++ b/test/specs/mainnet/getAddresses/arbitrum.spec.js @@ -20,7 +20,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -80,7 +80,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -140,7 +140,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { diff --git a/test/specs/mainnet/getAddresses/matic.spec.js b/test/specs/mainnet/getAddresses/matic.spec.js index f87ab78..e11de40 100644 --- a/test/specs/mainnet/getAddresses/matic.spec.js +++ b/test/specs/mainnet/getAddresses/matic.spec.js @@ -20,7 +20,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -80,7 +80,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -140,7 +140,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { diff --git a/test/specs/mainnet/getAddresses/optimism.spec.js b/test/specs/mainnet/getAddresses/optimism.spec.js index 6ff25c4..c6837dc 100644 --- a/test/specs/mainnet/getAddresses/optimism.spec.js +++ b/test/specs/mainnet/getAddresses/optimism.spec.js @@ -20,7 +20,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -80,7 +80,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -140,7 +140,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { diff --git a/test/specs/mainnet/getAddresses/xdai.spec.js b/test/specs/mainnet/getAddresses/xdai.spec.js index ce9f9bb..e48ea9a 100644 --- a/test/specs/mainnet/getAddresses/xdai.spec.js +++ b/test/specs/mainnet/getAddresses/xdai.spec.js @@ -20,7 +20,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -80,7 +80,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -140,7 +140,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { diff --git a/test/specs/mainnet/listAndRates/arbitrum.spec.js b/test/specs/mainnet/listAndRates/arbitrum.spec.js index f9c89da..30ac208 100644 --- a/test/specs/mainnet/listAndRates/arbitrum.spec.js +++ b/test/specs/mainnet/listAndRates/arbitrum.spec.js @@ -22,7 +22,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -129,7 +129,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let nfts; try { @@ -239,7 +239,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let tokenLists; let tokenListTokens; @@ -455,7 +455,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let TOKEN_LIST; let rates; diff --git a/test/specs/mainnet/listAndRates/matic.spec.js b/test/specs/mainnet/listAndRates/matic.spec.js index f9fd7c0..4bee892 100644 --- a/test/specs/mainnet/listAndRates/matic.spec.js +++ b/test/specs/mainnet/listAndRates/matic.spec.js @@ -22,7 +22,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -129,7 +129,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let nfts; try { @@ -239,7 +239,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let tokenLists; let tokenListTokens; @@ -455,7 +455,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let TOKEN_LIST; let rates; diff --git a/test/specs/mainnet/listAndRates/optimism.spec.js b/test/specs/mainnet/listAndRates/optimism.spec.js index a4bd857..ecbc788 100644 --- a/test/specs/mainnet/listAndRates/optimism.spec.js +++ b/test/specs/mainnet/listAndRates/optimism.spec.js @@ -22,7 +22,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -129,7 +129,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let nfts; try { @@ -239,7 +239,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let tokenLists; let tokenListTokens; @@ -455,7 +455,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let TOKEN_LIST; let rates; diff --git a/test/specs/mainnet/listAndRates/xdai.spec.js b/test/specs/mainnet/listAndRates/xdai.spec.js index 94598f1..1832385 100644 --- a/test/specs/mainnet/listAndRates/xdai.spec.js +++ b/test/specs/mainnet/listAndRates/xdai.spec.js @@ -22,7 +22,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -129,7 +129,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let nfts; try { @@ -239,7 +239,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let tokenLists; let tokenListTokens; @@ -455,7 +455,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let TOKEN_LIST; let rates; diff --git a/test/specs/mainnet/paymaster/arbitrum.spec.js b/test/specs/mainnet/paymaster/arbitrum.spec.js index 34bdaaf..a8c2053 100644 --- a/test/specs/mainnet/paymaster/arbitrum.spec.js +++ b/test/specs/mainnet/paymaster/arbitrum.spec.js @@ -25,7 +25,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -144,7 +144,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -365,8 +365,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -383,7 +389,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let balance; // get balance of the account address @@ -635,8 +641,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -843,8 +855,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } } else { addContext(test, message.fail_paymasterAddress_1); @@ -865,7 +883,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let balance; let transactionBatch; @@ -1106,8 +1124,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -1120,7 +1144,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // get the metadata @@ -1183,7 +1207,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // validate the get token paymaster address @@ -1216,7 +1240,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // validate the remove whitelist address @@ -1253,7 +1277,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // validate the add whitelist address @@ -1290,7 +1314,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // validate the whilelist address @@ -1321,7 +1345,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // validate the deposit @@ -2402,8 +2426,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -2528,8 +2558,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -2670,8 +2706,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -2811,8 +2853,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -2954,8 +3002,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -3095,8 +3149,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch diff --git a/test/specs/mainnet/paymaster/matic.spec.js b/test/specs/mainnet/paymaster/matic.spec.js index b75ea2a..cc201ee 100644 --- a/test/specs/mainnet/paymaster/matic.spec.js +++ b/test/specs/mainnet/paymaster/matic.spec.js @@ -25,7 +25,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -144,7 +144,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -365,8 +365,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -383,7 +389,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let balance; // get balance of the account address @@ -635,8 +641,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -843,8 +855,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } } else { addContext(test, message.fail_paymasterAddress_1); @@ -865,7 +883,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let balance; let transactionBatch; @@ -1106,8 +1124,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -1120,7 +1144,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // get the metadata @@ -1183,7 +1207,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // validate the get token paymaster address @@ -1216,7 +1240,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // validate the remove whitelist address @@ -1253,7 +1277,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // validate the add whitelist address @@ -1290,7 +1314,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // validate the whilelist address @@ -1321,7 +1345,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // validate the deposit try { @@ -2401,8 +2425,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -2527,8 +2557,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -2669,8 +2705,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -2810,8 +2852,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -2953,8 +3001,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -3094,8 +3148,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch diff --git a/test/specs/mainnet/paymaster/optimism.spec.js b/test/specs/mainnet/paymaster/optimism.spec.js index 9f5f3a5..fba3e0b 100644 --- a/test/specs/mainnet/paymaster/optimism.spec.js +++ b/test/specs/mainnet/paymaster/optimism.spec.js @@ -25,7 +25,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -144,7 +144,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -365,8 +365,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -383,7 +389,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let balance; // get balance of the account address @@ -635,8 +641,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -843,8 +855,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } } else { addContext(test, message.fail_paymasterAddress_1); @@ -865,7 +883,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let balance; let transactionBatch; @@ -1106,8 +1124,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -1120,7 +1144,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // get the metadata @@ -1183,7 +1207,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // validate the get token paymaster address @@ -1216,7 +1240,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // validate the remove whitelist address @@ -1253,7 +1277,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // validate the add whitelist address @@ -1290,7 +1314,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // validate the whilelist address @@ -1321,7 +1345,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // validate the deposit try { @@ -2401,8 +2425,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -2527,8 +2557,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -2669,8 +2705,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -2810,8 +2852,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -2953,8 +3001,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -3094,8 +3148,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch diff --git a/test/specs/mainnet/paymaster/xdai.spec.js b/test/specs/mainnet/paymaster/xdai.spec.js index 0b8e49d..a36dbae 100644 --- a/test/specs/mainnet/paymaster/xdai.spec.js +++ b/test/specs/mainnet/paymaster/xdai.spec.js @@ -25,7 +25,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -144,7 +144,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -365,8 +365,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -383,7 +389,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let balance; // get balance of the account address @@ -635,8 +641,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -843,8 +855,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } } else { addContext(test, message.fail_paymasterAddress_1); @@ -861,7 +879,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( @@ -1106,8 +1124,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -1120,7 +1144,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // get the metadata try { @@ -1182,7 +1206,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // validate the get token paymaster address @@ -1215,7 +1239,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // validate the remove whitelist address @@ -1252,7 +1276,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // validate the add whitelist address @@ -1289,7 +1313,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // validate the whilelist address @@ -1320,7 +1344,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // validate the deposit try { @@ -2400,8 +2424,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -2526,8 +2556,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -2668,8 +2704,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -2809,8 +2851,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -2952,8 +3000,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch @@ -3093,8 +3147,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // clear the transaction batch diff --git a/test/specs/mainnet/swap/arbitrum.spec.js b/test/specs/mainnet/swap/arbitrum.spec.js index da354b6..de1363b 100644 --- a/test/specs/mainnet/swap/arbitrum.spec.js +++ b/test/specs/mainnet/swap/arbitrum.spec.js @@ -22,7 +22,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -131,7 +131,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); exchangeSupportedAssets = await arbitrumDataService.getExchangeSupportedAssets({ @@ -305,7 +305,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); exchangeSupportedAssets = await arbitrumDataService.getExchangeSupportedAssets({ @@ -478,7 +478,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let quoteRequestPayload; let quotes; @@ -582,7 +582,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let quoteRequestPayload; let quotes; diff --git a/test/specs/mainnet/swap/matic.spec.js b/test/specs/mainnet/swap/matic.spec.js index 3d5d219..229ac57 100644 --- a/test/specs/mainnet/swap/matic.spec.js +++ b/test/specs/mainnet/swap/matic.spec.js @@ -22,7 +22,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -131,7 +131,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); exchangeSupportedAssets = await maticDataService.getExchangeSupportedAssets({ @@ -305,7 +305,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); exchangeSupportedAssets = await maticDataService.getExchangeSupportedAssets({ @@ -478,7 +478,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let quoteRequestPayload; let quotes; @@ -582,7 +582,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let quoteRequestPayload; let quotes; diff --git a/test/specs/mainnet/swap/optimism.spec.js b/test/specs/mainnet/swap/optimism.spec.js index 9af6f84..66ec65a 100644 --- a/test/specs/mainnet/swap/optimism.spec.js +++ b/test/specs/mainnet/swap/optimism.spec.js @@ -22,7 +22,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -131,7 +131,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); exchangeSupportedAssets = await optimismDataService.getExchangeSupportedAssets({ @@ -305,7 +305,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); exchangeSupportedAssets = await optimismDataService.getExchangeSupportedAssets({ @@ -478,7 +478,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let quoteRequestPayload; let quotes; @@ -582,7 +582,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let quoteRequestPayload; let quotes; diff --git a/test/specs/mainnet/swap/xdai.spec.js b/test/specs/mainnet/swap/xdai.spec.js index 0b0d792..19c01ac 100644 --- a/test/specs/mainnet/swap/xdai.spec.js +++ b/test/specs/mainnet/swap/xdai.spec.js @@ -22,7 +22,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -131,7 +131,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); exchangeSupportedAssets = await xdaiDataService.getExchangeSupportedAssets({ @@ -305,7 +305,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); exchangeSupportedAssets = await xdaiDataService.getExchangeSupportedAssets({ @@ -478,7 +478,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let quoteRequestPayload; let quotes; @@ -582,7 +582,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); let quoteRequestPayload; let quotes; diff --git a/test/specs/mainnet/transactionHistory/arbitrum.spec.js b/test/specs/mainnet/transactionHistory/arbitrum.spec.js index 0ede9d9..3eeb80d 100644 --- a/test/specs/mainnet/transactionHistory/arbitrum.spec.js +++ b/test/specs/mainnet/transactionHistory/arbitrum.spec.js @@ -23,7 +23,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -132,7 +132,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -185,8 +185,14 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // get transaction hash @@ -467,7 +473,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // Fetching historical transactions let transactions; @@ -688,7 +694,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -741,8 +747,14 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // get transaction hash @@ -1085,7 +1097,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // get the respective provider details let provider; @@ -1179,8 +1191,14 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // get transaction hash diff --git a/test/specs/mainnet/transactionHistory/matic.spec.js b/test/specs/mainnet/transactionHistory/matic.spec.js index 2cf1579..1323471 100644 --- a/test/specs/mainnet/transactionHistory/matic.spec.js +++ b/test/specs/mainnet/transactionHistory/matic.spec.js @@ -23,7 +23,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -132,7 +132,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -185,8 +185,14 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // get transaction hash @@ -467,7 +473,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // Fetching historical transactions let transactions; @@ -688,7 +694,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -741,8 +747,14 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // get transaction hash @@ -1085,7 +1097,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // get the respective provider details let provider; @@ -1179,8 +1191,14 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // get transaction hash diff --git a/test/specs/mainnet/transactionHistory/optimism.spec.js b/test/specs/mainnet/transactionHistory/optimism.spec.js index e74d23b..db6742e 100644 --- a/test/specs/mainnet/transactionHistory/optimism.spec.js +++ b/test/specs/mainnet/transactionHistory/optimism.spec.js @@ -23,7 +23,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -132,7 +132,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -185,8 +185,14 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // get transaction hash @@ -467,7 +473,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // Fetching historical transactions let transactions; @@ -688,7 +694,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -741,8 +747,14 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // get transaction hash @@ -1085,7 +1097,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // get the respective provider details let provider; @@ -1179,8 +1191,14 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // get transaction hash diff --git a/test/specs/mainnet/transactionHistory/xdai.spec.js b/test/specs/mainnet/transactionHistory/xdai.spec.js index 9bd2cad..1ed85e7 100644 --- a/test/specs/mainnet/transactionHistory/xdai.spec.js +++ b/test/specs/mainnet/transactionHistory/xdai.spec.js @@ -23,7 +23,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -132,7 +132,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -185,8 +185,14 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // get transaction hash @@ -467,7 +473,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // Fetching historical transactions let transactions; @@ -688,7 +694,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -741,8 +747,14 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // get transaction hash @@ -1085,7 +1097,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // get the respective provider details let provider; @@ -1179,8 +1191,14 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } // get transaction hash diff --git a/test/specs/mainnet/transferringFunds/arbitrum.spec.js b/test/specs/mainnet/transferringFunds/arbitrum.spec.js index deea1b6..757758d 100644 --- a/test/specs/mainnet/transferringFunds/arbitrum.spec.js +++ b/test/specs/mainnet/transferringFunds/arbitrum.spec.js @@ -24,7 +24,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -129,7 +129,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -344,8 +344,14 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -358,7 +364,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // get the respective provider details let provider; @@ -632,8 +638,14 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -646,7 +658,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // get erc721 Contract Interface let erc721Interface; @@ -868,8 +880,14 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -882,7 +900,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -1098,8 +1116,14 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -1115,7 +1139,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); const provider = new providers.JsonRpcProvider(); diff --git a/test/specs/mainnet/transferringFunds/matic.spec.js b/test/specs/mainnet/transferringFunds/matic.spec.js index 95e7dca..cc51a6c 100644 --- a/test/specs/mainnet/transferringFunds/matic.spec.js +++ b/test/specs/mainnet/transferringFunds/matic.spec.js @@ -24,7 +24,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -129,7 +129,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -344,8 +344,14 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -358,7 +364,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // get the respective provider details let provider; @@ -632,8 +638,14 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -646,7 +658,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // get erc721 Contract Interface let erc721Interface; @@ -868,8 +880,14 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -882,7 +900,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -1098,8 +1116,14 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -1115,7 +1139,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); const provider = new providers.JsonRpcProvider(); diff --git a/test/specs/mainnet/transferringFunds/optimism.spec.js b/test/specs/mainnet/transferringFunds/optimism.spec.js index 1a66d1d..6cbe328 100644 --- a/test/specs/mainnet/transferringFunds/optimism.spec.js +++ b/test/specs/mainnet/transferringFunds/optimism.spec.js @@ -24,7 +24,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -129,7 +129,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -344,8 +344,14 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -358,7 +364,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // get the respective provider details let provider; @@ -632,8 +638,14 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -646,7 +658,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // get erc721 Contract Interface let erc721Interface; @@ -868,8 +880,14 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -882,7 +900,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -1098,8 +1116,14 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -1115,7 +1139,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); const provider = new providers.JsonRpcProvider(); diff --git a/test/specs/mainnet/transferringFunds/xdai.spec.js b/test/specs/mainnet/transferringFunds/xdai.spec.js index a7e9a20..fbf745c 100644 --- a/test/specs/mainnet/transferringFunds/xdai.spec.js +++ b/test/specs/mainnet/transferringFunds/xdai.spec.js @@ -24,7 +24,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // initializating sdk try { @@ -129,7 +129,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -344,8 +344,14 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -358,7 +364,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // get the respective provider details let provider; @@ -632,8 +638,14 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -646,7 +658,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // get erc721 Contract Interface let erc721Interface; @@ -868,8 +880,14 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -882,7 +900,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', if (runTest) { await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); // clear the transaction batch try { @@ -1098,8 +1116,14 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', } catch (e) { console.error(e); const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_submitTransaction_1); + if (eString === "Error") { + console.warn(message.skip_transaction_error) + addContext(test, message.skip_transaction_error) + test.skip(); + } else { + addContext(test, eString); + assert.fail(message.fail_submitTransaction_1); + } } }, data.retry); // Retry this async test up to 5 times } else { @@ -1115,7 +1139,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', await customRetryAsync(async function () { - helper.wait(data.longTimeout); + helper.wait(data.mediumTimeout); const provider = new providers.JsonRpcProvider(); diff --git a/test/utils/baseTest.js b/test/utils/baseTest.js index ea184fc..cf29937 100644 --- a/test/utils/baseTest.js +++ b/test/utils/baseTest.js @@ -3,7 +3,7 @@ import helper from "./helper.js"; function customRetryAsync(fn, maxRetries) { return new Promise((resolve, reject) => { let retries = 0; - const retryDelay = 60000; // You can adjust the delay as needed + const retryDelay = 5000; // You can adjust the delay as needed async function run() { try {