diff options
author | Dan Miller <danjm.com@gmail.com> | 2019-03-28 20:23:38 +0800 |
---|---|---|
committer | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2019-03-29 02:50:11 +0800 |
commit | a44f2bb6ebe6979efc3c4711147b2420aa290e15 (patch) | |
tree | eee9e78ea003db07d547000a965a5535b55210f0 /test/e2e/beta/metamask-beta-responsive-ui.spec.js | |
parent | 649a1d483a574dcff902708f95b37329a02709a8 (diff) | |
download | tangerine-wallet-browser-a44f2bb6ebe6979efc3c4711147b2420aa290e15.tar tangerine-wallet-browser-a44f2bb6ebe6979efc3c4711147b2420aa290e15.tar.gz tangerine-wallet-browser-a44f2bb6ebe6979efc3c4711147b2420aa290e15.tar.bz2 tangerine-wallet-browser-a44f2bb6ebe6979efc3c4711147b2420aa290e15.tar.lz tangerine-wallet-browser-a44f2bb6ebe6979efc3c4711147b2420aa290e15.tar.xz tangerine-wallet-browser-a44f2bb6ebe6979efc3c4711147b2420aa290e15.tar.zst tangerine-wallet-browser-a44f2bb6ebe6979efc3c4711147b2420aa290e15.zip |
Use webRequest to cancel all requests to infura in e2e tests.
Diffstat (limited to 'test/e2e/beta/metamask-beta-responsive-ui.spec.js')
-rw-r--r-- | test/e2e/beta/metamask-beta-responsive-ui.spec.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/e2e/beta/metamask-beta-responsive-ui.spec.js b/test/e2e/beta/metamask-beta-responsive-ui.spec.js index 6df1da051..b1ed8536e 100644 --- a/test/e2e/beta/metamask-beta-responsive-ui.spec.js +++ b/test/e2e/beta/metamask-beta-responsive-ui.spec.js @@ -75,7 +75,18 @@ describe('MetaMask', function () { 'Promise.resolve({ json: () => Promise.resolve(JSON.parse(\'' + fetchMockResponses.metametrics + '\')) }); } else if ' + '(args[0] === "https://dev.blockscale.net/api/gasexpress.json") { return ' + 'Promise.resolve({ json: () => Promise.resolve(JSON.parse(\'' + fetchMockResponses.gasExpress + '\')) }); } ' + - 'return window.origFetch(...args); }' + 'return window.origFetch(...args); };' + + 'function cancelInfuraRequest(requestDetails) {' + + 'console.log("Canceling: " + requestDetails.url);' + + 'return {' + + 'cancel: true' + + '};' + + ' }' + + 'window.chrome && window.chrome.webRequest && window.chrome.webRequest.onBeforeRequest.addListener(' + + 'cancelInfuraRequest,' + + '{urls: ["https://*.infura.io/*"]},' + + '["blocking"]' + + ');' ) }) |