-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File download issue, after that page visit times out #15161
Comments
This script is added to every application run within Cypress. Is this error being thrown in the console? Can you give a screenshot of the console? Can you provide a reproducible example? Here are some tips for providing a Short, Self Contained, Correct, Example and our own Troubleshooting Cypress guide. |
@jennifer-shehane : Thanks for the quick response. Due to restrictions, we couldn't share the code. However, below or the snapshots. Browser network response snapshot showing the error while cypress is stuck: Cypress browser window in right corner displaying the loading icon (forever): Left cypress window showing, page load (forever)[NOTE: Actually application is loaded fully, but cypress waits thinking for a page load that will never load]. Couldn't workaround this and stuck. |
I am not sure I understand - is the test failing? I think the previous page is triggering file download, which breaks the next page's visit. You can mock the redirect and other server responses (even the document), see examples in https://github.com/cypress-io/cypress-example-recipes/tree/master/examples/stubbing-spying__intercept#stubbing-application-requests-using-cyintercept But really I do not understand what the test is meant to do, how it is written, what the app is doing, and what is going wrong or right here |
@bahmutov : Yes, the test stuck in the very 2nd page of the flow. & You are right, the previous page is triggering a file download, which is breaking the next page's visit. Also, couldnt find an example to mockthe server responses ( the document). Please help with one. Thanks!!! |
If you can explain how you download the file there, we could advise how to avoid the stuck test. We have a bunch of file download examples in https://github.com/cypress-io/cypress-example-recipes/tree/master/examples/testing-dom__download recipe that might help |
@bahmutov : It is about a jnlp file download and step is like , click "OK" button , JNLP file download starts and application moves to next page. When cypress gets to next page, it is getting stuck and couldn't proceed though the controls are accessible. |
Can you create small repo reproducing the file download? Or fork https://github.com/cypress-io/cypress-example-recipes/tree/master/examples/testing-dom__download and set up the file download the way it is done in your application so that we can investigate? |
@bahmutov : Due to project limitations, couldn't share the code. Cypress step is to click OK and proceed to next page and perform further steps. In the 2nd page, application loaded successfully but cypress stuck and it thinks something yet to be loaded which will never load. Please let know if we can overwrite or skip the waiting for new page to load step and proceed? |
@kbaala88 all I am asking is to see how the download is triggered because obviously, it is not the same as in our recipe. When you trigger the download the browser tries to display that file probably (just like a like to PDF sometimes downloads the file, but sometimes is displayed in the browser). When the browser tries to display the file - guess what, it can no longer be controlled by Cypress, since it switched to the file view mode. This is NOT a problem with the next page loading or waiting. This is a problem with the file taking over the browser tab, blocking the rest of the test execution. Thus if we understand how the file download event is coded in your application, we can suggest a workaround. Without it, there are only our examples we are showing in the recipe that we can suggest. |
@bahmutov : Thanks for the quick responses. It is the file displayed in the browser and the file type is .jnlp |
Can you make the same reproduction example in a fork of our repo, please
…Sent from my iPhone
On Feb 23, 2021, at 10:23, kbaala88 ***@***.***> wrote:
@bahmutov : Thanks for the quick responses. It is the file displayed in the browser and the file type is .jnlp
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Unfortunately cudnt share the code! Below wud be the sample looks like: location:Location; |
Take a look at cypress-io/cypress-example-recipes#651 |
Thanks much for the quick responses. Is it working for the CSV file? |
I don’t have an example of a jnlp file, do you have an example?
…Sent from my iPhone
On Feb 23, 2021, at 15:08, kbaala88 ***@***.***> wrote:
Thanks much for the quick responses. Is it working for the CSV file?
Applied the same to .jnlp file and still the issue persists unfortunately .;(
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@bahmutov : There is a call planned with cypress support team on this tomorrow. Please see if you can join or i shall keep posted on this. |
Updates on this? I have a similar issue, on the latest version of Cypress, after clicking and downloading a test txt file, (Mine from a presigned url) the page waits for a new load and fails after a timeout. I am following the code presented by the cypress recipe. #14857 (comment) |
If you are following the cypress recipe and it does not behave as expected can you open a pull request with a failing tests showing the screenshots or videos of what is happening?
…Sent from my iPhone
On Apr 24, 2021, at 10:51, Adam ***@***.***> wrote:
Updates on this? I have a similar issue, on the latest version of Cypress, after clicking and downloading a test txt file, (Mine from a presigned url) the page waits for a new load and fails after a timeout. I am following the code presented by the cypress recipe.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided. |
Hi,
Currently tried on Cypress 6.3.0, 6.4.0, 6.5.0 & older versions as well. In our application under test, we see that cypress gets stuck and couldn't proceed to next page stating that it is waiting for a load event that would never occur. Tried multiple workarounds , but couldnt resolve. Same behavior in chrome & electron browsers as well.
After debugging, found that cypress thrown below error that we could see from browser console. This issue is a blocker to us and any help on this issue would be of a great help.
<script type='text/javascript'> document.domain = '***.org'; var Cypress = window.Cypress = parent.Cypress; if (!Cypress) { throw new Error('Something went terribly wrong and we cannot proceed. We expected to find the global Cypress in the parent window but it is missing!. This should never happen and likely is a bug. Please open an issue!'); }; Cypress.action('app:window:before:load', window); </script>
The text was updated successfully, but these errors were encountered: