blob: 36b63619b0899db09b604a7ddc9cfd16a1a80361 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# frozen_string_literal: true
require_relative 'helpers/capybara_helpers'
require_relative 'helpers/wait_for_requests'
module Capybara
class Session
module WaitForAllRequestsAfterVisitPage
include CapybaraHelpers
include WaitForRequests
def visit(visit_uri)
super
wait_for_all_requests
end
end
prepend WaitForAllRequestsAfterVisitPage
end
module Node
module Actions
include CapybaraHelpers
include WaitForRequests
module WaitForAllRequestsAfterClickButton
def click_button(locator = nil, **options)
super
wait_for_all_requests
end
end
module WaitForAllRequestsAfterClickLink
def click_link(locator = nil, **options)
super
wait_for_all_requests
end
end
prepend WaitForAllRequestsAfterClickButton
prepend WaitForAllRequestsAfterClickLink
end
end
end
|