Synthetixio / synpress

Synpress is e2e testing framework based on Cypress.io and playwright with support for metamask.
https://synpress.io
MIT License
590 stars 188 forks source link

✨ feat: Optional caching for tests and enable tests for windows #1155

Closed Seroxdesign closed 2 months ago

Seroxdesign commented 3 months ago

Motivation and context

Currently, Synpress requires users to build a cache of browser contexts with pre-configured wallets before running tests. This task aims to remove this constraint, allowing developers to run tests directly without the need for a pre-built cache.

Does it fix any issue?

SYN-51 & Helps with Windows

Other useful info

N/A

Quality checklist

⚠️👆 Delete any section you see irrelevant before submitting the pull request 👆⚠️

vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
synpress ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 9, 2024 9:17am
Seroxdesign commented 3 months ago

Currently looking into how we will take the input for cache option from user, RN it's hardcoded but we can go with input, env, and different cli commands

Seroxdesign commented 3 months ago

Progress:


Please look into noCacheMetaMaskSetup there could be a potential security risk when unzipping an arbitrary download, not sure if that's relevant or something we can fix.


For some reason I can't get metaMaskFixtures.ts to read the SYNPRESS_USE_CACHE environment variable, I might be loading it wrong.


This PR will allow us to run on Windows OS when SYNPRESS_USE_CACHE is set to false, I tested it on an old laptop, note: it has 8gb ram and I couldn't really get tests to pass there in time, so something we can consider.

Seroxdesign commented 3 months ago

In future:

People should have multiple tests where they can run with or without cache based on their own setups.

Resource:

Seroxdesign commented 3 months ago

NOTE:

We need to update synpress-cache npm package and versioning in package.json before we merge this