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
Issues with take_failed_screenshot after PR 36047 #37255
Comments
@rmacklin can you take a look at this? |
Yes, thank you for bringing it to my attention! |
Here are my initial findings: I am unable to reproduce the issue when forcing a system test to fail in an application I just upgraded to Rails 6.0.0. Unfortunately, this repository is closed source so I can't show details. However, I happen to have an open source repository at https://github.com/rmacklin/rails_parallel_testing_experiments that has a fresh rails 5.2.3 application and a fresh rails 6.0.0.rc1 application. I created two new branches in that repository where I produced a failing system test in each application. Below are the details: Here is a failing CircleCI build for the rails 5 application: Here is a failing CircleCI build for the rails 6 application: As you can see, neither screenshot is an empty white page (in this sample application the only thing that's rendered is an Additionally, here is the terminal log from the rails 5 app:
and here is the terminal log from the rails 6 app:
As you can see, in both rails 5 and rails 6, the failure screenshot is printed directly above the failure message. Basically I was unable to reproduce either issue. Ultimately this isn't too surprising because I'm the person who submitted PR #36047 and I didn't hit either issue when I tested those changes. That isn't satisfying though -- what's going on with this issue that has several 👍 reactions? Let's take another look at the issue description... Oh:
It looks like this test was written for rspec rather than minitest (the default test framework in rails apps). That's probably why I'm unable to reproduce it in fresh/"stock" rails apps. As an FYI, I've never used rspec's system tests. But I found the "Integrate with ActionDispatch::SystemTest" PR in https://github.com/rspec/rspec-rails/pull/1813/files#diff-779a18a53423de804d5cbdc1edc6552dR19-R29 The code there is reaching for TLDRI suspect this is only an issue when using rspec-rails because I'm unable to reproduce it in a fresh rails 6 app (using minitest). If anyone who 👍'd this issue can reproduce using minitest, could you please share a public github repo that demonstrates the issue? Otherwise, I think we may want to move this issue to rspec-rails. |
Turns out there already was an issue opened about this on the Note, however, that that PR was merged into the @eileencodes do you think we can close this issue? The author of the |
Thanks for the followup @rmacklin! Closing here. |
After updating to Rails 6, Capybara acceptance test failure output changed, and screenshots for failures are now blank (empty white image).
The test summary changes make it difficult to associate failed test cases with the corresponding screenshot.
It looks like both issues stem from https://github.com/rails/rails/pull/36047/files, which moved failed screenshots into a
before_teardown
hook.Reverting the changes from https://github.com/rails/rails/pull/36047/files fixes both issues.
Steps to reproduce
Expected behavior
Maintain the same behavior as Rails 5.2:
Actual behavior
Rails 5.2
Rails 6.0
System configuration
Rails version: 6.0
Ruby version: 2.6.4
The text was updated successfully, but these errors were encountered: