Issue: #167 Using matches on the page class causes a infinite loop. 😱
The way we're getting the current page is by importing the Capybara DSL into the Percy module. Then we apply the module back to the Capybara class. In the process, we're surly clobbering things.
[x] current_page method name? #letsbikeshed There's currently no methods in capybara with that name, but it feels like it's prone to be broken in the future. Do we do something hyper specific with naming for Percy? (percy_page or something? Something that won't clobber future method names?)
What is this?
Issue: #167 Using matches on the
page
class causes a infinite loop. 😱The way we're getting the current page is by importing the Capybara DSL into the Percy module. Then we apply the module back to the Capybara class. In the process, we're surly clobbering things.
Approach
We're only including the DSL module to gain access to the current
page
session. We can copy exactly how the DSL defines thepage
method: https://github.com/teamcapybara/capybara/blob/master/lib/capybara/dsl.rb#L45-L47 which will avoid clobbering classes, as we're doing now.Question
current_page
method name? #letsbikeshed There's currently no methods in capybara with that name, but it feels like it's prone to be broken in the future. Do we do something hyper specific with naming for Percy? (percy_page
or something? Something that won't clobber future method names?)