In my Cypress test, I need to test a link which downloads a .txt, .xlsx and a .zip file when clicked, but when I use "click()" to click the hyperlink, it starts a page load and expects a new action to happen as a result of clicking a link.
As an alternative to this I tried using the cy.downloadFile()
to download the files directly through the link but the link I am using is dynamically generated hence I am unable to use that as well. Hence I want to store the newly generated link in the variable and then use it in cy.downloadFile()
every time I run the test.
Are there any other ways to test a hyperlink or how to store the dynamically generated link every time the test is run?