My app require to test third-party payment, so I have to setup chromeWebSecurity to false.
After redirect to different superdomain, the alertbox won't be auto accepted.

The alert box should be auto accepted.
Here is the repo to reproduce, steps in the README.md.
https://github.com/zackexplosion/cypress-alert-issue
test code is very simple.
describe('alert will hold page load', function() {
it('forever', function() {
// Just a blank page.
cy.visit('http://127.0.0.1:8080')
// after form submit, it will redirect to http://127.0.0.1:8081/alert, and the alertbox won't be accepted.
cy.get('#_form_aiochk').submit()
})
})
Cypress: 3.2.0
MacOS: 10.13.6
Browser: Chrome 74.0.3729.131
Hey @zackexplosion,
Cypress should auto-accept window alerts.
Can you try to set up an event listener to see if we are getting the alert event here? Make sure your DevTools are open to hit debugger or console.log.
cy.on('window:alert', () => {
debugger
})
I do suspect this is not hitting because the alert is coming from a different domain than you are currently on though.
Let me know what result you get here and perhaps we can think of a workaround if it is not hitting the event listener.
Hi @jennifer-shehane ,
By change the spec.js to this.
describe('alert will hold page load', function() {
it('forever', function() {
cy.on('window:alert', () => {
console.log('hello from cy event')
})
cy.visit('http://127.0.0.1:8080')
cy.on('window:alert', () => {
console.log('hello from cy event2')
})
cy.get('#_form_aiochk').submit()
cy.on('window:alert', () => {
console.log('hello from cy event3')
})
})
})
The event never fired.

Thanks for your reply.
I can recreate this from this repo: https://github.com/zackexplosion/cypress-alert-issue Likely does not work because the alert is being called from the new url being navigated to.
I can recreate this from this repo: https://github.com/zackexplosion/cypress-alert-issue Likely does not work because the alert is being called from the new url being navigated to.
Yes, that is the problem. Thanks for the reply.
have Any solution锛烮 hive the same problem too...
Did anyone find a solution for this?
Most helpful comment
I can recreate this from this repo: https://github.com/zackexplosion/cypress-alert-issue Likely does not work because the alert is being called from the new url being navigated to.