-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Add support for shadow dom #144
Comments
For anyone finding this issue on Google when searching for how to access the shadow Dom: it('.should - search by email', () => {
cy.get('profile-search').then(search=>{
const email = search[0].shadowRoot.querySelector('#email');
email.value='test@example.com';
email.dispatchEvent(new CustomEvent('change'));
});
cy.wait(200);
cy.get('profile-search').then(search => {
return search[0].shadowRoot.querySelector('profile-preview').getAttribute('uid');
}).should('eq', 1);
}); |
Any update on what might be best way to use Cypress on say a Polymer project nicely? |
Is there any update on this? The temporary solution proposed by @brian-mann in #830 doesn't seem to work in the newest versions of Cypress anymore. It throws a |
I would love to get some update on this too :) |
Same here, we're heavily relying on shadow-DOM and use Cypress for our functional testing. Thanks to @chrisbreiding we've figured a few ways to get around and select elements, but not having a proper support of shadow DOM makes it impossible to use |
Updates? 😅 |
Would love to see this working! 👍 |
Commented on a similar issue here with my findings, although am able to find shadow Dom elements with JS, cypress thinks the element is not attached to the DOM anymore when I work with it |
This feature is still in the 'proposal' stage. No work has been done on this feature as of yet. We're a small team and as much as we'd love to work on everything, we have to choose what to work on based on a multitude of things. |
Just plus oneing this issue. I hope you prioritize this, because I'd like to be able to use cypress without having to petition every company I work for to rewrite their front end, since shadow dom is super common. I've been using it all of two weeks and I'm impassibly stuck because shadow dom can't be seen. |
Another +1 here!
I agree with you. Nowadays it's a common scenario big companies bet for WebComponents for build their front-end, and it's a shame we can't use cypress for testing :( Hope it get's prioritized. |
This comment has been minimized.
This comment has been minimized.
May I ask is there any update or workarounds? I'm testing ionic4 based apps and there are thousands of shadow doms in ionic4 components. :-( |
I'm also on boat for cypress supporting shadow-dom for us stenciljs users. Any updates? |
No work has been done on this issue. |
What's the status quo here? Is it somehow possible to test WebComponents and/or ShadowDom? |
@Herbrandus we also invested a lot of R&D into Cypress, but due to growing demand of web components and shadow-dom, we are forced to abandon it. The Cypress team has their reasons and cannot argue whatever those reasons are. Unfortunately, we just cannot continue to use this solution. |
Folks, please refrain from the "I need this too" kinds of comments (you can upvote the original post instead). There's quite a lot of noise here recently. Thank you! |
@kamituel literally 5 comments above, a cypress team member wrote:
So I don't agree with your recommendation - and Github, after all, supports an unsubscribe feature. |
You can disagree of course. But unsubscribing is not a solution because then I wouldn't be notified when something actually meaningful happens with regard to the Shadow DOM support. |
Yeah, I might need to do that at some point. In all fairness I was hoping to also be notified when a proposal on the Shadow DOM support is posted, or any other meaningful updates. So I knew about them in advance. That's a pity Github doesn't allow us to limit notification to only those coming from project members. That'd be just perfect in this situation. Anyway, I'll just close my mouth now not to generate that noise I complained about myself ;) Cheers. |
Like i said above, i have a fairly solid implementation so far in #7469. it would be very useful if people who want this could give their opinion in there too, so im aware if it achieves the use cases people have |
I wonder if some people could be less blocked then they think they are. Here is a list of attempts to provide support for Shadow DOM. They might not be super robust or up-to-date, but certainly something that could be played with or one can learn from. https://github.com/JaySunSyn/cypress-daywalker from JaySunSyn These are more conceptual than potentially working solutions: There are probably others, these are the ones I could find relatively quickly. I also think this would be a good feature for Cypress to add direct support for, but I can also see that there are probably other features that are more important for the time being. |
@PerfectedApp what did you switch to? Looks like we will have to abandon again second project in a row. |
I need an alternative too. What do you use in place of cypress? |
We are considering forking Cypress to support Shadow DOM and #95 as both issues are still open after over 4 years. This issue along with fetch makes Cypress feel like its already becoming a legacy tool to work with |
OMG i didn't notice the #95 issue. After 4 days trying to make it works it looks like a very immature tool. |
Ladies, not every tool is for everyone and I assume the cypress team is juggling priorities and do not consider shadow dom support as one of them - which is IMO fine. Either consider using one of the plugins @JasonFairchild mentioned or look into things like https://github.com/microsoft/playwright where shadow dom is supported. |
There are a lot of other options out there. Depends on what you or your organisation is needing. Some of these options have a more professional, nonsexist, and friendly community than others. For those that are interested, our group is currently looking at CodeceptJS. Although, I still have hope for Cypress. |
@PerfectedApp thanks |
In the last day there's been some progress on the #7469 issue with getting some reviewing and a relative plan based on the review that I believe to be going on right now |
The code for this is done in cypress-io/cypress#7469, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
We've added experimental shadow DOM support through the To use it, update to Cypress 4.8.0 and pass the following to your configuration file or however you pass in configuration. {
"experimentalShadowDomSupport": true
} See the Experiments for more information including how to use the new This is still experimental, so we'd like your help working through any bugs or unexpected behavior before releasing into the main product. If you encounter any issues using the new experimental shadow DOM feature, please open a new issue, filling in the issue template and providing a reproducible example. |
Currently, Cypress fails for various reasons when dealing with the shadow dom. So far, I've seen three issues.
Moving the
.find
into the.then
gets past this issue, but is not ideal:It might be nice and maybe even necessary to have a convenience method like
cy.getShadowRoot()
that could be chained off other dom commands.$.contains(el1, el2)
returns false when el1 is outside the shadow root and el2 is inside it. Some discussion here.<body>
or<html>
elements while walking up the chain of ancestors.The text was updated successfully, but these errors were encountered: