synpress icon indicating copy to clipboard operation
synpress copied to clipboard

[๐Ÿ› Bug]: Alpha version: Wallet cache hashes are different between generation and test

Open andtos90 opened this issue 1 year ago โ€ข 15 comments

๐Ÿ”Ž Have you searched existing issues to avoid duplicates?

  • [X] I have made sure that my issue is not a duplicate.

๐Ÿงช Have you tested your code using latest version of Synpress?

๐Ÿ’ก Are you able to provide enough information to be able to reproduce your issue locally?

  • [X] I can provide enough details to reproduce my issue on local environment.

Synpress version

4.0.0-alpha.0

Node.js version

18

Operating system

macOS Sonoma 14.1.1

Run mode

Playwright + Synpress (as plugin)

CI platform (if applicable)

No response

Are you running your tests inside docker? (if applicable)

  • [ ] This issue could be related to docker.

What happened?

Not sure if you need any feedback on the alpha release, but I'll add this here and you can close it if it's something already on your radar. (Nice work, I really like the new API)

My playwright tests with Synpres don't work because I get this error inside the error trace:

{
  "type": "after",
  "callId": "fixture@6",
  "endTime": 405.01,
  "attachments": [],
  "error": {
    "name": "",
    "message": "Error: Cache for 45ff4daed99a0b6ab9cf does not exist. Create it first!",
    "stack": "Error: Cache for 45ff4daed99a0b6ab9cf does not exist. Create it first!\n    at Object.context (/Users/atosatto/neok/dapp/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@synthetixio/synpress-fixtures/src/fixtures/testWithSynpress.ts:54:12)"
  }
}

The easy workaround is manually renaming the cached wallet folder from the hash generated by synpress to the one from the error.

The internal function getWalletSetupFuncHash returns different values between synpress and playwright test, I can confirm that by putting a console.log after this line https://github.com/Synthetixio/synpress/blob/new-dawn/packages/core/src/defineWalletSetup.ts#L18

This is the PR I'm working on: https://github.com/NeokingdomDAO/dapp/pull/161

What is your expected behavior?

No response

How to reproduce the bug.

  • clone https://github.com/NeokingdomDAO/dapp/pull/161
  • run pnpm i
  • rename .env.test to .env
  • run pnpm e2e:init
  • run pnpm e2e:ui and select the test login just with the wallet (account in DAO)

It should fail before starting to test the real application. You can check the trace and see the error.

Relevant log output

No response

andtos90 avatar Feb 18 '24 21:02 andtos90

Thanks for report @andtos90, we're looking in to it. Will keep you updated.

ETA: hopefully until EOW.

drptbl avatar Feb 20 '24 00:02 drptbl

Thanks @drptbl for the quick answer. I've tried alpha.3 and patching locally the package based on #1105 but didn't work for me. Let me know if you need more help with testing, you can find me in your Discord (handle andtos)

andtos90 avatar Feb 26 '24 19:02 andtos90

Facing this. any work around other than manually renaming the cache?

vishwajeetraj11 avatar Mar 04 '24 08:03 vishwajeetraj11

Facing the same issue when running the example code.

danielsimao avatar Jun 07 '24 15:06 danielsimao

@andtos90 @vishwajeetraj11 @danielsimao could we connect on discord for further debugging, please? This issue is important for us.

My discord handle is: jakubsynthetix

drptbl avatar Jun 07 '24 15:06 drptbl

jakubsynthetix

Added you

danielsimao avatar Jun 07 '24 15:06 danielsimao

jakubsynthetix sent request.

vishwajeetraj11 avatar Jun 08 '24 07:06 vishwajeetraj11

any work around? still facing this.

vishwajeetraj11 avatar Jul 25 '24 11:07 vishwajeetraj11