Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prove that MetaMask can be properly e2e tested with cypress #6034

Closed
danjm opened this issue Jan 17, 2019 · 8 comments
Closed

Prove that MetaMask can be properly e2e tested with cypress #6034

danjm opened this issue Jan 17, 2019 · 8 comments

Comments

@danjm
Copy link
Contributor

danjm commented Jan 17, 2019

The task is to prove that we can properly test MetaMask with https://github.com/cypress-io/cypress

Cypress has an immense amount of benefits compared to our current e2e testing tools. It also solve a number of issue inherent in those tools. For a quick overview of advantages: https://www.cypress.io/features/

Cypress does not currently support testing of chrome extensions out of the box. There is an ongoing issue regarding this cypress-io/cypress#1965. Some users seem to have had some success with work arounds and some amount of stubbing extension apis.

It is unclear if we can stub all the extension behaviour necessary for a thorough testing of MetaMask. This task could be successfully resolved by showing this is possible via a single test of MetaMask interacting with a dapp (e.g. confirming a "Send" from the test dapp currently in our e2e/beta directory).

An alternative would be to hack on the Cypress codebase and prove that it can be updated to support chrome extensions like MetaMask. The above link issue is currently assigned to a Cypress team member, but if we were to make a PR, we might be able to help progress the issue. Even if our PR is rejected, if we put together a working set of changes, we can develop our tests while waiting for Cypress to resolve the issue themselves.

It is unclear to me which of these alternatives will require the most/least time and effort.

cc @whymarrh @tmashuang

@rstormsf
Copy link

rstormsf commented Jan 30, 2019

@danjm
Copy link
Contributor Author

danjm commented Jan 31, 2019

thanks @rstormsf, this looks promising

@danjm
Copy link
Contributor Author

danjm commented Feb 14, 2019

Doing this will be a lot of work, and too much risk of delay due to unknown unknowns. Also a risk that we will come up with a solution that will require changes after the new version of the chrome manifest comes into effect.

I will provide more detail later, but going to put this on ice for now.

@dotnetspec

This comment has been minimized.

@whymarrh

This comment has been minimized.

@mitar
Copy link

mitar commented Aug 25, 2019

There is also this plugin which claims to provide testing browser extensions in Cypress: https://github.com/ejoubaud/cypress-browser-extension-plugin

@Gudahtt
Copy link
Member

Gudahtt commented Jul 14, 2020

We're no longer planning to use Cypress, as it still doesn't support testing extensions.

@Gudahtt Gudahtt closed this as completed Jul 14, 2020
@jtakalai
Copy link

jtakalai commented Mar 3, 2021

Jakub seems to have succeeded in Metamask testing with Cypress in headed mode by injecting Metamask into the browser with puppeteer, or something. See:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants