BigW Consortium Gitlab

browse_files.feature 11.2 KB
Newer Older
1
Feature: Project Source Browse Files
2 3
  Background:
    Given I sign in as a user
Dmitriy Zaporozhets committed
4 5 6 7 8 9 10
    And I own project "Shop"
    Given I visit project source page

  Scenario: I browse files from master branch
    Then I should see files from repository

  Scenario: I browse files for specific ref
11 12
    Given I visit project source page for "6d39438"
    Then I should see files from repository for "6d39438"
Douwe Maan committed
13 14
    
  @javascript
Dmitriy Zaporozhets committed
15
  Scenario: I browse file content
16
    Given I click on ".gitignore" file in repo
Ciro Santilli committed
17
    Then I should see its content
Dmitriy Zaporozhets committed
18 19

  Scenario: I browse raw file
20
    Given I visit blob file from repo
21
    And I click link "Raw"
Dmitriy Zaporozhets committed
22
    Then I should see raw file content
Valeriy Sizov committed
23

24
  Scenario: I can create file
Stan Hu committed
25
    Given I click on "New file" link in repo
26 27
    Then I can see new file page

28 29 30 31 32 33
  Scenario: I can create file when I don't have write access
    Given I don't have write access
    And I click on "New file" link in repo
    Then I should see a notice about a new fork having been created
    Then I can see new file page

34
  @javascript
35
  Scenario: I can create and commit file
Stan Hu committed
36
    Given I click on "New file" link in repo
37 38
    And I edit code
    And I fill the new file name
39
    And I fill the commit message
40
    And I click on "Commit changes"
41 42
    Then I am redirected to the new file
    And I should see its new content
43

44 45 46 47 48 49 50
  @javascript
  Scenario: I can create and commit file when I don't have write access
    Given I don't have write access
    And I click on "New file" link in repo
    And I edit code
    And I fill the new file name
    And I fill the commit message
51
    And I click on "Commit changes"
52 53 54
    Then I am redirected to the fork's new merge request page
    And I can see the new commit message

55 56 57 58 59 60
  @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
61
    And I click on "Commit changes"
62 63 64 65
    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

66 67 68 69 70 71 72
  @javascript
  Scenario: I can create and commit file and specify new branch
    Given I click on "New file" link in repo
    And I edit code
    And I fill the new file name
    And I fill the commit message
    And I fill the new branch name
73
    And I click on "Commit changes"
Douwe Maan committed
74
    Then I am redirected to the new merge request page
75
    When I click on "Changes" tab
76 77
    And I should see its new content

78 79
  @javascript
  Scenario: I can upload file and commit
Stan Hu committed
80
    Given I click on "Upload file" link in repo
81 82
    And I upload a new text file
    And I fill the upload file commit message
Stan Hu committed
83
    And I fill the new branch name
84
    And I click on "Upload file"
85
    Then I can see the new commit message
Douwe Maan committed
86
    And I am redirected to the new merge request page
87 88
    When I click on "Changes" tab
    Then I can see the new text file
89

90 91 92 93 94 95 96 97 98
  @javascript
  Scenario: I can upload file and commit when I don't have write access
    Given I don't have write access
    And I click on "Upload file" link in repo
    Then I should see a notice about a new fork having been created
    When I click on "Upload file" link in repo
    And I upload a new text file
    And I fill the upload file commit message
    And I click on "Upload file"
99
    Then I can see the new commit message
100
    And I am redirected to the fork's new merge request page
101 102
    When I click on "Changes" tab
    Then I can see the new text file
103

104 105 106 107 108 109 110 111 112 113
  @javascript
  Scenario: I can replace file and commit
    Given I click on ".gitignore" file in repo
    And I see the ".gitignore"
    And I click on "Replace"
    And I replace it with a text file
    And I fill the replace file commit message
    And I click on "Replace file"
    Then I can see the new text file
    And I can see the replacement commit message
114

115
  @javascript
