aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-10-01 23:22:13 +0800
committerGitHub <noreply@github.com>2018-10-01 23:22:13 +0800
commit23aabcca6fb3deb5009564f16ed3edd46061f449 (patch)
treedbc7225914446397d2437c8f1420b7e7cc67086d
parentb5169340ab2c0fed27d770c2d120961559b37965 (diff)
parent08b3f41ecd03c41272b86b001c884f8b893a39f3 (diff)
downloadtangerine-wallet-browser-23aabcca6fb3deb5009564f16ed3edd46061f449.tar
tangerine-wallet-browser-23aabcca6fb3deb5009564f16ed3edd46061f449.tar.gz
tangerine-wallet-browser-23aabcca6fb3deb5009564f16ed3edd46061f449.tar.bz2
tangerine-wallet-browser-23aabcca6fb3deb5009564f16ed3edd46061f449.tar.lz
tangerine-wallet-browser-23aabcca6fb3deb5009564f16ed3edd46061f449.tar.xz
tangerine-wallet-browser-23aabcca6fb3deb5009564f16ed3edd46061f449.tar.zst
tangerine-wallet-browser-23aabcca6fb3deb5009564f16ed3edd46061f449.zip
Merge pull request #5402 from whymarrh/fix-e2e-tests
Fix e2e tests for adding custom RPC endpoints
-rw-r--r--test/e2e/beta/helpers.js5
-rw-r--r--test/e2e/beta/metamask-beta-ui.spec.js16
2 files changed, 4 insertions, 17 deletions
diff --git a/test/e2e/beta/helpers.js b/test/e2e/beta/helpers.js
index 73289e526..4055d8155 100644
--- a/test/e2e/beta/helpers.js
+++ b/test/e2e/beta/helpers.js
@@ -126,10 +126,7 @@ async function assertElementNotPresent (webdriver, driver, by) {
try {
dataTab = await findElement(driver, by, 4000)
} catch (err) {
- console.log(err)
assert(err instanceof webdriver.error.NoSuchElementError || err instanceof webdriver.error.TimeoutError)
}
- if (dataTab) {
- assert(false, 'Data tab should not be present')
- }
+ assert.ok(!dataTab, 'Found element that should not be present')
}
diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js
index 7370f1a92..ecad3e8fd 100644
--- a/test/e2e/beta/metamask-beta-ui.spec.js
+++ b/test/e2e/beta/metamask-beta-ui.spec.js
@@ -1030,7 +1030,7 @@ describe('MetaMask', function () {
]
customRpcUrls.forEach(customRpcUrl => {
- it('creates custom RPC: ' + customRpcUrl, async () => {
+ it(`creates custom RPC: ${customRpcUrl}`, async () => {
const networkDropdown = await findElement(driver, By.css('.network-name'))
await networkDropdown.click()
await delay(regularDelayMs)
@@ -1059,25 +1059,15 @@ describe('MetaMask', function () {
await delay(largeDelayMs * 2)
})
- it('finds 3 recent RPCs in history', async () => {
+ it('finds all 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)
- }
+ assert.equal(customRpcs.length, customRpcUrls.length)
})
})
})