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

79 Commits

Author SHA1 Message Date
Bowen Sanders
0e1c385cd0
[FLASK] Create E2E test for snap management (#16628)
* added management test

* added id and dismiss alert function

* changed xwindow handling

* fixed linting
2022-11-30 14:12:09 +01:00
seaona
ff25d44d98
[e2e] [MV3] Fix Custom RPC e2e test failures for MV3 build (#16599)
* Wait until element is not present

* Change selector network ticker

* Wait for loading overlay to disappear
2022-11-21 20:04:03 +01:00
Mark Stacey
0841c1df4f
Fix crash on e2e test failure (#16556)
If an e2e test fails on a website, the driver will crash on this line
because it can't find a reference to `stateHooks`. That variable is
only set in our UI, not on other sites.
2022-11-17 11:29:06 -03:30
Dan J Miller
0a5c46b156
Prevent user from editing a contract interaction created by a dapp (#16498)
* Prevent user from editing a contract interaction created by a dapp

* Code cleanup

* Fix e2e test selector

* Fix e2e test

* Fix e2e test

* Update snapshot
2022-11-15 12:28:39 -03:30
Peter Yinusa
b2293e6648
[e2e]: log exceptions when tests fail (#16453)
* log exceptions inc background

* show full stacktrace

* use driver api

* lint
2022-11-14 08:35:08 -06:00
Peter Yinusa
6cca9892b2
refactor sentryHooks object (#16435) 2022-11-09 19:28:32 +00:00
seaona
f03b3a872c
Fix e2e incremental-secuirty test for mv3 build (#16265) 2022-10-27 14:16:50 +02:00
PeterYinusa
1295fabfb5
[E2E]: Revoke nft approval (#15995) 2022-09-27 10:51:46 -05:00
PeterYinusa
1370f19cba
Portfolio site e2e (#15921)
* add env variables to test build

* add data-testid attribute to home component

* add method to retrieve the url of the current page

* add portfolio site test

Co-authored-by: ryanml <ryanlanese@gmail.com>
2022-09-22 08:39:34 +01:00
seaona
9cf401bb92
Expand error details before taking screenshot (#15779) 2022-09-09 14:40:51 +02:00
Brad Decker
652d631cda
remove exclusions for mismatched object jsdoc type casing (#15351) 2022-07-27 08:28:05 -05:00
Jyoti Puri
6aa0ecce2a
Capturing lavamoat stats in E2E (#15153) 2022-07-20 03:07:15 +04:00
Alex Donesky
09164dcabb
Bump controllers v30.0.2 (#14906)
* bump @metamask/controllers to v30.0.2 and adapt
2022-07-18 09:43:30 -05:00
PeterYinusa
9ae909d6a7
[E2E] Install Firefox extension from dist folder (#15255)
* update webdriver

* install extension from dist folder

* remove redundant code
2022-07-18 09:22:23 +01:00
PeterYinusa
4e1dbc6194
State logs e2e (#15123)
* download dir

* state logs e2e

* update ff version
2022-07-01 20:46:12 +01:00
PeterYinusa
dc780eeeb1
Send to hex-prefixed address e2e tests (#15111)
* add e2e test

* update variable name

* add test for ERC20
2022-07-01 17:40:31 +01:00
Mark Stacey
e6d5af5f9a Merge remote-tracking branch 'origin/develop' into master-sync
* origin/develop: (131 commits)
  Update `protobufjs` and remove obsolete advisory exclusion (#14841)
  Include snap version in pill (#14803)
  Update PULL_REQUEST_TEMPLATE.md (#14790)
  fix: keystone transaction qrcode has no white spacing (#14798)
  Snap notifications integration (#14605)
  Upgrade @metamask/eth-ledger-bridge-keyring (#14799)
  snaps-skunkworks@0.15.0 (#14772)
  Fix proptype errors in network dropdown, tx list item details, and account details modal tests (#14747)
  Ensure transaction type is correctly updated on edit (#14721)
  Add fiat onboarding for AVAX and MATIC through Wyre (#14683)
  Bump @metamask/contract-metadata from 1.33.0 to 1.35.0 (#14791)
  Slight cleanup of constants/transactions, useTransactionDisplayData, and TransactionIcon (#14784)
  Migrate the "estimateGas" API call to "getFees" for STX (#14767)
  Ignore advisory GHSA-wm7h-9275-46v2 (#14789)
  Adding flag for MV3 (#14762)
  Add types to send state (#14740)
  Remove site origin on snap install (#14752)
  Update design tokens library from 1.5 to 1.6 WIP (#14732)
  Enables the "Safe Transaction From" copy for safeTransferFrom transactions (#14769)
  remove draft transaction (#14701)
  ...
2022-06-03 11:53:40 -02:30
Mark Stacey
cf5db650fe Merge remote-tracking branch 'origin/master' into Version-v10.14.7
* origin/master: (101 commits)
  Updating changelog
  Add token standard to custom token details (#14506)
  Revert "Dark Mode: What's New Announcement (#14346)"
  Ensure network name in confirm page container is defined (#14520)
  Updating lavamoat policies
  Fix the alerts toggles in settings (#14498)
  Disable swaps whenever the environment is not development or testing, so that behaviour follows production for QA purposes (#14499)
  [skip e2e] Updating changelog for v10.14.0 (#14487)
  Version v10.14.0
  Docs - segment metrics (#14435)
  Add snaps view search (#14419)
  Run main, flask and beta in sequence in generate-lavamoat-policies.sh (#14470)
  Modify import SRP page (#14425)
  Dark Mode: Implement Metrics (#14455)
  HoldToRevealButton component (#13785)
  e2e test import json file as import account strategy (#14449)
  MetaMetrics: Identify 'number_of_tokens' user trait (#14427)
  MetaMetrics: Identify 'nft_autodetection_enabled' &  'opensea_api_enabled' (#14367)
  Swaps: Sort "token_from" dropdown tokens by their fiat value first and "token_to" by top tokens (#14436)
  Update segment instantiation check. Only check if SEGMENT_WRITE_KEY exists (#14407)
  ...
2022-06-02 18:30:23 -02:30
Mark Stacey
7199d9c567 Use externally hosted phishing warning page
An externally hosted phishing warning page is now used rather than the
built-in phishing warning page.The phishing page warning URL is set via
configuration file or environment variable. The default URL is either
the expected production URL or `http://localhost:9999/` for e2e testing
environments.

The new external phishing page includes a design change when it is
loaded within an iframe. In that case it now shows a condensed message,
and prompts the user to open the full warning page in a new tab to see
more details or bypass the warning. This is to prevent a clickjacking
attack from safelisting a site without user consent.

The new external phishing page also includes a simple caching service
worker to ensure it continues to work offline (or if our hosting goes
offline), as long as the user has successfully loaded the page at least
once. We also load the page temporarily during the extension startup
process to trigger the service worker installation.

The old phishing page and all related lines have been removed. The
property `web_accessible_resources` has also been removed from the
manifest. The only entry apart from the phishing page was `inpage.js`,
and we don't need that to be web accessible anymore because we inject
the script inline into each page rather than loading the file directly.

New e2e tests have been added to cover more phishing warning page
functionality, including the "safelist" action and the "iframe" case.
2022-05-16 14:40:50 -02:30
PeterYinusa
b0ad0cb1f3
E2e send tests (#14568)
* update fill method

* remove redundant steps

* remove arbitrary delays
2022-05-05 18:51:57 +01:00
Bowen Sanders
c1e53b3330
Create new e2e test for bip-44 snap in test-snaps (#14440)
* created new test for bip-44 snap test

* added driver.Key.SPACE to allow sending spacebar

* made changes to final result check

* fixed expected pk result to proper value

* fixed to use npm package instead of local

* removed comment

* removed const delay - not needed (lint error)
2022-04-27 11:21:40 -07:00
seaona
8eb8fc1591
Remove unused function (#14423)
* Remove unused function

* Removed fetch mocks file as it's no longer used
2022-04-12 18:33:16 +02:00
PeterYinusa
05fc865cbf
Update pasteIntoField method (#14205) 2022-03-25 14:23:18 +00:00
Daniel
95f830438a
Add a new fiat onboarding option via MoonPay (#13934) 2022-03-21 10:26:52 +01:00
seaona
22306826ff
Set Chrome logger to level 3: Log_Fatal (#14044) 2022-03-18 18:45:23 +01:00
Mark Stacey
13bb4662a8
Add pasteIntoField webdriver method (#14004)
A new method has been added to the e2e webdriver for pasting text into
a field. This will be required to properly test a change to the SRP
input, which will be coming in a separate PR.

A few existing e2e tests have been updated to use this method to input
the SRP, to show that it works properly.
2022-03-16 19:13:21 -02:30
Mark Stacey
bcf59ab09b
Fix snap e2e tests (#13912)
The snap e2e tests introduced in #13671 were broken due to a conflict
with the changes in #13895. The latter PR changed the version name for
non-main builds so that it always includes the build type.

The Firefox webdriver has been updated to use the new `getVersion`
utility, ensuring that it always looks for the correct build filename.
2022-03-10 20:36:21 -03:30
Shane
1f55af3151
Fixed firefox Snaps + add initial end-to-end tests (#13671)
* Changed registryUrl for snaps only in firefox
Fixed getPlatform to only be imported into metamask-controller in flask
Removed snaps specific testrunner script and use run-all with a cli option

* Fixed flakey tests

* Removed unneeded await

* Added delay

* Fixed linting
2022-03-10 14:01:55 -08:00
seaona
bc62e77cc3
Add e2e testcase for token details functionality (#13818)
* Add e2e testcase for token details functionality

* Remove unnecessary delays on token details testcase

* Add helper function for check if element exists

* Move helper function to driver.js

* Improve name of function
2022-03-09 09:35:14 +01:00
PeterYinusa
ebeb2668ea
E2e mocking (#13640)
* mock gas price api

* fix error

* full url

* remove duplicated packages

* full url

* customise mock per test

* customise mock per test

* enable mocking

* enable mocking

* enable mocking by default

* duplicated packages

* update mockttp

* pass through

* pass through
2022-02-16 14:21:41 +00:00
Mark Stacey
3732c5f71e
Add JSDoc ESLint rules (#12112)
ESLint rules have been added to enforce our JSDoc conventions. These
rules were introduced by updating `@metamask/eslint-config` to v9.

Some of the rules have been disabled because the effort to fix all lint
errors was too high. It might be easiest to enable these rules one
directory at a time, or one rule at a time.

Most of the changes in this PR were a result of running
`yarn lint:fix`. There were a handful of manual changes that seemed
obvious and simple to make. Anything beyond that and the rule was left
disabled.
2022-01-07 12:27:33 -03:30
Mark Stacey
8e835b1d78
Ignore 4Byte 502 errors during e2e tests (#13204)
The 4Byte API can sometimes fail during e2e tests with a 502 error.
Ideally we would avoid calling it at all during e2e tests, but in the
meantime we shouldn't treat this as a reason to fail the e2e test.
We have multiple fallbacks for 4Byte, it isn't relied upon by any
tests.
2022-01-04 14:40:59 -03:30
Thomas Huang
1792a1e787
Ignore sentry server errors in e2e tests (#12843)
* Ignore sentry server errors in e2e tests

* Update test/e2e/webdriver/driver.js

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

Co-authored-by: Dan J Miller <danjm.com@gmail.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-11-25 08:17:33 -03:30
Erik Marks
b3963daaab
eth-json-rpc-middleware@8.0.0 (#10738)
We're bumping from `^6` to `^8`. All imports are now named, and they have been updated. This is a breaking change, in that support for `eth_signTransaction` is added in `^8.0.0`. We do not support this method in our UI, so our middleware stack has been instrumented to reject.

In addition, there are some non-breaking behavioral changes in this version that reviewers should be aware of, see the [7.0.0 release](https://github.com/MetaMask/eth-json-rpc-middleware/releases).
2021-11-11 12:26:49 -08:00
Erik Marks
5f0fd9d1c2
Add lockdown e2e test (#12562)
This PR adds an e2e test to ensure that the background and UI environments are locked down. It reuses the logic from the `protect-intrinsics.test.js`, and runs in both Chrome and Firefox.
2021-11-02 17:01:01 -07:00
kumavis
20eb35be4e
test/e2e/driver/switchToWindowWithTitle - refresh window handles on each retry loop (#12237) 2021-09-28 12:40:07 -10:00
kumavis
d3f7464333
Ci test config improvement (#12223)
* ci - use same resource class for chrome and ff e2e tests

* e2e:chrome - enable logging by default

* lint fix
2021-09-27 12:39:31 -10:00
PeterYinusa
49de01c509
Interacting with MetaMask Notification window (#12147)
* wait for MetaMask Notification window title to update

* wait for notification to close

* wait for notification to close
2021-09-17 19:27:09 +01:00
Niranjana Binoy
eb987a47b5
Integrating the TokenListController to Extension (#11398) 2021-09-09 16:56:27 -04:00
Daniel
d438439661
Swaps: Add conditional routing to new APIs based on a feature flag (#11470) 2021-07-09 10:24:00 -05:00
sooyoung
ca7259246c
fix xpath to get firefox uuid (#11323) 2021-06-16 09:54:36 -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
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
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
Brad Decker
9079fb87ec
add abstraction for waitForSelector (#10844) 2021-04-08 10:41:23 -05:00
Brad Decker
097439eda3
Add support for locators into driver abstraction (#10802) 2021-04-02 14:45:11 -05:00
Erik Marks
76a2a9bb8b
@metamask/eslint config@5.0.0 (#10358)
* @metamask/eslint-config@5.0.0
* Update eslintrc and prettierrc
* yarn lint:fix
2021-02-04 10:15:23 -08:00
Mark Stacey
d8ec5f19f6
Use .zip for Firefox e2e tests (#10056)
The Firefox e2e tests now use the `.zip` file for testing the
extension. We've found this to produce more similar results to
production, compared to the old method of loading the unzipped
directory.

Passing in a `.zip` file to the Chrome driver didn't seem to work. I
didn't investigate this further to see if it was possible, but I'm not
sure it makes a difference on Chrome anyway.
2020-12-11 12:54:17 -03:30
Mark Stacey
7a2b3b908a
Move initial e2e navitation into individual tests (#9979)
The e2e test driver used to perform the initial navigation
automatically within the `buildWebDriver` function, so that that step
wouldn't need to be repeated at the beginning of each test. However
this prevented you from doing any setup in the test before the first
navigation.

The navigation has now been moved into each individual test. It should
be functionally equivalent, except now it's possible to control exactly
when the first navigation occurs.

A 1 second delay was also removed, as it didn't seem to be necessary
when testing this. It was initially added as an attempted fix to an
intermittent failure. It did not fix that failure.
2020-12-03 14:00:51 -03:30