From c482c9926c4514e67105c61f4909ff019caeb7f0 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Mon, 24 Sep 2018 13:27:37 -0230 Subject: Default to the new UI for first time users --- app/scripts/controllers/preferences.js | 4 +++- app/scripts/ui.js | 17 ++++------------- ui/app/select-app.js | 29 +++++++++++------------------ ui/app/selectors.js | 8 ++++++++ 4 files changed, 26 insertions(+), 32 deletions(-) diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index ffb593b09..a5931ddc9 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -32,7 +32,9 @@ class PreferencesController { tokens: [], suggestedTokens: {}, useBlockie: false, - featureFlags: {}, + featureFlags: { + betaUI: true, + }, currentLocale: opts.initLangCode, identities: {}, lostIdentities: {}, diff --git a/app/scripts/ui.js b/app/scripts/ui.js index 444097f14..682a4aaac 100644 --- a/app/scripts/ui.js +++ b/app/scripts/ui.js @@ -1,6 +1,7 @@ const injectCss = require('inject-css') const OldMetaMaskUiCss = require('../../old-ui/css') const NewMetaMaskUiCss = require('../../ui/css') +const {getShouldUseNewUi} = require('../../ui/app/selectors') const startPopup = require('./popup-core') const PortStream = require('extension-port-stream') const { getEnvironmentType } = require('./lib/util') @@ -33,10 +34,6 @@ async function start () { return state } - // inject css - // const css = MetaMaskUiCss() - // injectCss(css) - // identify window type (popup, notification) const windowType = getEnvironmentType(window.location.href) global.METAMASK_UI_TYPE = windowType @@ -51,15 +48,9 @@ async function start () { startPopup({ container, connectionStream }, (err, store) => { if (err) return displayCriticalError(err) - // Code commented out until we begin auto adding users to NewUI - // const { isMascara, identities = {}, featureFlags = {} } = store.getState().metamask - // const firstTime = Object.keys(identities).length === 0 - const { isMascara, featureFlags = {} } = store.getState().metamask - let betaUIState = featureFlags.betaUI - - // Code commented out until we begin auto adding users to NewUI - // const useBetaCss = isMascara || firstTime || betaUIState - const useBetaCss = isMascara || betaUIState + const state = store.getState() + let betaUIState = Boolean(state.featureFlags && state.featureFlags.betaUI) + const useBetaCss = getShouldUseNewUi(state) let css = useBetaCss ? NewMetaMaskUiCss() : OldMetaMaskUiCss() let deleteInjectedCss = injectCss(css) diff --git a/ui/app/select-app.js b/ui/app/select-app.js index f2e8e8d10..f5f9e33ab 100644 --- a/ui/app/select-app.js +++ b/ui/app/select-app.js @@ -5,17 +5,14 @@ const h = require('react-hyperscript') const { HashRouter } = require('react-router-dom') const App = require('./app') const OldApp = require('../../old-ui/app/app') -const { autoAddToBetaUI } = require('./selectors') +const { getShouldUseNewUi } = require('./selectors') const { setFeatureFlag } = require('./actions') const I18nProvider = require('./i18n-provider') function mapStateToProps (state) { return { - betaUI: state.metamask.featureFlags.betaUI, - autoAdd: autoAddToBetaUI(state), - isUnlocked: state.metamask.isUnlocked, isMascara: state.metamask.isMascara, - firstTime: Object.keys(state.metamask.identities).length === 0, + shouldUseNewUi: getShouldUseNewUi(state), } } @@ -56,17 +53,13 @@ SelectedApp.prototype.componentWillReceiveProps = function (nextProps) { } SelectedApp.prototype.render = function () { - // Code commented out until we begin auto adding users to NewUI - // const { betaUI, isMascara, firstTime } = this.props - // const Selected = betaUI || isMascara || firstTime ? App : OldApp - - const { betaUI, isMascara } = this.props - - return betaUI || isMascara - ? h(HashRouter, { - hashType: 'noslash', - }, [ - h(I18nProvider, [ h(App) ]), - ]) - : h(OldApp) + const { shouldUseNewUi } = this.props + const newUi = h(HashRouter, { + hashType: 'noslash', + }, [ + h(I18nProvider, [ + h(App), + ]), + ]) + return shouldUseNewUi ? newUi : h(OldApp) } diff --git a/ui/app/selectors.js b/ui/app/selectors.js index 7209f19d1..b518527c9 100644 --- a/ui/app/selectors.js +++ b/ui/app/selectors.js @@ -31,6 +31,7 @@ const selectors = { getSelectedTokenToFiatRate, getSelectedTokenContract, autoAddToBetaUI, + getShouldUseNewUi, getSendMaxModeState, getCurrentViewContext, getTotalUnapprovedCount, @@ -185,6 +186,13 @@ function autoAddToBetaUI (state) { return userIsNotInBeta && userPassesThreshold } +function getShouldUseNewUi (state) { + const isAlreadyUsingBetaUi = state.metamask.featureFlags.betaUI + const isMascara = state.metamask.isMascara + const isFreshInstall = Object.keys(state.metamask.identities).length === 0 + return isAlreadyUsingBetaUi || isMascara || isFreshInstall +} + function getCurrentViewContext (state) { const { currentView = {} } = state.appState return currentView.context -- cgit v1.2.3 From 921125b7fd999965d757c86772b845bdcbc85c20 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Mon, 24 Sep 2018 18:15:15 -0230 Subject: Update new UI e2e tests for new UI default --- test/e2e/beta/drizzle.spec.js | 16 ----- test/e2e/beta/from-import-beta-ui.spec.js | 73 +++-------------------- test/e2e/beta/metamask-beta-responsive-ui.spec.js | 71 +++------------------- test/e2e/beta/metamask-beta-ui.spec.js | 70 +++------------------- 4 files changed, 21 insertions(+), 209 deletions(-) diff --git a/test/e2e/beta/drizzle.spec.js b/test/e2e/beta/drizzle.spec.js index a9d72a9ba..e669dabcc 100644 --- a/test/e2e/beta/drizzle.spec.js +++ b/test/e2e/beta/drizzle.spec.js @@ -81,22 +81,6 @@ describe('MetaMask', function () { }) it('selects the new UI option', async () => { - try { - const overlay = await findElement(driver, By.css('.full-flex-height')) - await driver.wait(until.stalenessOf(overlay)) - } catch (e) {} - - let button - try { - button = await findElement(driver, By.xpath("//button[contains(text(), 'Try it now')]")) - } catch (e) { - await loadExtension(driver, extensionId) - await delay(largeDelayMs) - button = await findElement(driver, By.xpath("//button[contains(text(), 'Try it now')]")) - } - await button.click() - await delay(regularDelayMs) - // Close all other tabs const [tab0, tab1, tab2] = await driver.getAllWindowHandles() await driver.switchTo().window(tab0) diff --git a/test/e2e/beta/from-import-beta-ui.spec.js b/test/e2e/beta/from-import-beta-ui.spec.js index 77a61a73e..4273e7e39 100644 --- a/test/e2e/beta/from-import-beta-ui.spec.js +++ b/test/e2e/beta/from-import-beta-ui.spec.js @@ -12,11 +12,9 @@ const { } = require('../func') const { checkBrowserForConsoleErrors, - closeAllWindowHandlesExcept, verboseReportOnFailure, findElement, findElements, - loadExtension, } = require('./helpers') @@ -27,7 +25,6 @@ describe('Using MetaMask with an existing account', function () { const testSeedPhrase = 'phrase upgrade clock rough situate wedding elder clever doctor stamp excess tent' const testAddress = '0xE18035BF8712672935FDB4e5e431b1a0183d2DFC' const testPrivateKey2 = '14abe6f4aab7f9f626fe981c864d0adeb5685f289ac9270c27b8fd790b4235d6' - const tinyDelayMs = 500 const regularDelayMs = 1000 const largeDelayMs = regularDelayMs * 2 @@ -40,7 +37,7 @@ describe('Using MetaMask with an existing account', function () { const extensionPath = path.resolve('dist/chrome') driver = buildChromeWebDriver(extensionPath) extensionId = await getExtensionIdChrome(driver) - await driver.get(`chrome-extension://${extensionId}/popup.html`) + await driver.get(`chrome-extension://${extensionId}/home.html`) await delay(regularDelayMs) break } @@ -50,7 +47,7 @@ describe('Using MetaMask with an existing account', function () { await installWebExt(driver, extensionPath) await delay(regularDelayMs) extensionId = await getExtensionIdFirefox(driver) - await driver.get(`moz-extension://${extensionId}/popup.html`) + await driver.get(`moz-extension://${extensionId}/home.html`) await delay(regularDelayMs) break } @@ -75,69 +72,13 @@ describe('Using MetaMask with an existing account', function () { await driver.quit() }) - describe('New UI setup', async function () { - it('switches to first tab', async function () { - await delay(tinyDelayMs) - const [firstTab] = await driver.getAllWindowHandles() - await driver.switchTo().window(firstTab) - await delay(regularDelayMs) - }) - - it('selects the new UI option', async () => { - try { - const overlay = await findElement(driver, By.css('.full-flex-height')) - await driver.wait(until.stalenessOf(overlay)) - } catch (e) {} - - let button - try { - button = await findElement(driver, By.xpath("//button[contains(text(), 'Try it now')]")) - } catch (e) { - await loadExtension(driver, extensionId) - await delay(largeDelayMs) - button = await findElement(driver, By.xpath("//button[contains(text(), 'Try it now')]")) - } - await button.click() - await delay(regularDelayMs) - - // Close all other tabs - const [tab0, tab1, tab2] = await driver.getAllWindowHandles() - await driver.switchTo().window(tab0) - await delay(tinyDelayMs) - - let selectedUrl = await driver.getCurrentUrl() - await delay(tinyDelayMs) - if (tab0 && selectedUrl.match(/popup.html/)) { - await closeAllWindowHandlesExcept(driver, tab0) - } else if (tab1) { - await driver.switchTo().window(tab1) - selectedUrl = await driver.getCurrentUrl() - await delay(tinyDelayMs) - if (selectedUrl.match(/popup.html/)) { - await closeAllWindowHandlesExcept(driver, tab1) - } else if (tab2) { - await driver.switchTo().window(tab2) - selectedUrl = await driver.getCurrentUrl() - selectedUrl.match(/popup.html/) && await closeAllWindowHandlesExcept(driver, tab2) - } - } else { - throw new Error('popup.html not found') - } - await delay(regularDelayMs) - const [appTab] = await driver.getAllWindowHandles() - await driver.switchTo().window(appTab) - await delay(tinyDelayMs) - - await loadExtension(driver, extensionId) - await delay(regularDelayMs) - - const continueBtn = await findElement(driver, By.css('.welcome-screen__button')) - await continueBtn.click() - await delay(regularDelayMs) + describe('First time flow starting from an existing seed phrase', () => { + it('clicks the continue button on the welcome screen', async () => { + const welcomeScreenBtn = await findElement(driver, By.css('.welcome-screen__button')) + welcomeScreenBtn.click() + await delay(largeDelayMs) }) - }) - describe('First time flow starting from an existing seed phrase', () => { it('imports a seed phrase', async () => { const [seedPhrase] = await findElements(driver, By.xpath(`//a[contains(text(), 'Import with seed phrase')]`)) await seedPhrase.click() diff --git a/test/e2e/beta/metamask-beta-responsive-ui.spec.js b/test/e2e/beta/metamask-beta-responsive-ui.spec.js index b93563b25..107f9aa6c 100644 --- a/test/e2e/beta/metamask-beta-responsive-ui.spec.js +++ b/test/e2e/beta/metamask-beta-responsive-ui.spec.js @@ -12,7 +12,6 @@ const { } = require('../func') const { checkBrowserForConsoleErrors, - closeAllWindowHandlesExcept, findElement, findElements, loadExtension, @@ -37,7 +36,7 @@ describe('MetaMask', function () { const extPath = path.resolve('dist/chrome') driver = buildChromeWebDriver(extPath, { responsive: true }) extensionId = await getExtensionIdChrome(driver) - await driver.get(`chrome-extension://${extensionId}/popup.html`) + await driver.get(`chrome-extension://${extensionId}/home.html`) break } case 'firefox': { @@ -46,7 +45,7 @@ describe('MetaMask', function () { await installWebExt(driver, extPath) await delay(700) extensionId = await getExtensionIdFirefox(driver) - await driver.get(`moz-extension://${extensionId}/popup.html`) + await driver.get(`moz-extension://${extensionId}/home.html`) } } }) @@ -69,69 +68,13 @@ describe('MetaMask', function () { await driver.quit() }) - describe('New UI setup', async function () { - it('switches to first tab', async function () { - await delay(tinyDelayMs) - const [firstTab] = await driver.getAllWindowHandles() - await driver.switchTo().window(firstTab) - await delay(regularDelayMs) - }) - - it('selects the new UI option', async () => { - try { - const overlay = await findElement(driver, By.css('.full-flex-height')) - await driver.wait(until.stalenessOf(overlay)) - } catch (e) {} - - let button - try { - button = await findElement(driver, By.xpath("//button[contains(text(), 'Try it now')]")) - } catch (e) { - await loadExtension(driver, extensionId) - await delay(largeDelayMs) - button = await findElement(driver, By.xpath("//button[contains(text(), 'Try it now')]")) - } - await button.click() - await delay(regularDelayMs) - - // Close all other tabs - const [tab0, tab1, tab2] = await driver.getAllWindowHandles() - await driver.switchTo().window(tab0) - await delay(tinyDelayMs) - - let selectedUrl = await driver.getCurrentUrl() - await delay(tinyDelayMs) - if (tab0 && selectedUrl.match(/popup.html/)) { - await closeAllWindowHandlesExcept(driver, tab0) - } else if (tab1) { - await driver.switchTo().window(tab1) - selectedUrl = await driver.getCurrentUrl() - await delay(tinyDelayMs) - if (selectedUrl.match(/popup.html/)) { - await closeAllWindowHandlesExcept(driver, tab1) - } else if (tab2) { - await driver.switchTo().window(tab2) - selectedUrl = await driver.getCurrentUrl() - selectedUrl.match(/popup.html/) && await closeAllWindowHandlesExcept(driver, tab2) - } - } else { - throw new Error('popup.html not found') - } - await delay(regularDelayMs) - const [appTab] = await driver.getAllWindowHandles() - await driver.switchTo().window(appTab) - await delay(tinyDelayMs) - - await loadExtension(driver, extensionId) - await delay(regularDelayMs) - - const continueBtn = await findElement(driver, By.css('.welcome-screen__button')) - await continueBtn.click() - await delay(regularDelayMs) + describe('Going through the first time flow', () => { + it('clicks the continue button on the welcome screen', async () => { + const welcomeScreenBtn = await findElement(driver, By.css('.welcome-screen__button')) + welcomeScreenBtn.click() + await delay(largeDelayMs) }) - }) - describe('Going through the first time flow', () => { it('accepts a secure password', async () => { const passwordBox = await findElement(driver, By.css('.create-password #create-password')) const passwordBoxConfirm = await findElement(driver, By.css('.create-password #confirm-password')) diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js index 0ef945f8d..9e96ceee6 100644 --- a/test/e2e/beta/metamask-beta-ui.spec.js +++ b/test/e2e/beta/metamask-beta-ui.spec.js @@ -42,7 +42,7 @@ describe('MetaMask', function () { const extPath = path.resolve('dist/chrome') driver = buildChromeWebDriver(extPath) extensionId = await getExtensionIdChrome(driver) - await driver.get(`chrome-extension://${extensionId}/popup.html`) + await driver.get(`chrome-extension://${extensionId}/home.html`) break } case 'firefox': { @@ -51,7 +51,7 @@ describe('MetaMask', function () { await installWebExt(driver, extPath) await delay(700) extensionId = await getExtensionIdFirefox(driver) - await driver.get(`moz-extension://${extensionId}/popup.html`) + await driver.get(`moz-extension://${extensionId}/home.html`) } } }) @@ -74,69 +74,13 @@ describe('MetaMask', function () { await driver.quit() }) - describe('New UI setup', async function () { - it('switches to first tab', async function () { - await delay(tinyDelayMs) - const [firstTab] = await driver.getAllWindowHandles() - await driver.switchTo().window(firstTab) - await delay(regularDelayMs) - }) - - it('selects the new UI option', async () => { - try { - const overlay = await findElement(driver, By.css('.full-flex-height')) - await driver.wait(until.stalenessOf(overlay)) - } catch (e) {} - - let button - try { - button = await findElement(driver, By.xpath("//button[contains(text(), 'Try it now')]")) - } catch (e) { - await loadExtension(driver, extensionId) - await delay(largeDelayMs) - button = await findElement(driver, By.xpath("//button[contains(text(), 'Try it now')]")) - } - await button.click() - await delay(regularDelayMs) - - // Close all other tabs - const [tab0, tab1, tab2] = await driver.getAllWindowHandles() - await driver.switchTo().window(tab0) - await delay(tinyDelayMs) - - let selectedUrl = await driver.getCurrentUrl() - await delay(tinyDelayMs) - if (tab0 && selectedUrl.match(/popup.html/)) { - await closeAllWindowHandlesExcept(driver, tab0) - } else if (tab1) { - await driver.switchTo().window(tab1) - selectedUrl = await driver.getCurrentUrl() - await delay(tinyDelayMs) - if (selectedUrl.match(/popup.html/)) { - await closeAllWindowHandlesExcept(driver, tab1) - } else if (tab2) { - await driver.switchTo().window(tab2) - selectedUrl = await driver.getCurrentUrl() - selectedUrl.match(/popup.html/) && await closeAllWindowHandlesExcept(driver, tab2) - } - } else { - throw new Error('popup.html not found') - } - await delay(regularDelayMs) - const [appTab] = await driver.getAllWindowHandles() - await driver.switchTo().window(appTab) - await delay(tinyDelayMs) - - await loadExtension(driver, extensionId) - await delay(regularDelayMs) - - const continueBtn = await findElement(driver, By.css('.welcome-screen__button')) - await continueBtn.click() - await delay(regularDelayMs) + describe('Going through the first time flow', () => { + it('clicks the continue button on the welcome screen', async () => { + const welcomeScreenBtn = await findElement(driver, By.css('.welcome-screen__button')) + welcomeScreenBtn.click() + await delay(largeDelayMs) }) - }) - describe('Going through the first time flow', () => { it('accepts a secure password', async () => { const passwordBox = await findElement(driver, By.css('.create-password #create-password')) const passwordBoxConfirm = await findElement(driver, By.css('.create-password #confirm-password')) -- cgit v1.2.3 From 2902fa948fb4582bd49587bc5638f5f4bc947dc3 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Mon, 19 Nov 2018 13:43:49 -0330 Subject: Add timeout to waitUntilXWindowHandles e2e helper fn --- test/e2e/beta/helpers.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/test/e2e/beta/helpers.js b/test/e2e/beta/helpers.js index 08416857e..5e3f45b2b 100644 --- a/test/e2e/beta/helpers.js +++ b/test/e2e/beta/helpers.js @@ -85,11 +85,22 @@ async function openNewPage (driver, url) { await delay(1000) } -async function waitUntilXWindowHandles (driver, x) { - const windowHandles = await driver.getAllWindowHandles() - if (windowHandles.length === x) return - await delay(1000) - return await waitUntilXWindowHandles(driver, x) +async function waitUntilXWindowHandles (driver, x, delayStep = 1000, timeout = 5000) { + let timeElapsed = 0 + async function _pollWindowHandles () { + const windowHandles = await driver.getAllWindowHandles() + if (windowHandles.length === x) { + return + } + await delay(delayStep) + timeElapsed += delayStep + if (timeElapsed > timeout) { + throw new Error('waitUntilXWindowHandles timed out polling window handles') + } else { + await _pollWindowHandles() + } + } + return await _pollWindowHandles() } async function switchToWindowWithTitle (driver, title, windowHandles) { -- cgit v1.2.3 From c5da84d7a28f1ee85b90564d6efb24fcbb5fe744 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Mon, 24 Sep 2018 15:47:45 -0230 Subject: Remove "Beta" from header logo --- app/images/logo/metamask-logo-horizontal-beta.svg | 115 --------------------- app/images/logo/metamask-logo-horizontal.svg | 62 +++++++++++ .../components/app-header/app-header.component.js | 2 +- 3 files changed, 63 insertions(+), 116 deletions(-) delete mode 100644 app/images/logo/metamask-logo-horizontal-beta.svg create mode 100644 app/images/logo/metamask-logo-horizontal.svg diff --git a/app/images/logo/metamask-logo-horizontal-beta.svg b/app/images/logo/metamask-logo-horizontal-beta.svg deleted file mode 100644 index b1fa040ac..000000000 --- a/app/images/logo/metamask-logo-horizontal-beta.svg +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/images/logo/metamask-logo-horizontal.svg b/app/images/logo/metamask-logo-horizontal.svg new file mode 100644 index 000000000..8e0bdb938 --- /dev/null +++ b/app/images/logo/metamask-logo-horizontal.svg @@ -0,0 +1,62 @@ + + + + metamask-logo-horizontal-beta + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ui/app/components/app-header/app-header.component.js b/ui/app/components/app-header/app-header.component.js index c82dc1de9..83ec4809d 100644 --- a/ui/app/components/app-header/app-header.component.js +++ b/ui/app/components/app-header/app-header.component.js @@ -108,7 +108,7 @@ export default class AppHeader extends PureComponent { > Date: Mon, 24 Sep 2018 15:56:51 -0230 Subject: Update new UI links in the old UI s/Beta/New/ --- old-ui/app/components/app-bar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/old-ui/app/components/app-bar.js b/old-ui/app/components/app-bar.js index fa8e499ed..c0da36615 100644 --- a/old-ui/app/components/app-bar.js +++ b/old-ui/app/components/app-bar.js @@ -422,7 +422,7 @@ module.exports = class AppBar extends Component { onClick: () => { dispatch(actions.setFeatureFlag('betaUI', true, 'BETA_UI_NOTIFICATION_MODAL')) }, - }, 'Try Beta!'), + }, 'Try New UI!'), ]) } -- cgit v1.2.3 From 444c68ae535bb7b7da1a65c95f8b5d6f4af6e324 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Mon, 24 Sep 2018 15:59:00 -0230 Subject: Don't announce new UI to users switching back --- app/scripts/controllers/preferences.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index a5931ddc9..b21cdfb36 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -34,6 +34,7 @@ class PreferencesController { useBlockie: false, featureFlags: { betaUI: true, + skipAnnounceBetaUI: true, }, currentLocale: opts.initLangCode, identities: {}, -- cgit v1.2.3 From 6b32e82ac1279900225d52b32696ae0b9ebea273 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Fri, 26 Oct 2018 10:42:29 +0200 Subject: Remove "Beta" from welcome messages More sed magic: sed -i.bak 's/MetaMask Beta/MetaMask/' app/_locales/**/messages.json && \ find app/_locales -name '*.bak' -delete sed -i.bak 's/"welcomeBeta"/"welcome"/' app/_locales/**/messages.json && \ find app/_locales -name '*.bak' -delete --- app/_locales/cs/messages.json | 4 ++-- app/_locales/de/messages.json | 4 ++-- app/_locales/en/messages.json | 4 ++-- app/_locales/es/messages.json | 4 ++-- app/_locales/fr/messages.json | 2 +- app/_locales/hn/messages.json | 2 +- app/_locales/ht/messages.json | 4 ++-- app/_locales/it/messages.json | 2 +- app/_locales/ja/messages.json | 2 +- app/_locales/ko/messages.json | 2 +- app/_locales/nl/messages.json | 4 ++-- app/_locales/pl/messages.json | 6 +++--- app/_locales/pt/messages.json | 4 ++-- app/_locales/ru/messages.json | 4 ++-- app/_locales/sl/messages.json | 4 ++-- app/_locales/th/messages.json | 2 +- app/_locales/tml/messages.json | 2 +- app/_locales/tr/messages.json | 4 ++-- app/_locales/zh_CN/messages.json | 2 +- app/_locales/zh_TW/messages.json | 4 ++-- ui/app/welcome-screen.js | 2 +- 21 files changed, 34 insertions(+), 34 deletions(-) diff --git a/app/_locales/cs/messages.json b/app/_locales/cs/messages.json index fde553c9e..cac436b1b 100644 --- a/app/_locales/cs/messages.json +++ b/app/_locales/cs/messages.json @@ -942,8 +942,8 @@ "warning": { "message": "Varování" }, - "welcomeBeta": { - "message": "Vítejte v MetaMask Beta" + "welcome": { + "message": "Vítejte v MetaMask" }, "whatsThis": { "message": "Co to je?" diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index 9404a9824..71421a4d1 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -918,8 +918,8 @@ "warning": { "message": "Warnung" }, - "welcomeBeta": { - "message": "Willkommen zu MetaMask Beta" + "welcome": { + "message": "Willkommen zu MetaMask" }, "whatsThis": { "message": "Was ist das?" diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 7a70937a3..14810782a 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -1357,8 +1357,8 @@ "welcomeBack": { "message": "Welcome Back!" }, - "welcomeBeta": { - "message": "Welcome to MetaMask Beta" + "welcome": { + "message": "Welcome to MetaMask" }, "whatsThis": { "message": "What's this?" diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json index 55276e1ec..3043e2ac0 100644 --- a/app/_locales/es/messages.json +++ b/app/_locales/es/messages.json @@ -918,8 +918,8 @@ "warning": { "message": "Advertencia" }, - "welcomeBeta": { - "message": "Bienvenido a MetaMask Beta" + "welcome": { + "message": "Bienvenido a MetaMask" }, "whatsThis": { "message": "¿Qué es esto?" diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index 17306d0f2..3e89afcc9 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -1303,7 +1303,7 @@ "welcomeBack": { "message": "Bienvenue à nouveau !" }, - "welcomeBeta": { + "welcome": { "message": "Bienvenue dans la Beta de MetaMask" }, "whatsThis": { diff --git a/app/_locales/hn/messages.json b/app/_locales/hn/messages.json index 8e2281418..d9e74800c 100644 --- a/app/_locales/hn/messages.json +++ b/app/_locales/hn/messages.json @@ -849,7 +849,7 @@ "warning": { "message": "चेतावनी" }, - "welcomeBeta": { + "welcome": { "message": "मेटामास्क बीटा में आपका स्वागत है" }, "whatsThis": { diff --git a/app/_locales/ht/messages.json b/app/_locales/ht/messages.json index ff44af903..30ed2621f 100644 --- a/app/_locales/ht/messages.json +++ b/app/_locales/ht/messages.json @@ -1327,8 +1327,8 @@ "welcomeBack": { "message": "Bon Retou!" }, - "welcomeBeta": { - "message": "Byenveni nan MetaMask Beta" + "welcome": { + "message": "Byenveni nan MetaMask" }, "whatsThis": { "message": "Kisa sa ye?" diff --git a/app/_locales/it/messages.json b/app/_locales/it/messages.json index e97c28e42..70630f237 100644 --- a/app/_locales/it/messages.json +++ b/app/_locales/it/messages.json @@ -1309,7 +1309,7 @@ "welcomeBack": { "message": "Bentornato!" }, - "welcomeBeta": { + "welcome": { "message": "Benvenuto nella Beta di MetaMask" }, "whatsThis": { diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json index 8ae363030..93b5447d7 100644 --- a/app/_locales/ja/messages.json +++ b/app/_locales/ja/messages.json @@ -793,7 +793,7 @@ "welcomeBack": { "message": "おかえりなさい!" }, - "welcomeBeta": { + "welcome": { "message": "MetaMask ベータ版へようこそ!" }, "whatsThis": { diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json index af1c32615..cadb0da06 100644 --- a/app/_locales/ko/messages.json +++ b/app/_locales/ko/messages.json @@ -1273,7 +1273,7 @@ "welcomeBack": { "message": "환영합니다!" }, - "welcomeBeta": { + "welcome": { "message": "메타마스크 Beta에 오신 것을 환영합니다" }, "whatsThis": { diff --git a/app/_locales/nl/messages.json b/app/_locales/nl/messages.json index 5d9f1f3ab..3a041327b 100644 --- a/app/_locales/nl/messages.json +++ b/app/_locales/nl/messages.json @@ -849,8 +849,8 @@ "warning": { "message": "Waarschuwing" }, - "welcomeBeta": { - "message": "Welkom bij MetaMask Beta" + "welcome": { + "message": "Welkom bij MetaMask" }, "whatsThis": { "message": "Wat is dit?" diff --git a/app/_locales/pl/messages.json b/app/_locales/pl/messages.json index c6d797c34..ddd4131bb 100644 --- a/app/_locales/pl/messages.json +++ b/app/_locales/pl/messages.json @@ -1192,8 +1192,8 @@ "welcomeBack": { "message": "Witaj z powrotem!" }, - "welcomeBeta": { - "message": "Witaj w MetaMask Beta" + "welcome": { + "message": "Witaj w MetaMask" }, "whatsThis": { "message": "Co to jest?" @@ -1210,4 +1210,4 @@ "yourPrivateSeedPhrase": { "message": "Twoja prywatna fraza seed" } -} \ No newline at end of file +} diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json index 8e07aaef5..4e3465936 100644 --- a/app/_locales/pt/messages.json +++ b/app/_locales/pt/messages.json @@ -849,8 +849,8 @@ "warning": { "message": "Aviso" }, - "welcomeBeta": { - "message": "Bem-vindo ao MetaMask Beta" + "welcome": { + "message": "Bem-vindo ao MetaMask" }, "whatsThis": { "message": "O que é isto?" diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index 917b2b615..8788d9d92 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -927,8 +927,8 @@ "warning": { "message": "Предупреждение" }, - "welcomeBeta": { - "message": "Добро пожаловать в MetaMask Beta" + "welcome": { + "message": "Добро пожаловать в MetaMask" }, "whatsThis": { "message": "Что это?" diff --git a/app/_locales/sl/messages.json b/app/_locales/sl/messages.json index ee9f67b97..7b8c7debd 100644 --- a/app/_locales/sl/messages.json +++ b/app/_locales/sl/messages.json @@ -1348,8 +1348,8 @@ "welcomeBack": { "message": "Dobrodošli nazaj!" }, - "welcomeBeta": { - "message": "Dobrodošli v MetaMask Beta" + "welcome": { + "message": "Dobrodošli v MetaMask" }, "whatsThis": { "message": "Kaj je to?" diff --git a/app/_locales/th/messages.json b/app/_locales/th/messages.json index 7fabe4eac..9fb2d6fb0 100644 --- a/app/_locales/th/messages.json +++ b/app/_locales/th/messages.json @@ -849,7 +849,7 @@ "warning": { "message": "คำเตือน" }, - "welcomeBeta": { + "welcome": { "message": "ยินดีต้อนรับสู่ MetaMask เบต้า" }, "whatsThis": { diff --git a/app/_locales/tml/messages.json b/app/_locales/tml/messages.json index 0643ce205..022754da5 100644 --- a/app/_locales/tml/messages.json +++ b/app/_locales/tml/messages.json @@ -942,7 +942,7 @@ "warning": { "message": "எச்சரிக்கை" }, - "welcomeBeta": { + "welcome": { "message": "மெட்டாமாஸ்க் பீட்டாவுக்கு வருக" }, "whatsThis": { diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index 1bb149eaa..66d5303d4 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -942,8 +942,8 @@ "warning": { "message": "Uyarı" }, - "welcomeBeta": { - "message": "MetaMask Beta'ya Hoşgeldiniz" + "welcome": { + "message": "MetaMask'ya Hoşgeldiniz" }, "whatsThis": { "message": "Bu nedir?" diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index 911ddf476..e253aeb88 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -978,7 +978,7 @@ "warning": { "message": "警告" }, - "welcomeBeta": { + "welcome": { "message": "欢迎使用 MetaMask 测试版" }, "whatsThis": { diff --git a/app/_locales/zh_TW/messages.json b/app/_locales/zh_TW/messages.json index 3b048fd91..de79f935f 100644 --- a/app/_locales/zh_TW/messages.json +++ b/app/_locales/zh_TW/messages.json @@ -933,8 +933,8 @@ "warning": { "message": "警告" }, - "welcomeBeta": { - "message": "歡迎到 MetaMask Beta" + "welcome": { + "message": "歡迎到 MetaMask" }, "whatsThis": { "message": "這是什麼?" diff --git a/ui/app/welcome-screen.js b/ui/app/welcome-screen.js index 63512cd50..146661eb3 100644 --- a/ui/app/welcome-screen.js +++ b/ui/app/welcome-screen.js @@ -50,7 +50,7 @@ class WelcomeScreen extends Component { height: '225', }), - h('div.welcome-screen__info__header', this.context.t('welcomeBeta')), + h('div.welcome-screen__info__header', this.context.t('welcome')), h('div.welcome-screen__info__copy', this.context.t('metamaskDescription')), -- cgit v1.2.3 From 63e10f6e738b0ddb2ac4dc29132a6bb8faa65b4c Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Tue, 13 Nov 2018 14:49:34 -0330 Subject: Remove Mascara from CircleCI config --- .circleci/config.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3aac53171..165325ee6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,14 +47,6 @@ workflows: requires: - prep-deps-npm - prep-build - # - test-integration-mascara-chrome: - # requires: - # - prep-deps-npm - # - prep-scss - # - test-integration-mascara-firefox: - # requires: - # - prep-deps-npm - # - prep-scss - test-integration-flat-chrome: requires: - prep-deps-npm @@ -73,8 +65,6 @@ workflows: - test-e2e-beta-chrome - test-e2e-beta-firefox - test-e2e-beta-drizzle - # - test-integration-mascara-chrome - # - test-integration-mascara-firefox - test-integration-flat-chrome - test-integration-flat-firefox - job-screens: @@ -293,9 +283,6 @@ jobs: - checkout - attach_workspace: at: . - # - store_artifacts: - # path: dist/mascara - # destination: builds/mascara - store_artifacts: path: dist/sourcemaps destination: builds/sourcemaps -- cgit v1.2.3 From f1248ac26abd6641f29476e40bef6193a7130f16 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Mon, 19 Nov 2018 11:42:25 -0330 Subject: ci: Drop old UI e2e tests from CircleCI --- .circleci/config.yml | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 165325ee6..22d14476b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,14 +20,6 @@ workflows: - test-deps: requires: - prep-deps-npm - - test-e2e-chrome: - requires: - - prep-deps-npm - - prep-build - - test-e2e-firefox: - requires: - - prep-deps-npm - - prep-build - test-e2e-beta-chrome: requires: - prep-deps-npm @@ -60,8 +52,6 @@ workflows: - test-lint - test-unit - test-mozilla-lint - - test-e2e-chrome - - test-e2e-firefox - test-e2e-beta-chrome - test-e2e-beta-firefox - test-e2e-beta-drizzle @@ -186,37 +176,6 @@ jobs: name: Test command: npx nsp check - test-e2e-chrome: - docker: - - image: circleci/node:8.11.3-browsers - steps: - - checkout - - attach_workspace: - at: . - - run: - name: test:e2e:chrome - command: npm run test:e2e:chrome - - store_artifacts: - path: test-artifacts - destination: test-artifacts - - test-e2e-firefox: - docker: - - image: circleci/node:8.11.3-browsers - steps: - - checkout - - run: - name: Install Firefox - command: ./.circleci/scripts/firefox-install - - attach_workspace: - at: . - - run: - name: test:e2e:firefox - command: npm run test:e2e:firefox - - store_artifacts: - path: test-artifacts - destination: test-artifacts - test-e2e-beta-drizzle: docker: - image: circleci/node:8.11.3-browsers -- cgit v1.2.3 From 5dc87b6835f446d009b39e9b28c0b98d01a1001d Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Mon, 19 Nov 2018 13:34:32 -0330 Subject: Speed up genStates script by using built-in require fn --- development/genStates.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/development/genStates.js b/development/genStates.js index 0ac1059be..15e0863e8 100644 --- a/development/genStates.js +++ b/development/genStates.js @@ -2,7 +2,7 @@ const fs = require('fs') const path = require('path') const promisify = require('pify') const enLocaleMessages = require('../app/_locales/en/messages.json') - +const writeFile = promisify(fs.writeFile) start().catch(console.error) @@ -12,8 +12,7 @@ async function start () { const states = {} await Promise.all(stateFilesNames.map(async (stateFileName) => { const stateFilePath = path.join(__dirname, 'states', stateFileName) - const stateFileContent = await promisify(fs.readFile)(stateFilePath, 'utf8') - const state = JSON.parse(stateFileContent) + const state = require(stateFilePath) state.localeMessages = { en: enLocaleMessages, current: {} } @@ -22,5 +21,5 @@ async function start () { })) const generatedFileContent = `module.exports = ${JSON.stringify(states)}` const generatedFilePath = path.join(__dirname, 'states.js') - await promisify(fs.writeFile)(generatedFilePath, generatedFileContent) + await writeFile(generatedFilePath, generatedFileContent) } -- cgit v1.2.3 From e68008edf483cdf67a1a97a048fbbe610097d050 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Mon, 19 Nov 2018 13:35:00 -0330 Subject: Remove first-time and navigate-txs integration tests --- .eslintignore | 2 - development/mock-dev.js | 2 +- test/integration/lib/first-time.js | 117 ------------------------- test/integration/lib/mascara-first-time.js | 133 ----------------------------- test/integration/lib/navigate-txs.js | 87 ------------------- 5 files changed, 1 insertion(+), 340 deletions(-) delete mode 100644 test/integration/lib/first-time.js delete mode 100644 test/integration/lib/mascara-first-time.js delete mode 100644 test/integration/lib/navigate-txs.js diff --git a/.eslintignore b/.eslintignore index 70f23dafd..0e50a2721 100644 --- a/.eslintignore +++ b/.eslintignore @@ -19,5 +19,3 @@ mascara/test/jquery-3.1.0.min.js test/integration/bundle.js test/integration/jquery-3.1.0.min.js test/integration/helpers.js -test/integration/lib/first-time.js - diff --git a/development/mock-dev.js b/development/mock-dev.js index 15f6ad4bf..1af10a131 100644 --- a/development/mock-dev.js +++ b/development/mock-dev.js @@ -42,7 +42,7 @@ if (routerPath) { queryString = qs.parse(routerPath.split('?')[1]) } -selectedView = queryString.view || 'first time' +selectedView = queryString.view || 'send new ui' const firstState = states[selectedView] updateQueryParams(selectedView) diff --git a/test/integration/lib/first-time.js b/test/integration/lib/first-time.js deleted file mode 100644 index 8cacd7f14..000000000 --- a/test/integration/lib/first-time.js +++ /dev/null @@ -1,117 +0,0 @@ -const reactTriggerChange = require('react-trigger-change') -const PASSWORD = 'password123' -const runMascaraFirstTimeTest = require('./mascara-first-time') -const { - timeout, - findAsync, -} = require('../../lib/util') - -QUnit.module('first time usage') - -QUnit.test('render init screen', (assert) => { - const done = assert.async() - runFirstTimeUsageTest(assert).then(done).catch((err) => { - assert.notOk(err, `Error was thrown: ${err.stack}`) - done() - }) -}) - -async function runFirstTimeUsageTest(assert, done) { - if (window.METAMASK_PLATFORM_TYPE === 'mascara') { - return runMascaraFirstTimeTest(assert, done) - } - - const selectState = $('select') - selectState.val('first time') - reactTriggerChange(selectState[0]) - - const app = $('#app-content') - - // Selects new ui - const tryNewUIButton = (await findAsync(app, 'button.negative'))[0] - tryNewUIButton.click() - await timeout() - - // recurse notices - while (true) { - const button = await findAsync(app, 'button') - if (button.html() === 'Accept') { - // still notices to accept - const termsPageRaw = await findAsync(app, '.markdown') - const termsPage = (await findAsync(app, '.markdown'))[0] - console.log('termsPageRaw', termsPageRaw) - termsPage.scrollTop = termsPage.scrollHeight - console.log('Clearing notice') - button.click() - } else { - // exit loop - console.log('No more notices...') - break - } - } - - // Scroll through terms - const title = (await findAsync(app, 'h1'))[0] - assert.equal(title.textContent, 'MetaMask', 'title screen') - - // enter password - const pwBox = (await findAsync(app, '#password-box'))[0] - const confBox = (await findAsync(app, '#password-box-confirm'))[0] - pwBox.value = PASSWORD - confBox.value = PASSWORD - - // create vault - const createButton = (await findAsync(app, 'button.primary'))[0] - createButton.click() - - await timeout() - const created = (await findAsync(app, 'h3'))[0] - assert.equal(created.textContent, 'Vault Created', 'Vault created screen') - - // Agree button - const button = (await findAsync(app, 'button'))[0] - assert.ok(button, 'button present') - button.click() - - const detail = (await findAsync(app, '.account-detail-section'))[0] - assert.ok(detail, 'Account detail section loaded.') - - const sandwich = (await findAsync(app, '.sandwich-expando'))[0] - sandwich.click() - - const menu = (await findAsync(app, '.menu-droppo'))[0] - const children = menu.children - const logout = children[2] - assert.ok(logout, 'Lock menu item found') - logout.click() - - const pwBox2 = (await findAsync(app, '#password-box'))[0] - pwBox2.value = PASSWORD - - const createButton2 = (await findAsync(app, 'button.primary'))[0] - createButton2.click() - - const detail2 = (await findAsync(app, '.account-detail-section'))[0] - assert.ok(detail2, 'Account detail section loaded again.') - - // open account settings dropdown - const qrButton = (await findAsync(app, '.fa.fa-ellipsis-h'))[0] - qrButton.click() - - // qr code item - const qrButton2 = (await findAsync(app, '.dropdown-menu-item'))[1] - qrButton2.click() - - const qrHeader = (await findAsync(app, '.qr-header'))[0] - const qrContainer = (await findAsync(app, '#qr-container'))[0] - assert.equal(qrHeader.textContent, 'Account 1', 'Should show account label.') - assert.ok(qrContainer, 'QR Container found') - - const networkMenu = (await findAsync(app, '.network-indicator'))[0] - networkMenu.click() - - const networkMenu2 = (await findAsync(app, '.network-indicator'))[0] - const children2 = networkMenu2.children - children2.length[3] - assert.ok(children2, 'All network options present') -} diff --git a/test/integration/lib/mascara-first-time.js b/test/integration/lib/mascara-first-time.js deleted file mode 100644 index 6756b83f9..000000000 --- a/test/integration/lib/mascara-first-time.js +++ /dev/null @@ -1,133 +0,0 @@ -const PASSWORD = 'password123' -const { - timeout, - findAsync, - queryAsync, -} = require('../../lib/util') - -async function runFirstTimeUsageTest (assert, done) { - await timeout(4000) - - const app = await queryAsync($, '#app-content') - - // Used to set values on TextField input component - const nativeInputValueSetter = Object.getOwnPropertyDescriptor( - window.HTMLInputElement.prototype, 'value' - ).set - - await skipNotices(app) - - const welcomeButton = (await findAsync(app, '.welcome-screen__button'))[0] - welcomeButton.click() - - // Scroll through terms - const title = (await findAsync(app, '.create-password__title')).text() - assert.equal(title, 'Create Password', 'create password screen') - - // enter password - const pwBox = (await findAsync(app, '#create-password'))[0] - const confBox = (await findAsync(app, '#confirm-password'))[0] - - nativeInputValueSetter.call(pwBox, PASSWORD) - pwBox.dispatchEvent(new Event('input', { bubbles: true})) - - nativeInputValueSetter.call(confBox, PASSWORD) - confBox.dispatchEvent(new Event('input', { bubbles: true})) - - // Create Password - const createButton = (await findAsync(app, 'button.first-time-flow__button'))[0] - createButton.click() - - const created = (await findAsync(app, '.unique-image__title'))[0] - assert.equal(created.textContent, 'Your unique account image', 'unique image screen') - - // Agree button - const button = (await findAsync(app, 'button'))[0] - assert.ok(button, 'button present') - button.click() - - await skipNotices(app) - - // secret backup phrase - const seedTitle = (await findAsync(app, '.backup-phrase__title'))[0] - assert.equal(seedTitle.textContent, 'Secret Backup Phrase', 'seed phrase screen') - ;(await findAsync(app, '.backup-phrase__reveal-button')).click() - const seedPhrase = (await findAsync(app, '.backup-phrase__secret-words')).text().split(' ') - ;(await findAsync(app, '.first-time-flow__button')).click() - - await timeout() - const selectPhrase = text => { - const option = $('.backup-phrase__confirm-seed-option') - .filter((i, d) => d.textContent === text)[0] - $(option).click() - } - - seedPhrase.forEach(sp => selectPhrase(sp)) - ;(await findAsync(app, '.first-time-flow__button')).click() - - // Deposit Ether Screen - const depositEthTitle = (await findAsync(app, '.page-container__title'))[0] - assert.equal(depositEthTitle.textContent, 'Deposit Ether', 'deposit ether screen') - ;(await findAsync(app, '.page-container__header-close')).click() - - const menu = (await findAsync(app, '.account-menu__icon'))[0] - menu.click() - - const lock = (await findAsync(app, '.account-menu__logout-button'))[0] - assert.ok(lock, 'Lock menu item found') - lock.click() - - await timeout(5000) - - const pwBox2 = (await findAsync(app, '#password'))[0] - pwBox2.focus() - await timeout(1000) - - nativeInputValueSetter.call(pwBox2, PASSWORD) - pwBox2.dispatchEvent(new Event('input', { bubbles: true})) - - const createButton2 = (await findAsync(app, 'button[type="submit"]'))[0] - createButton2.click() - - const detail2 = (await findAsync(app, '.wallet-view'))[0] - assert.ok(detail2, 'Account detail section loaded again.') - - // open account settings dropdown - const qrButton = (await findAsync(app, '.wallet-view__details-button'))[0] - qrButton.click() - - const qrHeader = (await findAsync(app, '.editable-label__value'))[0] - const qrContainer = (await findAsync(app, '.qr-wrapper'))[0] - assert.equal(qrHeader.textContent, 'Account 1', 'Should show account label.') - assert.ok(qrContainer, 'QR Container found') - - const networkMenu = (await findAsync(app, '.network-component'))[0] - networkMenu.click() - - const networkMenu2 = (await findAsync(app, '.network-indicator'))[0] - const children2 = networkMenu2.children - children2.length[3] - assert.ok(children2, 'All network options present') -} - -module.exports = runFirstTimeUsageTest - -async function skipNotices (app) { - while (true) { - const button = await findAsync(app, 'button') - if (button && button.html() === 'Accept') { - // still notices to accept - const termsPage = (await findAsync(app, '.markdown'))[0] - if (!termsPage) { - break - } - termsPage.scrollTop = termsPage.scrollHeight - await timeout() - button.click() - await timeout() - } else { - console.log('No more notices...') - break - } - } -} diff --git a/test/integration/lib/navigate-txs.js b/test/integration/lib/navigate-txs.js deleted file mode 100644 index 0679d6b00..000000000 --- a/test/integration/lib/navigate-txs.js +++ /dev/null @@ -1,87 +0,0 @@ -const reactTriggerChange = require('react-trigger-change') -const { - timeout, - queryAsync, -} = require('../../lib/util') - -QUnit.module('navigate txs') - -QUnit.test('successful navigate', (assert) => { - const done = assert.async() - runNavigateTxsFlowTest(assert) - .then(done) - .catch(err => { - assert.notOk(err, `Error was thrown: ${err.stack}`) - done() - }) -}) - -async function runNavigateTxsFlowTest (assert, done) { - const selectState = await queryAsync($, 'select') - - selectState.val('navigate txs') - reactTriggerChange(selectState[0]) - - // Confirm navigation buttons present - let navigateTxButtons = await queryAsync($, '.confirm-page-container-navigation__arrow') - assert.ok(navigateTxButtons[0], 'navigation button present') - assert.ok(navigateTxButtons[1], 'navigation button present') - assert.ok(navigateTxButtons[2], 'navigation button present') - assert.ok(navigateTxButtons[3], 'navigation button present') - - // Verify number of transactions present - let trxNum = await queryAsync($, '.confirm-page-container-navigation') - assert.equal(trxNum[0].innerText.includes('1'), true, 'starts on first') - - // Verify correct route - let summaryAction = await queryAsync($, '.confirm-page-container-summary__action') - assert.equal(summaryAction[0].innerText, 'CONTRACT DEPLOYMENT', 'correct route') - - // Click navigation button - navigateTxButtons[2].click() - await timeout(2000) - - // Verify transaction changed to num 2 and routed correctly - trxNum = await queryAsync($, '.confirm-page-container-navigation') - assert.equal(trxNum[0].innerText.includes('2'), true, 'changed transaction right') - summaryAction = await queryAsync($, '.confirm-page-container-summary__action') - // assert.equal(summaryAction[0].innerText, 'CONFIRM', 'correct route') - - // Click navigation button - navigateTxButtons = await queryAsync($, '.confirm-page-container-navigation__arrow') - navigateTxButtons[2].click() - - // Verify transation changed to num 3 and routed correctly - trxNum = await queryAsync($, '.confirm-page-container-navigation') - assert.equal(trxNum[0].innerText.includes('3'), true, 'changed transaction right') - summaryAction = await queryAsync($, '.confirm-page-container-summary__action') - assert.equal(summaryAction[0].innerText, 'CONFIRM', 'correct route') - - // Click navigation button - navigateTxButtons = await queryAsync($, '.confirm-page-container-navigation__arrow') - navigateTxButtons[2].click() - - // Verify transation changed to num 4 and routed correctly - trxNum = await queryAsync($, '.confirm-page-container-navigation') - assert.equal(trxNum[0].innerText.split('4').length, 3, '4 transactions present') - summaryAction = await queryAsync($, '.confirm-page-container-summary__action') - assert.equal(summaryAction[0].innerText, 'TRANSFER', 'correct route') - - // Verify left arrow is working correctly - navigateTxButtons = await queryAsync($, '.confirm-page-container-navigation__arrow') - navigateTxButtons[1].click() - trxNum = await queryAsync($, '.confirm-page-container-navigation') - assert.equal(trxNum[0].innerText.includes('3'), true, 'changed transaction left') - - // Verify navigate to last transaction is working correctly - navigateTxButtons = await queryAsync($, '.confirm-page-container-navigation__arrow') - navigateTxButtons[3].click() - trxNum = await queryAsync($, '.confirm-page-container-navigation') - assert.equal(trxNum[0].innerText.split('4').length, 3, 'navigate to last transaction') - - // Verify navigate to first transaction is working correctly - navigateTxButtons = await queryAsync($, '.confirm-page-container-navigation__arrow') - navigateTxButtons[0].click() - trxNum = await queryAsync($, '.confirm-page-container-navigation') - assert.equal(trxNum[0].innerText.includes('1'), true, 'navigate to first transaction') -} -- cgit v1.2.3