debian-mirror-gitlab/spec/support/helpers/selection_helper.rb
2018-10-15 14:42:47 +05:30

6 lines
260 B
Ruby

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