I am testing a form submit with Cypress. My Form action is the same has the current page URL. Once I hit submit it downloads a file. I am facing two issues:
- Since my form action URL is the same as the current page URL, after submitting it went on an infinite loop.
cy.get(urSelector.UserActivityReportForm) .then(() => { util.clearAndSendKeys(urSelector.FromCalendar, urData.From) util.clearAndSendKeys(urSelector.ToCalendar, urData.To) util.clearAndSendKeys( urSelector.SearchByCategoryTxtBox, urData.Category ) util.clickSearchButton() }) .then(() => { cy.get(urSelector.DownloadUserReportForm).submit() })
- How can I Validate the file download is completed?