116 117 118 119 120
  Scenario: I can replace file and commit when I don't have write access
    Given I don't have write access
    And I click on ".gitignore" file in repo
    And I see the ".gitignore"
    And I click on "Replace"
121 122
    Then I should see a Fork/Cancel combo
    And I click button "Fork"
123 124 125 126 127 128
    Then I should see a notice about a new fork having been created
    When I click on "Replace"
    And I replace it with a text file
    And I fill the replace file commit message
    And I click on "Replace file"
    And I can see the replacement commit message
129 130 131
    And I am redirected to the fork's new merge request page
    When I click on "Changes" tab
    Then I can see the new text file
132

133 134
  @javascript
  Scenario: If I enter an illegal file name I see an error message
Stan Hu committed
135
    Given I click on "New file" link in repo
136 137 138 139 140
    And I fill the new file name with an illegal name
    And I edit code
    And I fill the commit message
    And I click on "Commit changes"
    Then I am on the new file page
141
    And I see "Path can contain only..."
142

143 144 145 146 147 148 149 150 151 152
  @javascript
  Scenario: I can create file with a directory name
    Given I click on "New file" link in repo
    And I fill the new file name with a new directory
    And I edit code
    And I fill the commit message
    And I click on "Commit changes"
    Then I am redirected to the new file with directory
    And I should see its new content

Valeriy Sizov committed
153 154
  @javascript
  Scenario: I can edit file
155
    Given I click on ".gitignore" file in repo
156
    And I click button "Edit"
157
    Then I can edit code
skv-headless committed
158

159 160 161 162 163
  @javascript
  Scenario: I can edit file when I don't have write access
    Given I don't have write access
    And I click on ".gitignore" file in repo
    And I click button "Edit"
164 165
    Then I should see a Fork/Cancel combo
    And I click button "Fork"
166 167 168
    Then I should see a notice about a new fork having been created
    And I can edit code

169 170 171 172
  Scenario: If the file is binary the edit link is hidden
    Given I visit a binary file in the repo
    Then I cannot see the edit button

173 174 175
  @javascript
  Scenario: I can edit and commit file
    Given I click on ".gitignore" file in repo
176
    And I click button "Edit"
177 178
    And I edit code
    And I fill the commit message
179
    And I click on "Commit changes"
180 181 182
    Then I am redirected to the ".gitignore"
    And I should see its new content

183 184 185 186 187
  @javascript
  Scenario: I can edit and commit file when I don't have write access
    Given I don't have write access
    And I click on ".gitignore" file in repo
    And I click button "Edit"
188 189
    Then I should see a Fork/Cancel combo
    And I click button "Fork"
190 191
    And I edit code
    And I fill the commit message
192
    And I click on "Commit changes"
193 194 195
    Then I am redirected to the fork's new merge request page
    And I can see the new commit message

196 197 198 199 200 201 202
  @javascript
  Scenario: I can edit and commit file to new branch
    Given I click on ".gitignore" file in repo
    And I click button "Edit"
    And I edit code
    And I fill the commit message
    And I fill the new branch name
203
    And I click on "Commit changes"
Douwe Maan committed
204
    Then I am redirected to the new merge request page
205
    Then I click on "Changes" tab
206 207
    And I should see its new content

208 209 210 211 212 213 214 215 216 217
  @javascript  @wip
  Scenario: If I don't change the content of the file I see an error message
    Given I click on ".gitignore" file in repo
    And I click button "edit"
    And I fill the commit message
    And I click on "Commit changes"
    # Test fails because carriage returns are added to the file.
    Then I am on the ".gitignore" edit file page
    And I see a commit error message

Stan Hu committed
218 219 220 221 222 223 224
  @javascript
  Scenario: I can create directory in repo
    When I click on "New directory" link in repo
    And I fill the new directory name
    And I fill the commit message
    And I fill the new branch name
    And I click on "Create directory"
Douwe Maan committed
225
    Then I am redirected to the new merge request page
