synpress icon indicating copy to clipboard operation
synpress copied to clipboard

confirmMetamaskPermissionToSpend Error

Open kwdikeman opened this issue 2 years ago • 3 comments

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

Cannot read property 'waitForTimeout' of undefined

The call to approve permission for spend of coins works - invokes the metamask popup

Fails on: cy.confirmMetamaskPermissionToSpend();

kwdikeman avatar Mar 09 '22 04:03 kwdikeman

can you share a bit more details how you use it in the spec file? Because for me the command works just fine. What I found is, that sometimes if you dont chain the .then onto the async commands, the next command will run before the metamask interaction is finished, which will lead to errors.

cy.confirmMetamaskPermissionToSpend().then(spent => {
        expect(spent).to.be.true;
      });

maxhoheiser avatar Mar 14 '22 13:03 maxhoheiser

For whatever reason if I do not go through the main unlock of MM I can get the confirmMetamask commands to fail.
This is solved. I did chain the .then on the command as well.

kwdikeman avatar Mar 16 '22 02:03 kwdikeman

cy.confirmMetamaskDataSignatureRequest();

calling this actually fixed this issue for me

jerrynoah96 avatar Dec 08 '23 02:12 jerrynoah96