merge_requests.feature 9.35 KB
Newer Older
1
Feature: Project Merge Requests
2
  Background:
3
    Given I sign in as a user
4 5 6
    And I own project "Shop"
    And project "Shop" have "Bug NS-04" open merge request
    And project "Shop" have "Feature NS-03" closed merge request
7
    And I visit project "Shop" merge requests page
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

  Scenario: I should see open merge requests
    Then I should see "Bug NS-04" in merge requests
    And I should not see "Feature NS-03" in merge requests

  Scenario: I should see closed merge requests
    Given I click link "Closed"
    Then I should see "Feature NS-03" in merge requests
    And I should not see "Bug NS-04" in merge requests

  Scenario: I should see all merge requests
    Given I click link "All"
    Then I should see "Feature NS-03" in merge requests
    And I should see "Bug NS-04" in merge requests

  Scenario: I visit merge request page
    Given I click link "Bug NS-04"
    Then I should see merge request "Bug NS-04"

  Scenario: I close merge request page
    Given I click link "Bug NS-04"
    And I click link "Close"
    Then I should see closed merge request "Bug NS-04"

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
32 33 34 35 36 37 38
  Scenario: I reopen merge request page
    Given I click link "Bug NS-04"
    And I click link "Close"
    Then I should see closed merge request "Bug NS-04"
    When I click link "Reopen"
    Then I should see reopened merge request "Bug NS-04"

39 40 41 42 43
  Scenario: I submit new unassigned merge request
    Given I click link "New Merge Request"
    And I submit new merge request "Wiki Feature"
    Then I should see merge request "Wiki Feature"

44 45 46 47 48
  @javascript
  Scenario: I comment on a merge request
    Given I visit merge request page "Bug NS-04"
    And I leave a comment like "XML attached"
    Then I should see comment "XML attached"
49

50 51 52 53 54
  @javascript
  Scenario: I comment on a merge request diff
    Given project "Shop" have "Bug NS-05" open merge request with diffs inside
    And I visit merge request page "Bug NS-05"
    And I switch to the diff tab
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
55
    And I leave a comment like "Line is wrong" on diff
56
    And I switch to the merge request's comments tab
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
57
    Then I should see a discussion has started on diff
58 59 60 61 62

  @javascript
  Scenario: I comment on a line of a commit in merge request
    Given project "Shop" have "Bug NS-05" open merge request with diffs inside
    And I visit merge request page "Bug NS-05"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
63 64
    And I click on the commit in the merge request
    And I leave a comment like "Line is wrong" on diff in commit
65
    And I switch to the merge request's comments tab
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
66
    Then I should see a discussion has started on commit diff
67 68 69 70 71

  @javascript
  Scenario: I comment on a commit in merge request
    Given project "Shop" have "Bug NS-05" open merge request with diffs inside
    And I visit merge request page "Bug NS-05"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
72
    And I click on the commit in the merge request
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
73
    And I leave a comment on the diff page in commit
74
    And I switch to the merge request's comments tab
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
75
    Then I should see a discussion has started on commit
76 77 78 79 80 81 82 83 84 85

  @javascript
  Scenario: I accept merge request with custom commit message
    Given project "Shop" have "Bug NS-05" open merge request with diffs inside
    And merge request "Bug NS-05" is mergeable
    And I visit merge request page "Bug NS-05"
    And merge request is mergeable
    Then I modify merge commit message
    And I accept this merge request
    Then I should see merged request
86 87 88 89 90 91 92 93 94 95 96 97

  # Markdown

  Scenario: Headers inside the description should have ids generated for them.
    When I visit merge request page "Bug NS-04"
    Then Header "Description header" should have correct id and link

  @javascript
  Scenario: Headers inside comments should not have ids generated for them.
    Given I visit merge request page "Bug NS-04"
    And I leave a comment with a header containing "Comment with a header"
    Then The comment with the header should not have an ID
98

99 100 101 102 103 104 105 106 107 108
  Scenario: Merge request description should render task checkboxes
    Given project "Shop" has "MR-task-open" open MR with task markdown
    When I visit merge request page "MR-task-open"
    Then I should see task checkboxes in the description

  Scenario: Merge request notes should not render task checkboxes
    Given project "Shop" has "MR-task-open" open MR with task markdown
    When I visit merge request page "MR-task-open"
    Then I should not see task checkboxes in the comment

109 110 111 112 113 114 115 116 117
  # Toggling inline comments

  @javascript
  Scenario: I hide comments on a merge request diff with comments in a single file
    Given project "Shop" have "Bug NS-05" open merge request with diffs inside
    And I visit merge request page "Bug NS-05"
    And I switch to the diff tab
    And I leave a comment like "Line is wrong" on line 39 of the second file
    And I click link "Hide inline discussion" of the second file
