diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2019-04-24 22:39:44 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2019-05-07 01:07:23 +0800 |
commit | 52b9797af21ea717518041afca804edd3e4aaa0c (patch) | |
tree | 9224da526b5fe531fde028c5fefc9dcf503e7480 /spec/support/helpers/features | |
parent | 65a7a20ae9b70cdb25835b64466106c796825876 (diff) | |
download | gitlab-ce-52b9797af21ea717518041afca804edd3e4aaa0c.tar.gz |
Avoid quick action prompt blocking preview button58882-reduce-test-view-port
Diffstat (limited to 'spec/support/helpers/features')
-rw-r--r-- | spec/support/helpers/features/notes_helpers.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/support/helpers/features/notes_helpers.rb b/spec/support/helpers/features/notes_helpers.rb index 89517fde6e2..38f30a14409 100644 --- a/spec/support/helpers/features/notes_helpers.rb +++ b/spec/support/helpers/features/notes_helpers.rb @@ -23,8 +23,18 @@ module Spec def preview_note(text) page.within('.js-main-target-form') do - fill_in('note[note]', with: text) + filled_text = fill_in('note[note]', with: text) + + begin + # Dismiss quick action prompt if it appears + filled_text.parent.send_keys(:escape) + rescue Selenium::WebDriver::Error::ElementNotInteractableError + # It's fine if we can't escape when there's no prompt. + end + click_on('Preview') + + yield if block_given? end end end |