Skip to content
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

fix: cy.contains() ignores <style> and <script> without removing them. #19424

Merged
merged 8 commits into from
Dec 20, 2021

Conversation

sainthkh
Copy link
Contributor

User facing changelog

cy.contains() ignores <style> and <script> without removing them.

Additional details

  • Why was this change necessary? => cy.contains() removed <style> and <script> to ignore them. But it causes many unexpected errors.
  • What is affected by this change? => N/A
  • Any implementation details to explain? => It now filters out those tags manually, not by sizzle.

How has the user experience changed?

N/A

PR Tasks

  • Have tests been added/updated?
  • [na] Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • [na] Has a PR for user-facing changes been opened in cypress-documentation?
  • [na] Have API changes been updated in the type definitions?
  • [na] Have new configuration options been added to the cypress.schema.json?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 20, 2021

Thanks for taking the time to open a PR!

@sainthkh sainthkh marked this pull request as ready for review December 20, 2021 03:43
@emilyrohrbough
Copy link
Member

I pulled this change down locally & verifying the changes agains the cypress-contains-script repo provided to demonstrate the issue. This change appears to resolve ##19377 while maintain the intended fix for #14861.

chrisbreiding
chrisbreiding previously approved these changes Dec 20, 2021
Co-authored-by: Emily Rohrbough  <emilyrohrbough@users.noreply.github.com>
chrisbreiding
chrisbreiding previously approved these changes Dec 20, 2021
emilyrohrbough
emilyrohrbough previously approved these changes Dec 20, 2021
@mjhenkes mjhenkes requested a review from a team as a code owner December 20, 2021 21:46
@mjhenkes mjhenkes requested review from jennifer-shehane and removed request for a team December 20, 2021 21:46
@jennifer-shehane jennifer-shehane removed their request for review December 20, 2021 21:48
@emilyrohrbough
Copy link
Member

Thank you @sainthkh for the quick fix!

@mjhenkes mjhenkes merged commit 3250945 into cypress-io:develop Dec 20, 2021
tgriesser added a commit that referenced this pull request Dec 21, 2021
…ert-with-stack

* tgriesser/10.0-release/refactor-lifecycle: (50 commits)
  Remove unused test file
  update task spec to use correct projectRoot
  update
  Fix test
  Fix test
  Fix tests
  update tests
  fix test
  correct config path
  Fix TS
  resolve conflicts
  Fixing component & e2e tests
  build: fix dev process on windows (#19401)
  fix: `cy.contains()` ignores `<style>` and `<script>` without removing them. (#19424)
  Fix some tests
  chore: Fix the broken codeowners automation (#19431)
  chore: add types for Cypress.session.clearAllSavedSessions (#19412)
  fix: No unnecessary snapshotting (#19311)
  chore: Remove pkg/driver @ts-nocheck part 1 (#19353)
  fix: add CYPRESS_VERIFY_TIMEOUT param and a test for it (#19282)
  ...
@simfeld
Copy link
Contributor

simfeld commented Dec 21, 2021

Thanks @sainthkh and Cypress team for the quick response, much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cy.contains removes <script> and <style> nodes from the app under test
5 participants