diff options
Diffstat (limited to 'features')
-rw-r--r-- | features/project/commits/commits.feature | 3 | ||||
-rw-r--r-- | features/project/issues/issues.feature | 6 | ||||
-rw-r--r-- | features/project/merge_requests.feature | 10 | ||||
-rw-r--r-- | features/project/service.feature | 6 | ||||
-rw-r--r-- | features/project/source/browse_files.feature | 11 | ||||
-rw-r--r-- | features/steps/admin/settings.rb | 2 | ||||
-rw-r--r-- | features/steps/project/commits/commits.rb | 6 | ||||
-rw-r--r-- | features/steps/project/issues/issues.rb | 10 | ||||
-rw-r--r-- | features/steps/project/merge_requests.rb | 21 | ||||
-rw-r--r-- | features/steps/project/services.rb | 10 | ||||
-rw-r--r-- | features/steps/project/source/browse_files.rb | 8 | ||||
-rw-r--r-- | features/steps/shared/project.rb | 2 | ||||
-rw-r--r-- | features/support/capybara.rb | 2 |
13 files changed, 76 insertions, 21 deletions
diff --git a/features/project/commits/commits.feature b/features/project/commits/commits.feature index 21367fd76a0..5bb2d0e976b 100644 --- a/features/project/commits/commits.feature +++ b/features/project/commits/commits.feature @@ -19,7 +19,8 @@ Feature: Project Commits Scenario: I browse commit with ci from list Given commit has ci status - And I click on commit link + And repository contains ".gitlab-ci.yml" file + When I click on commit link Then I see commit ci info And I click status link Then I see builds list diff --git a/features/project/issues/issues.feature b/features/project/issues/issues.feature index f08b30e0b88..ab234bc7507 100644 --- a/features/project/issues/issues.feature +++ b/features/project/issues/issues.feature @@ -197,3 +197,9 @@ Feature: Project Issues And I should not see labels field And I submit new issue "500 error on profile" Then I should see issue "500 error on profile" + + @javascript + Scenario: Another user adds a comment to issue I'm currently viewing + Given I visit issue page "Release 0.4" + And another user adds a comment with text "Yay!" to issue "Release 0.4" + Then I should see a new comment with text "Yay!" diff --git a/features/project/merge_requests.feature b/features/project/merge_requests.feature index 7490ad400b5..aa9078b878f 100644 --- a/features/project/merge_requests.feature +++ b/features/project/merge_requests.feature @@ -95,6 +95,16 @@ Feature: Project Merge Requests And I should see a diff comment saying "Typo, please fix" @javascript + Scenario: I delete a comment on a merge request diff + Given project "Shop" have "Bug NS-05" open merge request with diffs inside + And I visit merge request page "Bug NS-05" + And I click on the Changes tab + And I leave a comment like "Line is wrong" on diff + And I delete the comment "Line is wrong" on diff + And I click on the Discussion tab + Then I should not see any discussion + + @javascript Scenario: I comment on a line of a commit in merge request Given project "Shop" have "Bug NS-05" open merge request with diffs inside And I visit merge request page "Bug NS-05" diff --git a/features/project/service.feature b/features/project/service.feature index 5014b52b9f6..ff3e7a0b38e 100644 --- a/features/project/service.feature +++ b/features/project/service.feature @@ -7,12 +7,6 @@ Feature: Project Services When I visit project "Shop" services page Then I should see list of available services - Scenario: Activate gitlab-ci service - When I visit project "Shop" services page - And I click gitlab-ci service link - And I fill gitlab-ci settings - Then I should see service settings saved - Scenario: Activate hipchat service When I visit project "Shop" services page And I click hipchat service link diff --git a/features/project/source/browse_files.feature b/features/project/source/browse_files.feature index 439787f2641..02159ee3776 100644 --- a/features/project/source/browse_files.feature +++ b/features/project/source/browse_files.feature @@ -35,6 +35,17 @@ Feature: Project Source Browse Files And I should see its new content @javascript + Scenario: I can create and commit file with new lines at the end of file + Given I click on "New file" link in repo + And I edit code with new lines at end of file + And I fill the new file name + And I fill the commit message + And I click on "Commit Changes" + Then I am redirected to the new file + And I click button "Edit" + And I should see its content with new lines preserved at end of file + + @javascript Scenario: I can upload file and commit Given I click on "Upload file" link in repo And I upload a new text file diff --git a/features/steps/admin/settings.rb b/features/steps/admin/settings.rb index 6acbf46eb20..037f7494a77 100644 --- a/features/steps/admin/settings.rb +++ b/features/steps/admin/settings.rb @@ -32,6 +32,7 @@ class Spinach::Features::AdminSettings < Spinach::FeatureSteps page.check('Comments') page.check('Issues events') page.check('Merge Request events') + page.check('Build events') click_on 'Save' end @@ -39,6 +40,7 @@ class Spinach::Features::AdminSettings < Spinach::FeatureSteps fill_in 'Webhook', with: 'http://localhost' fill_in 'Username', with: 'test_user' fill_in 'Channel', with: '#test_channel' + page.check('Notify only broken builds') end step 'I should see service template settings saved' do diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb index 0d6a9a8fc66..a3141fe3be1 100644 --- a/features/steps/project/commits/commits.rb +++ b/features/steps/project/commits/commits.rb @@ -104,10 +104,14 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps step 'commit has ci status' do @project.enable_ci - ci_commit = create :ci_commit, gl_project: @project, sha: sample_commit.id + ci_commit = create :ci_commit, project: @project, sha: sample_commit.id create :ci_build, commit: ci_commit end + step 'repository contains ".gitlab-ci.yml" file' do + allow_any_instance_of(Ci::Commit).to receive(:ci_yaml_file).and_return(String.new) + end + step 'I see commit ci info' do expect(page).to have_content "build: pending" end diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb index a13044c3ae1..4a7ff21d385 100644 --- a/features/steps/project/issues/issues.rb +++ b/features/steps/project/issues/issues.rb @@ -284,6 +284,16 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps end end + step 'another user adds a comment with text "Yay!" to issue "Release 0.4"' do + issue = Issue.find_by!(title: 'Release 0.4') + create(:note_on_issue, noteable: issue, note: 'Yay!') + end + + step 'I should see a new comment with text "Yay!"' do + page.within '#notes' do + expect(page).to have_content('Yay!') + end + end def filter_issue(text) fill_in 'issue_search', with: text end diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 13d9d180dd1..0d340d97ff9 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -211,6 +211,25 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end end + step 'I delete the comment "Line is wrong" on diff' do + page.within('.diff-file:nth-of-type(5) .note') do + find('.js-note-delete').click + end + end + + step 'I click on the Discussion tab' do + page.within '.merge-request-tabs' do + click_link 'Discussion' + end + + # Waits for load + expect(page).to have_css('.tab-content #notes.active') + end + + step 'I should not see any discussion' do + expect(page).not_to have_css('.notes .discussion') + end + step 'I should see a discussion has started on diff' do page.within(".notes .discussion") do page.should have_content "#{current_user.name} started a discussion" @@ -386,7 +405,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step '"Bug NS-05" has CI status' do project = merge_request.source_project project.enable_ci - ci_commit = create :ci_commit, gl_project: project, sha: merge_request.last_commit.id + ci_commit = create :ci_commit, project: project, sha: merge_request.last_commit.id create :ci_build, commit: ci_commit end diff --git a/features/steps/project/services.rb b/features/steps/project/services.rb index 1c700df0c63..ed3957ca873 100644 --- a/features/steps/project/services.rb +++ b/features/steps/project/services.rb @@ -11,7 +11,6 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps expect(page).to have_content 'Project services' expect(page).to have_content 'Campfire' expect(page).to have_content 'HipChat' - expect(page).to have_content 'GitLab CI' expect(page).to have_content 'Assembla' expect(page).to have_content 'Pushover' expect(page).to have_content 'Atlassian Bamboo' @@ -20,15 +19,6 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps expect(page).to have_content 'Irker (IRC gateway)' end - step 'I click gitlab-ci service link' do - click_link 'GitLab CI' - end - - step 'I fill gitlab-ci settings' do - check 'Active' - click_button 'Save' - end - step 'I should see service settings saved' do expect(find_field('Active').value).to eq '1' end diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index f2b95764267..b88709620ab 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -37,6 +37,10 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps expect(page).to have_content new_gitignore_content end + step 'I should see its content with new lines preserved at end of file' do + expect(evaluate_script('blob.editor.getValue()')).to eq "Sample\n\n\n" + end + step 'I click link "Raw"' do click_link 'Raw' end @@ -62,6 +66,10 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps set_new_content end + step 'I edit code with new lines at end of file' do + execute_script('blob.editor.setValue("Sample\n\n\n")') + end + step 'I fill the new file name' do fill_in :file_name, with: new_file_name end diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb index 7021fac5fe4..da643bf3ba9 100644 --- a/features/steps/shared/project.rb +++ b/features/steps/shared/project.rb @@ -204,7 +204,7 @@ module SharedProject step 'project "Shop" has CI build' do project = Project.find_by(name: "Shop") - create :ci_commit, gl_project: project, sha: project.commit.sha + create :ci_commit, project: project, sha: project.commit.sha end step 'I should see last commit with CI status' do diff --git a/features/support/capybara.rb b/features/support/capybara.rb index 31dbf0feb2f..4156c7ec484 100644 --- a/features/support/capybara.rb +++ b/features/support/capybara.rb @@ -2,7 +2,7 @@ require 'spinach/capybara' require 'capybara/poltergeist' # Give CI some extra time -timeout = (ENV['CI'] || ENV['CI_SERVER']) ? 90 : 10 +timeout = (ENV['CI'] || ENV['CI_SERVER']) ? 90 : 15 Capybara.javascript_driver = :poltergeist Capybara.register_driver :poltergeist do |app| |