diff options
author | Evgeniy Filatov <efilatov@geeksforless.net> | 2018-08-20 01:25:33 +0800 |
---|---|---|
committer | Evgeniy Filatov <efilatov@geeksforless.net> | 2018-08-23 06:18:13 +0800 |
commit | b23cca14699b6c6a8c843c9cc020ec96fe758822 (patch) | |
tree | 482ceba0213032e1de8d614dc0cc5c76d8946875 /test/e2e | |
parent | 25eac2334b96b8b2af6b8859631d8a032bfdd2bb (diff) | |
download | tangerine-wallet-browser-b23cca14699b6c6a8c843c9cc020ec96fe758822.tar tangerine-wallet-browser-b23cca14699b6c6a8c843c9cc020ec96fe758822.tar.gz tangerine-wallet-browser-b23cca14699b6c6a8c843c9cc020ec96fe758822.tar.bz2 tangerine-wallet-browser-b23cca14699b6c6a8c843c9cc020ec96fe758822.tar.lz tangerine-wallet-browser-b23cca14699b6c6a8c843c9cc020ec96fe758822.tar.xz tangerine-wallet-browser-b23cca14699b6c6a8c843c9cc020ec96fe758822.tar.zst tangerine-wallet-browser-b23cca14699b6c6a8c843c9cc020ec96fe758822.zip |
implemented improvements to RPC history
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/beta/metamask-beta-ui.spec.js | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js index 40ef90506..bb562c83a 100644 --- a/test/e2e/beta/metamask-beta-ui.spec.js +++ b/test/e2e/beta/metamask-beta-ui.spec.js @@ -1011,4 +1011,64 @@ describe('MetaMask', function () { await delay(regularDelayMs) }) }) + + describe('Stores custom RPC history', () => { + const customRpcUrls = [ + 'https://mainnet.infura.io/1', + 'https://mainnet.infura.io/2', + 'https://mainnet.infura.io/3', + 'https://mainnet.infura.io/4', + ] + + customRpcUrls.forEach(customRpcUrl => { + it('creates custom RPC: ' + customRpcUrl, async () => { + const networkDropdown = await findElement(driver, By.css('.network-name')) + await networkDropdown.click() + await delay(regularDelayMs) + + const customRpcButton = await findElement(driver, By.xpath(`//span[contains(text(), 'Custom RPC')]`)) + await customRpcButton.click() + await delay(regularDelayMs) + + const customRpcInput = await findElement(driver, By.css('input[placeholder="New RPC URL"]')) + await customRpcInput.clear() + await customRpcInput.sendKeys(customRpcUrl) + + const customRpcSave = await findElement(driver, By.css('.settings__rpc-save-button')) + await customRpcSave.click() + await delay(largeDelayMs * 2) + }) + }) + + it('selects another provider', async () => { + const networkDropdown = await findElement(driver, By.css('.network-name')) + await networkDropdown.click() + await delay(regularDelayMs) + + const customRpcButton = await findElement(driver, By.xpath(`//span[contains(text(), 'Main Ethereum Network')]`)) + await customRpcButton.click() + await delay(largeDelayMs * 2) + }) + + it('finds 3 recent RPCs in history', async () => { + const networkDropdown = await findElement(driver, By.css('.network-name')) + await networkDropdown.click() + await delay(regularDelayMs) + + // oldest selected RPC is not found + await assertElementNotPresent(webdriver, driver, By.xpath(`//span[contains(text(), '${customRpcUrls[0]}')]`)) + + // only recent 3 are found and in correct order (most recent at the top) + const customRpcs = await findElements(driver, By.xpath(`//span[contains(text(), 'https://mainnet.infura.io/')]`)) + + assert.equal(customRpcs.length, 3) + + for (let i = 0; i < customRpcs.length; i++) { + const linkText = await customRpcs[i].getText() + const rpcUrl = customRpcUrls[customRpcUrls.length - i - 1] + + assert.notEqual(linkText.indexOf(rpcUrl), -1) + } + }) + }) })
\ No newline at end of file |