How to listen global events with Cypress?
问题 We have an application that polls the server periodically until a task is completed. We fire a global event so that Cypress can catch and find out if the task is finished but we had trouble using document.addEventListener on Cypress. Here's what we're doing: document.addEventListener('queryEnd', () => { cy.get('.chart').should('be.visible') cy.get('.table').should('be.visible') }) However; when we use it in a spec, it doesn't work expected and we're not able to catch it. Also, Cypress doesn't