https://cypress.io logo
Location null when using download verification wor...
# i-need-help
p
Hello! Currently experiencing a very similar issue to this guy: https://github.com/cypress-io/cypress/issues/14857 However, the workaround provided (https://github.com/cypress-io/cypress/issues/14857#issuecomment-785717474) isn't working for us. We're getting the error:
Cannot read properties of null (reading 'reload')
Does this workaround need to be different for Cypress 11.0.1+? Or what can I do here? Thanks!
I also confirmed with an expect statement that doc.location is not null, so it shouldn't be having an issue
Solved it myself:
Copy code
cy.window()
    .document()
    .then(function (doc) {
        doc.addEventListener('click', function () {
            setTimeout(doc.location.reload.bind(doc.location), 5000)
        })