Merge pull request #5334 from whymarrh/ui-switch

Default to the new UI for first time users
feature/default_network_editable
Whymarrh Whitby 6 years ago committed by GitHub
commit 66e0de73c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 54
      .circleci/config.yml
  2. 2
      .eslintignore
  3. 4
      app/_locales/cs/messages.json
  4. 4
      app/_locales/de/messages.json
  5. 4
      app/_locales/en/messages.json
  6. 4
      app/_locales/es/messages.json
  7. 2
      app/_locales/fr/messages.json
  8. 2
      app/_locales/hn/messages.json
  9. 4
      app/_locales/ht/messages.json
  10. 2
      app/_locales/it/messages.json
  11. 2
      app/_locales/ja/messages.json
  12. 2
      app/_locales/ko/messages.json
  13. 4
      app/_locales/nl/messages.json
  14. 6
      app/_locales/pl/messages.json
  15. 4
      app/_locales/pt/messages.json
  16. 4
      app/_locales/ru/messages.json
  17. 4
      app/_locales/sl/messages.json
  18. 2
      app/_locales/th/messages.json
  19. 2
      app/_locales/tml/messages.json
  20. 4
      app/_locales/tr/messages.json
  21. 2
      app/_locales/zh_CN/messages.json
  22. 4
      app/_locales/zh_TW/messages.json
  23. 115
      app/images/logo/metamask-logo-horizontal-beta.svg
  24. 62
      app/images/logo/metamask-logo-horizontal.svg
  25. 5
      app/scripts/controllers/preferences.js
  26. 17
      app/scripts/ui.js
  27. 7
      development/genStates.js
  28. 2
      development/mock-dev.js
  29. 2
      old-ui/app/components/app-bar.js
  30. 16
      test/e2e/beta/drizzle.spec.js
  31. 73
      test/e2e/beta/from-import-beta-ui.spec.js
  32. 21
      test/e2e/beta/helpers.js
  33. 71
      test/e2e/beta/metamask-beta-responsive-ui.spec.js
  34. 70
      test/e2e/beta/metamask-beta-ui.spec.js
  35. 117
      test/integration/lib/first-time.js
  36. 133
      test/integration/lib/mascara-first-time.js
  37. 87
      test/integration/lib/navigate-txs.js
  38. 2
      ui/app/components/app-header/app-header.component.js
  39. 29
      ui/app/select-app.js
  40. 8
      ui/app/selectors.js
  41. 2
      ui/app/welcome-screen.js

@ -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
@ -47,14 +39,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
@ -68,13 +52,9 @@ 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
# - test-integration-mascara-chrome
# - test-integration-mascara-firefox
- test-integration-flat-chrome
- test-integration-flat-firefox
- job-screens:
@ -196,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
@ -293,9 +242,6 @@ jobs:
- checkout
- attach_workspace:
at: .
# - store_artifacts:
# path: dist/mascara
# destination: builds/mascara
- store_artifacts:
path: dist/sourcemaps
destination: builds/sourcemaps

@ -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

@ -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?"

