File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ # Simulates the user double clicking on an element specified by a css_selector
2+ # by using the API provided by Ferrum to manipulate the browser directly.
3+ #
4+ # @param css_selector [String] The CSS selector for the element to be double clicked.
5+ #
6+ # @example Usage
7+ # # Make sure the element is there
8+ # expect(page.find('a.btn.btn-success.btn-md[href*="/picked_up"]')).to have_content("Distribution Complete")
9+ #
10+ # # Double click it
11+ # ferrum_double_click('a.btn.btn-success.btn-md[href*="/picked_up"]')
12+ #
13+ # # Assert something based on the double click.
14+ def ferrum_double_click ( css_selector )
15+ node = Capybara . page . driver . browser . at_css ( css_selector )
16+ x , y = node . find_position
17+ mouse = node . page . mouse
18+ mouse . move ( x :, y :)
19+ mouse . down
20+ mouse . up
21+ sleep ( 0.05 )
22+ mouse . down
23+ mouse . up
24+ end
You can’t perform that action at this time.
0 commit comments