118
    Then I should not see a comment like "Line is wrong here" in the second file
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135

  @javascript
  Scenario: I show comments on a merge request diff with comments in a single file
    Given project "Shop" have "Bug NS-05" open merge request with diffs inside
    And I visit merge request page "Bug NS-05"
    And I switch to the diff tab
    And I leave a comment like "Line is wrong" on line 39 of the second file
    Then I should see a comment like "Line is wrong" in the second file

  @javascript
  Scenario: I hide comments on a merge request diff with comments in multiple files
    Given project "Shop" have "Bug NS-05" open merge request with diffs inside
    And I visit merge request page "Bug NS-05"
    And I switch to the diff tab
    And I leave a comment like "Line is correct" on line 12 of the first file
    And I leave a comment like "Line is wrong" on line 39 of the second file
    And I click link "Hide inline discussion" of the second file
136
    Then I should not see a comment like "Line is wrong here" in the second file
137 138 139 140 141 142 143 144 145 146 147 148 149
    And I should still see a comment like "Line is correct" in the first file

  @javascript
  Scenario: I show comments on a merge request diff with comments in multiple files
    Given project "Shop" have "Bug NS-05" open merge request with diffs inside
    And I visit merge request page "Bug NS-05"
    And I switch to the diff tab
    And I leave a comment like "Line is correct" on line 12 of the first file
    And I leave a comment like "Line is wrong" on line 39 of the second file
    And I click link "Hide inline discussion" of the second file
    And I click link "Show inline discussion" of the second file
    Then I should see a comment like "Line is wrong" in the second file
    And I should still see a comment like "Line is correct" in the first file
skv's avatar
skv committed
150 151 152 153 154 155 156 157

  @javascript
  Scenario: I unfold diff
    Given project "Shop" have "Bug NS-05" open merge request with diffs inside
    And I visit merge request page "Bug NS-05"
    And I switch to the diff tab
    And I unfold diff
    Then I should see additional file lines
Marin Jankovski's avatar
Marin Jankovski committed
158 159 160 161 162 163 164 165 166 167

  @javascript
  Scenario: I show comments on a merge request side-by-side diff with comments in multiple files
    Given project "Shop" have "Bug NS-05" open merge request with diffs inside
    And I visit merge request page "Bug NS-05"
    And I switch to the diff tab
    And I leave a comment like "Line is correct" on line 12 of the first file
    And I leave a comment like "Line is wrong" on line 39 of the second file
    And I click Side-by-side Diff tab
    Then I should see comments on the side-by-side diff page
168 169 170 171 172 173

  # Task status in issues list

  Scenario: Merge requests list should display task status
    Given project "Shop" has "MR-task-open" open MR with task markdown
    When I visit project "Shop" merge requests page
174
    Then I should see the task status for the Taskable
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189

  # Toggling task items

  @javascript
  Scenario: Task checkboxes should be enabled for an open merge request
    Given project "Shop" has "MR-task-open" open MR with task markdown
    When I visit merge request page "MR-task-open"
    Then Task checkboxes should be enabled

  @javascript
  Scenario: Task checkboxes should be disabled for a closed merge request
    Given project "Shop" has "MR-task-open" open MR with task markdown
    And I visit merge request page "MR-task-open"
    And I click link "Close"
    Then Task checkboxes should be disabled
190 191 192 193 194 195

  # Description preview

  @javascript
  Scenario: I can't preview without text
    Given I visit merge request page "Bug NS-04"
196
    And I click link "Edit" for the merge request
197
    And I haven't written any description text
198
    Then The Markdown preview tab should say there is nothing to do
199 200 201 202

  @javascript
  Scenario: I can preview with text
    Given I visit merge request page "Bug NS-04"
203
    And I click link "Edit" for the merge request
204 205
    And I write a description like ":+1: Nice"
    Then The Markdown preview tab should display rendered Markdown
206 207 208 209

  @javascript
  Scenario: I preview a merge request description
    Given I visit merge request page "Bug NS-04"
210
    And I click link "Edit" for the merge request
211 212 213 214 215 216 217
    And I preview a description text like "Bug fixed :smile:"
    Then I should see the Markdown preview
    And I should not see the Markdown text field

  @javascript
  Scenario: I can edit after preview
    Given I visit merge request page "Bug NS-04"
218
    And I click link "Edit" for the merge request
219
    And I preview a description text like "Bug fixed :smile:"
220
    Then I should see the Markdown write tab
221 222 223 224 225 226 227

  @javascript
  Scenario: I search merge request
    Given I click link "All"
    When I fill in merge request search with "Fe"
    Then I should see "Feature NS-03" in merge requests
    And I should not see "Bug NS-04" in merge requests