@ -918,8 +918,8 @@
"warning": {
"message": "Warnung"
},
"welcomeBeta": {
"message": "Willkommen zu MetaMask Beta"
"welcome": {
"message": "Willkommen zu MetaMask"
},
"whatsThis": {
"message": "Was ist das?"

@ -1357,8 +1357,8 @@
"welcomeBack": {
"message": "Welcome Back!"
},
"welcomeBeta": {
"message": "Welcome to MetaMask Beta"
"welcome": {
"message": "Welcome to MetaMask"
},
"whatsThis": {
"message": "What's this?"

@ -918,8 +918,8 @@
"warning": {
"message": "Advertencia"
},
"welcomeBeta": {
"message": "Bienvenido a MetaMask Beta"
"welcome": {
"message": "Bienvenido a MetaMask"
},
"whatsThis": {
"message": "¿Qué es esto?"

@ -1303,7 +1303,7 @@
"welcomeBack": {
"message": "Bienvenue à nouveau !"
},
"welcomeBeta": {
"welcome": {
"message": "Bienvenue dans la Beta de MetaMask"
},
"whatsThis": {

@ -849,7 +849,7 @@
"warning": {
"message": "चवन"
},
"welcomeBeta": {
"welcome": {
"message": "मक ब आपकगत ह"
},
"whatsThis": {

@ -1327,8 +1327,8 @@
"welcomeBack": {
"message": "Bon Retou!"
},
"welcomeBeta": {
"message": "Byenveni nan MetaMask Beta"
"welcome": {
"message": "Byenveni nan MetaMask"
},
"whatsThis": {
"message": "Kisa sa ye?"

@ -1309,7 +1309,7 @@
"welcomeBack": {
"message": "Bentornato!"
},
"welcomeBeta": {
"welcome": {
"message": "Benvenuto nella Beta di MetaMask"
},
"whatsThis": {

@ -793,7 +793,7 @@
"welcomeBack": {
"message": "おかえりなさい!"
},
"welcomeBeta": {
"welcome": {
"message": "MetaMask ベータ版へようこそ!"
},
"whatsThis": {

@ -1273,7 +1273,7 @@
"welcomeBack": {
"message": "환영합니다!"
},
"welcomeBeta": {
"welcome": {
"message": "메타마스크 Beta에 오신 것을 환영합니다"
},
"whatsThis": {

@ -849,8 +849,8 @@
"warning": {
"message": "Waarschuwing"
},
"welcomeBeta": {
"message": "Welkom bij MetaMask Beta"
"welcome": {
"message": "Welkom bij MetaMask"
},
"whatsThis": {
"message": "Wat is dit?"

@ -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"
}
}
}

@ -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?"

@ -927,8 +927,8 @@
"warning": {
"message": "Предупреждение"
},
"welcomeBeta": {
"message": "Добро пожаловать в MetaMask Beta"
"welcome": {
"message": "Добро пожаловать в MetaMask"
},
"whatsThis": {
"message": "Что это?"

@ -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?"

@ -849,7 +849,7 @@
"warning": {
"message": "คำเตอน"
},
"welcomeBeta": {
"welcome": {
"message": "ยนดอนรบส MetaMask เบตา"
},
"whatsThis": {

@ -942,7 +942,7 @@
"warning": {
"message": "எசசரி"
},
"welcomeBeta": {
"welcome": {
"message": "ம வரக"
},
"whatsThis": {

@ -942,8 +942,8 @@
"warning": {
"message": "Uyarı"
},
"welcomeBeta": {
"message": "MetaMask Beta'ya Hoşgeldiniz"
"welcome": {
"message": "MetaMask'ya Hoşgeldiniz"
},
"whatsThis": {
"message": "Bu nedir?"

@ -978,7 +978,7 @@
"warning": {
"message": "警告"
},
"welcomeBeta": {
"welcome": {
"message": "欢迎使用 MetaMask 测试版"
},
"whatsThis": {

@ -933,8 +933,8 @@
"warning": {
"message": "警告"
},
"welcomeBeta": {
"message": "歡迎到 MetaMask Beta"
"welcome": {
"message": "歡迎到 MetaMask"
},
"whatsThis": {
"message": "這是什麼?"

@ -1,115 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1672.1 241.2"
style="enable-background:new 0 0 1672.1 241.2;" xml:space="preserve">
<style type="text/css">
.st0{fill:#161616;}
.st1{fill:#E17726;stroke:#E17726;stroke-linecap:round;stroke-linejoin:round;}
.st2{fill:#E27625;stroke:#E27625;stroke-linecap:round;stroke-linejoin:round;}
.st3{fill:#D5BFB2;stroke:#D5BFB2;stroke-linecap:round;stroke-linejoin:round;}
.st4{fill:#233447;stroke:#233447;stroke-linecap:round;stroke-linejoin:round;}
.st5{fill:#CC6228;stroke:#CC6228;stroke-linecap:round;stroke-linejoin:round;}
.st6{fill:#E27525;stroke:#E27525;stroke-linecap:round;stroke-linejoin:round;}
.st7{fill:#F5841F;stroke:#F5841F;stroke-linecap:round;stroke-linejoin:round;}
.st8{fill:#C0AC9D;stroke:#C0AC9D;stroke-linecap:round;stroke-linejoin:round;}
.st9{fill:#161616;stroke:#161616;stroke-linecap:round;stroke-linejoin:round;}
.st10{fill:#763E1A;stroke:#763E1A;stroke-linecap:round;stroke-linejoin:round;}
.st11{fill:#F5841F;}
</style>
<g>
<path class="st0" d="M1157.7,121.9c-6.8-4.5-14.3-7.7-21.4-11.7c-4.6-2.6-9.5-4.9-13.5-8.2c-6.8-5.6-5.4-16.6,1.7-21.4
c10.2-6.8,27.1-3,28.9,10.9c0,0.3,0.3,0.5,0.6,0.5h15.4c0.4,0,0.7-0.3,0.6-0.7c-0.8-9.6-4.5-17.6-11.3-22.7
c-6.5-4.9-13.9-7.5-21.8-7.5c-40.7,0-44.4,43.1-22.5,56.7c2.5,1.6,24,12.4,31.6,17.1s10,13.3,6.7,20.1c-3,6.2-10.8,10.5-18.6,10
c-8.5-0.5-15.1-5.1-17.4-12.3c-0.4-1.3-0.6-3.8-0.6-4.9c0-0.3-0.3-0.6-0.6-0.6h-16.7c-0.3,0-0.6,0.3-0.6,0.6
c0,12.1,3,18.8,11.2,24.9c7.7,5.8,16.1,8.2,24.8,8.2c22.8,0,34.6-12.9,37-26.3C1173.3,141.5,1169.4,129.7,1157.7,121.9z"/>
<path class="st0" d="M432.6,63.3h-7.4h-8.1c-0.3,0-0.5,0.2-0.6,0.4l-13.7,45.2c-0.2,0.6-1,0.6-1.2,0l-13.7-45.2
c-0.1-0.3-0.3-0.4-0.6-0.4h-8.1h-7.4h-10c-0.3,0-0.6,0.3-0.6,0.6v115.4c0,0.3,0.3,0.6,0.6,0.6h16.7c0.3,0,0.6-0.3,0.6-0.6V91.6
c0-0.7,1-0.8,1.2-0.2l13.8,45.5l1,3.2c0.1,0.3,0.3,0.4,0.6,0.4h12.8c0.3,0,0.5-0.2,0.6-0.4l1-3.2l13.8-45.5
c0.2-0.7,1.2-0.5,1.2,0.2v87.7c0,0.3,0.3,0.6,0.6,0.6h16.7c0.3,0,0.6-0.3,0.6-0.6V63.9c0-0.3-0.3-0.6-0.6-0.6L432.6,63.3
L432.6,63.3z"/>
<path class="st0" d="M902,63.3c-0.3,0-0.5,0.2-0.6,0.4l-13.7,45.2c-0.2,0.6-1,0.6-1.2,0l-13.7-45.2c-0.1-0.3-0.3-0.4-0.6-0.4h-25.4
c-0.3,0-0.6,0.3-0.6,0.6v115.4c0,0.3,0.3,0.6,0.6,0.6h16.7c0.3,0,0.6-0.3,0.6-0.6V91.6c0-0.7,1-0.8,1.2-0.2l13.8,45.5l1,3.2
c0.1,0.3,0.3,0.4,0.6,0.4h12.8c0.3,0,0.5-0.2,0.6-0.4l1-3.2l13.8-45.5c0.2-0.7,1.2-0.5,1.2,0.2v87.7c0,0.3,0.3,0.6,0.6,0.6h16.7
c0.3,0,0.6-0.3,0.6-0.6V63.9c0-0.3-0.3-0.6-0.6-0.6L902,63.3L902,63.3z"/>
<path class="st0" d="M686.6,63.3h-31.1h-16.7h-31.1c-0.3,0-0.6,0.3-0.6,0.6v14.4c0,0.3,0.3,0.6,0.6,0.6h30.5v100.4
c0,0.3,0.3,0.6,0.6,0.6h16.7c0.3,0,0.6-0.3,0.6-0.6V78.9h30.5c0.3,0,0.6-0.3,0.6-0.6V63.9C687.2,63.6,687,63.3,686.6,63.3z"/>
<path class="st0" d="M785.1,179.9h15.2c0.4,0,0.7-0.4,0.6-0.8L769.5,63.3c-0.1-0.3-0.3-0.4-0.6-0.4h-5.8h-10.2h-5.8
c-0.3,0-0.5,0.2-0.6,0.4l-31.4,115.8c-0.1,0.4,0.2,0.8,0.6,0.8h15.2c0.3,0,0.5-0.2,0.6-0.4l9.1-33.7c0.1-0.3,0.3-0.4,0.6-0.4h33.6
c0.3,0,0.5,0.2,0.6,0.4l9.1,33.7C784.6,179.7,784.9,179.9,785.1,179.9z M745.2,128.9l12.2-45.1c0.2-0.6,1-0.6,1.2,0l12.2,45.1
c0.1,0.4-0.2,0.8-0.6,0.8h-24.4C745.4,129.7,745.1,129.3,745.2,128.9z"/>
<path class="st0" d="M1044.3,179.9h15.2c0.4,0,0.7-0.4,0.6-0.8l-31.4-115.8c-0.1-0.3-0.3-0.4-0.6-0.4h-5.8h-10.2h-5.8
c-0.3,0-0.5,0.2-0.6,0.4l-31.4,115.8c-0.1,0.4,0.2,0.8,0.6,0.8h15.2c0.3,0,0.5-0.2,0.6-0.4l9.1-33.7c0.1-0.3,0.3-0.4,0.6-0.4h33.6
c0.3,0,0.5,0.2,0.6,0.4l9.1,33.7C1043.8,179.7,1044,179.9,1044.3,179.9z M1004.4,128.9l12.2-45.1c0.2-0.6,1-0.6,1.2,0l12.2,45.1
c0.1,0.4-0.2,0.8-0.6,0.8H1005C1004.6,129.7,1004.3,129.3,1004.4,128.9z"/>
<path class="st0" d="M510.8,162.8V127c0-0.3,0.3-0.6,0.6-0.6h44.5c0.3,0,0.6-0.3,0.6-0.6v-14.4c0-0.3-0.3-0.6-0.6-0.6h-44.5
c-0.3,0-0.6-0.3-0.6-0.6V79.6c0-0.3,0.3-0.6,0.6-0.6H562c0.3,0,0.6-0.3,0.6-0.6V64c0-0.3-0.3-0.6-0.6-0.6h-51.2h-17.3
c-0.3,0-0.6,0.3-0.6,0.6v15v31.9v15.6v37v15.8c0,0.3,0.3,0.6,0.6,0.6h17.3h53.3c0.3,0,0.6-0.3,0.6-0.6v-15.2c0-0.3-0.3-0.6-0.6-0.6
h-52.8C511,163.4,510.8,163.2,510.8,162.8z"/>
<path class="st0" d="M1310.3,178.9l-57.8-59.7c-0.2-0.2-0.2-0.6,0-0.8l52-54c0.4-0.4,0.1-1-0.4-1h-21.3c-0.2,0-0.3,0.1-0.4,0.2
l-44.1,45.8c-0.4,0.4-1,0.1-1-0.4V64c0-0.3-0.3-0.6-0.6-0.6H1220c-0.3,0-0.6,0.3-0.6,0.6v115.4c0,0.3,0.3,0.6,0.6,0.6h16.7
c0.3,0,0.6-0.3,0.6-0.6v-50.8c0-0.5,0.7-0.8,1-0.4l50,51.6c0.1,0.1,0.3,0.2,0.4,0.2h21.3C1310.4,179.9,1310.7,179.2,1310.3,178.9z"
/>
</g>
<g>
<polygon class="st1" points="247.1,1.2 146,76.2 164.8,32 "/>
<g>
<polygon class="st2" points="13.9,1.2 114.1,76.9 96.2,32 "/>
<polygon class="st2" points="210.7,175.1 183.8,216.3 241.4,232.2 257.9,176 "/>
<polygon class="st2" points="3.2,176 19.6,232.2 77.1,216.3 50.3,175.1 "/>
<polygon class="st2" points="74,105.5 58,129.7 115,132.3 113.1,70.8 "/>
<polygon class="st2" points="187,105.5 147.3,70.1 146,132.3 203,129.7 "/>
<polygon class="st2" points="77.1,216.3 111.6,199.6 81.9,176.4 "/>
<polygon class="st2" points="149.4,199.6 183.8,216.3 179.1,176.4 "/>
</g>
<g>
<polygon class="st3" points="183.8,216.3 149.4,199.6 152.2,222 151.9,231.5 "/>
<polygon class="st3" points="77.1,216.3 109.1,231.5 108.9,222 111.6,199.6 "/>
</g>
<polygon class="st4" points="109.7,161.6 81.1,153.2 101.3,143.9 "/>
<polygon class="st4" points="151.3,161.6 159.7,143.9 180,153.2 "/>
<g>
<polygon class="st5" points="77.1,216.3 82.1,175.1 50.3,176 "/>
<polygon class="st5" points="178.9,175.1 183.8,216.3 210.7,176 "/>
<polygon class="st5" points="203,129.7 146,132.3 151.3,161.6 159.7,143.9 180,153.2 "/>
<polygon class="st5" points="81.1,153.2 101.3,143.9 109.7,161.6 115,132.3 58,129.7 "/>
</g>
<g>
<polygon class="st6" points="58,129.7 81.9,176.4 81.1,153.2 "/>
<polygon class="st6" points="180,153.2 179.1,176.4 203,129.7 "/>
<polygon class="st6" points="115,132.3 109.7,161.6 116.4,196.2 117.9,150.6 "/>
<polygon class="st6" points="146,132.3 143.2,150.5 144.6,196.2 151.3,161.6 "/>
</g>
<polygon class="st7" points="151.3,161.6 144.6,196.2 149.4,199.6 179.1,176.4 180,153.2 "/>
<polygon class="st7" points="81.1,153.2 81.9,176.4 111.6,199.6 116.4,196.2 109.7,161.6 "/>
<polygon class="st8" points="151.9,231.5 152.2,222 149.6,219.8 111.4,219.8 108.9,222 109.1,231.5 77.1,216.3 88.3,225.5
111,241.2 149.9,241.2 172.7,225.5 183.8,216.3 "/>
<polygon class="st9" points="149.4,199.6 144.6,196.2 116.4,196.2 111.6,199.6 108.9,222 111.4,219.8 149.6,219.8 152.2,222 "/>
<g>
<polygon class="st10" points="251.4,81.1 259.9,39.7 247.1,1.2 149.4,73.7 187,105.5 240.1,121 251.8,107.3 246.7,103.6
254.8,96.2 248.6,91.4 256.7,85.2 "/>
<polygon class="st10" points="1.1,39.7 9.7,81.1 4.2,85.2 12.4,91.4 6.2,96.2 14.3,103.6 9.2,107.3 20.9,121 74,105.5 111.6,73.7
13.9,1.2 "/>
</g>
<polygon class="st7" points="240.1,121 187,105.5 203,129.7 179.1,176.4 210.7,176 257.9,176 "/>
<polygon class="st7" points="74,105.5 20.9,121 3.2,176 50.3,176 81.9,176.4 58,129.7 "/>
<polygon class="st7" points="146,132.3 149.4,73.7 164.8,32 96.2,32 111.6,73.7 115,132.3 116.3,150.7 116.4,196.2 144.6,196.2
144.7,150.7 "/>
</g>
<g>
<path class="st7" d="M1409.7,92.6V32.1h19.3c2.9,0,5.6,0.4,8.2,1c2.5,0.6,4.7,1.6,6.6,2.9c1.9,1.3,3.4,3,4.5,5.1
c1.1,2.1,1.6,4.5,1.6,7.3c0,3-0.9,5.5-2.5,7.7c-1.6,2.1-3.8,3.8-6.6,4.9c1.7,0.5,3.2,1.1,4.5,2c1.3,0.9,2.4,1.9,3.3,3.1
c0.9,1.2,1.6,2.6,2,4c0.5,1.5,0.7,3.1,0.7,4.7c0,2.9-0.5,5.4-1.6,7.6c-1.1,2.2-2.5,4-4.4,5.5c-1.9,1.5-4.1,2.6-6.6,3.3
c-2.6,0.8-5.3,1.2-8.3,1.2H1409.7z M1419.8,57.6h9.6c1.5,0,2.9-0.2,4.2-0.6c1.3-0.4,2.4-0.9,3.3-1.7c0.9-0.7,1.7-1.6,2.2-2.7
c0.6-1.1,0.8-2.3,0.8-3.7c0-1.5-0.3-2.8-0.8-3.9c-0.5-1.1-1.3-2-2.2-2.7c-1-0.7-2.1-1.2-3.4-1.5c-1.3-0.3-2.7-0.5-4.3-0.5h-9.5
V57.6z M1419.8,65.2v19.3h10.9c1.6,0,3-0.3,4.3-0.7c1.3-0.5,2.4-1.1,3.4-1.9c0.9-0.8,1.7-1.8,2.2-2.9c0.5-1.2,0.8-2.5,0.8-3.9
c0-1.5-0.2-2.9-0.7-4.1c-0.5-1.2-1.1-2.2-2-3.1c-0.9-0.8-2-1.5-3.2-1.9c-1.3-0.5-2.7-0.7-4.3-0.7H1419.8z"/>
<path class="st7" d="M1506.3,65.5h-24.9v19h29.1v8.1h-39.1V32.1h38.8v8.2h-28.8v17.1h24.9V65.5z"/>
<path class="st7" d="M1574.8,40.4h-18.6v52.2h-9.9V40.4h-18.4v-8.2h46.9V40.4z"/>
<path class="st7" d="M1615.2,78.6h-18.9l-4.2,14h-10.3l19.6-60.5h8.8l19.3,60.5h-10.3L1615.2,78.6z M1598.9,70h13.9l-6.9-23.7
L1598.9,70z"/>
</g>
<path class="st11" d="M1644.3,8c10.7,0,19.5,8.7,19.5,19.5v69.8c0,10.7-8.7,19.5-19.5,19.5H1395c-10.7,0-19.5-8.7-19.5-19.5V27.5
c0-10.7,8.7-19.5,19.5-19.5H1644.3 M1644.3,0H1395c-15.2,0-27.5,12.3-27.5,27.5v69.8c0,15.2,12.3,27.5,27.5,27.5h249.2
c15.2,0,27.5-12.3,27.5-27.5V27.5C1671.7,12.3,1659.4,0,1644.3,0L1644.3,0z"/>
</svg>

Before

Width:  |  Height:  |  Size: 8.7 KiB

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="1311px" height="242px" viewBox="0 0 1311 242" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 51.3 (57544) - http://www.bohemiancoding.com/sketch -->
<title>metamask-logo-horizontal-beta</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="metamask-logo-horizontal-beta" transform="translate(1.000000, 1.000000)" fill-rule="nonzero">
<g id="Group" transform="translate(360.000000, 60.000000)" fill="#161616">
<path d="M796.7,60.9 C789.9,56.4 782.4,53.2 775.3,49.2 C770.7,46.6 765.8,44.3 761.8,41 C755,35.4 756.4,24.4 763.5,19.6 C773.7,12.8 790.6,16.6 792.4,30.5 C792.4,30.8 792.7,31 793,31 L808.4,31 C808.8,31 809.1,30.7 809,30.3 C808.2,20.7 804.5,12.7 797.7,7.6 C791.2,2.7 783.8,0.1 775.9,0.1 C735.2,0.1 731.5,43.2 753.4,56.8 C755.9,58.4 777.4,69.2 785,73.9 C792.6,78.6 795,87.2 791.7,94 C788.7,100.2 780.9,104.5 773.1,104 C764.6,103.5 758,98.9 755.7,91.7 C755.3,90.4 755.1,87.9 755.1,86.8 C755.1,86.5 754.8,86.2 754.5,86.2 L737.8,86.2 C737.5,86.2 737.2,86.5 737.2,86.8 C737.2,98.9 740.2,105.6 748.4,111.7 C756.1,117.5 764.5,119.9 773.2,119.9 C796,119.9 807.8,107 810.2,93.6 C812.3,80.5 808.4,68.7 796.7,60.9 Z" id="Shape"></path>
<path d="M71.6,2.3 L64.2,2.3 L56.1,2.3 C55.8,2.3 55.6,2.5 55.5,2.7 L41.8,47.9 C41.6,48.5 40.8,48.5 40.6,47.9 L26.9,2.7 C26.8,2.4 26.6,2.3 26.3,2.3 L18.2,2.3 L10.8,2.3 L0.8,2.3 C0.5,2.3 0.2,2.6 0.2,2.9 L0.2,118.3 C0.2,118.6 0.5,118.9 0.8,118.9 L17.5,118.9 C17.8,118.9 18.1,118.6 18.1,118.3 L18.1,30.6 C18.1,29.9 19.1,29.8 19.3,30.4 L33.1,75.9 L34.1,79.1 C34.2,79.4 34.4,79.5 34.7,79.5 L47.5,79.5 C47.8,79.5 48,79.3 48.1,79.1 L49.1,75.9 L62.9,30.4 C63.1,29.7 64.1,29.9 64.1,30.6 L64.1,118.3 C64.1,118.6 64.4,118.9 64.7,118.9 L81.4,118.9 C81.7,118.9 82,118.6 82,118.3 L82,2.9 C82,2.6 81.7,2.3 81.4,2.3 L71.6,2.3 Z" id="Shape"></path>
<path d="M541,2.3 C540.7,2.3 540.5,2.5 540.4,2.7 L526.7,47.9 C526.5,48.5 525.7,48.5 525.5,47.9 L511.8,2.7 C511.7,2.4 511.5,2.3 511.2,2.3 L485.8,2.3 C485.5,2.3 485.2,2.6 485.2,2.9 L485.2,118.3 C485.2,118.6 485.5,118.9 485.8,118.9 L502.5,118.9 C502.8,118.9 503.1,118.6 503.1,118.3 L503.1,30.6 C503.1,29.9 504.1,29.8 504.3,30.4 L518.1,75.9 L519.1,79.1 C519.2,79.4 519.4,79.5 519.7,79.5 L532.5,79.5 C532.8,79.5 533,79.3 533.1,79.1 L534.1,75.9 L547.9,30.4 C548.1,29.7 549.1,29.9 549.1,30.6 L549.1,118.3 C549.1,118.6 549.4,118.9 549.7,118.9 L566.4,118.9 C566.7,118.9 567,118.6 567,118.3 L567,2.9 C567,2.6 566.7,2.3 566.4,2.3 L541,2.3 Z" id="Shape"></path>
<path d="M325.6,2.3 L294.5,2.3 L277.8,2.3 L246.7,2.3 C246.4,2.3 246.1,2.6 246.1,2.9 L246.1,17.3 C246.1,17.6 246.4,17.9 246.7,17.9 L277.2,17.9 L277.2,118.3 C277.2,118.6 277.5,118.9 277.8,118.9 L294.5,118.9 C294.8,118.9 295.1,118.6 295.1,118.3 L295.1,17.9 L325.6,17.9 C325.9,17.9 326.2,17.6 326.2,17.3 L326.2,2.9 C326.2,2.6 326,2.3 325.6,2.3 Z" id="Shape"></path>
<path d="M424.1,118.9 L439.3,118.9 C439.7,118.9 440,118.5 439.9,118.1 L408.5,2.3 C408.4,2 408.2,1.9 407.9,1.9 L402.1,1.9 L391.9,1.9 L386.1,1.9 C385.8,1.9 385.6,2.1 385.5,2.3 L354.1,118.1 C354,118.5 354.3,118.9 354.7,118.9 L369.9,118.9 C370.2,118.9 370.4,118.7 370.5,118.5 L379.6,84.8 C379.7,84.5 379.9,84.4 380.2,84.4 L413.8,84.4 C414.1,84.4 414.3,84.6 414.4,84.8 L423.5,118.5 C423.6,118.7 423.9,118.9 424.1,118.9 Z M384.2,67.9 L396.4,22.8 C396.6,22.2 397.4,22.2 397.6,22.8 L409.8,67.9 C409.9,68.3 409.6,68.7 409.2,68.7 L384.8,68.7 C384.4,68.7 384.1,68.3 384.2,67.9 Z" id="Shape"></path>
<path d="M683.3,118.9 L698.5,118.9 C698.9,118.9 699.2,118.5 699.1,118.1 L667.7,2.3 C667.6,2 667.4,1.9 667.1,1.9 L661.3,1.9 L651.1,1.9 L645.3,1.9 C645,1.9 644.8,2.1 644.7,2.3 L613.3,118.1 C613.2,118.5 613.5,118.9 613.9,118.9 L629.1,118.9 C629.4,118.9 629.6,118.7 629.7,118.5 L638.8,84.8 C638.9,84.5 639.1,84.4 639.4,84.4 L673,84.4 C673.3,84.4 673.5,84.6 673.6,84.8 L682.7,118.5 C682.8,118.7 683,118.9 683.3,118.9 Z M643.4,67.9 L655.6,22.8 C655.8,22.2 656.6,22.2 656.8,22.8 L669,67.9 C669.1,68.3 668.8,68.7 668.4,68.7 L644,68.7 C643.6,68.7 643.3,68.3 643.4,67.9 Z" id="Shape"></path>
<path d="M149.8,101.8 L149.8,66 C149.8,65.7 150.1,65.4 150.4,65.4 L194.9,65.4 C195.2,65.4 195.5,65.1 195.5,64.8 L195.5,50.4 C195.5,50.1 195.2,49.8 194.9,49.8 L150.4,49.8 C150.1,49.8 149.8,49.5 149.8,49.2 L149.8,18.6 C149.8,18.3 150.1,18 150.4,18 L201,18 C201.3,18 201.6,17.7 201.6,17.4 L201.6,3 C201.6,2.7 201.3,2.4 201,2.4 L149.8,2.4 L132.5,2.4 C132.2,2.4 131.9,2.7 131.9,3 L131.9,18 L131.9,49.9 L131.9,65.5 L131.9,102.5 L131.9,118.3 C131.9,118.6 132.2,118.9 132.5,118.9 L149.8,118.9 L203.1,118.9 C203.4,118.9 203.7,118.6 203.7,118.3 L203.7,103.1 C203.7,102.8 203.4,102.5 203.1,102.5 L150.3,102.5 C150,102.4 149.8,102.2 149.8,101.8 Z" id="Shape"></path>
<path d="M949.3,117.9 L891.5,58.2 C891.3,58 891.3,57.6 891.5,57.4 L943.5,3.4 C943.9,3 943.6,2.4 943.1,2.4 L921.8,2.4 C921.6,2.4 921.5,2.5 921.4,2.6 L877.3,48.4 C876.9,48.8 876.3,48.5 876.3,48 L876.3,3 C876.3,2.7 876,2.4 875.7,2.4 L859,2.4 C858.7,2.4 858.4,2.7 858.4,3 L858.4,118.4 C858.4,118.7 858.7,119 859,119 L875.7,119 C876,119 876.3,118.7 876.3,118.4 L876.3,67.6 C876.3,67.1 877,66.8 877.3,67.2 L927.3,118.8 C927.4,118.9 927.6,119 927.7,119 L949,119 C949.4,118.9 949.7,118.2 949.3,117.9 Z" id="Shape"></path>
</g>
<g id="Group" stroke-linecap="round" stroke-linejoin="round">
<polygon id="Shape" stroke="#E17726" fill="#E17726" points="246.1 0.2 145 75.2 163.8 31"></polygon>
<g transform="translate(2.000000, 0.000000)" fill="#E27625" id="Shape" stroke="#E27625">
<polygon points="10.9 0.2 111.1 75.9 93.2 31"></polygon>
<polygon points="207.7 174.1 180.8 215.3 238.4 231.2 254.9 175"></polygon>
<polygon points="0.2 175 16.6 231.2 74.1 215.3 47.3 174.1"></polygon>
<polygon points="71 104.5 55 128.7 112 131.3 110.1 69.8"></polygon>
<polygon points="184 104.5 144.3 69.1 143 131.3 200 128.7"></polygon>
<polygon points="74.1 215.3 108.6 198.6 78.9 175.4"></polygon>
<polygon points="146.4 198.6 180.8 215.3 176.1 175.4"></polygon>
</g>
<g transform="translate(76.000000, 198.000000)" fill="#D5BFB2" id="Shape" stroke="#D5BFB2">
<polygon points="106.8 17.3 72.4 0.6 75.2 23 74.9 32.5"></polygon>
<polygon points="0.1 17.3 32.1 32.5 31.9 23 34.6 0.6"></polygon>
</g>
<polygon id="Shape" stroke="#233447" fill="#233447" points="108.7 160.6 80.1 152.2 100.3 142.9"></polygon>
<polygon id="Shape" stroke="#233447" fill="#233447" points="150.3 160.6 158.7 142.9 179 152.2"></polygon>
<g transform="translate(49.000000, 128.000000)" fill="#CC6228" id="Shape" stroke="#CC6228">
<polygon points="27.1 87.3 32.1 46.1 0.3 47"></polygon>
<polygon points="128.9 46.1 133.8 87.3 160.7 47"></polygon>
<polygon points="153 0.7 96 3.3 101.3 32.6 109.7 14.9 130 24.2"></polygon>
<polygon points="31.1 24.2 51.3 14.9 59.7 32.6 65 3.3 8 0.7"></polygon>
</g>
<g transform="translate(57.000000, 128.000000)" fill="#E27525" id="Shape" stroke="#E27525">
<polygon points="0 0.7 23.9 47.4 23.1 24.2"></polygon>
<polygon points="122 24.2 121.1 47.4 145 0.7"></polygon>
<polygon points="57 3.3 51.7 32.6 58.4 67.2 59.9 21.6"></polygon>
<polygon points="88 3.3 85.2 21.5 86.6 67.2 93.3 32.6"></polygon>
</g>
<polygon id="Shape" stroke="#F5841F" fill="#F5841F" points="150.3 160.6 143.6 195.2 148.4 198.6 178.1 175.4 179 152.2"></polygon>
<polygon id="Shape" stroke="#F5841F" fill="#F5841F" points="80.1 152.2 80.9 175.4 110.6 198.6 115.4 195.2 108.7 160.6"></polygon>
<polygon id="Shape" stroke="#C0AC9D" fill="#C0AC9D" points="150.9 230.5 151.2 221 148.6 218.8 110.4 218.8 107.9 221 108.1 230.5 76.1 215.3 87.3 224.5 110 240.2 148.9 240.2 171.7 224.5 182.8 215.3"></polygon>
<polygon id="Shape" stroke="#161616" fill="#161616" points="148.4 198.6 143.6 195.2 115.4 195.2 110.6 198.6 107.9 221 110.4 218.8 148.6 218.8 151.2 221"></polygon>
<g fill="#763E1A" id="Shape" stroke="#763E1A">
<polygon points="250.4 80.1 258.9 38.7 246.1 0.2 148.4 72.7 186 104.5 239.1 120 250.8 106.3 245.7 102.6 253.8 95.2 247.6 90.4 255.7 84.2"></polygon>
<polygon points="0.1 38.7 8.7 80.1 3.2 84.2 11.4 90.4 5.2 95.2 13.3 102.6 8.2 106.3 19.9 120 73 104.5 110.6 72.7 12.9 0.2"></polygon>
</g>
<polygon id="Shape" stroke="#F5841F" fill="#F5841F" points="239.1 120 186 104.5 202 128.7 178.1 175.4 209.7 175 256.9 175"></polygon>
<polygon id="Shape" stroke="#F5841F" fill="#F5841F" points="73 104.5 19.9 120 2.2 175 49.3 175 80.9 175.4 57 128.7"></polygon>
<polygon id="Shape" stroke="#F5841F" fill="#F5841F" points="145 131.3 148.4 72.7 163.8 31 95.2 31 110.6 72.7 114 131.3 115.3 149.7 115.4 195.2 143.6 195.2 143.7 149.7"></polygon>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.3 KiB

@ -32,7 +32,10 @@ class PreferencesController {
tokens: [],
suggestedTokens: {},
useBlockie: false,
featureFlags: {},
featureFlags: {
betaUI: true,
skipAnnounceBetaUI: true,
},
currentLocale: opts.initLangCode,
identities: {},
lostIdentities: {},

@ -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)

@ -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)
}

@ -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)

@ -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!'),
])
}

@ -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)

@ -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()

@ -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) {

@ -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'))

@ -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'))

@ -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')
}

@ -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
}
}
}

@ -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')
}

@ -108,7 +108,7 @@ export default class AppHeader extends PureComponent {
>
<img
className="app-header__metafox-logo app-header__metafox-logo--horizontal"
src="/images/logo/metamask-logo-horizontal-beta.svg"
src="/images/logo/metamask-logo-horizontal.svg"
height={30}
/>
<img

@ -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)
}

@ -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

@ -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')),

Loading…
Cancel
Save