percy / percy-capybara

Visual testing for Capybara with Percy.
https://docs.percy.io/docs/capybara
MIT License
45 stars 23 forks source link

5.0.0.pre.3 breaks with `have_current_path` Capybara matcher #167

Closed geoffharcourt closed 3 years ago

geoffharcourt commented 3 years ago

Hello Percy team!

The 5.0.0.pre.3 release of the package causes stack too deep error in specs that use Capybara's have_current_path matcher.

Stacktrace looks like this (until it runs out of space):


Failure/Error: expect(page).to have_current_path(new_user_session_path)
--
  |  
  | SystemStackError:
  | stack level too deep
  |  
  |  
  |  
  | [Screenshot Image]: /app/tmp/screenshots/failures_r_spec_example_groups_authentication_through_google_auth_when_not_using_interims_or_clever_o_auth_when_the_user_is_not_found_by_email_redirects_to_new_user_session_path;_displaying_email_in_error_mess_102.png
  |  
  |  
  |  
  |  
  | # /bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara.rb:429:in `specified_session'
  | # /bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara.rb:315:in `current_session'
  | # /bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/dsl.rb:46:in `page'
  | # /bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/dsl.rb:53:in `assert_current_path'
  | # /bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/dsl.rb:53:in `call'
  | # /bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/dsl.rb:53:in `assert_current_path'
  | # /bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/dsl.rb:53:in `call'
  | # /bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/dsl.rb:53:in `assert_current_path'
  | # /bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/dsl.rb:53:in `call'
  | # /bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/dsl.rb:53:in `assert_current_path'
  | # /bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/dsl.rb:53:in `call'
  | # /bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/dsl.rb:53:in `assert_current_path'
  | # /bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/dsl.rb:53:in `call'
  | # /bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/dsl.rb:53:in `assert_current_path'
  | # /bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/dsl.rb:53:in `call'
  | # /bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/dsl.rb:53:in `assert_current_path'
  | # /bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/dsl.rb:53:in `call'
Robdel12 commented 3 years ago

Hey @geoffharcourt! Thanks for the issue, I was able to ship a fix in 5.0.0.pre.4. Curious to hear how it goes :)

geoffharcourt commented 3 years ago

Hi @Robdel12 this unblocked us (test suite now runs). We filed a new issue, #169 about something further downstream. Hoping we can get onto the new hotness. Thanks for your fix here.