diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-04-11 11:45:18 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-04-11 11:45:18 +0400 |
commit | 1743cbf1d8f7fde1595c6b95a417f8a5e2f4d62c (patch) | |
tree | 4f1f1ae76eb2d8daeab85bad408a1ff59ed320aa /features | |
parent | c351b8a3e53c05c73f3365cc738c9437e8774392 (diff) |
Update capybara to 2.1, poltergeist to master
Diffstat (limited to 'features')
-rw-r--r-- | features/steps/project/project_merge_requests.rb | 8 | ||||
-rw-r--r-- | features/steps/shared/diff_note.rb | 20 | ||||
-rw-r--r-- | features/steps/shared/note.rb | 4 |
3 files changed, 17 insertions, 15 deletions
diff --git a/features/steps/project/project_merge_requests.rb b/features/steps/project/project_merge_requests.rb index 77f45338beb..fa7666bcbb6 100644 --- a/features/steps/project/project_merge_requests.rb +++ b/features/steps/project/project_merge_requests.rb @@ -97,7 +97,7 @@ class ProjectMergeRequests < Spinach::FeatureSteps end And 'I leave a comment on the diff page' do - find("#4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185 .add-diff-note").click + init_diff_note within('.js-temp-notes-holder') do fill_in "note_note", with: "One comment to rule them all" @@ -106,7 +106,7 @@ class ProjectMergeRequests < Spinach::FeatureSteps end And 'I leave a comment like "Line is wrong" on line 185 of the first file' do - find("#4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185 .add-diff-note").click + init_diff_note within(".js-temp-notes-holder") do fill_in "note_note", with: "Line is wrong" @@ -140,4 +140,8 @@ class ProjectMergeRequests < Spinach::FeatureSteps def merge_request @merge_request ||= MergeRequest.find_by_title!("Bug NS-05") end + + def init_diff_note + find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185"]').click + end end diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb index 9dbbc553137..9c39a226e1b 100644 --- a/features/steps/shared/diff_note.rb +++ b/features/steps/shared/diff_note.rb @@ -3,15 +3,13 @@ module SharedDiffNote Given 'I cancel the diff comment' do within(".file") do - find(".js-close-discussion-note-form").trigger("click") + find(".js-close-discussion-note-form").click end end Given 'I delete a diff comment' do - sleep 1 - within(".file") do - first(".js-note-delete").trigger("click") - end + find('.note').hover + find(".js-note-delete").click end Given 'I haven\'t written any diff comment text' do @@ -21,17 +19,16 @@ module SharedDiffNote end Given 'I leave a diff comment like "Typo, please fix"' do - find("#586fb7c4e1add2d4d24e27566ed7064680098646_29_14.line_holder .js-add-diff-note-button").trigger("click") + find('a[data-line-code="586fb7c4e1add2d4d24e27566ed7064680098646_29_14"]').click within(".file form[rel$='586fb7c4e1add2d4d24e27566ed7064680098646_29_14']") do fill_in "note[note]", with: "Typo, please fix" - #click_button("Add Comment") find(".js-comment-button").trigger("click") sleep 0.05 end end Given 'I preview a diff comment text like "Should fix it :smile:"' do - find("#586fb7c4e1add2d4d24e27566ed7064680098646_29_14.line_holder .js-add-diff-note-button").trigger("click") + find('a[data-line-code="586fb7c4e1add2d4d24e27566ed7064680098646_29_14"]').click within(".file form[rel$='586fb7c4e1add2d4d24e27566ed7064680098646_29_14']") do fill_in "note[note]", with: "Should fix it :smile:" find(".js-note-preview-button").trigger("click") @@ -39,7 +36,8 @@ module SharedDiffNote end Given 'I preview another diff comment text like "DRY this up"' do - find("#586fb7c4e1add2d4d24e27566ed7064680098646_57_41.line_holder .js-add-diff-note-button").trigger("click") + find('a[data-line-code="586fb7c4e1add2d4d24e27566ed7064680098646_57_41"]').click + within(".file form[rel$='586fb7c4e1add2d4d24e27566ed7064680098646_57_41']") do fill_in "note[note]", with: "DRY this up" find(".js-note-preview-button").trigger("click") @@ -47,11 +45,11 @@ module SharedDiffNote end Given 'I open a diff comment form' do - find("#586fb7c4e1add2d4d24e27566ed7064680098646_29_14.line_holder .js-add-diff-note-button").trigger("click") + find('a[data-line-code="586fb7c4e1add2d4d24e27566ed7064680098646_29_14"]').click end Given 'I open another diff comment form' do - find("#586fb7c4e1add2d4d24e27566ed7064680098646_57_41.line_holder .js-add-diff-note-button").trigger("click") + find('a[data-line-code="586fb7c4e1add2d4d24e27566ed7064680098646_57_41"]').click end Given 'I write a diff comment like ":-1: I don\'t like this"' do diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb index e0ff52a7252..da08da9420d 100644 --- a/features/steps/shared/note.rb +++ b/features/steps/shared/note.rb @@ -2,8 +2,8 @@ module SharedNote include Spinach::DSL Given 'I delete a comment' do - sleep 1 - first(".js-note-delete").trigger("click") + find('.note').hover + find(".js-note-delete").click end Given 'I haven\'t written any comment text' do |