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: AUT Redirect bug on form / anchor target #16394

Merged
merged 34 commits into from
May 10, 2021

Conversation

tgriesser
Copy link
Member

@tgriesser tgriesser commented May 7, 2021

User facing changelog

Adds code to detect when a form submit or anchor tag target is set to _top / _parent, setting to '' to avoid redirecting the parent frame. Maintains behavior for target=_blank & target=_self, as these have no effect on test execution.

Additional details

Split out from where it was originally added in #15995

How has the user experience changed?

User's AUT is no-longer redirected incorrectly to /__ and instead maintains the correct window location path.

PR Tasks

  • Have tests been added/updated?
  • Has the original issue or this PR been tagged with a release in ZenHub?
  • Has a PR for user-facing changes been opened in cypress-documentation?
  • Have API changes been updated in the type definitions?
  • Have new configuration options been added to the cypress.schema.json?

…io/cypress into tgriesser/fix/3975-redirect-bug

* 'tgriesser/fix/3975-redirect-bug' of github.com:cypress-io/cypress:
  fix(@cypress/webpack-batteries-included-preprocessor): Ensure typescript options are set if typescript path is provided (#15991)
  chore: release @cypress/vite-dev-server-v1.2.2
  fix: conditionally require vue and update alias if installed (#16000)
  docs: remove cssFiles from the vue documentation (#15971)
  chore: release @cypress/webpack-dev-server-v1.1.3
  chore: release @cypress/vite-dev-server-v1.2.1
  chore: release @cypress/react-v5.3.3
  fix: remove lazy-compile-webpack-plugin (#15964)
* develop: (49 commits)
  fix: `cy.type()` should not change the value attr of button-like inputs. (#16154)
  fix: properly detect `cy.intercept(url, routeMatcher, handler)` overload (#16167)
  fix: consider multiple routes when looking for aliases (#16180)
  fix: pass contextIsolation: true (#16165)
  chore: fix failing "should handle aborted requests" test (#16170)
  feat(issue-3741): added keyboard support for folder (#15648)
  fix(webpack-dev-server): remove hard dependency on html-webpack-plugin v4  (#16108)
  chore(deps): downgrade electron to v12.0.0-beta.14 (#16113)
  fix: accept absolute paths in vite dev server (#16148)
  fix: cy.then shows wrong type when collection of HTMLElement's is provided (#15869)
  fix: do not treat utf8 requests as binary (#15946)
  chore: fix types
  docs: fix broken links for @cypress/react example recipes (#15674)
  update circle yml
  ignore undefined beforeEach
  fix: make vite-dev-server work on windows (#16103)
  chore: add triple slash reference
  chore: remove conflicting types
  chore: rebuild yarn lock
  resolve conflicts in master(fe0b63c) and develop
  ...
* develop:
  feat(design-system): SpecList - FileTree - VirtualizedTree (#16179)
  fix: Ensure binary request body is not mutated by cy.intercept (#16306)
  chore: run driver, runner tests in electron (#16208)
  fix: accept webapck 4 & 5 as peer dependencies of @cypress/vue and @cypress/react (#16290)
@cypress-bot
Copy link
Contributor

cypress-bot bot commented May 7, 2021

Thanks for taking the time to open a PR!

@tgriesser tgriesser changed the title fix: Form submit AUT Redirect bug fix: AUT Redirect bug on form / anchor target May 7, 2021
@cypress
Copy link

cypress bot commented May 7, 2021



Test summary

4057 0 50 2Flakiness 0


Run details

Project cypress
Status Passed
Commit 23e0241
Started May 10, 2021 2:42 PM
Ended May 10, 2021 2:52 PM
Duration 10:07 💡
OS Linux Debian - 10.8
Browser Chrome 89

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@tgriesser tgriesser requested a review from jennifer-shehane May 7, 2021 16:19
* develop: (28 commits)
  fix: XHR event listener AUT redirect bug (#15995)
  chore: fix typo (#16345)
  chore(design-system): Added missing exports and index.ts (#16351)
  chore: Remove extra renovate.json file (#16385)
  Do not print 'uploading' stdout when --quiet mode is passed (#16271)
  fix(deps): update dependency color-string to version 1.5.5 🌟 (#16362)
  fix(deps): update dependency cypress-real-events to version 1.4.0 🌟 (#16363)
  tests: use the proper keys for selecting framework
  fix: Prevent Firefox from opening custom search when pressing / (#16372)
  fix(socket): update serialization for circular binary socket messages (#16311)
  fix: vueCli and webpack key vue@2 fix when guessing
  tests: update snapshots
  fix: add return config for vueCli and vueWebpack
  chore(deps): update dependency classnames to version 2.3.1 🌟 (#8337)
  fix: add return config for vitejs templates
  chore: release @cypress/vue-v2.2.2
  chore: release @cypress/react-v5.5.0
  fix: remove all of rollup, not supported anymore
  fix: typo in the final message (run vs run-ct)
  fix: use close event when asking the browser for its version (#16312)
  ...
@tgriesser tgriesser marked this pull request as ready for review May 7, 2021 16:24
@tgriesser tgriesser requested a review from a team as a code owner May 7, 2021 16:24
@tgriesser tgriesser requested review from flotwig and brian-mann and removed request for a team May 7, 2021 16:24
Copy link
Member

@brian-mann brian-mann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_parent cannot always be stripped. Must only be conditionally stripped if parent is Cypress top. Add test creating nested iframe with a form targeting parent. That case should not strip parent target

tgriesser added 2 commits May 10, 2021 09:45
* develop:
  remove unused deps from webpack-preprocessor (#16384)
  feat: exclude html pwa plugin in webpack dev server (#16388)
  fix(ui): display duplicate aliases in command log (#16382)
  fix(ui): show req stub/fn when a handler is supplied (#16383)
  feat(component-testing): Expose CT through CLI module API (#16368)
@tgriesser tgriesser merged commit 2b0add1 into develop May 10, 2021
@tgriesser tgriesser deleted the tgriesser/fix/1244-redirect-bug branch May 10, 2021 18:06
@cypress-bot
Copy link
Contributor

cypress-bot bot commented May 10, 2021

Released in 7.3.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v7.3.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators May 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: EISDIR: illegal operation on a directory
3 participants