diff options
Diffstat (limited to 'features/steps/shared')
-rw-r--r-- | features/steps/shared/diff_note.rb | 42 | ||||
-rw-r--r-- | features/steps/shared/markdown.rb | 6 | ||||
-rw-r--r-- | features/steps/shared/note.rb | 38 | ||||
-rw-r--r-- | features/steps/shared/project_tab.rb | 2 |
4 files changed, 44 insertions, 44 deletions
diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb index 5b75e45e18a..a716ca5837c 100644 --- a/features/steps/shared/diff_note.rb +++ b/features/steps/shared/diff_note.rb @@ -3,7 +3,7 @@ module SharedDiffNote include RepoHelpers step 'I cancel the diff comment' do - within(diff_file_selector) do + page.within(diff_file_selector) do find(".js-close-discussion-note-form").click end end @@ -14,14 +14,14 @@ module SharedDiffNote end step 'I haven\'t written any diff comment text' do - within(diff_file_selector) do + page.within(diff_file_selector) do fill_in "note[note]", with: "" end end step 'I leave a diff comment like "Typo, please fix"' do click_diff_line(sample_commit.line_code) - within("#{diff_file_selector} form[rel$='#{sample_commit.line_code}']") do + page.within("#{diff_file_selector} form[rel$='#{sample_commit.line_code}']") do fill_in "note[note]", with: "Typo, please fix" find(".js-comment-button").trigger("click") sleep 0.05 @@ -30,7 +30,7 @@ module SharedDiffNote step 'I preview a diff comment text like "Should fix it :smile:"' do click_diff_line(sample_commit.line_code) - within("#{diff_file_selector} form[rel$='#{sample_commit.line_code}']") do + page.within("#{diff_file_selector} form[rel$='#{sample_commit.line_code}']") do fill_in "note[note]", with: "Should fix it :smile:" find('.js-md-preview-button').click end @@ -39,7 +39,7 @@ module SharedDiffNote step 'I preview another diff comment text like "DRY this up"' do click_diff_line(sample_commit.del_line_code) - within("#{diff_file_selector} form[rel$='#{sample_commit.del_line_code}']") do + page.within("#{diff_file_selector} form[rel$='#{sample_commit.del_line_code}']") do fill_in "note[note]", with: "DRY this up" find('.js-md-preview-button').click end @@ -54,62 +54,62 @@ module SharedDiffNote end step 'I write a diff comment like ":-1: I don\'t like this"' do - within(diff_file_selector) do + page.within(diff_file_selector) do fill_in "note[note]", with: ":-1: I don\'t like this" end end step 'I submit the diff comment' do - within(diff_file_selector) do + page.within(diff_file_selector) do click_button("Add Comment") end end step 'I should not see the diff comment form' do - within(diff_file_selector) do + page.within(diff_file_selector) do expect(page).not_to have_css("form.new_note") end end step 'The diff comment preview tab should say there is nothing to do' do - within(diff_file_selector) do + page.within(diff_file_selector) do find('.js-md-preview-button').click expect(find('.js-md-preview')).to have_content('Nothing to preview.') end end step 'I should not see the diff comment text field' do - within(diff_file_selector) do + page.within(diff_file_selector) do expect(find('.js-note-text')).not_to be_visible end end step 'I should only see one diff form' do - within(diff_file_selector) do + page.within(diff_file_selector) do expect(page).to have_css("form.new_note", count: 1) end end step 'I should see a diff comment form with ":-1: I don\'t like this"' do - within(diff_file_selector) do + page.within(diff_file_selector) do expect(page).to have_field("note[note]", with: ":-1: I don\'t like this") end end step 'I should see a diff comment saying "Typo, please fix"' do - within("#{diff_file_selector} .note") do + page.within("#{diff_file_selector} .note") do expect(page).to have_content("Typo, please fix") end end step 'I should see a discussion reply button' do - within(diff_file_selector) do + page.within(diff_file_selector) do expect(page).to have_button('Reply') end end step 'I should see a temporary diff comment form' do - within(diff_file_selector) do + page.within(diff_file_selector) do expect(page).to have_css(".js-temp-notes-holder form.new_note") end end @@ -119,38 +119,38 @@ module SharedDiffNote end step 'I should see an empty diff comment form' do - within(diff_file_selector) do + page.within(diff_file_selector) do expect(page).to have_field("note[note]", with: "") end end step 'I should see the cancel comment button' do - within("#{diff_file_selector} form") do + page.within("#{diff_file_selector} form") do expect(page).to have_css(".js-close-discussion-note-form", text: "Cancel") end end step 'I should see the diff comment preview' do - within("#{diff_file_selector} form") do + page.within("#{diff_file_selector} form") do expect(page).to have_css('.js-md-preview', visible: true) end end step 'I should see the diff comment write tab' do - within(diff_file_selector) do + page.within(diff_file_selector) do expect(page).to have_css('.js-md-write-button', visible: true) end end step 'The diff comment preview tab should display rendered Markdown' do - within(diff_file_selector) do + page.within(diff_file_selector) do find('.js-md-preview-button').click expect(find('.js-md-preview')).to have_css('img.emoji', visible: true) end end step 'I should see two separate previews' do - within(diff_file_selector) do + page.within(diff_file_selector) do expect(page).to have_css('.js-md-preview', visible: true, count: 2) expect(page).to have_content('Should fix it') expect(page).to have_content('DRY this up') diff --git a/features/steps/shared/markdown.rb b/features/steps/shared/markdown.rb index 34172f5bb51..56b36f7c46c 100644 --- a/features/steps/shared/markdown.rb +++ b/features/steps/shared/markdown.rb @@ -19,7 +19,7 @@ module SharedMarkdown end step 'The Markdown preview tab should say there is nothing to do' do - within('.gfm-form') do + page.within('.gfm-form') do find('.js-md-preview-button').click expect(find('.js-md-preview')).to have_content('Nothing to preview.') end @@ -38,7 +38,7 @@ module SharedMarkdown end step 'The Markdown preview tab should display rendered Markdown' do - within('.gfm-form') do + page.within('.gfm-form') do find('.js-md-preview-button').click expect(find('.js-md-preview')).to have_css('img.emoji', visible: true) end @@ -49,7 +49,7 @@ module SharedMarkdown end step 'I preview a description text like "Bug fixed :smile:"' do - within('.gfm-form') do + page.within('.gfm-form') do fill_in 'Description', with: 'Bug fixed :smile:' find('.js-md-preview-button').click end diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb index 59dca1db706..b2675546a14 100644 --- a/features/steps/shared/note.rb +++ b/features/steps/shared/note.rb @@ -7,13 +7,13 @@ module SharedNote end step 'I haven\'t written any comment text' do - within(".js-main-target-form") do + page.within(".js-main-target-form") do fill_in "note[note]", with: "" end end step 'I leave a comment like "XML attached"' do - within(".js-main-target-form") do + page.within(".js-main-target-form") do fill_in "note[note]", with: "XML attached" click_button "Add Comment" sleep 0.05 @@ -21,20 +21,20 @@ module SharedNote end step 'I preview a comment text like "Bug fixed :smile:"' do - within(".js-main-target-form") do + page.within(".js-main-target-form") do fill_in "note[note]", with: "Bug fixed :smile:" find('.js-md-preview-button').click end end step 'I submit the comment' do - within(".js-main-target-form") do + page.within(".js-main-target-form") do click_button "Add Comment" end end step 'I write a comment like ":+1: Nice"' do - within(".js-main-target-form") do + page.within(".js-main-target-form") do fill_in 'note[note]', with: ':+1: Nice' end end @@ -44,63 +44,63 @@ module SharedNote end step 'I should not see the cancel comment button' do - within(".js-main-target-form") do + page.within(".js-main-target-form") do should_not have_link("Cancel") end end step 'I should not see the comment preview' do - within(".js-main-target-form") do + page.within(".js-main-target-form") do expect(find('.js-md-preview')).not_to be_visible end end step 'The comment preview tab should say there is nothing to do' do - within(".js-main-target-form") do + page.within(".js-main-target-form") do find('.js-md-preview-button').click expect(find('.js-md-preview')).to have_content('Nothing to preview.') end end step 'I should not see the comment text field' do - within(".js-main-target-form") do + page.within(".js-main-target-form") do expect(find('.js-note-text')).not_to be_visible end end step 'I should see a comment saying "XML attached"' do - within(".note") do + page.within(".note") do expect(page).to have_content("XML attached") end end step 'I should see an empty comment text field' do - within(".js-main-target-form") do + page.within(".js-main-target-form") do expect(page).to have_field("note[note]", with: "") end end step 'I should see the comment write tab' do - within(".js-main-target-form") do + page.within(".js-main-target-form") do expect(page).to have_css('.js-md-write-button', visible: true) end end step 'The comment preview tab should be display rendered Markdown' do - within(".js-main-target-form") do + page.within(".js-main-target-form") do find('.js-md-preview-button').click expect(find('.js-md-preview')).to have_css('img.emoji', visible: true) end end step 'I should see the comment preview' do - within(".js-main-target-form") do + page.within(".js-main-target-form") do expect(page).to have_css('.js-md-preview', visible: true) end end step 'I should see comment "XML attached"' do - within(".note") do + page.within(".note") do expect(page).to have_content("XML attached") end end @@ -108,7 +108,7 @@ module SharedNote # Markdown step 'I leave a comment with a header containing "Comment with a header"' do - within(".js-main-target-form") do + page.within(".js-main-target-form") do fill_in "note[note]", with: "# Comment with a header" click_button "Add Comment" sleep 0.05 @@ -116,7 +116,7 @@ module SharedNote end step 'The comment with the header should not have an ID' do - within(".note-body > .note-text") do + page.within(".note-body > .note-text") do expect(page).to have_content("Comment with a header") expect(page).not_to have_css("#comment-with-a-header") end @@ -126,7 +126,7 @@ module SharedNote find(".note").hover find('.js-note-edit').click - within(".current-note-edit-form") do + page.within(".current-note-edit-form") do fill_in 'note[note]', with: '+1 Awesome!' click_button 'Save Comment' sleep 0.05 @@ -134,7 +134,7 @@ module SharedNote end step 'I should see +1 in the description' do - within(".note") do + page.within(".note") do expect(page).to have_content("+1 Awesome!") end end diff --git a/features/steps/shared/project_tab.rb b/features/steps/shared/project_tab.rb index ce8cbe80aa8..3b94b7d8621 100644 --- a/features/steps/shared/project_tab.rb +++ b/features/steps/shared/project_tab.rb @@ -45,7 +45,7 @@ module SharedProjectTab end step 'the active main tab should be Settings' do - within '.nav-sidebar' do + page.within '.nav-sidebar' do expect(page).to have_content('Back to project') end end |