DEV: Add select_range to composer page object (#28539)
Covers the use case of doing this in composer: ```javascript page.execute_script("document.querySelector('.d-editor-input').setSelectionRange(6, 12);") ```
This commit is contained in:
parent
e25578d702
commit
0803e2d237
|
@ -237,6 +237,14 @@ module PageObjects
|
||||||
JS
|
JS
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def select_range(start_index, length)
|
||||||
|
execute_script(<<~JS, text)
|
||||||
|
const composer = document.querySelector("#{COMPOSER_ID} .d-editor-input");
|
||||||
|
composer.focus();
|
||||||
|
composer.setSelectionRange(#{start_index}, #{length});
|
||||||
|
JS
|
||||||
|
end
|
||||||
|
|
||||||
def submit
|
def submit
|
||||||
find("#{COMPOSER_ID} .save-or-cancel .create").click
|
find("#{COMPOSER_ID} .save-or-cancel .create").click
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue