BigW Consortium Gitlab

paths.rb 5.79 KB
Newer Older
Nihad Abbasov committed
1 2 3
module SharedPaths
  include Spinach::DSL

4 5 6 7
  When 'I visit new project page' do
    visit new_project_path
  end

randx committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
  # ----------------------------------------
  # Group
  # ----------------------------------------

  When 'I visit group page' do
    visit group_path(current_group)
  end

  When 'I visit group issues page' do
    visit issues_group_path(current_group)
  end

  When 'I visit group merge requests page' do
    visit merge_requests_group_path(current_group)
  end

24 25 26 27 28 29 30 31 32 33
  # ----------------------------------------
  # Dashboard
  # ----------------------------------------

  Given 'I visit dashboard page' do
    visit dashboard_path
  end

  Given 'I visit dashboard issues page' do
    visit dashboard_issues_path
Nihad Abbasov committed
34 35
  end

36
  Given 'I visit dashboard merge requests page' do
Nihad Abbasov committed
37 38 39
    visit dashboard_merge_requests_path
  end

40 41
  Given 'I visit dashboard search page' do
    visit search_path
Nihad Abbasov committed
42 43
  end

44 45
  Given 'I visit dashboard help page' do
    visit help_path
Nihad Abbasov committed
46 47
  end

48 49 50 51
  # ----------------------------------------
  # Profile
  # ----------------------------------------

Nihad Abbasov committed
52 53 54 55
  Given 'I visit profile page' do
    visit profile_path
  end

56 57
  Given 'I visit profile account page' do
    visit profile_account_path
Nihad Abbasov committed
58 59
  end

60 61 62 63 64 65 66 67 68 69 70 71
  Given 'I visit profile SSH keys page' do
    visit keys_path
  end

  Given 'I visit profile design page' do
    visit profile_design_path
  end

  Given 'I visit profile history page' do
    visit profile_history_path
  end

Nihad Abbasov committed
72 73 74 75
  Given 'I visit profile token page' do
    visit profile_token_path
  end

76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
  # ----------------------------------------
  # Admin
  # ----------------------------------------

  Given 'I visit admin page' do
    visit admin_root_path
  end

  Given 'I visit admin projects page' do
    visit admin_projects_path
  end

  Given 'I visit admin users page' do
    visit admin_users_path
  end

  Given 'I visit admin logs page' do
    visit admin_logs_path
  end

  Given 'I visit admin hooks page' do
    visit admin_hooks_path
  end

  Given 'I visit admin Resque page' do
    visit admin_resque_path
  end

randx committed
104 105 106 107
  And 'I visit admin groups page' do
    visit admin_groups_path
  end

108 109 110 111 112 113 114 115 116 117
  # ----------------------------------------
  # Generic Project
  # ----------------------------------------

  Given "I visit my project's home page" do
    visit project_path(@project)
  end

  Given "I visit my project's files page" do
    visit project_tree_path(@project, @project.root_ref)
Nihad Abbasov committed
118 119
  end

120 121 122 123
  Given "I visit my project's commits page" do
    visit project_commits_path(@project, @project.root_ref, {limit: 5})
  end

124 125 126 127
  Given "I visit my project's commits page for a specific path" do
    visit project_commits_path(@project, @project.root_ref + "/app/models/project.rb", {limit: 5})
  end

randx committed
128 129 130 131
  Given 'I visit my project\'s commits stats page' do
    visit stats_project_repository_path(@project)
  end

132
  Given "I visit my project's network page" do
133 134
    # Stub Graph::JsonBuilder max_size to speed up test (10 commits vs. 650)
    Gitlab::Graph::JsonBuilder.stub(max_count: 10)
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154

    visit graph_project_path(@project)
  end

  Given "I visit my project's issues page" do
    visit project_issues_path(@project)
  end

  Given "I visit my project's merge requests page" do
    visit project_merge_requests_path(@project)
  end

  Given "I visit my project's wall page" do
    visit wall_project_path(@project)
  end

  Given "I visit my project's wiki page" do
    visit project_wiki_path(@project, :index)
  end

155 156 157 158
  When 'I visit project hooks page' do
    visit project_hooks_path(@project)
  end

159 160 161 162
  # ----------------------------------------
  # "Shop" Project
  # ----------------------------------------

Nihad Abbasov committed
163 164 165 166 167 168 169 170 171 172
  And 'I visit project "Shop" page' do
    project = Project.find_by_name("Shop")
    visit project_path(project)
  end

  Given 'I visit project branches page' do
    visit branches_project_repository_path(@project)
  end

  Given 'I visit compare refs page' do
173
    visit project_compare_index_path(@project)
Nihad Abbasov committed
174 175 176
  end

  Given 'I visit project commits page' do
177 178 179 180 181
    visit project_commits_path(@project, @project.root_ref, {limit: 5})
  end

  Given 'I visit project commits page for stable branch' do
    visit project_commits_path(@project, 'stable', {limit: 5})
Nihad Abbasov committed
182 183 184
  end

  Given 'I visit project source page' do
185
    visit project_tree_path(@project, @project.root_ref)
Nihad Abbasov committed
186 187 188
  end

  Given 'I visit blob file from repo' do
189
    visit project_tree_path(@project, File.join(ValidCommit::ID, ValidCommit::BLOB_FILE_PATH))
Nihad Abbasov committed
190 191 192
  end

  Given 'I visit project source page for "8470d70"' do
193
    visit project_tree_path(@project, "8470d70")
Nihad Abbasov committed
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231
  end

  Given 'I visit project tags page' do
    visit tags_project_repository_path(@project)
  end

  Given 'I visit project commit page' do
    visit project_commit_path(@project, ValidCommit::ID)
  end

  And 'I visit project "Shop" issues page' do
    visit project_issues_path(Project.find_by_name("Shop"))
  end

  Given 'I visit issue page "Release 0.4"' do
    issue = Issue.find_by_title("Release 0.4")
    visit project_issue_path(issue.project, issue)
  end

  Given 'I visit project "Shop" labels page' do
    visit project_labels_path(Project.find_by_name("Shop"))
  end

  Given 'I visit merge request page "Bug NS-04"' do
    mr = MergeRequest.find_by_title("Bug NS-04")
    visit project_merge_request_path(mr.project, mr)
  end

  And 'I visit project "Shop" merge requests page' do
    visit project_merge_requests_path(Project.find_by_name("Shop"))
  end

  Given 'I visit project "Shop" milestones page' do
    @project = Project.find_by_name("Shop")
    visit project_milestones_path(@project)
  end

  Then 'I visit project "Shop" team page' do
232
    visit project_team_index_path(Project.find_by_name("Shop"))
Nihad Abbasov committed
233 234 235 236 237 238 239 240 241 242 243
  end

  Then 'I visit project "Shop" wall page' do
    project = Project.find_by_name("Shop")
    visit wall_project_path(project)
  end

  Given 'I visit project wiki page' do
    visit project_wiki_path(@project, :index)
  end
end