Stan Hu committed
226

227 228 229 230 231 232 233 234 235 236 237
  @javascript
  Scenario: I can create directory in repo when I don't have write access
    Given I don't have write access
    When I click on "New directory" link in repo
    Then I should see a notice about a new fork having been created
    When I click on "New directory" link in repo
    And I fill the new directory name
    And I fill the commit message
    And I click on "Create directory"
    Then I am redirected to the fork's new merge request page

Stan Hu committed
238 239 240 241 242 243 244 245 246
  @javascript
  Scenario: I attempt to create an existing directory
    When I click on "New directory" link in repo
    And I fill an existing directory name
    And I fill the commit message
    And I click on "Create directory"
    Then I see "Unable to create directory"
    And I am redirected to the root directory

skv-headless committed
247 248
  @javascript
  Scenario: I can see editing preview
249
    Given I click on ".gitignore" file in repo
250
    And I click button "Edit"
skv-headless committed
251 252 253 254
    And I edit code
    And I click link "Diff"
    Then I see diff

255
  @javascript
Douwe Maan committed
256
  Scenario: I can delete file and commit
257 258
    Given I click on ".gitignore" file in repo
    And I see the ".gitignore"
Douwe Maan committed
259
    And I click on "Delete"
260
    And I fill the commit message
Douwe Maan committed
261
    And I click on "Delete file"
262 263 264
    Then I am redirected to the files URL
    And I don't see the ".gitignore"

265 266 267 268 269 270
  @javascript
  Scenario: I can delete file and commit when I don't have write access
    Given I don't have write access
    And I click on ".gitignore" file in repo
    And I see the ".gitignore"
    And I click on "Delete"
271 272
    Then I should see a Fork/Cancel combo
    And I click button "Fork"
273 274 275 276 277 278 279
    Then I should see a notice about a new fork having been created
    When I click on "Delete"
    And I fill the commit message
    And I click on "Delete file"
    Then I am redirected to the fork's new merge request page
    And I can see the new commit message

280
  Scenario: I can browse directory with Browse Dir
281
    Given I click on files directory
282
    And I click on History link
283 284 285 286
    Then I see Browse dir link

  Scenario: I can browse file with Browse File
    Given I click on readme file
287
    And I click on History link
288 289 290
    Then I see Browse file link

  Scenario: I can browse code with Browse Code
291
    Given I click on History link
292
    Then I see Browse code link
293 294 295 296 297

  # Permalink

  Scenario: I click on the permalink link from a branch ref
    Given I click on ".gitignore" file in repo
298
    And I click on Permalink
299 300 301 302 303 304
    Then I am redirected to the permalink URL

  Scenario: I don't see the permalink link from a SHA ref
    Given I visit project source page for "6d394385cf567f80a8fd85055db1ab4c5295806f"
    And I click on ".gitignore" file in repo
    Then I don't see the permalink link
305 306 307 308 309 310 311

  @javascript
  Scenario: I browse code with single quotes in the ref
    Given I switch ref to 'test'
    And I see the ref 'test' has been selected
    And I visit the 'test' tree
    Then I see the commit data
312 313 314 315 316 317

  @javascript
  Scenario: I browse code with a leading dot in the directory
    Given I switch ref to fix
    And I visit the fix tree
    Then I see the commit data for a directory with a leading dot
318 319 320 321 322 323

  Scenario: I browse LFS object
    Given I click on "files/lfs/lfs_object.iso" file in repo
    Then I should see download link and object size
    And I should not see lfs pointer details
    And I should see buttons for allowed commands
Stan Hu committed
324 325 326 327 328 329 330 331 332 333

  @javascript
  Scenario: I preview an SVG file
    Given I click on "Upload file" link in repo
    And I upload a new SVG file
    And I fill the upload file commit message
    And I fill the new branch name
    And I click on "Upload file"
    Given I visit the SVG file
    Then I can see the new rendered SVG image