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

setupMetamask Errors with Electron #188

Open
marcusnewton opened this issue Aug 9, 2021 · 5 comments
Open

setupMetamask Errors with Electron #188

marcusnewton opened this issue Aug 9, 2021 · 5 comments
Labels

Comments

@marcusnewton
Copy link

marcusnewton commented Aug 9, 2021

EDIT: I might just be dumb, this probably shouldn't work with Electron, right?

Getting the following issue only when running Electron.

The first issue I was getting was with the remote debugger

CypressError: `cy.task('setupMetamask')` failed with the following error:

> request to http://localhost:9222/json/version failed, reason: connect ECONNREFUSED 127.0.0.1:9222

which I fixed by exporting ELECTRON_EXTRA_LAUNCH_ARGS=--remote-debugging-port=9222. I'd suggest some way to handle this internally, or at least a line of documentation.

CypressError: `cy.task('setupMetamask')` failed with the following error:

> Cannot read property 'waitForTimeout' of undefined

It seems like await metamask.initialSetup({ secretWords, network, password }); from the plugin is being called before puppeteer has been been properly set up.

Note that I've configured metamask to use a custom network.

@marcusnewton
Copy link
Author

Call stack

> Cannot read property 'waitForTimeout' of undefined

https://on.cypress.io/api/task

Because this error occurred during a `before all` hook we are skipping all of the remaining tests.
      at http://localhost:5000/__cypress/runner/cypress_runner.js:142397:19
      at tryCatcher (http://localhost:5000/__cypress/runner/cypress_runner.js:10798:23)
      at Promise._settlePromiseFromHandler (http://localhost:5000/__cypress/runner/cypress_runner.js:8733:31)
      at Promise._settlePromise (http://localhost:5000/__cypress/runner/cypress_runner.js:8790:18)
      at Promise._settlePromise0 (http://localhost:5000/__cypress/runner/cypress_runner.js:8835:10)
      at Promise._settlePromises (http://localhost:5000/__cypress/runner/cypress_runner.js:8911:18)
      at _drainQueueStep (http://localhost:5000/__cypress/runner/cypress_runner.js:5505:12)
      at _drainQueue (http://localhost:5000/__cypress/runner/cypress_runner.js:5498:9)
      at Async.../../node_modules/bluebird/js/release/async.js.Async._drainQueues (http://localhost:5000/__cypress/runner/cypress_runner.js:5514:5)
      at Async.drainQueues (http://localhost:5000/__cypress/runner/cypress_runner.js:5384:14)
  From Your Spec Code:
      at Context.eval (http://localhost:5000/__cypress/tests?p=node_modules/@synthetixio/synpress/support/index.js:6334:15)

@marcusnewton
Copy link
Author

marcusnewton commented Aug 9, 2021

Yeah only getting 1 page showing up in assignWindows

http://localhost:5000/__/#/tests/integration/e2e/specs/example-spec.ts

I'd expect to see metamask extension popping up here. Although I'm still figuring out if Electron actually supports metamask in the first place.

@drptbl
Copy link
Collaborator

drptbl commented Aug 9, 2021

Hey @marcusnewton, after a quick look I can see that synpress could support Electron (as Electron supports loading Chrome extensions which would be metamask in this case), but it would require more coding before that. I don't think that it's going to work in current state, sorry.

@drptbl drptbl added the electron label Aug 9, 2021
@marcusnewton
Copy link
Author

Ok thanks for confirming.

@YakovL
Copy link
Contributor

YakovL commented Jul 11, 2023

As the error is similar, this may be helpful: #804

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

No branches or pull requests

3 participants