File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -198,6 +198,20 @@ def capybara_obscured?(x: nil, y: nil)
198198 end
199199 ::Playwright ::ElementHandle . prepend ( CapybaraObscuredPatch )
200200
201+ # ref: https://github.com/teamcapybara/capybara/pull/2424
202+ module ElementDropPathCompatPatch
203+ def drop ( *args )
204+ options = args . map { |arg | arg . respond_to? ( :to_path ) ? arg . to_path : arg }
205+ synchronize { base . drop ( *options ) }
206+ self
207+ end
208+ end
209+ if Gem ::Version . new ( Capybara ::VERSION ) < Gem ::Version . new ( '3.34.0' )
210+ # Older Capybara returns early for Pathname arguments in Element#drop,
211+ # so the driver implementation never runs.
212+ Node ::Element . prepend ( ElementDropPathCompatPatch )
213+ end
214+
201215 module Playwright
202216 # Selector and checking methods are derived from twapole/apparition
203217 # Action methods (click, select_option, ...) uses playwright.
You can’t perform that action at this time.
0 commit comments