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
bug: E2EPage setContent removes all script and style tags from the page #3229
Comments
👋 I've confirmed that this is a bug and have labeled it so that it gets ingested into our internal issue tracker & backlog. Thanks for the great reproduction case, it's very much appreciated!! |
No problem! I took a stab at fixing it last night as well, but I couldn't get the build to work linked into my project locally. I'll reach out to the Slack for some help with that later on today. If anyone else is having issues with this, I was able to get around it by adding the script tags after the |
Read the existing head element content, add that content to the e2e page that is being created. This prevents a user losing script or style tags that may have been added to the page before using the setContent method. Fixes ionic-team#3229
Read the existing head element content, add that content to the e2e page that is being created. This prevents a user losing script or style tags that may have been added to the page before using the setContent method. Fixes ionic-team#3229
Update:I revisited this issue, and came up with a solution. The pull request is failing automated tests, currently. I'll attempt to fix those in the future. |
Prerequisites
Stencil Version
2.13
Current Behavior
Sometimes there may be external dependencies that many tests will need, so adding a script or stylesheet to the E2EPage could be defined in a
beforeEach/beforeAll
. However, if you are usingE2EPage.setContent
in an individual test, it will remove all previously added script and styles, leading to some confusing behavior.Expected Behavior
Calling E2EPage.setContent will not remove previous scripts and styles.
Steps to Reproduce
beforeEach
that creates the page, and callspage.addScriptTag
to add a dependency (i.e. bootstrap, shoelace, etc).describe
andit
, callpage.setContent
.<head>
.Code Reproduction URL
https://github.com/Trendy/stencil-set-content-bug
Additional Information
No response
The text was updated successfully, but these errors were encountered: