Closed paulpruteanu closed 6 years ago
Curious if you have tried updating to a newer version of Cypress? If not, why do you need 1.0.3?
I'm working behind a corporate firewall, and it might take some time until I'll get the latest binary in.
I am extremely confident this is due to security mechanisms in the app you're visiting preventing Cypress from working. You'll need to disable those or figure out where the checks are and use Cypress to disable them.
There are lots of issues that explain this in more detail:
I dig deeper comparing the manual browse and cypress, and it seems like the cypress iframe might cause the issue. There is, indeed, a check in the code that does
if (top !== self) {
top.location.href = self.location.href;
}
which, re-triggers the request, which might redirect to __ UPDATE:
Cypress.on('window:before:load', (win) => {
Object.defineProperty(win, 'self', {
get: () => {
return window.top
}
})
})
did the trick, many thanks!
Yup. There is an easy fix for that in the links I posted.
I am building an E2E test in which I use a button / submit to go to a second page. the submit triggers a redirect. The code as shown above does not work for redirects behind buttons; only for cy.visit (as it looks)
Some updates to frame-busting changes we're making can be read here: #886
Yup this is fixed by https://github.com/cypress-io/cypress/pull/1295
Released in 2.0.0
.
Still happening the full screen even though tried the above solutions.
@naraharun Please open a new issue with a fully reproducible example.
Is this a Feature or Bug?
Bug
Current behavior:
I run a test that opens a page and it randomly redirects from //#my/path/to/test.js to //
Desired behavior:
To have my test continue with its journey
How to reproduce:
Quite hard, it runs an URL routed internal looking like my-resource.test.group as nameserver UPDATE: When I reach to a stage when by clicking on a button, I submit a POST form, that redirects me to a page, which redirects to another one, which finally redirects to the last one (cypress reaches here successfully), then I see this network request in cypress Chrome dev tools: Request headers: GET /last/redirect/page/ HTTP/1.1 Host: my-resource.test.group Connection: keep-alive Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8 Referer: https://my-resource.test.group/last/redirect/page/ Accept-Encoding: gzip, deflate, br Accept-Language: en-US,en;q=0.9 Cookie: my-cookie; __cypress.unload=true
Response headers: HTTP/1.1 302 Found Location: /__/ Vary: Accept, Accept-Encoding Content-Type: text/html; charset=utf-8 Content-Length: 52 Date: Wed, 13 Dec 2017 16:30:47 GMT Connection: keep-alive
Test code:
Additional Info (images, stack traces, etc)
Look for