synpress
synpress copied to clipboard
Idea: Offer way of using package in playwright test
After looking into playwright we think playwright is actually a better e2e testing framework than cypress. Because of this we plan on switching from cypress to playwright and copying some of the code here along with some code here (only the wallet specific stuff) https://github.com/DePayFi/web3-mock/blob/main/src/platforms/evm/request.js for automatically making the tests able to run in headless mode.
Since we are essentially planning on copy pasting the existing playwright code to interact with metamask, I thought it would be nice if this library essentially moved that into it's own package or exported it here.
@roninjin10 Great idea. What do you think about an idea of integrating this mocking library with synpress together with adding an ability to choose between running your tests with cypress or playwright straight from synpress? Would it suit your needs? I can see huge benefit of going with this approach as you would be able to choose your testing framework together with preferred way of testing using single testing codebase - with real wallet or mocked one, heedlessly or not, with cypress or playwright. Does it make sense? I can take a look at it this week.
On another hand, I think it should already be possible to use playwright-related commands driving metamask straight from synpress inside playwright tests. I will create some PoC and let you know.
@
Yea I think so too. I think we could even just import the commands direction from source folder and have it work right away
@drptbl got an idea for a spec for the in page headless provider:
- it looks like the metamask in page provider could be used directly by importing it from here https://github.com/MetaMask/providers/blob/235551b9de409ecf723e12a58189b52d2649b8fc/src/MetaMaskInpageProvider.ts
- I think some extra work might be needed to enable doing stuff like rejecting requests to the wallet
any progress on that? or maybe there is some poc how to use it with playwright?
@obstar haven't had any bandwith unfortunately to do this yet. Hoping to sync with @drptbl and make this happen later this year after we get some more hires to take work off my plate. First we have to make synpress a little more modular which will be really good for the library in general
@nickbalestra @mitsudani @obstar @scherroman @alexvechirko @roninjin10 @duckception Playwright is now officially supported with synpress: https://github.com/drptbl/synpress-examples