From 5beab87bf6dd67a87ece04f28adad3a2179b63eb Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Mon, 1 Oct 2018 12:23:53 -0230 Subject: Switch string concatenation to template string --- test/e2e/beta/metamask-beta-ui.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js index 7370f1a92..b8381cdee 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) -- cgit v1.2.3 From 9f2d074f9ef502d4dd7ec70847a3bfa403044a9c Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Mon, 1 Oct 2018 12:24:30 -0230 Subject: Update e2e tests for adding mutliple custom RPC endpoints Refs 56965b3 Refs #5267 The list of custom RPC endpoints is no longer limited to 3 entries so the test is now to confirm that they _all_ show up. --- test/e2e/beta/metamask-beta-ui.spec.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js index b8381cdee..ecad3e8fd 100644 --- a/test/e2e/beta/metamask-beta-ui.spec.js +++ b/test/e2e/beta/metamask-beta-ui.spec.js @@ -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) }) }) }) -- cgit v1.2.3 From b7946928fdefb134a876c116778de383fab893b6 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Mon, 1 Oct 2018 12:28:00 -0230 Subject: Don't log errors extraneously in e2e tests --- test/e2e/beta/helpers.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/e2e/beta/helpers.js b/test/e2e/beta/helpers.js index 73289e526..db0b47ef2 100644 --- a/test/e2e/beta/helpers.js +++ b/test/e2e/beta/helpers.js @@ -126,7 +126,6 @@ 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) { -- cgit v1.2.3 From 08b3f41ecd03c41272b86b001c884f8b893a39f3 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Mon, 1 Oct 2018 12:28:24 -0230 Subject: Fix error message shown in assertElementNotPresent e2e helper fn --- test/e2e/beta/helpers.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/e2e/beta/helpers.js b/test/e2e/beta/helpers.js index db0b47ef2..4055d8155 100644 --- a/test/e2e/beta/helpers.js +++ b/test/e2e/beta/helpers.js @@ -128,7 +128,5 @@ async function assertElementNotPresent (webdriver, driver, by) { } catch (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') } -- cgit v1.2.3