summaryrefslogtreecommitdiff
path: root/features/project/source
diff options
context:
space:
mode:
authorJason Hollingsworth <jhworth.developer@gmail.com>2013-11-27 12:24:27 -0600
committerJason Hollingsworth <jhworth.developer@gmail.com>2013-11-27 20:08:37 -0600
commit568e05a73b1c4aac814f75da488d3d1ed7d847e9 (patch)
tree94226bd1af711c2cc540106899fd3cb9bf8c379d /features/project/source
parent09d00563af8168de14daca9193a6f708e5563870 (diff)
downloadgitlab-ce-568e05a73b1c4aac814f75da488d3d1ed7d847e9.tar.gz
Enable multiline select for blobs.
Holding shift will allow users to click and select multiple lines. The behavior is similar to GitHub. Complete with tests.
Diffstat (limited to 'features/project/source')
-rw-r--r--features/project/source/multiselect_blob.feature86
1 files changed, 86 insertions, 0 deletions
diff --git a/features/project/source/multiselect_blob.feature b/features/project/source/multiselect_blob.feature
new file mode 100644
index 00000000000..3038c0814ad
--- /dev/null
+++ b/features/project/source/multiselect_blob.feature
@@ -0,0 +1,86 @@
+Feature: Project Multiselect Blob
+ Background:
+ Given I sign in as a user
+ And I own project "Shop"
+ And I visit project source page
+ And I click on "Gemfile.lock" file in repo
+
+ @javascript
+ Scenario: I click line 1 in file
+ When I click line 1 in file
+ Then I should see "L1" as URI fragment
+ And I should see line 1 highlighted
+
+ @javascript
+ Scenario: I shift-click line 1 in file
+ When I shift-click line 1 in file
+ Then I should see "L1" as URI fragment
+ And I should see line 1 highlighted
+
+ @javascript
+ Scenario: I click line 1 then click line 2 in file
+ When I click line 1 in file
+ Then I should see "L1" as URI fragment
+ And I should see line 1 highlighted
+ Then I click line 2 in file
+ Then I should see "L2" as URI fragment
+ And I should see line 2 highlighted
+
+ @javascript
+ Scenario: I click various line numbers to test multiselect
+ Then I click line 1 in file
+ Then I should see "L1" as URI fragment
+ And I should see line 1 highlighted
+ Then I shift-click line 2 in file
+ Then I should see "L1-2" as URI fragment
+ And I should see lines 1-2 highlighted
+ Then I shift-click line 3 in file
+ Then I should see "L1-3" as URI fragment
+ And I should see lines 1-3 highlighted
+ Then I click line 3 in file
+ Then I should see "L3" as URI fragment
+ And I should see line 3 highlighted
+ Then I shift-click line 1 in file
+ Then I should see "L1-3" as URI fragment
+ And I should see lines 1-3 highlighted
+ Then I shift-click line 5 in file
+ Then I should see "L1-5" as URI fragment
+ And I should see lines 1-5 highlighted
+ Then I shift-click line 4 in file
+ Then I should see "L1-4" as URI fragment
+ And I should see lines 1-4 highlighted
+ Then I click line 5 in file
+ Then I should see "L5" as URI fragment
+ And I should see line 5 highlighted
+ Then I shift-click line 3 in file
+ Then I should see "L3-5" as URI fragment
+ And I should see lines 3-5 highlighted
+ Then I shift-click line 1 in file
+ Then I should see "L1-3" as URI fragment
+ And I should see lines 1-3 highlighted
+ Then I shift-click line 1 in file
+ Then I should see "L1" as URI fragment
+ And I should see line 1 highlighted
+
+ @javascript
+ Scenario: I multiselect lines 1-5 and then go back and forward in history
+ When I click line 1 in file
+ And I shift-click line 3 in file
+ And I shift-click line 2 in file
+ And I shift-click line 5 in file
+ Then I should see "L1-5" as URI fragment
+ And I should see lines 1-5 highlighted
+ Then I go back in history
+ Then I should see "L1-2" as URI fragment
+ And I should see lines 1-2 highlighted
+ Then I go back in history
+ Then I should see "L1-3" as URI fragment
+ And I should see lines 1-3 highlighted
+ Then I go back in history
+ Then I should see "L1" as URI fragment
+ And I should see line 1 highlighted
+ Then I go forward in history
+ And I go forward in history
+ And I go forward in history
+ Then I should see "L1-5" as URI fragment
+ And I should see lines 1-5 highlighted \ No newline at end of file