Skip to content

Commit 98bdf13

Browse files
committed
Add env for trigger
1 parent 6a8da81 commit 98bdf13

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/capybara/cuprite/page.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
module Capybara::Cuprite
66
module Page
77
MODAL_WAIT = ENV.fetch("CUPRITE_MODAL_WAIT", 0.05).to_f
8+
TRIGGER_CLICK_WAIT = ENV.fetch("CUPRITE_TRIGGER_CLICK_WAIT", 0.1).to_f
89

910
extend Forwardable
1011
delegate %i[at_css at_xpath css xpath
@@ -30,7 +31,7 @@ def select(node, value)
3031

3132
def trigger(node, event)
3233
options = {}
33-
options.merge!(wait: Ferrum::Mouse::CLICK_WAIT) if event.to_s == "click"
34+
options.merge!(wait: TRIGGER_CLICK_WAIT) if event.to_s == "click" && TRIGGER_CLICK_WAIT > 0
3435
evaluate_on(node: node, expression: %(_cuprite.trigger(this, "#{event}")), **options)
3536
end
3637

0 commit comments

Comments
 (0)