synpress icon indicating copy to clipboard operation
synpress copied to clipboard

Broken Selector for confirmMetamaskSignatureRequest();

Open saur-bh opened this issue 3 years ago • 5 comments

Discussed in https://github.com/Synthetixio/synpress/discussions/324

Originally posted by saur-bh February 7, 2022 After investigation found that selector needs to be corrected in @synthetixio/synpress/pages/metamask/notification-page.js as {code} const confirmSignatureRequestButton = ${notificationPage} .signature-request-footer :last-child; const rejectSignatureRequestButton = ${notificationPage} .signature-request-footer :first-child; {code}

which is {code} const confirmSignatureRequestButton = ${notificationPage} .request-signature__footer__sign-button; const rejectSignatureRequestButton = ${notificationPage} .request-signature__footer__cancel-button; {code}

saur-bh avatar Feb 07 '22 12:02 saur-bh

Thanks for reporting @saur-bh. I think it only applies to metamask 10+, but it's not supported (yet) by synpress (we still use metamask 9). I'm still going to verify this report on old metamask version and take a deeper look in to it. Will post an update until end of this week.

Cheers, Jakub.

drptbl avatar Feb 10 '22 12:02 drptbl

I am also having an issue with this method using MM v9.7.1. Not sure if its related but I think it has to do with eth_sign vs signTypedData_v4. The former works just fine to sign arbitrary strings but using the later hangs for both confirmMetamaskSignatureRequest and rejectMetamaskSignatureRequest

Using ethers to interact with MM if that makes any difference

ghardin1314 avatar Feb 15 '22 03:02 ghardin1314

Hi @saur-bh

Where does it stop when running the tests?

In my cases it does not go through the account selection in the Metamask wallet. It is very strange because if i use run the command cypress open it works (it selects the account 1).

When i run "cypress run" I'm using the Synpress as a plugin within cypress because i don't want to have setup Metamask at all the files.

pcardosolei avatar Apr 22 '22 11:04 pcardosolei

A bit more context, does not pass this step when cypress open does work.

Screenshot 2022-04-22 at 14 03 16 Screenshot 2022-04-22 at 14 03 21

pcardosolei avatar Apr 22 '22 13:04 pcardosolei

did some debugging.

https://github.com/Synthetixio/synpress/issues/398

not sure if related.

pcardosolei avatar Apr 22 '22 18:04 pcardosolei

@synthetixio/[email protected] has been released which includes metamask@10+ update solving this issue. Please reopen if not, thanks!

cc @ghardin1314 @pcardosolei @saur-bh

drptbl avatar Oct 31 '22 12:10 drptbl

Seems metamask changed data-testid for signing. For 10.28.1 version it's page-container-footer-next for sign button and page-container-footer-cancel for reject button.

image

0xmad avatar Apr 17 '23 21:04 0xmad