gitlab-org--gitlab-foss/spec/support/helpers/selection_helper.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

9 lines
291 B
Ruby
Raw Normal View History

# 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