diff options
Diffstat (limited to 'features')
-rw-r--r-- | features/dashboard/merge_requests.feature | 21 | ||||
-rw-r--r-- | features/dashboard/new_project.feature | 30 | ||||
-rw-r--r-- | features/dashboard/todos.feature | 28 | ||||
-rw-r--r-- | features/group/members.feature | 59 | ||||
-rw-r--r-- | features/profile/notifications.feature | 15 | ||||
-rw-r--r-- | features/steps/dashboard/dashboard.rb | 2 | ||||
-rw-r--r-- | features/steps/dashboard/merge_requests.rb | 121 | ||||
-rw-r--r-- | features/steps/dashboard/new_project.rb | 59 | ||||
-rw-r--r-- | features/steps/dashboard/starred_projects.rb | 15 | ||||
-rw-r--r-- | features/steps/dashboard/todos.rb | 191 | ||||
-rw-r--r-- | features/steps/groups.rb | 2 | ||||
-rw-r--r-- | features/steps/project/merge_requests.rb | 2 | ||||
-rw-r--r-- | features/steps/project/source/browse_files.rb | 5 | ||||
-rw-r--r-- | features/steps/shared/diff_note.rb | 2 | ||||
-rw-r--r-- | features/steps/shared/paths.rb | 4 |
15 files changed, 6 insertions, 550 deletions
diff --git a/features/dashboard/merge_requests.feature b/features/dashboard/merge_requests.feature deleted file mode 100644 index 4a2c997d707..00000000000 --- a/features/dashboard/merge_requests.feature +++ /dev/null @@ -1,21 +0,0 @@ -@dashboard -Feature: Dashboard Merge Requests - Background: - Given I sign in as a user - And I have authored merge requests - And I have assigned merge requests - And I have other merge requests - And I visit dashboard merge requests page - - Scenario: I should see assigned merge_requests - Then I should see merge requests assigned to me - - @javascript - Scenario: I should see authored merge_requests - When I click "Authored by me" link - Then I should see merge requests authored by me - - @javascript - Scenario: I should see all merge_requests - When I click "All" link - Then I should see all merge requests diff --git a/features/dashboard/new_project.feature b/features/dashboard/new_project.feature deleted file mode 100644 index 046e2815d4e..00000000000 --- a/features/dashboard/new_project.feature +++ /dev/null @@ -1,30 +0,0 @@ -@dashboard -Feature: New Project -Background: - Given I sign in as a user - And I own project "Shop" - And I visit dashboard page - And I click "New project" link - - @javascript - Scenario: I should see New Projects page - Then I see "New Project" page - Then I see all possible import options - - @javascript - Scenario: I should see instructions on how to import from Git URL - Given I see "New Project" page - When I click on "Repo by URL" - Then I see instructions on how to import from Git URL - - @javascript - Scenario: I should see instructions on how to import from GitHub - Given I see "New Project" page - When I click on "Import project from GitHub" - Then I am redirected to the GitHub import page - - @javascript - Scenario: I should see Google Code import page - Given I see "New Project" page - When I click on "Google Code" - Then I redirected to Google Code import page diff --git a/features/dashboard/todos.feature b/features/dashboard/todos.feature deleted file mode 100644 index 0b23bbb7951..00000000000 --- a/features/dashboard/todos.feature +++ /dev/null @@ -1,28 +0,0 @@ -@dashboard -Feature: Dashboard Todos - Background: - Given I sign in as a user - And I own project "Shop" - And "John Doe" is a developer of project "Shop" - And "Mary Jane" is a developer of project "Shop" - And "Mary Jane" owns private project "Enterprise" - And I am a developer of project "Enterprise" - And I have todos - And I visit dashboard todos page - - @javascript - Scenario: I mark todos as done - Then I should see todos assigned to me - And I mark the todo as done - Then I should see the todo marked as done - - @javascript - Scenario: I mark all todos as done - Then I should see todos assigned to me - And I mark all todos as done - Then I should see all todos marked as done - - @javascript - Scenario: I click on a todo row - Given I click on the todo - Then I should be directed to the corresponding page diff --git a/features/group/members.feature b/features/group/members.feature index e539f6a1273..49a44f57cbb 100644 --- a/features/group/members.feature +++ b/features/group/members.feature @@ -4,65 +4,6 @@ Feature: Group Members And "John Doe" is owner of group "Owned" And "John Doe" is guest of group "Guest" - # Leave - - @javascript - Scenario: Owner should be able to remove himself from group if he is not the last owner - Given "Mary Jane" is owner of group "Owned" - When I visit group "Owned" members page - Then I should see user "John Doe" in team list - Then I should see user "Mary Jane" in team list - When I click on the "Remove User From Group" button for "John Doe" - And I visit group "Owned" members page - Then I should not see user "John Doe" in team list - Then I should see user "Mary Jane" in team list - - @javascript - Scenario: Owner should not be able to remove himself from group if he is the last owner - Given "Mary Jane" is guest of group "Owned" - When I visit group "Owned" members page - Then I should see user "John Doe" in team list - Then I should see user "Mary Jane" in team list - Then I should not see the "Remove User From Group" button for "John Doe" - - @javascript - Scenario: Guest should be able to remove himself from group - Given "Mary Jane" is guest of group "Guest" - When I visit group "Guest" members page - Then I should see user "John Doe" in team list - Then I should see user "Mary Jane" in team list - When I click on the "Remove User From Group" button for "John Doe" - When I visit group "Guest" members page - Then I should not see user "John Doe" in team list - Then I should see user "Mary Jane" in team list - - @javascript - Scenario: Guest should be able to remove himself from group even if he is the only user in the group - When I visit group "Guest" members page - Then I should see user "John Doe" in team list - When I click on the "Remove User From Group" button for "John Doe" - When I visit group "Guest" members page - Then I should not see user "John Doe" in team list - - # Remove others - - Scenario: Owner should be able to remove other users from group - Given "Mary Jane" is owner of group "Owned" - When I visit group "Owned" members page - Then I should see user "John Doe" in team list - Then I should see user "Mary Jane" in team list - When I click on the "Remove User From Group" button for "Mary Jane" - When I visit group "Owned" members page - Then I should see user "John Doe" in team list - Then I should not see user "Mary Jane" in team list - - Scenario: Guest should not be able to remove other users from group - Given "Mary Jane" is guest of group "Guest" - When I visit group "Guest" members page - Then I should see user "John Doe" in team list - Then I should see user "Mary Jane" in team list - Then I should not see the "Remove User From Group" button for "Mary Jane" - Scenario: Search member by name Given "Mary Jane" is guest of group "Guest" And I visit group "Guest" members page diff --git a/features/profile/notifications.feature b/features/profile/notifications.feature deleted file mode 100644 index ef8743932f5..00000000000 --- a/features/profile/notifications.feature +++ /dev/null @@ -1,15 +0,0 @@ -@profile -Feature: Profile Notifications - Background: - Given I sign in as a user - And I own project "Shop" - - Scenario: I visit notifications tab - When I visit profile notifications page - Then I should see global notifications settings - - @javascript - Scenario: I edit Project Notifications - Given I visit profile notifications page - When I select Mention setting from dropdown - Then I should see Notification saved message diff --git a/features/steps/dashboard/dashboard.rb b/features/steps/dashboard/dashboard.rb index 71c69a4fdea..3c06b188f3e 100644 --- a/features/steps/dashboard/dashboard.rb +++ b/features/steps/dashboard/dashboard.rb @@ -27,7 +27,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps step 'I see prefilled new Merge Request page' do expect(page).to have_selector('.merge-request-form') - expect(current_path).to eq new_namespace_project_merge_request_path(@project.namespace, @project) + expect(current_path).to eq namespace_project_new_merge_request_path(@project.namespace, @project) expect(find("#merge_request_target_project_id").value).to eq @project.id.to_s expect(find("input#merge_request_source_branch").value).to eq "fix" expect(find("input#merge_request_target_branch").value).to eq "master" diff --git a/features/steps/dashboard/merge_requests.rb b/features/steps/dashboard/merge_requests.rb deleted file mode 100644 index 909ffec3646..00000000000 --- a/features/steps/dashboard/merge_requests.rb +++ /dev/null @@ -1,121 +0,0 @@ -class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include Select2Helper - - step 'I should see merge requests assigned to me' do - should_see(assigned_merge_request) - should_see(assigned_merge_request_from_fork) - should_not_see(authored_merge_request) - should_not_see(authored_merge_request_from_fork) - should_not_see(other_merge_request) - end - - step 'I should see merge requests authored by me' do - should_see(authored_merge_request) - should_see(authored_merge_request_from_fork) - should_not_see(assigned_merge_request) - should_not_see(assigned_merge_request_from_fork) - should_not_see(other_merge_request) - end - - step 'I should see all merge requests' do - should_see(authored_merge_request) - should_see(assigned_merge_request) - should_see(other_merge_request) - end - - step 'I have authored merge requests' do - authored_merge_request - authored_merge_request_from_fork - end - - step 'I have assigned merge requests' do - assigned_merge_request - assigned_merge_request_from_fork - end - - step 'I have other merge requests' do - other_merge_request - end - - step 'I click "Authored by me" link' do - find("#assignee_id").set("") - find(".js-author-search", match: :first).click - find(".dropdown-menu-author li a", match: :first, text: current_user.to_reference).click - end - - step 'I click "All" link' do - find(".js-author-search").click - expect(page).to have_selector(".dropdown-menu-author li a") - find(".dropdown-menu-author li a", match: :first).click - expect(page).not_to have_selector(".dropdown-menu-author li a") - - find(".js-assignee-search").click - expect(page).to have_selector(".dropdown-menu-assignee li a") - find(".dropdown-menu-assignee li a", match: :first).click - expect(page).not_to have_selector(".dropdown-menu-assignee li a") - end - - def should_see(merge_request) - expect(page).to have_content(merge_request.title[0..10]) - end - - def should_not_see(merge_request) - expect(page).not_to have_content(merge_request.title[0..10]) - end - - def assigned_merge_request - @assigned_merge_request ||= create :merge_request, - assignee: current_user, - target_project: project, - source_project: project - end - - def authored_merge_request - @authored_merge_request ||= create :merge_request, - source_branch: 'markdown', - author: current_user, - target_project: project, - source_project: project - end - - def other_merge_request - @other_merge_request ||= create :merge_request, - source_branch: 'fix', - target_project: project, - source_project: project - end - - def authored_merge_request_from_fork - @authored_merge_request_from_fork ||= create :merge_request, - source_branch: 'feature_conflict', - author: current_user, - target_project: public_project, - source_project: forked_project - end - - def assigned_merge_request_from_fork - @assigned_merge_request_from_fork ||= create :merge_request, - source_branch: 'markdown', - assignee: current_user, - target_project: public_project, - source_project: forked_project - end - - def project - @project ||= begin - project = create(:project, :repository) - project.team << [current_user, :master] - project - end - end - - def public_project - @public_project ||= create(:project, :public, :repository) - end - - def forked_project - @forked_project ||= Projects::ForkService.new(public_project, current_user).execute - end -end diff --git a/features/steps/dashboard/new_project.rb b/features/steps/dashboard/new_project.rb deleted file mode 100644 index 530fd6f7bdb..00000000000 --- a/features/steps/dashboard/new_project.rb +++ /dev/null @@ -1,59 +0,0 @@ -class Spinach::Features::NewProject < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'I click "New project" link' do - page.within '#content-body' do - click_link "New project" - end - end - - step 'I click "New project" in top right menu' do - page.within '.header-content' do - click_link "New project" - end - end - - step 'I see "New Project" page' do - expect(page).to have_content('Project path') - expect(page).to have_content('Project name') - end - - step 'I see all possible import options' do - expect(page).to have_link('GitHub') - expect(page).to have_link('Bitbucket') - expect(page).to have_link('GitLab.com') - expect(page).to have_link('Google Code') - expect(page).to have_button('Repo by URL') - expect(page).to have_link('GitLab export') - end - - step 'I click on "Import project from GitHub"' do - first('.import_github').click - end - - step 'I am redirected to the GitHub import page' do - expect(page).to have_content('Import Projects from GitHub') - expect(current_path).to eq new_import_github_path - end - - step 'I click on "Repo by URL"' do - first('.import_git').click - end - - step 'I see instructions on how to import from Git URL' do - git_import_instructions = first('.js-toggle-content') - expect(git_import_instructions).to be_visible - expect(git_import_instructions).to have_content "Git repository URL" - end - - step 'I click on "Google Code"' do - first('.import_google_code').click - end - - step 'I redirected to Google Code import page' do - expect(page).to have_content('Import projects from Google Code') - expect(current_path).to eq new_import_google_code_path - end -end diff --git a/features/steps/dashboard/starred_projects.rb b/features/steps/dashboard/starred_projects.rb deleted file mode 100644 index c33813e550b..00000000000 --- a/features/steps/dashboard/starred_projects.rb +++ /dev/null @@ -1,15 +0,0 @@ -class Spinach::Features::DashboardStarredProjects < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'I starred project "Community"' do - current_user.toggle_star(Project.find_by(name: 'Community')) - end - - step 'I should not see project "Shop"' do - page.within '.projects-list' do - expect(page).not_to have_content('Shop') - end - end -end diff --git a/features/steps/dashboard/todos.rb b/features/steps/dashboard/todos.rb deleted file mode 100644 index 4a33babe3bd..00000000000 --- a/features/steps/dashboard/todos.rb +++ /dev/null @@ -1,191 +0,0 @@ -class Spinach::Features::DashboardTodos < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - include SharedUser - include WaitForRequests - - step '"John Doe" is a developer of project "Shop"' do - project.team << [john_doe, :developer] - end - - step 'I am a developer of project "Enterprise"' do - enterprise.team << [current_user, :developer] - end - - step '"Mary Jane" is a developer of project "Shop"' do - project.team << [john_doe, :developer] - end - - step 'I have todos' do - create(:todo, user: current_user, project: project, author: mary_jane, target: issue, action: Todo::MENTIONED) - create(:todo, user: current_user, project: project, author: john_doe, target: issue, action: Todo::ASSIGNED) - note = create(:note, author: john_doe, noteable: issue, note: "#{current_user.to_reference} Wdyt?", project: project) - create(:todo, user: current_user, project: project, author: john_doe, target: issue, action: Todo::MENTIONED, note: note) - create(:todo, user: current_user, project: project, author: john_doe, target: merge_request, action: Todo::ASSIGNED) - end - - step 'I should see todos assigned to me' do - merge_request_reference = merge_request.to_reference(full: true) - issue_reference = issue.to_reference(full: true) - - page.within('.todos-count') { expect(page).to have_content '4' } - expect(page).to have_content 'To do 4' - expect(page).to have_content 'Done 0' - - expect(page).to have_link project.name_with_namespace - should_see_todo(1, "John Doe assigned you merge request #{merge_request_reference}", merge_request.title) - should_see_todo(2, "John Doe mentioned you on issue #{issue_reference}", "#{current_user.to_reference} Wdyt?") - should_see_todo(3, "John Doe assigned you issue #{issue_reference}", issue.title) - should_see_todo(4, "Mary Jane mentioned you on issue #{issue_reference}", issue.title) - end - - step 'I mark the todo as done' do - page.within('.todo:nth-child(1)') do - click_link 'Done' - end - - page.within('.todos-count') { expect(page).to have_content '3' } - expect(page).to have_content 'To do 3' - expect(page).to have_content 'Done 1' - should_see_todo(1, "John Doe assigned you merge request #{merge_request.to_reference(full: true)}", merge_request.title, state: :done_reversible) - end - - step 'I mark all todos as done' do - merge_request_reference = merge_request.to_reference(full: true) - issue_reference = issue.to_reference(full: true) - - find('.js-todos-mark-all').trigger('click') - - page.within('.todos-count') { expect(page).to have_content '0' } - expect(page).to have_content 'To do 0' - expect(page).to have_content 'Done 4' - expect(page).to have_content "You're all done!" - expect('.prepend-top-default').not_to have_link project.name_with_namespace - should_not_see_todo "John Doe assigned you merge request #{merge_request_reference}" - should_not_see_todo "John Doe mentioned you on issue #{issue_reference}" - should_not_see_todo "John Doe assigned you issue #{issue_reference}" - should_not_see_todo "Mary Jane mentioned you on issue #{issue_reference}" - end - - step 'I should see the todo marked as done' do - find('.todos-done a').trigger('click') - - expect(page).to have_link project.name_with_namespace - should_see_todo(1, "John Doe assigned you merge request #{merge_request.to_reference(full: true)}", merge_request.title, state: :done_irreversible) - end - - step 'I should see all todos marked as done' do - merge_request_reference = merge_request.to_reference(full: true) - issue_reference = issue.to_reference(full: true) - - find('.todos-done a').trigger('click') - - expect(page).to have_link project.name_with_namespace - should_see_todo(1, "John Doe assigned you merge request #{merge_request_reference}", merge_request.title, state: :done_irreversible) - should_see_todo(2, "John Doe mentioned you on issue #{issue_reference}", "#{current_user.to_reference} Wdyt?", state: :done_irreversible) - should_see_todo(3, "John Doe assigned you issue #{issue_reference}", issue.title, state: :done_irreversible) - should_see_todo(4, "Mary Jane mentioned you on issue #{issue_reference}", issue.title, state: :done_irreversible) - end - - step 'I filter by "Enterprise"' do - click_button 'Project' - page.within '.dropdown-menu-project' do - click_link enterprise.name_with_namespace - end - end - - step 'I filter by "John Doe"' do - click_button 'Author' - page.within '.dropdown-menu-author' do - click_link john_doe.username - end - end - - step 'I filter by "Issue"' do - click_button 'Type' - page.within '.dropdown-menu-type' do - click_link 'Issue' - end - end - - step 'I filter by "Mentioned"' do - click_button 'Action' - page.within '.dropdown-menu-action' do - click_link 'Mentioned' - end - end - - step 'I should not see todos' do - expect(page).to have_content "You're all done!" - end - - step 'I should not see todos related to "Mary Jane" in the list' do - should_not_see_todo "Mary Jane mentioned you on issue #{issue.to_reference(full: true)}" - end - - step 'I should not see todos related to "Merge Requests" in the list' do - should_not_see_todo "John Doe assigned you merge request #{merge_request.to_reference(full: true)}" - end - - step 'I should not see todos related to "Assignments" in the list' do - should_not_see_todo "John Doe assigned you merge request #{merge_request.to_reference(full: true)}" - should_not_see_todo "John Doe assigned you issue #{issue.to_reference(full: true)}" - end - - step 'I click on the todo' do - find('.todo:nth-child(1)').click - end - - step 'I should be directed to the corresponding page' do - page.should have_css('.identifier', text: 'Merge request !1') - # Merge request page loads and issues a number of Ajax requests - wait_for_requests - end - - def should_see_todo(position, title, body, state: :pending) - page.within(".todo:nth-child(#{position})") do - expect(page).to have_content title - expect(page).to have_content body - - if state == :pending - expect(page).to have_link 'Done' - elsif state == :done_reversible - expect(page).to have_link 'Undo' - elsif state == :done_irreversible - expect(page).not_to have_link 'Undo' - expect(page).not_to have_link 'Done' - else - raise 'Invalid state given, valid states: :pending, :done_reversible, :done_irreversible' - end - end - end - - def should_not_see_todo(title) - expect(page).not_to have_visible_content title - end - - def have_visible_content(text) - have_css('*', text: text, visible: true) - end - - def john_doe - @john_doe ||= user_exists("John Doe", { username: "john_doe" }) - end - - def mary_jane - @mary_jane ||= user_exists("Mary Jane", { username: "mary_jane" }) - end - - def enterprise - @enterprise ||= Project.find_by(name: 'Enterprise') - end - - def issue - @issue ||= create(:issue, assignees: [current_user], project: project) - end - - def merge_request - @merge_request ||= create(:merge_request, assignee: current_user, source_project: project) - end -end diff --git a/features/steps/groups.rb b/features/steps/groups.rb index 25bb374b868..0aedc422563 100644 --- a/features/steps/groups.rb +++ b/features/steps/groups.rb @@ -5,7 +5,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps include SharedUser step 'I should see group "Owned"' do - expect(page).to have_content '@owned' + expect(page).to have_content 'Owned' end step 'I am a signed out user' do diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 69f5d0f8410..dceeed5aafe 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -65,7 +65,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I should not see "master" branch' do - expect(find('.merge-request-info')).not_to have_content "master" + expect(find('.issuable-info')).not_to have_content "master" end step 'I should see "feature_conflict" branch' do diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index 80aa3a047a0..02434319a08 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -266,12 +266,12 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I am redirected to the new merge request page' do - expect(current_path).to eq(new_namespace_project_merge_request_path(@project.namespace, @project)) + expect(current_path).to eq(namespace_project_new_merge_request_path(@project.namespace, @project)) end step "I am redirected to the fork's new merge request page" do fork = @user.fork_of(@project) - expect(current_path).to eq(new_namespace_project_merge_request_path(fork.namespace, fork)) + expect(current_path).to eq(namespace_project_new_merge_request_path(fork.namespace, fork)) end step 'I am redirected to the root directory' do @@ -369,7 +369,6 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps expect(page).to have_content 'Permalink' expect(page).not_to have_content 'Edit' expect(page).not_to have_content 'Blame' - expect(page).not_to have_content 'Annotate' expect(page).to have_content 'Delete' expect(page).to have_content 'Replace' end diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb index 36fc315599e..2c59ec5bb06 100644 --- a/features/steps/shared/diff_note.rb +++ b/features/steps/shared/diff_note.rb @@ -232,7 +232,7 @@ module SharedDiffNote end def click_parallel_diff_line(code, line_type) - find(".line_content.parallel.#{line_type}[data-line-code='#{code}']").trigger 'mouseover' + find(".line_holder.parallel .diff-line-num[id='#{code}']").trigger 'mouseover' find(".line_holder.parallel button[data-line-code='#{code}']").trigger 'click' end end diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index 794631a2c4f..1f062dc4009 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -112,10 +112,6 @@ module SharedPaths visit dashboard_groups_path end - step 'I visit dashboard todos page' do - visit dashboard_todos_path - end - step 'I should be redirected to the dashboard groups page' do expect(current_path).to eq dashboard_groups_path end |