-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
PDF download timing out on Chromium > 127 #279
Comments
Any luck here? I am having the same issue with the same helper downloading a file (not a PDF). |
Thanks for the hint @brianclinkenbeard. Recently our tests related to file downloads started to fail and I had no clue why. We use the same or similar download handling code. I could get some tests running again by changing the way kt-paperclip constructs URLs (sic), but other still failed and I didn't really know how to proceed. After reading your issue I thought, maybe that hit us as well. I replaced the repo version of chrome by the headless variant found here: https://googlechromelabs.github.io/chrome-for-testing/ (back linked to from here https://developer.chrome.com/blog/chrome-for-testing, so I believe it is credible). First I used some older version (some 127) but then I wondered whether newer versions also work. And indeed, the currently latest stable version 131.0.6778.87 also works. I changed our base image to install chrome from that archive file rather then the repo, so we have control over the actually used version and when to update. |
It's not cuprite/ferrum issue, find the version that still works |
For me, the problem only occurs with specific versions of cuprite / ferrum:
It does not seem to be affected by the version of Chrome (I tried both Chrome for Testing v113.0.5672.0 and v133.0.6943.2). Also, the problem seems to be triggered by opening a new (second) browser window during a test. We have tests like this (using RSpec and Capybara): scenario "foo" do
visit root_path
print_view_window = window_opened_by do
click_on "Open print view"
end
within_window print_view_window do
expect(page).to have_css("h1", text: "Dolor lorem ipsum")
end
print_view_window.close
end These tests run fine. However, as soon as one such test has been executed, all subsequent tests trying to download a file fail. Again, this only happens with cuprite 0.15.1 / ferrum 0.15. |
Interesting, @noniq could you try to activate given page with rubycdp/ferrum@600d63d for ferrum 0.15 |
Not really sure if I got this right – I tried the following: scenario "foo" do
visit root_path
print_view_window = window_opened_by do
click_on "Open print view"
end
# ADDED
print_view_window.session.driver.browser.page.activate
within_window print_view_window do
expect(page).to have_css("h1", text: "Dolor lorem ipsum")
end
print_view_window.close
end This does not make a difference, though. |
hm I think wrong target is active, I have a sense what's going on. Let me try to reproduce it with pure Cuprite test |
After updating past Chromium 127, running RSpec tests on PDF downloads now uniformly time out. We use this somewhat popular helper code to yield the download after clicking a PDF link:
Waiting for a PDF download just hangs indefinitely. Watching with headless turned off, the PDF will never load in the new tab, however, trying this manually on a clean instance of Chromium will load the PDF perfectly. Perhaps an upstream regression with the CDP? Maybe also related: rubycdp/ferrum#457 (reply in thread)
The text was updated successfully, but these errors were encountered: