-
Notifications
You must be signed in to change notification settings - Fork 48
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
Unable to capture the dialog web component when it is nested inside a shadow DOM #1670
Comments
This issue is stale because it has been open for more than 14 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
It’s waiting for someone to take a look |
Hey @hoaiduc87, From the build logs that you have attached I see the snapshot is javascript enabled. You can use with javascript disabled and it would work fine. [ but in my testing backdrop and the location of popup does not seem correct ] Another note being percy currently does not support CustomElements specifically in js disabled case - so any kind of css that relies on |
Thanks for the explaination @ninadbstack |
@hoaiduc87 no, currently percy by default works in Snapshot mode where we capture and replicate DOM across multiple browsers. If you want to take screenshot of your test browser - its currently only supported when you are using percy with Browserstack Automate [ it comes with some other restrictions ] |
The problem
We are using a micro-frontend architecture, where each sub-project is mounted inside a Shadow DOM. Our UI library is built with web components, with each component also attached inside its own Shadow DOM. We are using Cypress for functional testing and integrating with Percy for visual testing.
In this example, I have a button and a dialog, both built as web components and attached inside their respective Shadow DOMs. I want to render this dialog in my sub-project, which is itself attached inside a parent Shadow DOM. When I click the button, the dialog should open.
However, the problem is that the dialog does not appear in the snapshot captured by Percy, although the button remains visible. I have found that the dialog appears correctly when it is wrapped by only one Shadow DOM. I also perform some assertions with Cypress to ensure the elements are visible. It seems like Cypress handles nested Shadow DOMs properly, except for Percy.
Could you help me determine the reason for this issue and suggest how to fix it? Does it require any additional configuration?
Environment
@percy/cli
version: 1.29.0 (latest)@percy/cypress
version: 3.1.2cypress
version: 13.13.1 (latest)Debug logs
35431593_build_35431593_cli_f357c65217906f7679bd4ebbf77e9a2818531084
Code to reproduce issue
The text was updated successfully, but these errors were encountered: