debian-mirror-gitlab/spec/support/helpers/selection_helper.rb
2019-10-12 21:52:04 +05:30

8 lines
291 B
Ruby

# frozen_string_literal: true
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