synpress
synpress copied to clipboard
confirmMetamaskPermissionToSpend Error
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();
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;
});
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.
cy.confirmMetamaskDataSignatureRequest();
calling this actually fixed this issue for me