diff options
Diffstat (limited to 'spec/support/selection_helper.rb')
-rw-r--r-- | spec/support/selection_helper.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/support/selection_helper.rb b/spec/support/selection_helper.rb new file mode 100644 index 00000000000..b4725b137b2 --- /dev/null +++ b/spec/support/selection_helper.rb @@ -0,0 +1,6 @@ +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 |