diff options
Diffstat (limited to 'features/steps/shared/note.rb')
-rw-r--r-- | features/steps/shared/note.rb | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb index 7885cc7ab77..492da38355c 100644 --- a/features/steps/shared/note.rb +++ b/features/steps/shared/note.rb @@ -1,14 +1,19 @@ module SharedNote include Spinach::DSL - include WaitForAjax + include WaitForRequests after do - wait_for_ajax if javascript_test? + wait_for_requests if javascript_test? end step 'I delete a comment' do page.within('.main-notes-list') do - find('.note').hover + note = find('.note') + note.hover + + find('.more-actions').click + find('.more-actions .dropdown-menu li', match: :first) + find(".js-note-delete").click end end @@ -24,6 +29,8 @@ module SharedNote fill_in "note[note]", with: "XML attached" click_button "Comment" end + + wait_for_requests end step 'I preview a comment text like "Bug fixed :smile:"' do @@ -37,6 +44,8 @@ module SharedNote page.within(".js-main-target-form") do click_button "Comment" end + + wait_for_requests end step 'I write a comment like ":+1: Nice"' do @@ -123,7 +132,7 @@ module SharedNote click_button "Comment" end - wait_for_ajax + wait_for_requests end step 'The comment with the header should not have an ID' do @@ -135,8 +144,10 @@ module SharedNote step 'I edit the last comment with a +1' do page.within(".main-notes-list") do - find(".note").hover - find('.js-note-edit').click + note = find('.note') + note.hover + + note.find('.js-note-edit').click end page.within(".current-note-edit-form") do |