debian-mirror-gitlab/spec/support/helpers/selection_helper.rb

7 lines
260 B
Ruby
Raw Normal View History

2018-03-17 18:26:18 +05:30
module SelectionHelper
def select_element(selector)
find(selector)
execute_script("let range = document.createRange(); let sel = window.getSelection(); range.selectNodeContents(document.querySelector('#{selector}')); sel.addRange(range);")
end
end