gitlab-org--gitlab-foss/features/steps/shared/paths.rb

477 lines
12 KiB
Ruby
Raw Normal View History

2012-09-10 11:35:03 -04:00
module SharedPaths
include Spinach::DSL
include RepoHelpers
include DashboardHelper
2012-09-10 11:35:03 -04:00
2013-05-06 08:09:41 -04:00
step 'I visit new project page' do
visit new_project_path
end
# ----------------------------------------
# User
# ----------------------------------------
step 'I visit user "John Doe" page' do
visit user_path("john_doe")
end
2012-10-22 14:42:06 -04:00
# ----------------------------------------
# Group
# ----------------------------------------
2014-02-07 11:59:55 -05:00
step 'I visit group "Owned" page' do
visit group_path(Group.find_by(name:"Owned"))
2012-10-22 14:42:06 -04:00
end
2014-02-07 11:59:55 -05:00
step 'I visit group "Owned" issues page' do
visit issues_group_path(Group.find_by(name:"Owned"))
2012-10-22 14:42:06 -04:00
end
2014-02-07 11:59:55 -05:00
step 'I visit group "Owned" merge requests page' do
visit merge_requests_group_path(Group.find_by(name:"Owned"))
2012-10-22 14:42:06 -04:00
end
2014-02-07 11:59:55 -05:00
step 'I visit group "Owned" members page' do
visit members_group_path(Group.find_by(name:"Owned"))
2012-12-25 17:52:49 -05:00
end
2014-02-07 11:59:55 -05:00
step 'I visit group "Owned" settings page' do
visit edit_group_path(Group.find_by(name:"Owned"))
end
step 'I visit group "Guest" page' do
visit group_path(Group.find_by(name:"Guest"))
end
step 'I visit group "Guest" issues page' do
visit issues_group_path(Group.find_by(name:"Guest"))
end
step 'I visit group "Guest" merge requests page' do
visit merge_requests_group_path(Group.find_by(name:"Guest"))
end
step 'I visit group "Guest" members page' do
visit members_group_path(Group.find_by(name:"Guest"))
end
step 'I visit group "Guest" settings page' do
visit edit_group_path(Group.find_by(name:"Guest"))
end
# ----------------------------------------
# Dashboard
# ----------------------------------------
2013-05-06 08:09:41 -04:00
step 'I visit dashboard page' do
visit dashboard_path
end
2013-05-06 08:09:41 -04:00
step 'I visit dashboard projects page' do
2013-01-27 08:41:35 -05:00
visit projects_dashboard_path
end
2013-05-06 08:09:41 -04:00
step 'I visit dashboard issues page' do
visit assigned_issues_dashboard_path
2012-09-10 11:35:03 -04:00
end
2013-05-06 08:09:41 -04:00
step 'I visit dashboard merge requests page' do
visit assigned_mrs_dashboard_path
2012-09-10 11:35:03 -04:00
end
2013-05-06 08:09:41 -04:00
step 'I visit dashboard search page' do
visit search_path
2012-09-10 11:35:03 -04:00
end
2013-05-06 08:09:41 -04:00
step 'I visit dashboard help page' do
visit help_path
2012-09-10 11:35:03 -04:00
end
# ----------------------------------------
# Profile
# ----------------------------------------
2013-05-06 08:09:41 -04:00
step 'I visit profile page' do
2012-09-10 11:35:03 -04:00
visit profile_path
end
step 'I visit profile applications page' do
visit applications_profile_path
end
2013-10-09 10:01:04 -04:00
step 'I visit profile password page' do
visit edit_profile_password_path
end
2013-05-06 08:09:41 -04:00
step 'I visit profile account page' do
2013-10-09 10:01:04 -04:00
visit profile_account_path
2012-09-10 11:35:03 -04:00
end
2013-05-06 08:09:41 -04:00
step 'I visit profile SSH keys page' do
visit profile_keys_path
end
2013-05-06 08:09:41 -04:00
step 'I visit profile design page' do
visit design_profile_path
end
2013-05-06 08:09:41 -04:00
step 'I visit profile history page' do
visit history_profile_path
2012-09-10 11:35:03 -04:00
end
2014-02-07 11:59:55 -05:00
step 'I visit profile groups page' do
visit profile_groups_path
end
step 'I should be redirected to the profile groups page' do
current_path.should == profile_groups_path
end
# ----------------------------------------
# Admin
# ----------------------------------------
2013-05-06 08:09:41 -04:00
step 'I visit admin page' do
visit admin_root_path
end
2013-05-06 08:09:41 -04:00
step 'I visit admin projects page' do
visit admin_projects_path
end
2013-05-06 08:09:41 -04:00
step 'I visit admin users page' do
visit admin_users_path
end
2013-05-06 08:09:41 -04:00
step 'I visit admin logs page' do
visit admin_logs_path
end
step 'I visit admin messages page' do
visit admin_broadcast_messages_path
end
2013-05-06 08:09:41 -04:00
step 'I visit admin hooks page' do
visit admin_hooks_path
end
2013-05-06 08:09:41 -04:00
step 'I visit admin Resque page' do
visit admin_background_jobs_path
end
2013-05-06 08:09:41 -04:00
step 'I visit admin groups page' do
2012-10-22 14:42:06 -04:00
visit admin_groups_path
end
2013-05-06 08:09:41 -04:00
step 'I visit admin teams page' do
2013-01-19 12:11:11 -05:00
visit admin_teams_path
end
step 'I visit admin settings page' do
visit admin_application_settings_path
end
2015-01-19 14:18:00 -05:00
step 'I visit applications page' do
visit admin_applications_path
end
# ----------------------------------------
# Generic Project
# ----------------------------------------
2013-05-06 08:09:41 -04:00
step "I visit my project's home page" do
visit project_path(@project)
end
2013-05-06 08:09:41 -04:00
step "I visit my project's settings page" do
visit edit_project_path(@project)
end
2013-05-06 08:09:41 -04:00
step "I visit my project's files page" do
visit project_tree_path(@project, root_ref)
2012-09-10 11:35:03 -04:00
end
step 'I visit a binary file in the repo' do
visit project_blob_path(@project, File.join(
root_ref, 'files/images/logo-black.png'))
end
2013-05-06 08:09:41 -04:00
step "I visit my project's commits page" do
visit project_commits_path(@project, root_ref, {limit: 5})
end
2013-05-06 08:09:41 -04:00
step "I visit my project's commits page for a specific path" do
visit project_commits_path(@project, root_ref + "/app/models/project.rb", {limit: 5})
end
2013-05-06 08:09:41 -04:00
step 'I visit my project\'s commits stats page' do
2012-11-10 16:33:10 -05:00
visit stats_project_repository_path(@project)
end
2013-05-06 08:09:41 -04:00
step "I visit my project's network page" do
# Stub Graph max_size to speed up test (10 commits vs. 650)
Network::Graph.stub(max_count: 10)
visit project_network_path(@project, root_ref)
end
2013-05-06 08:09:41 -04:00
step "I visit my project's issues page" do
visit project_issues_path(@project)
end
2013-05-06 08:09:41 -04:00
step "I visit my project's merge requests page" do
visit project_merge_requests_path(@project)
end
2013-05-06 08:09:41 -04:00
step "I visit my project's wiki page" do
visit project_wiki_path(@project, :home)
end
2013-05-06 08:09:41 -04:00
step 'I visit project hooks page' do
visit project_hooks_path(@project)
end
2013-05-06 08:09:41 -04:00
step 'I visit project deploy keys page' do
visit project_deploy_keys_path(@project)
end
# ----------------------------------------
# "Shop" Project
# ----------------------------------------
2013-05-06 08:09:41 -04:00
step 'I visit project "Shop" page' do
2012-09-10 11:35:03 -04:00
visit project_path(project)
end
Merge Request on forked projects The good: - You can do a merge request for a forked commit and it will merge properly (i.e. it does work). - Push events take into account merge requests on forked projects - Tests around merge_actions now present, spinach, and other rspec tests - Satellites now clean themselves up rather then recreate The questionable: - Events only know about target projects - Project's merge requests only hold on to MR's where they are the target - All operations performed in the satellite The bad: - Duplication between project's repositories and satellites (e.g. commits_between) (for reference: http://feedback.gitlab.com/forums/176466-general/suggestions/3456722-merge-requests-between-projects-repos) Fixes: Make test repos/satellites only create when needed -Spinach/Rspec now only initialize test directory, and setup stubs (things that are relatively cheap) -project_with_code, source_project_with_code, and target_project_with_code now create/destroy their repos individually -fixed remote removal -How to merge renders properly -Update emails to show project/branches -Edit MR doesn't set target branch -Fix some failures on editing/creating merge requests, added a test -Added back a test around merge request observer -Clean up project_transfer_spec, Remove duplicate enable/disable observers -Ensure satellite lock files are cleaned up, Attempted to add some testing around these as well -Signifant speed ups for tests -Update formatting ordering in notes_on_merge_requests -Remove wiki schema update Fixes for search/search results -Search results was using by_project for a list of projects, updated this to use in_projects -updated search results to reference the correct (target) project -udpated search results to print both sides of the merge request Change-Id: I19407990a0950945cc95d62089cbcc6262dab1a8
2013-04-25 10:15:33 -04:00
step 'I visit project "Forked Shop" merge requests page' do
visit project_merge_requests_path(@forked_project)
end
2013-05-06 08:09:41 -04:00
step 'I visit edit project "Shop" page' do
2013-01-09 00:14:05 -05:00
visit edit_project_path(project)
end
2013-05-06 08:09:41 -04:00
step 'I visit project branches page' do
2013-07-16 15:25:59 -04:00
visit project_branches_path(@project)
2012-09-10 11:35:03 -04:00
end
step 'I visit project protected branches page' do
visit project_protected_branches_path(@project)
end
2013-05-06 08:09:41 -04:00
step 'I visit compare refs page' do
visit project_compare_index_path(@project)
2012-09-10 11:35:03 -04:00
end
2013-05-06 08:09:41 -04:00
step 'I visit project commits page' do
visit project_commits_path(@project, root_ref, {limit: 5})
end
2013-05-06 08:09:41 -04:00
step 'I visit project commits page for stable branch' do
visit project_commits_path(@project, 'stable', {limit: 5})
2012-09-10 11:35:03 -04:00
end
2013-05-06 08:09:41 -04:00
step 'I visit project source page' do
visit project_tree_path(@project, root_ref)
2012-09-10 11:35:03 -04:00
end
2013-05-06 08:09:41 -04:00
step 'I visit blob file from repo' do
visit project_blob_path(@project, File.join(sample_commit.id, sample_blob.path))
2012-09-10 11:35:03 -04:00
end
step 'I visit ".gitignore" file in repo' do
visit project_blob_path(@project, File.join(root_ref, '.gitignore'))
end
step 'I am on the new file page' do
current_path.should eq(project_create_blob_path(@project, root_ref))
end
step 'I am on the ".gitignore" edit file page' do
current_path.should eq(project_edit_blob_path(
@project, File.join(root_ref, '.gitignore')))
end
step 'I visit project source page for "6d39438"' do
visit project_tree_path(@project, "6d39438")
2012-09-10 11:35:03 -04:00
end
step 'I visit project source page for' \
' "6d394385cf567f80a8fd85055db1ab4c5295806f"' do
visit project_tree_path(@project,
'6d394385cf567f80a8fd85055db1ab4c5295806f')
end
2013-05-06 08:09:41 -04:00
step 'I visit project tags page' do
2013-07-16 16:14:22 -04:00
visit project_tags_path(@project)
2012-09-10 11:35:03 -04:00
end
2013-05-06 08:09:41 -04:00
step 'I visit project commit page' do
visit project_commit_path(@project, sample_commit.id)
2012-09-10 11:35:03 -04:00
end
2013-05-06 08:09:41 -04:00
step 'I visit project "Shop" issues page' do
visit project_issues_path(project)
2012-09-10 11:35:03 -04:00
end
2013-05-06 08:09:41 -04:00
step 'I visit issue page "Release 0.4"' do
2014-01-19 13:55:59 -05:00
issue = Issue.find_by(title: "Release 0.4")
2012-09-10 11:35:03 -04:00
visit project_issue_path(issue.project, issue)
end
2014-10-06 02:59:03 -04:00
step 'I visit issue page "Tasks-open"' do
issue = Issue.find_by(title: 'Tasks-open')
visit project_issue_path(issue.project, issue)
end
step 'I visit issue page "Tasks-closed"' do
issue = Issue.find_by(title: 'Tasks-closed')
visit project_issue_path(issue.project, issue)
end
2013-05-06 08:09:41 -04:00
step 'I visit project "Shop" labels page' do
2014-08-13 08:12:05 -04:00
project = Project.find_by(name: 'Shop')
visit project_labels_path(project)
2012-09-10 11:35:03 -04:00
end
2014-08-13 08:12:05 -04:00
step 'I visit project "Forum" labels page' do
project = Project.find_by(name: 'Forum')
visit project_labels_path(project)
end
step 'I visit project "Shop" new label page' do
project = Project.find_by(name: 'Shop')
visit new_project_label_path(project)
end
step 'I visit project "Forum" new label page' do
project = Project.find_by(name: 'Forum')
visit new_project_label_path(project)
end
2013-05-06 08:09:41 -04:00
step 'I visit merge request page "Bug NS-04"' do
2014-01-19 13:55:59 -05:00
mr = MergeRequest.find_by(title: "Bug NS-04")
Merge Request on forked projects The good: - You can do a merge request for a forked commit and it will merge properly (i.e. it does work). - Push events take into account merge requests on forked projects - Tests around merge_actions now present, spinach, and other rspec tests - Satellites now clean themselves up rather then recreate The questionable: - Events only know about target projects - Project's merge requests only hold on to MR's where they are the target - All operations performed in the satellite The bad: - Duplication between project's repositories and satellites (e.g. commits_between) (for reference: http://feedback.gitlab.com/forums/176466-general/suggestions/3456722-merge-requests-between-projects-repos) Fixes: Make test repos/satellites only create when needed -Spinach/Rspec now only initialize test directory, and setup stubs (things that are relatively cheap) -project_with_code, source_project_with_code, and target_project_with_code now create/destroy their repos individually -fixed remote removal -How to merge renders properly -Update emails to show project/branches -Edit MR doesn't set target branch -Fix some failures on editing/creating merge requests, added a test -Added back a test around merge request observer -Clean up project_transfer_spec, Remove duplicate enable/disable observers -Ensure satellite lock files are cleaned up, Attempted to add some testing around these as well -Signifant speed ups for tests -Update formatting ordering in notes_on_merge_requests -Remove wiki schema update Fixes for search/search results -Search results was using by_project for a list of projects, updated this to use in_projects -updated search results to reference the correct (target) project -udpated search results to print both sides of the merge request Change-Id: I19407990a0950945cc95d62089cbcc6262dab1a8
2013-04-25 10:15:33 -04:00
visit project_merge_request_path(mr.target_project, mr)
2012-09-10 11:35:03 -04:00
end
2013-05-06 08:09:41 -04:00
step 'I visit merge request page "Bug NS-05"' do
2014-01-19 13:55:59 -05:00
mr = MergeRequest.find_by(title: "Bug NS-05")
Merge Request on forked projects The good: - You can do a merge request for a forked commit and it will merge properly (i.e. it does work). - Push events take into account merge requests on forked projects - Tests around merge_actions now present, spinach, and other rspec tests - Satellites now clean themselves up rather then recreate The questionable: - Events only know about target projects - Project's merge requests only hold on to MR's where they are the target - All operations performed in the satellite The bad: - Duplication between project's repositories and satellites (e.g. commits_between) (for reference: http://feedback.gitlab.com/forums/176466-general/suggestions/3456722-merge-requests-between-projects-repos) Fixes: Make test repos/satellites only create when needed -Spinach/Rspec now only initialize test directory, and setup stubs (things that are relatively cheap) -project_with_code, source_project_with_code, and target_project_with_code now create/destroy their repos individually -fixed remote removal -How to merge renders properly -Update emails to show project/branches -Edit MR doesn't set target branch -Fix some failures on editing/creating merge requests, added a test -Added back a test around merge request observer -Clean up project_transfer_spec, Remove duplicate enable/disable observers -Ensure satellite lock files are cleaned up, Attempted to add some testing around these as well -Signifant speed ups for tests -Update formatting ordering in notes_on_merge_requests -Remove wiki schema update Fixes for search/search results -Search results was using by_project for a list of projects, updated this to use in_projects -updated search results to reference the correct (target) project -udpated search results to print both sides of the merge request Change-Id: I19407990a0950945cc95d62089cbcc6262dab1a8
2013-04-25 10:15:33 -04:00
visit project_merge_request_path(mr.target_project, mr)
2012-10-29 17:23:49 -04:00
end
2014-10-06 02:59:03 -04:00
step 'I visit merge request page "MR-task-open"' do
mr = MergeRequest.find_by(title: 'MR-task-open')
visit project_merge_request_path(mr.target_project, mr)
end
step 'I visit merge request page "MR-task-closed"' do
mr = MergeRequest.find_by(title: 'MR-task-closed')
visit project_merge_request_path(mr.target_project, mr)
end
2013-05-06 08:09:41 -04:00
step 'I visit project "Shop" merge requests page' do
visit project_merge_requests_path(project)
2012-09-10 11:35:03 -04:00
end
Merge Request on forked projects The good: - You can do a merge request for a forked commit and it will merge properly (i.e. it does work). - Push events take into account merge requests on forked projects - Tests around merge_actions now present, spinach, and other rspec tests - Satellites now clean themselves up rather then recreate The questionable: - Events only know about target projects - Project's merge requests only hold on to MR's where they are the target - All operations performed in the satellite The bad: - Duplication between project's repositories and satellites (e.g. commits_between) (for reference: http://feedback.gitlab.com/forums/176466-general/suggestions/3456722-merge-requests-between-projects-repos) Fixes: Make test repos/satellites only create when needed -Spinach/Rspec now only initialize test directory, and setup stubs (things that are relatively cheap) -project_with_code, source_project_with_code, and target_project_with_code now create/destroy their repos individually -fixed remote removal -How to merge renders properly -Update emails to show project/branches -Edit MR doesn't set target branch -Fix some failures on editing/creating merge requests, added a test -Added back a test around merge request observer -Clean up project_transfer_spec, Remove duplicate enable/disable observers -Ensure satellite lock files are cleaned up, Attempted to add some testing around these as well -Signifant speed ups for tests -Update formatting ordering in notes_on_merge_requests -Remove wiki schema update Fixes for search/search results -Search results was using by_project for a list of projects, updated this to use in_projects -updated search results to reference the correct (target) project -udpated search results to print both sides of the merge request Change-Id: I19407990a0950945cc95d62089cbcc6262dab1a8
2013-04-25 10:15:33 -04:00
step 'I visit forked project "Shop" merge requests page' do
visit project_merge_requests_path(project)
end
2013-05-06 08:09:41 -04:00
step 'I visit project "Shop" milestones page' do
visit project_milestones_path(project)
2012-09-10 11:35:03 -04:00
end
2013-05-06 08:09:41 -04:00
step 'I visit project "Shop" team page' do
visit project_team_index_path(project)
2012-09-10 11:35:03 -04:00
end
2013-05-06 08:09:41 -04:00
step 'I visit project wiki page' do
visit project_wiki_path(@project, :home)
2012-09-10 11:35:03 -04:00
end
2014-06-26 03:49:14 -04:00
# ----------------------------------------
# Visibility Projects
# ----------------------------------------
step 'I visit project "Community" page' do
project = Project.find_by(name: "Community")
visit project_path(project)
end
step 'I visit project "Community" source page' do
project = Project.find_by(name: 'Community')
visit project_tree_path(project, root_ref)
end
2014-06-26 03:49:14 -04:00
step 'I visit project "Internal" page' do
project = Project.find_by(name: "Internal")
visit project_path(project)
end
step 'I visit project "Enterprise" page' do
project = Project.find_by(name: "Enterprise")
visit project_path(project)
end
# ----------------------------------------
# Empty Projects
# ----------------------------------------
step "I visit empty project page" do
project = Project.find_by(name: "Empty Public Project")
visit project_path(project)
end
# ----------------------------------------
# Public Projects
# ----------------------------------------
2013-05-06 08:09:41 -04:00
step 'I visit the public projects area' do
visit explore_projects_path
end
step 'I visit the explore trending projects' do
visit trending_explore_projects_path
end
step 'I visit the explore starred projects' do
visit starred_explore_projects_path
end
step 'I visit the public groups area' do
visit explore_groups_path
end
# ----------------------------------------
# Snippets
# ----------------------------------------
step 'I visit project "Shop" snippets page' do
visit project_snippets_path(project)
end
step 'I visit snippets page' do
2013-03-24 18:17:38 -04:00
visit snippets_path
end
step 'I visit new snippet page' do
2013-03-24 18:17:38 -04:00
visit new_snippet_path
end
def root_ref
@project.repository.root_ref
end
def project
2014-10-03 06:19:31 -04:00
Project.find_by!(name: 'Shop')
end
2014-02-07 11:59:55 -05:00
# ----------------------------------------
# Errors
# ----------------------------------------
step 'page status code should be 404' do
2014-09-24 02:28:41 -04:00
status_code.should == 404
2014-02-07 11:59:55 -05:00
end
2012-09-10 11:35:03 -04:00
end