Closed eroteev closed 3 years ago
I had the same issue some time ago, checked it now on 6.2.0 and it seems to be fixed.
Since this issue hasn't had activity in a while, we'll close the issue until we can confirm this is still happening. Please comment if there is new information to provide concerning the original issue and we'd be happy to reopen.
Redirects in XHR do not work in the test runner started by Cypress.io (both inside the test itself or when I open the application in a new tab). The functionality works as expected in regular chrome.
Steps to reproduce:
X-Redirect
header (https://www.yiiframework.com/doc/api/2.0/yii-web-controller#redirect()-detail)$(document).ajaxComplete()
which is supposed to assign the new url, but this callback is never triggered.Current behavior:
Response is returned with
Location: undefined
Desired behavior:
The browser should be redirected to the new url. (Works in Chrome/Firefox/Opera/Safari)
Versions
Cypress.io version: 3.1.0 Chrome version: 69.0.3497.100 (Official Build) (64-bit)
Response headers in Chrome browser
Response headers in a Chrome browser controlled by Cypress.io Test Runner
Additional notes
The application is based on Yii2 Framework and in the link that I have pointed out above is explained that redirects in AJAX mode normally won't work as expected. Therefore the framework provides Javascript code that reads the
X-Redirect
header and switches the location of the browser.In the tests I performed it looks like this code is never executed in Cypress.io during the redirect response: