synpress icon indicating copy to clipboard operation
synpress copied to clipboard

`cy.task('setupMetamask')` failed with the following error: > Cannot read properties of undefined (reading 'waitForTimeout')

Open dev2021-ctrl opened this issue 2 years ago • 4 comments

My test script is below.the issue is random so sometimes the tests are passed and sometimes it fails. I am running on ubuntu with latetst verion of synpress. I can share the synpress json file fi needed. Please advise anyone .A bit urgent.

describe('Metamask', () => { context('Test11 commands', () => {

it(`Try to connect to website`, () => {
  cy.visit('/');
  cy.contains('Welcome')


});

}); });

Below are the error logs:

  1. "before all" hook for "Try to connect to website"

0 passing (379ms) 1 failing

  1. Metamask Test11 commands "before all" hook for "Try to connect to website": CypressError: cy.task('setupMetamask') failed with the following error:

Cannot read properties of undefined (reading 'waitForTimeout')

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/__cypress/runner/cypress_runner.js:161147:78 at tryCatcher (http://localhost/__cypress/runner/cypress_runner.js:13196:23) at Promise._settlePromiseFromHandler (http://localhost/__cypress/runner/cypress_runner.js:11131:31) at Promise._settlePromise (http://localhost/__cypress/runner/cypress_runner.js:11188:18) at Promise._settlePromise0 (http://localhost/__cypress/runner/cypress_runner.js:11233:10) at Promise._settlePromises (http://localhost/__cypress/runner/cypress_runner.js:11309:18) at _drainQueueStep (http://localhost/__cypress/runner/cypress_runner.js:7903:12) at _drainQueue (http://localhost/__cypress/runner/cypress_runner.js:7896:9) at Async.../../node_modules/bluebird/js/release/async.js.Async._drainQueues (http://localhost/__cypress/runner/cypress_runner.js:7912:5) at Async.drainQueues (http://localhost/__cypress/runner/cypress_runner.js:7782:14)

From Node.js Internals: TypeError: Cannot read properties of undefined (reading 'waitForTimeout') at Object.initialSetup (/main/node_modules/@synthetixio/synpress/commands/metamask.js:557:37) at runMicrotasks () at processTicksAndRejections (node:internal/process/task_queues:96:5) at setupMetamask (/main/node_modules/@synthetixio/synpress/plugins/index.js:211:7)

dev2021-ctrl avatar Mar 27 '22 07:03 dev2021-ctrl

We actually commented out the before all call in the support/index.js file. It seems to still go through the setup and unlocks.

kwdikeman avatar Apr 06 '22 15:04 kwdikeman

what command are you running?

pcardosolei avatar Apr 22 '22 13:04 pcardosolei

I have the same issue, using synpress open command

Eveelin avatar Jan 26 '23 15:01 Eveelin

I have the same issue as well, only when I use synpress open.

Christopher-Stevers avatar Apr 13 '23 13:04 Christopher-Stevers