-
Notifications
You must be signed in to change notification settings - Fork 55
Chroma: e2e testing library for Polkadot wallet integrations #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chroma: e2e testing library for Polkadot wallet integrations #40
Conversation
…n and multi-chain support
…esting capabilities and proof of concept updates
|
Hi @preschian sorry for the delay here. This looks interesting and certainly fills a gap when it comes to wallet integration testing. Can you confirm the following:
|
|
@preschian Thank you for the application. Do you know this project: https://github.com/Synthetixio/synpress |
|
Hi @keeganquigley and @ditavia-br thank you very much for the response
Yes, based on Playwright documentation it's limited to Chromium browsers only. But I think this is more than enough, especially since Chromium is still dominantly used by users at the moment.
It can run in headless mode. More precisely, I haven't tested heavily in headless mode yet. I'll try to reword this grant application document later.
Do you mean wallet providers have to use this library? Actually the main target is dapp developers. Dapp developers use this library to test their dapps. Wallet providers don't need to adopt this library, they're just optional. But conversely, this library will expand to support other wallet providers in the Polkadot ecosystem. As long as the wallet is open source.
Yes, there are quite a lot of options in other ecosystems. Actually I've been researching for quite a while, and have tried several other libraries. And now trying that library again I'm getting an error:
My answer might be a bit biased. But since I haven't found a suitable library, I tried to create a new one. For example with |
…d known limitations with wallet extensions
|
I just tested regarding headless mode, the results look ok. But the results might be different with other wallet extensions or certain conditions that haven't been covered yet. GitHub actions: https://github.com/preschian/create-dot-app/actions/runs/18152695184 |
…let support and multi-chain features
|
@preschian thanks for the reply. I'm not willing to support the development of a completely new tool, since that often leads to yet another open-source project with little usage or maintenance. I like the project and think it’s needed, but it would be better if it were implemented as a plugin or extension to an already well-known and widely used tool. This would help avoid duplicating code that already exists elsewhere and could be reused. There are tools in the EVM ecosystem that work well for end-to-end testing, so it would be great to have them working with Polkadot wallets as well. |
|
Hi @ditavia-br, thanks for the feedback. Even though my proposal might not be approved, I'll probably still maintain it and spread it to our ecosystem. At least I'll use it in projects I'm building like Chaotic or include it in create-dot-app, so the templates are more complete with e2e testing. As mentioned in previous posts, my problem with other ecosystems is I can't find one that works on new projects. The difference also is that this library plans not to include wallets that are not open-source. Because of reasons related to maintaining that wallet version. Extracting from chrome extensions also isn't necessarily reliable forever. Besides that, a few days ago I found this |
|
hi @ditavia-br 👋🏻 here are some early impressions from several developers about chroma that might be worth considering
to make it clearer why I decided to create this library: I also noticed that Velocity Labs tried to use an existing library, As far as I know, most existing libraries try to support non-open-source extensions. During my research, I found that extracting Chrome extensions is quite hacky and I’m not a fan of that approach, since it can’t be guaranteed to work forever. On top of that, controlling the wallet version in that flow is tricky, exactly like the issue mentioned here: So, if we were to integrate Polkadot wallets into an existing ecosystem library, the effort wouldn’t just be adding the wallet, it would also require fixing their core functions. Moreover, if builders in Polkadot use a non-open-source wallet from those libraries and encounter issues, it would result in a poor developer experience. Meanwhile, in my early version, it’s already possible to connect both Polkadot and Ethereum addresses and run successfully in CI/CD: https://github.com/avalix-labs/chroma-examples/blob/cce24378982ac970699b15cb3e3489d958779939/tests/dapp/hydration.spec.ts#L35-L47 Actually, I don’t mind expanding or integrating into an existing library. If there’s already a library that’s good enough. For instance, AssetHub (Kusama and Paseo) now supports Solidity smart contracts, but it’s not yet available in Thirdweb. In that situation, I’d prefer finding a way to make Thirdweb support AssetHub, because its main functionality works well, and other EVM-compatible parachains like Moonbeam already have support. |
|
@preschian Thanks for the comment. E2E testing in Web3 applications is not a new challenge. My main concern here is the long-term maintenance of the tool. Building a new one would not leverage the community benefits that come from adding a feature to an already widely used project. Furthermore, the issues you mentioned with Synpress would also occur if you maintained this new tool over time. Each time a dependency releases a new version, whether it’s Playwright or a wallet, you would need to adjust the software to stay compatible. For a tool that’s already in use, you get help from the community with these updates. For instance, there’s already an open PR to support a more recent version of Playwright. So, while I agree that the problem you’re addressing is important, developing an entirely new tool has a higher chance of becoming an abandoned project in the future than simply adding new features to an existing one. For this reason, I’ll stand by my position and not support building a completely new E2E testing tool. Don't need to be Synpress, can be any tool that is already widely adopted for this problem and can be adjusted to Polkadot ecosystem. |
|
hi @ditavia-br thank you so much for your response.
Actually, during my research, this is one of the reasons why I decided to create a new one. If you look, that PR is from one of the core contributors. But after 7 months, there’s still no update. So how much longer do we have to wait? It’s uncertain when it will be fixed. In fact, it should already be tested with Playwright v1.55, because in that version Chrome extension v2 is no longer supported. playwright release notes v1.55
So, what should I do next? I’ve already tried looking for existing tools, but none are compatible with the latest version of Playwright. Even Velocity Labs has tried using tools other than Synpress and still failed. From what I know, most existing tools try to support non-open-source wallets, which causes issues whenever Chromium upgrades its extension manifest version. They use hacky methods like unzipping Chrome extensions, instead of building the extension directly from open-source code. If there’s already an existing tool that’s good and only supports open-source wallets, please let me know. I’ll try integrating Polkadot wallets there. My question is: if builders in the Polkadot ecosystem want to use E2E testing for their dApps, what should they use? |
|
@preschian Thanks for your answer. Let’s look at it this way: if a well-established project in another ecosystem is already facing maintenance issues, what makes you confident that your project won’t face the same challenges? What is your long-term plan to ensure the sustainability of your project? How do you intend to make it maintainable in the long run and avoid the same problems they encountered? What will you do differently to make your project more sustainable? |
|
Hi @ditavia-br, thanks again for your thoughtful follow-up! That’s a fair question. Honestly, I also share the same concern. Many tools start strong but fade out when maintenance becomes heavy. So here’s how I plan to make Chroma more sustainable in the long run:
The idea is to keep Chroma small, useful, and community-friendly rather than a big monolith that depends on one maintainer. |
|
@preschian I was wondering if it would make sense to include a small maintenance milestone in this proposal, or if that would fall outside your current scope. Also, I believe that one of the main factors in keeping an open-source project healthy is ensuring it finds real users. If the community finds value in it, sustainability tends to follow naturally. I think the project is valuable, my only suggestion would be to make sure there’s a clear commitment to maintaining the project for some time and to actively engage potential users. Long-term success will depend not only on delivering the code but also on fostering adoption. If the project is completed successfully, you could consider approaching wallet teams to explore ways of supporting or promoting the work. |
…nability strategy, and short-term plans for community engagement and wallet support
|
hi @ditavia-br 👋🏻 thanks again for the suggestion! I’ve added a clear Maintenance Commitment section in the updated proposal. For me, maintaining the project after completion is already a given. I’ve been maintaining create-dot-app, another open-source tool I built for Polkadot developers, and I plan to do the same for Chroma for at least 6 to 12 months after delivery. I fully agree that sustainability depends on real users and adoption, so I’ll keep engaging with dApp and wallet teams to ensure Chroma stays relevant and useful over time. |
semuelle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification. Happy to support.
ditavia-br
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to support and looking forward to seeing long-term adoption of the software.
keeganquigley
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @preschian for the changes, happy to approve also.
|
Thank you everyone for the approvals! Excited to move forward and keep refining Chroma together 💪 |
|
Not trying to be a party crasher here, but for DApp E2E testing, won't you just need to inject a signer/headless-extension? |
|
Hi @tien, no worries, I really appreciate the feedback 👌 Actually, injecting a signer is exactly what I try to avoid for this use case. But with signer injection, the flow becomes more artificial, like: Each dApp also implements wallet connection differently. For example, some store user data in localStorage or cookies after the “Connect Wallet” step. So, I prefer leaving the signer logic to the existing wallet provider instead of patching or re-implementing it. |
|
I believe "Headless-wallet" is the other thing that you are looking for here. It would be this exact same flow you mentioned: The signer logic is exactly the same as all wallets uses the same core keyring implementation, but even then, that doesn't matter at all since it's just the |
|
But we’d still need to create an adapter layer for that “headless-wallet” and maintain one for each supported chain. From a development and maintenance perspective, it’s much easier to rely on existing wallets like Talisman, which already supports Polkadot, Ethereum, and Solana. For now, the main focus is to make things work reliably and stay stable, especially for cross-chain and embedded wallet cases. That said, if this requirement becomes relevant in the future, I’m very open to collaborating on it 🦾 |
If we are talking about Polkadot chains, then only one implementation is needed for any number of chains? Which, a basic headless version, should be relatively short and easy to implement, I believe. We are talking about one to two days of work or up to one week max for a well-encapsulated version. @semuelle @keeganquigley @ditavia-br pardon for asking, but shouldn’t you guys be the ones to make these most basic of evaluations? |
hi @tien, perhaps you missed the part I mentioned earlier. I wasn’t referring only to Polkadot, even though that’s the main focus. If you check my very first commit in this PR, you’ll see this already included: What you call a "headless-wallet" is actually quite similar to what some Ethereum projects call a "Mock Wallet". In my opinion, that falls under modified or mocked implementation details. After experimenting with that approach, I found it simpler and more reliable to just use existing wallets. The main reason, as I mentioned before, is multi-chain and embedded wallet support. This way, if more dApps like Hyperbridge, Hydration, or Turtle appear in the Polkadot ecosystem with multi-chain connections, they can benefit from the same setup. On top of that, there’s also https://polana.network/. As far as I remember, when I first submitted this proposal, Talisman didn’t yet support Solana. So later, if Solana support is added, I won’t need to dive into its spec or implementation details. I can just update Talisman and adjust the UI flow for Solana. |
It is not modified/mocked (in the sense that you think) when you are still signing transactions with a real key and via a real "wallet interface”.
This is simply not possible. You can make other points, but this one is just not. Like this is the entire implementation of a headless Polkadot wallet version. |
|
I've used the Cypress plugin in the past and it worked like a charm. I get that it might be a bit outdated for the newest versions of Cypress, and it also could use a few more features, but I wouldn't discard it. It can even be used as a base for a Playwright alternative. |
|
hi @tien @laurogripa 👋🏻 thank you both for taking the time to respond to this proposal
I’m not sure what exactly you meant by “not possible”. Have you checked this repository? It already runs successfully both in CI/CD and locally, and supports multi-chain connections. Regarding
Maybe you can check the points I mentioned in this proposal about why I decided not to follow the same approach from ChainSafe. I’m very open to any feedback or suggestions. |
|
When I said "This is simply not possible", I meant that it's not possible for "Headless wallet" to be "less simple and less reliable" by any definitions. |
|
Now to address your other points
Like I said before, this is the entire meat of that library, it does not matter at all whether that is being ran by Cypress or Playwright.
You can similarly do the same with whatever supersede
Other chains also have "headless" wallet for E2E testing, for example: https://github.com/cawabunga/headless-web3-provider If there isn't for any particular chain, I can guarantee you that implementing one is almost certain to be simpler than to juggle with real wallet internals. And that it would be of great values.
As I've mentioned earlier, headless wallet IS real wallet.
You are not testing DApps, but wallets at this point. DApps have zero exposure to wallets’ internals other than through a fixed interface. |
|
I take no pleasure in having to point these out btw
But you have to understand that a treasury funded bounty need to meet certain standards. |
I think we’ve found the main point where we agree to disagree on this part. Maybe for you, a "headless" implementation can still be reliable and simpler. But for now, I personally find that using existing wallets is the simpler approach, especially when it comes to multi-chain cases. For this case, I prefer maintaining the ui-flow first rather than focusing on the chain-spec.
If we strictly think that way, then libraries like Synpress or Dappwright probably wouldn’t have any users at all. |
How is handling internals un-specced UI state less flaky than dealing with fixed spec interfaces?
Honestly they shouldn't, if your dapp only deal with specced behaviour & can leverage programmatically controllable wallets for E2E testing, then please do. Tagging @noahjoeris cuz Velocity was mentioned 🙏 |
Because I lock the wallet version being used instead of always pulling the latest extension release. For example, the current Polkadot-JS version used is v0.61.7, specifically the Honestly, I think most of the questions you’re raising were already brought up by one of the curators earlier. But from what I see, our discussion here seems to be more about how to implement it rather than how to solve the actual problem. Personally, I prefer to focus on solving the actual problem first by taking the simplest path. The main issue, in my view, is that there is currently no E2E testing library that supports multi-chain setups for the Polkadot ecosystem. That’s the part I’m focusing on right now. In the end, I believe most library users don’t really care how the implementation works internally. What matters to them is simply that they can use the E2E testing library to test their dApps effectively. |
This is why I hate having to join the discussion like this, I don't want to discourage this.
For a $30k, we absolutely should care. We should care regardless, if we don’t care as the "top of the funnel", how will that filter down to end users?
And wallet integration is just one line item in that equation, which is already easily “solvable," just maybe not matching some preference, hence not a priority. There are definitely more to testing than just wallets (e.g. if you bundle in wallets with other stuffs like Chopstick for example), you are always welcome to explore more. I just wish that this process was given more guidance from the start, so it didn't build up to be adversarial like this. |
|
Hey, @preschian, thanks for your reply!
I read the whole thread and your proposal, which is why I said the Cypress plugin could use some updating and some new features; I'm just not sure about creating a whole new opinionated project. I share some of the same concerns mentioned in the thread, namely usage and maintainability, but also fragmenting collaboration. However, I also don't want to appear unwelcoming, our devx is already hard as it is. I hope I'm not discouraging you. |
|
Hi everyone, thanks for the high-quality discussion here. We welcome community members to participate. I want to briefly summarize the points raised to ensure we are all on the same page. Correct me if I'm wrong, but: It seems we have two valid but distinct philosophies on testing being debated: The "Headless" Approach (highlighted by @tien): Focusing on reliable, fast, and maintainable testing of dApp logic using simulated wallets. The argument is that this covers the vast majority of use cases without the "brittleness" of testing UI elements. Since it might be tricky to maintain with UIs constantly changing, tests might break down the line, etc. The "fully E2E" Approach (proposed by @preschian): Focusing on integration testing with the actual, "injected" wallet extension. The argument is that there is currently a gap in tooling for developers who need to verify the full user experience, especially given the maintenance issues with existing tools like Synpress. If I understand correctly, @tien is arguing that the cost of testing this small gap isn't worth the instability it could create. While @tien makes excellent points regarding the efficiency and stability of headless testing, we believe there is value in funding @preschian’s approach to solve the specific problem of real-world extension interaction. Lowering the barrier to entry for developers who need "true" UI verification is a net positive for the ecosystem. Since this application has been approved, we are going to proceed with Chroma. However, @preschian, please take @tien's feedback seriously regarding the maintenance challenges of UI-based testing. The success of this project will largely depend on its ability to remain stable even when wallet UIs update. Thanks for bringing this to our attention and I hope this helps to shed light on the situation from the bounty side. |



Project Abstract
Chroma is an end-to-end (E2E) testing library specifically designed for Polkadot wallet interactions. It enables developers to write automated tests that interact with real wallet extensions, providing a comprehensive testing solution for decentralized applications (dApps) in the Polkadot ecosystem.
Application Checklist
project_name.md).