diff options
Diffstat (limited to 'test/e2e/beta')
-rw-r--r-- | test/e2e/beta/helpers.js | 5 | ||||
-rw-r--r-- | test/e2e/beta/metamask-beta-ui.spec.js | 16 |
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) }) }) }) |