1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00
Commit Graph

452 Commits

Author SHA1 Message Date
Elliot Winkler
72617d7036
Fix e2e to not check for X when running locally (#12043)
The X server check was only added to make Chrome tests run successfully
on CI.
2021-09-08 12:02:15 -06:00
Alex Donesky
3358ac2c1f
send user to account page upon adding a custom network (#11945) 2021-09-03 10:52:37 -05:00
Elliot Winkler
8ffebb294b
Fix 'yarn setup' on M1 Macs (#11887)
There are a few issues encountered when running `yarn setup` on new
Apple Silicon (aka M1, aka arm64) Macs:

* The script halts when attempting to run the install step for
  the `chromedriver` package with the message "Only Mac 64 bits
  supported". This is somewhat misleading as it seems to indicate that
  chromedriver can only be installed on a 64-bit Mac. However, what I
  think is happening is that the installation script for `chromedriver`
  is not able to detect that an arm64 CPU *is* a 64-bit CPU. After
  looking through the `chromedriver` repo, it appears that 87.0.1 is the
  first version that adds a proper check ([1]).

  Note that upgrading chromedriver caused the Chrome-specific tests to
  fail intermittently on CI. I was not able to 100% work out the reason
  for this, but ensuring that X (which provides a way for Chrome to run
  in a GUI setting from the command line) is available seems to fix
  these issues.

* The script also halts when attempting to run the install step for
  the `electron` package. This happens because for the version of
  `electron` we are using (9.4.2), there is no available binary for
  arm64. It appears that Electron 11.x was the first version to support
  arm64 Macs ([2]). This is a bit trickier to resolve because we don't
  explicitly rely on `electron` — that's brought in by `react-devtools`.
  The first version of `react-devtools` that relies on `electron` 11.x
  is 4.11.0 ([3]).

[1]: 469dd0a6ee
[2]: https://www.electronjs.org/blog/apple-silicon
[3]: https://github.com/facebook/react/blob/main/packages/react-devtools/CHANGELOG.md#4110-april-9-2021
2021-09-01 10:40:40 -06:00
PeterYinusa
f4d93776d9
refactor account details test to use fixtures (#11926) 2021-08-26 17:08:48 +01:00
kumavis
d75795b73f
add appropriate test timeouts (#11667)
Co-authored-by: Etienne Dusseault <etienne.dusseault@gmail.com>
2021-08-10 15:09:42 -07:00
David Walsh
e2fbc7ce8e
Remove button group for non-EIP-1559 networks (#11712)
* Remove button group for non-EIP-1559 networks

* Fix tests...maybe

* Remove unnecessary props, as well as gas display

* Remove unused string

* test progress

* fix test

* fix test

* add customizes gas block to improve e2e pass rate

Co-authored-by: Alex <adonesky@gmail.com>
2021-08-02 18:53:13 -05:00
David Walsh
38ff2c937f
Fix #11703 - Provide wiring for approval modal (#11711) 2021-08-02 09:07:15 -05:00
Alex Donesky
8a42258e10
Remove the SHOW_EIP_1559_UI environment variable, replace with network detection where appropriate (#11694)
Fixing up tests and add back old custom gas modal for non-eip1559 compliant networks

Remove unnecessary props from send-gas-row.component

fix breaking test

Fix primary and secondary title overrides

fix rebase issue

Fix rebase conflict

Co-authored-by: David Walsh <davidwalsh83@gmail.com>
2021-07-30 22:59:21 -02:30
Daniel
d438439661
Swaps: Add conditional routing to new APIs based on a feature flag (#11470) 2021-07-09 10:24:00 -05:00
PeterYinusa
22973704e8
Use fixtures for dapp interaction tests (#11444)
* move send eth from dapp test

* move contract interactions test

* fix lint issues
2021-07-05 12:56:37 +01:00
ryanml
a69ed05141
Removing obsolete client-side transaction metrics events (#11329)
* Removing metametrics send count tracking

* Removing client side Transaction Completed and Canceled events
2021-06-24 15:37:44 -07:00
PeterYinusa
171320eaa9
account tests using fixtures (#11374) 2021-06-24 15:19:31 +01:00
Brad Decker
c30cb7d33a
Refactor send page state management (#10965) 2021-06-23 16:35:25 -05:00
ryanml
a171ac7b34
Allowing custom rpc form submission when chainId is a duplicate (#11363) 2021-06-23 09:14:38 -07:00
Mark Stacey
cc90fca2f6
Add retries to the benchmark script (#11319)
The benchmark script can now be set to retry upon failure, like the E2E
tests do. The default is zero, just as with the E2E tests. A retry of 2
has been set in CI to match the E2E tests as well.

The `retry` module had to be adjusted to throw an error in the case of
failure. Previously it just set the exit code, but that only worked
because it was the last thing called before the process ended. That is
no longer the case.
2021-06-21 12:46:18 -02:30
Mark Stacey
52de2cda49
Update benchmark.js script to use yargs (#11318)
Our benchmark script now uses `yargs`. Functionally it should be nearly
the same as before, except that now it has more documentation and
validation. The one functional difference aside from that is that the
`--pages` flag now takes space-separated arguments rather than comma-
separated.
2021-06-17 18:36:53 -02:30
ryanml
76f25eef81
Updating Secret Recovery code -> Secret Recovery Phrase (Backup notice) (#11338)
* Updating Secret Recovery code -> Secret Recovery Phrase (Backup notice)

* Updating expected text for e2e test
2021-06-17 11:43:25 -07:00
PeterYinusa
910a3ab81a
refactor send eth tests to use fixture (#11189) 2021-06-16 21:59:10 +01:00
Mark Stacey
de55cd926a
Fix benchmark script with 1 sample (#11320)
Previously the benchmark script would throw an error if asked to take
just 1 sample. Now it works, though the stats returned are of
dubious use.

The problem was that it was impossible to calculate the standard
deviation or margin of error of a set of 1. Instead it now returns
zero for both of those values in the single-sample case, which is what
it would return for two identical samples.
2021-06-16 12:53:51 -02:30
Mark Stacey
3e959b6493
Add --leave-running flag to E2E test script (#11321)
* Add `--leave-running` flag to E2E test script

The `--leave-running` flag has been added to the E2E test runner. This
ensures the browser, ganache, and everything else stays running upon
test failure. This is useful for local debugging, for investigating
what state the extension was in when it failed.

* Add `--leave-running` support to `metamask-ui.spec.js`
2021-06-16 12:42:20 -02:30
sooyoung
ca7259246c
fix xpath to get firefox uuid (#11323) 2021-06-16 09:54:36 -02:30
Mark Stacey
7535d63466
Add run-e2e-test.js script (#11301)
This script makes it easier to run an individual E2E test. In the past
I've run individual scripts by editing `run-all.sh` manually, but now
that can be done more easily with this script. It also allows setting
the number of retries to use and the browser to use from the CLI.

This script has been added as an npm script as well, called
'test:e2e:single'.

The `run-all.sh` script was rewritten in JavaScript to make it easier
to pass through a `--retries` argument.

The default number of retries has been set to zero to make local
testing easier. It has been set to 2 on CI.

This was mainly done to consolidate the code used to run an E2E test in
one place, to make later improvements easier.
2021-06-15 15:21:25 -02:30
Mark Stacey
f7c37cab51
Enable Chrome E2E logs (#11295)
Chrome logs are now enabled for E2E tests when the 'ENABLE_CHROME_LOGS'
environment variable is set to anything other than `false`.

This was helpful to me in debugging Chrome crashes on CI, the ones with
the error "unknown error: DevToolsActivePort file doesn't exist". This
was the only way to discover the cause of the error. It's also useful
for discovering console errors from the background process or from the
UI.

It's disabled by default because it makes the test output quite noisy
and difficult to read.
2021-06-15 15:18:21 -02:30
Mark Stacey
feb989c12b
Start dapp directly from metamask-ui.spec.js (#11299)
The dapp is now started directly from the `metamask-ui.spec.js` test
module. This makes it easier to run independently, and brings it in-
line with our other E2E tests.

The `--no-timeouts` flag is now used as well, rather than setting the
timeout to `0` within the test. This also brings it in-line with our
other tests.

Mainly this was done to facilitate further refactors which will come in
later PRs.
2021-06-15 14:16:09 -02:30
Alex Donesky
e76762548c
Warn users when they attempt to add a network that is already configured (#11179)
* warn users when they attempt to add a network that is already configured

* clean up validation logic

* fixing up e2e tests

* Update test/e2e/helpers.js

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-06-04 08:52:07 -05:00
ryanml
ccbc2e568a
Adding entry to custom token state for Ledger support notification (#11199) 2021-05-27 10:28:29 -07:00
ryanml
629da90d72
Adding "What's New" notification for Ledger Support Update (#11188)
* Adding "What's New" notification for Ledger Support Update

* Using Typography component
2021-05-26 14:29:19 -07:00
PeterYinusa
3b68fc4c58
refactor add/hide token tests to use fixture (#11183)
* refactor add/hide token tests to use fixture

* refactor add/hide token tests to use fixture
2021-05-26 21:36:17 +01:00
ryanml
b7a1c8c302
Adding notification for updated seed phrase wording (#11131)
* Adding notification for updated seed phrase wording

* Updating e2e notification state

* Always displaying image for swaps notification
2021-05-18 15:00:34 -07:00
PeterYinusa
fc256157f6
refactor custom rpc history test to use fixture (#11068)
* refactor custom rpc history test to use fixture

* code formatting

* refactoring to use custom-rpc fixture

* remove delays
2021-05-14 20:41:43 +01:00
Mark Stacey
36869a4350
Migrate version from _base manifest to package.json (#11029)
The version field is now stored in the main `package.json` file rather
than in the base manifest. It is built into the final manifest during
the build script.

This makes it easier to communicate what the current version should be
to our `auto-changelog` script. It's also generally a more conventional
place to keep track of the version, even considering that we're not
publishing to npm.
2021-05-10 14:16:03 -07:00
Mark Stacey
f47cfbbb3e
Use strict assertion mode everywhere (#11012)
The `assert` module has two modes: "Legacy" and "strict". When using
strict mode, the "strict" version of each assertion method is implied.
Whereas in legacy mode, by default it will use the deprecated, "loose"
version of each assertion.

We now use strict mode everywhere. A few tests required updates where
they were asserting the wrong thing, and it was passing beforehand due
to the loose matching.
2021-05-07 17:08:24 -02:30
Niranjana Binoy
2b1e4fb013
replacing seed phrase with Secret Recovery Phrase (#10994) 2021-05-07 09:07:43 -04:00
Alex Donesky
ac7b05442a
send user to activity after transaction complete (#10946) 2021-05-03 12:51:09 -05:00
Dan J Miller
b73f543b23
Whats new popup (#10583)
* Add 'What's New' notification popup

* Move selectors from shared/notifications into ui/ directory

* Use keys for localized message in whats new notifications objects, to ensure notifications will be translated.

* Remove unused swaps intro popup locale messages

* Fix keys of whats new notification locales

* Remove notifications messages and descriptions from comment in shared/notifications

* Move notifcationActionFunctions to shared/notifications and make it stateless

* Get notification data from constants instead of state in whats-new-popup

* Code cleanup

* Fix build quote reference to swapsEthToken, broken during rebase

* Rename notificationFilters to notificationToExclude to clarify its purpose

* Documentation for getSortedNotificationsToShow

* Move notification action functions from shared/ to whats-new-popup.js

* Stop setting swapsWelcomeMessageHasBeenShown to state in app-state controller

* Update e2e tests for whats new popup changes

* Updating migration files

* Addressing feedback part 1

* Addressing feedback part 2

* Remove unnecessary div in whats-new-popup

* Change getNotificationsToExclude to getNotificationsToInclude for use in the getSortedNotificationsToShow selector

* Delete intro-popup directory and test files

* Lint fix

* Add notifiction state to address-entry fixture

* Use two separate functions for rendering first and subsequent notifications in the whats-new-popup

* Ensure that string literals are passed to t for whats new popup text

* Update import-ui fixtures to include notificaiton controller state

* Remove unnecessary, accidental change confirm-approve

* Remove swaps notification in favour of mobile swaps as first notifcation and TBD 3rd notification

* Update whats-new-popup to use intersection observer api to detect if notification has been seen

* Add notifications to send-edit and threebox e2e test fixtures

* Update ui/app/selectors/selectors.js

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* Update ui/app/selectors/selectors.js

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* Clean up locale code for whats-new-popup notifications

* Disconnect observers in whats-new-popup when their callback is first called

* Add test case for migration 58 for when the AppStateController does not exist

* Rename popover components containerRef to popoverWrapRef

* Fix messages.json

* Update notification messages and images

* Rename popoverWrapRef -> popoverRef in whats-new-popup and popover.component

* Only create one observer, and only after images have loaded, in whats-new-popup

* Set width and height on whats-new-popup image, instead of setting state on img load

* Update ui/app/components/app/whats-new-popup/whats-new-popup.js

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* Code clean up in whats new popup re: notification rendering and action functions

* Code cleanup in render notification functions of whats-new-popup

* Update ui/app/components/app/whats-new-popup/whats-new-popup.js

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* lint fix

* Update and localize  notification dates

* Clean up date code in shred/notifications/index.js

Co-authored-by: ryanml <ryanlanese@gmail.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-04-28 14:21:41 -02:30
Alex Donesky
13a0389c96
add hamburger menu to eth page (#10938)
* add hamburger menu to eth page

* change token-options to asset-options, use more direct selector for user address fetch
2021-04-27 17:48:46 -05:00
Austin Akers
539a2b65f3
[Fix] 10365 My Accounts Removal (#10680)
* pushing my-accounts removal

* removed CONTACT_MY_ACCOUNTS_ROUTE

* removed CONTACT_MY_ACCOUNTS_VIEW_ROUTE

* removing CONTACT_MY_ACCOUNTS_EDIT_ROUTE

* removing CONTACT_MY_ACCOUNTS_EDIT_ROUTE

* removed showingMyAccounts dead code

* removed more dead code related to isMyAccountsPage

* removing more dead code

* fixed linting error(s)

* removing my-accounts component/folder

* added empty contact screen ui

* styled empty contact page ui

* fixed linting, removed add contacts button, and fixed errors

* localized text and centered No Contacts

* pushing localized verification and fixed e2e test

* added listRoute redirect

* added listroute and fixed linting error
2021-04-27 15:55:58 -02:30
David Walsh
15b596ad15
Implement Ledger Live bridge (#10293) 2021-04-26 13:05:48 -05:00
Niranjana Binoy
d97a9e8acc
Refactoring incremental-security.spec.js to use fixtures (#10917) 2021-04-26 11:02:29 -04:00
David Walsh
75f8f0fb35
Fix 10458 - Understand where to get support (#10895) 2021-04-22 17:31:13 -05:00
Niranjana Binoy
c254e14598
Refactoring from-import-ui.spec.js to use fixtures (#10907) 2021-04-22 14:03:47 -04:00
Niranjana Binoy
18aa540f42
Adding option to set Custom Nonce to Confirm Approve Page (#10595) 2021-04-16 18:00:18 -04:00
Niranjana Binoy
0974709e7c
Refactoring metamask-responsive-ui.spec.js to use fixtures (#10866) 2021-04-15 09:58:51 -04:00
ryanml
9e918b6026
Adding recovery phrase video to onboarding process (#10717)
* Adding recovery phrase video to onboarding process

Adding english subtitles

* Support textAlign in Box, converting sidebar to Box
2021-04-13 15:29:44 -07:00
Brad Decker
57be0e49d1
use waitForSelector instead of until (#10852)
* complete abstraction of until method

* response to feedback
2021-04-13 16:36:02 -05:00
Brad Decker
2f4e377cf5
add key literals to driver (#10854) 2021-04-12 10:32:38 -05:00
Niranjana Binoy
8df7a712f3
Refactoring threebox.spec.js to use fixtures (#10849) 2021-04-08 19:53:18 -04:00
Brad Decker
9079fb87ec
add abstraction for waitForSelector (#10844) 2021-04-08 10:41:23 -05:00
Brad Decker
cd97340bb8
use locator abstraction in tests folder (#10833) 2021-04-07 09:57:40 -05:00
Niranjana Binoy
d1d7622c93
Refactoring signature-request.spec.js to use fixtures (#10820) 2021-04-07 10:18:20 -04:00