From 226601a956594d00817cdb1fa5214242aae7936c Mon Sep 17 00:00:00 2001 From: bitpshr Date: Wed, 10 Oct 2018 14:52:26 -0400 Subject: EIP-1102: add user privacy option --- test/e2e/beta/metamask-beta-ui.spec.js | 16 ++++++++++++++++ test/e2e/metamask.spec.js | 33 ++++----------------------------- 2 files changed, 20 insertions(+), 29 deletions(-) (limited to 'test') diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js index 5acc00e25..3285939e7 100644 --- a/test/e2e/beta/metamask-beta-ui.spec.js +++ b/test/e2e/beta/metamask-beta-ui.spec.js @@ -284,6 +284,22 @@ describe('MetaMask', function () { }) }) + describe('Enable privacy mode', () => { + it('enables privacy mode', 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 privacyToggle = await findElement(driver, By.css('.settings-page__content-row:nth-of-type(9) .settings-page__content-item-col > div')) + await privacyToggle.click() + await delay(largeDelayMs * 2) + }) + }) + describe('Log out an log back in', () => { it('logs out of the account', async () => { await driver.findElement(By.css('.account-menu__icon')).click() diff --git a/test/e2e/metamask.spec.js b/test/e2e/metamask.spec.js index 4fee40af9..980113007 100644 --- a/test/e2e/metamask.spec.js +++ b/test/e2e/metamask.spec.js @@ -2,11 +2,6 @@ const path = require('path') const assert = require('assert') const { By, Key, until } = require('selenium-webdriver') const { delay, createModifiedTestBuild, setupBrowserAndExtension, verboseReportOnFailure } = require('./func') -const { - closeAllWindowHandlesExcept, - switchToWindowWithTitle, - switchToWindowWithUrlThatMatches, -} = require('./beta/helpers') describe('Metamask popup page', function () { const browser = process.env.SELENIUM_BROWSER @@ -188,7 +183,6 @@ describe('Metamask popup page', function () { }) it('restores from seed phrase', async function () { - await delay(1000) const restoreSeedLink = await driver.findElement(By.css('#app-content > div > div.app-primary.from-left > div > div.flex-row.flex-center.flex-grow > p')) assert.equal(await restoreSeedLink.getText(), 'Restore from seed phrase') await restoreSeedLink.click() @@ -207,10 +201,10 @@ describe('Metamask popup page', function () { }) it('balance renders', async function () { - await delay(1000) + await delay(500) const balance = await driver.findElement(By.css('#app-content > div > div.app-primary.from-right > div > div > div.flex-row > div.ether-balance.ether-balance-amount > div > div > div:nth-child(1) > div:nth-child(1)')) assert.equal(await balance.getText(), '100.000') - await delay(1000) + await delay(200) }) it('sends transaction', async function () { @@ -248,31 +242,12 @@ describe('Metamask popup page', function () { }) describe('Token Factory', function () { - let windowHandles - let extension - let dapp it('navigates to token factory', async function () { - await driver.get('http://token-factory-1102.now.sh') - await delay(7000) - windowHandles = await driver.getAllWindowHandles() - - dapp = await switchToWindowWithTitle(driver, 'Token Factory', windowHandles) - await delay(400) - extension = await switchToWindowWithUrlThatMatches(driver, /notification.html/, windowHandles) - await delay(400) - - await closeAllWindowHandlesExcept(driver, [extension, dapp]) - await switchToWindowWithUrlThatMatches(driver, /notification.html/, [extension, dapp]) - const approveButton = await driver.wait(until.elementLocated(By.xpath(`//button[contains(text(), 'APPROVE')]`)), 10000) - await approveButton.click() + await driver.get('http://tokenfactory.surge.sh/') }) it('navigates to create token contract link', async function () { - await delay(400) - await switchToWindowWithTitle(driver, 'Token Factory', windowHandles) - await delay(400) - const createToken = await driver.findElement(By.css('#bs-example-navbar-collapse-1 > ul > li:nth-child(3) > a')) await createToken.click() }) @@ -374,4 +349,4 @@ describe('Metamask popup page', function () { return matchedErrorObjects } -}) +}) \ No newline at end of file -- cgit v1.2.3