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

322 lines
7.3 KiB
Ruby
Raw Normal View History

2012-09-10 15:35:03 +00:00
module SharedPaths
include Spinach::DSL
2013-05-06 12:09:41 +00:00
step 'I visit new project page' do
visit new_project_path
end
2012-10-22 18:42:06 +00:00
# ----------------------------------------
# Group
# ----------------------------------------
2013-05-06 12:09:41 +00:00
step 'I visit group page' do
2012-10-22 18:42:06 +00:00
visit group_path(current_group)
end
2013-05-06 12:09:41 +00:00
step 'I visit group issues page' do
2012-10-22 18:42:06 +00:00
visit issues_group_path(current_group)
end
2013-05-06 12:09:41 +00:00
step 'I visit group merge requests page' do
2012-10-22 18:42:06 +00:00
visit merge_requests_group_path(current_group)
end
2013-07-12 16:01:39 +00:00
step 'I visit group members page' do
visit members_group_path(current_group)
2012-12-25 22:52:49 +00:00
end
2013-05-06 12:09:41 +00:00
step 'I visit group settings page' do
visit edit_group_path(current_group)
end
# ----------------------------------------
# Dashboard
# ----------------------------------------
2013-05-06 12:09:41 +00:00
step 'I visit dashboard page' do
visit dashboard_path
end
2013-05-06 12:09:41 +00:00
step 'I visit dashboard projects page' do
2013-01-27 13:41:35 +00:00
visit projects_dashboard_path
end
2013-05-06 12:09:41 +00:00
step 'I visit dashboard issues page' do
2013-01-27 12:10:42 +00:00
visit issues_dashboard_path
2012-09-10 15:35:03 +00:00
end
2013-05-06 12:09:41 +00:00
step 'I visit dashboard merge requests page' do
2013-01-27 12:10:42 +00:00
visit merge_requests_dashboard_path
2012-09-10 15:35:03 +00:00
end
2013-05-06 12:09:41 +00:00
step 'I visit dashboard search page' do
visit search_path
2012-09-10 15:35:03 +00:00
end
2013-05-06 12:09:41 +00:00
step 'I visit dashboard help page' do
visit help_path
2012-09-10 15:35:03 +00:00
end
# ----------------------------------------
# Profile
# ----------------------------------------
2013-05-06 12:09:41 +00:00
step 'I visit profile page' do
2012-09-10 15:35:03 +00:00
visit profile_path
end
2013-10-09 14:01:04 +00:00
step 'I visit profile password page' do
visit edit_profile_password_path
end
2013-05-06 12:09:41 +00:00
step 'I visit profile account page' do
2013-10-09 14:01:04 +00:00
visit profile_account_path
2012-09-10 15:35:03 +00:00
end
2013-05-06 12:09:41 +00:00
step 'I visit profile SSH keys page' do
visit profile_keys_path
end
2013-05-06 12:09:41 +00:00
step 'I visit profile design page' do
visit design_profile_path
end
2013-05-06 12:09:41 +00:00
step 'I visit profile history page' do
visit history_profile_path
2012-09-10 15:35:03 +00:00
end
# ----------------------------------------
# Admin
# ----------------------------------------
2013-05-06 12:09:41 +00:00
step 'I visit admin page' do
visit admin_root_path
end
2013-05-06 12:09:41 +00:00
step 'I visit admin projects page' do
visit admin_projects_path
end
2013-05-06 12:09:41 +00:00
step 'I visit admin users page' do
visit admin_users_path
end
2013-05-06 12:09:41 +00: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 12:09:41 +00:00
step 'I visit admin hooks page' do
visit admin_hooks_path
end
2013-05-06 12:09:41 +00:00
step 'I visit admin Resque page' do
visit admin_background_jobs_path
end
2013-05-06 12:09:41 +00:00
step 'I visit admin groups page' do
2012-10-22 18:42:06 +00:00
visit admin_groups_path
end
2013-05-06 12:09:41 +00:00
step 'I visit admin teams page' do
2013-01-19 17:11:11 +00:00
visit admin_teams_path
end
# ----------------------------------------
# Generic Project
# ----------------------------------------
2013-05-06 12:09:41 +00:00
step "I visit my project's home page" do
visit project_path(@project)
end
2013-05-06 12:09:41 +00:00
step "I visit my project's settings page" do
visit edit_project_path(@project)
end
2013-05-06 12:09:41 +00:00
step "I visit my project's files page" do
visit project_tree_path(@project, root_ref)
2012-09-10 15:35:03 +00:00
end
2013-05-06 12:09:41 +00:00
step "I visit my project's commits page" do
visit project_commits_path(@project, root_ref, {limit: 5})
end
2013-05-06 12:09:41 +00: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 12:09:41 +00:00
step 'I visit my project\'s commits stats page' do
2012-11-10 21:33:10 +00:00
visit stats_project_repository_path(@project)
end
2013-05-06 12:09:41 +00: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 12:09:41 +00:00
step "I visit my project's issues page" do
visit project_issues_path(@project)
end
2013-05-06 12:09:41 +00:00
step "I visit my project's merge requests page" do
visit project_merge_requests_path(@project)
end
2013-05-06 12:09:41 +00:00
step "I visit my project's wall page" do
2013-03-19 12:39:32 +00:00
visit project_wall_path(@project)
end
2013-05-06 12:09:41 +00:00
step "I visit my project's wiki page" do
visit project_wiki_path(@project, :home)
end
2013-05-06 12:09:41 +00:00
step 'I visit project hooks page' do
visit project_hooks_path(@project)
end
2013-05-06 12:09:41 +00:00
step 'I visit project deploy keys page' do
visit project_deploy_keys_path(@project)
end
# ----------------------------------------
# "Shop" Project
# ----------------------------------------
2013-05-06 12:09:41 +00:00
step 'I visit project "Shop" page' do
2012-09-10 15:35:03 +00: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 14:15:33 +00:00
step 'I visit project "Forked Shop" merge requests page' do
visit project_merge_requests_path(@forked_project)
end
2013-05-06 12:09:41 +00:00
step 'I visit edit project "Shop" page' do
2013-01-09 05:14:05 +00:00
visit edit_project_path(project)
end
2013-05-06 12:09:41 +00:00
step 'I visit project branches page' do
2013-07-16 19:25:59 +00:00
visit project_branches_path(@project)
2012-09-10 15:35:03 +00:00
end
2013-05-06 12:09:41 +00:00
step 'I visit compare refs page' do
visit project_compare_index_path(@project)
2012-09-10 15:35:03 +00:00
end
2013-05-06 12:09:41 +00:00
step 'I visit project commits page' do
visit project_commits_path(@project, root_ref, {limit: 5})
end
2013-05-06 12:09:41 +00:00
step 'I visit project commits page for stable branch' do
visit project_commits_path(@project, 'stable', {limit: 5})
2012-09-10 15:35:03 +00:00
end
2013-05-06 12:09:41 +00:00
step 'I visit project source page' do
visit project_tree_path(@project, root_ref)
2012-09-10 15:35:03 +00:00
end
2013-05-06 12:09:41 +00:00
step 'I visit blob file from repo' do
2013-04-03 07:06:31 +00:00
visit project_blob_path(@project, File.join(ValidCommit::ID, ValidCommit::BLOB_FILE_PATH))
2012-09-10 15:35:03 +00:00
end
2013-05-06 12:09:41 +00:00
step 'I visit project source page for "8470d70"' do
visit project_tree_path(@project, "8470d70")
2012-09-10 15:35:03 +00:00
end
2013-05-06 12:09:41 +00:00
step 'I visit project tags page' do
2013-07-16 20:14:22 +00:00
visit project_tags_path(@project)
2012-09-10 15:35:03 +00:00
end
2013-05-06 12:09:41 +00:00
step 'I visit project commit page' do
2012-09-10 15:35:03 +00:00
visit project_commit_path(@project, ValidCommit::ID)
end
2013-05-06 12:09:41 +00:00
step 'I visit project "Shop" issues page' do
visit project_issues_path(project)
2012-09-10 15:35:03 +00:00
end
2013-05-06 12:09:41 +00:00
step 'I visit issue page "Release 0.4"' do
2012-09-10 15:35:03 +00:00
issue = Issue.find_by_title("Release 0.4")
visit project_issue_path(issue.project, issue)
end
2013-05-06 12:09:41 +00:00
step 'I visit project "Shop" labels page' do
visit project_labels_path(project)
2012-09-10 15:35:03 +00:00
end
2013-05-06 12:09:41 +00:00
step 'I visit merge request page "Bug NS-04"' do
2012-09-10 15:35:03 +00: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 14:15:33 +00:00
visit project_merge_request_path(mr.target_project, mr)
2012-09-10 15:35:03 +00:00
end
2013-05-06 12:09:41 +00:00
step 'I visit merge request page "Bug NS-05"' do
2012-10-29 21:23:49 +00: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 14:15:33 +00:00
visit project_merge_request_path(mr.target_project, mr)
2012-10-29 21:23:49 +00:00
end
2013-05-06 12:09:41 +00:00
step 'I visit project "Shop" merge requests page' do
visit project_merge_requests_path(project)
2012-09-10 15:35:03 +00: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 14:15:33 +00:00
step 'I visit forked project "Shop" merge requests page' do
visit project_merge_requests_path(project)
end
2013-05-06 12:09:41 +00:00
step 'I visit project "Shop" milestones page' do
visit project_milestones_path(project)
2012-09-10 15:35:03 +00:00
end
2013-05-06 12:09:41 +00:00
step 'I visit project "Shop" team page' do
visit project_team_index_path(project)
2012-09-10 15:35:03 +00:00
end
2013-05-06 12:09:41 +00:00
step 'I visit project "Shop" wall page' do
visit project_wall_path(project)
2012-09-10 15:35:03 +00:00
end
2013-05-06 12:09:41 +00:00
step 'I visit project wiki page' do
visit project_wiki_path(@project, :home)
2012-09-10 15:35:03 +00:00
end
# ----------------------------------------
# Public Projects
# ----------------------------------------
2013-05-06 12:09:41 +00:00
step 'I visit the public projects area' do
visit public_root_path
end
2013-07-29 14:07:03 +00:00
step 'I visit public page for "Community" project' do
visit public_project_path(Project.find_by_name("Community"))
end
# ----------------------------------------
# Snippets
# ----------------------------------------
Given 'I visit project "Shop" snippets page' do
visit project_snippets_path(project)
end
2013-03-24 22:17:38 +00:00
Given 'I visit snippets page' do
visit snippets_path
end
Given 'I visit new snippet page' do
visit new_snippet_path
end
def root_ref
@project.repository.root_ref
end
def project
project = Project.find_by_name!("Shop")
end
2012-09-10 15:35:03 +00:00
end