Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2014-08-21 12:14:31 +0400
committerRobert Schilling <rschilling@student.tugraz.at>2014-09-01 13:49:17 +0400
commit0cbc19f9449ffc6e624c0b7e22ea837468658377 (patch)
treee48375611c09c38a14f45adecbe31309f308798b /features
parent174c00cf2c026a3bdc61d94b45195a5e5c99202f (diff)
Awesome shortcuts for GitLab
Diffstat (limited to 'features')
-rw-r--r--features/dashboard/shortcuts.feature21
-rw-r--r--features/project/shortcuts.feature46
-rw-r--r--features/steps/dashboard/active_tab.rb14
-rw-r--r--features/steps/dashboard/shortcuts.rb6
-rw-r--r--features/steps/project/active_tab.rb39
-rw-r--r--features/steps/project/project_shortcuts.rb36
-rw-r--r--features/steps/shared/active_tab.rb20
-rw-r--r--features/steps/shared/project_tab.rb44
-rw-r--r--features/steps/shared/shortcuts.rb18
9 files changed, 193 insertions, 51 deletions
diff --git a/features/dashboard/shortcuts.feature b/features/dashboard/shortcuts.feature
new file mode 100644
index 00000000000..7c25b3926c9
--- /dev/null
+++ b/features/dashboard/shortcuts.feature
@@ -0,0 +1,21 @@
+@dashboard
+Feature: Dashboard shortcuts
+ Background:
+ Given I sign in as a user
+ And I visit dashboard page
+
+ @javascript
+ Scenario: Navigate to projects tab
+ Given I press "g" and "p"
+ Then the active main tab should be Projects
+
+ @javascript
+ Scenario: Navigate to issue tab
+ Given I press "g" and "i"
+ Then the active main tab should be Issues
+
+ @javascript
+ Scenario: Navigate to merge requests tab
+ Given I press "g" and "m"
+ Then the active main tab should be Merge Requests
+
diff --git a/features/project/shortcuts.feature b/features/project/shortcuts.feature
new file mode 100644
index 00000000000..16882fded8e
--- /dev/null
+++ b/features/project/shortcuts.feature
@@ -0,0 +1,46 @@
+@dashboard
+Feature: Project shortcuts
+ Background:
+ Given I sign in as a user
+ And I own a project
+ And I visit my project's home page
+
+ @javascript
+ Scenario: Navigate to files tab
+ Given I press "g" and "f"
+ Then the active main tab should be Files
+
+ @javascript
+ Scenario: Navigate to commits tab
+ Given I press "g" and "c"
+ Then the active main tab should be Commits
+
+ @javascript
+ Scenario: Navigate to network tab
+ Given I press "g" and "n"
+ Then the active main tab should be Network
+
+ @javascript
+ Scenario: Navigate to graphs tab
+ Given I press "g" and "g"
+ Then the active main tab should be Graphs
+
+ @javascript
+ Scenario: Navigate to issues tab
+ Given I press "g" and "i"
+ Then the active main tab should be Issues
+
+ @javascript
+ Scenario: Navigate to merge requests tab
+ Given I press "g" and "m"
+ Then the active main tab should be Merge Requests
+
+ @javascript
+ Scenario: Navigate to snippets tab
+ Given I press "g" and "s"
+ Then the active main tab should be Snippets
+
+ @javascript
+ Scenario: Navigate to wiki tab
+ Given I press "g" and "w"
+ Then the active main tab should be Wiki
diff --git a/features/steps/dashboard/active_tab.rb b/features/steps/dashboard/active_tab.rb
index 68d32ed971a..d5db3339df2 100644
--- a/features/steps/dashboard/active_tab.rb
+++ b/features/steps/dashboard/active_tab.rb
@@ -3,19 +3,7 @@ class DashboardActiveTab < Spinach::FeatureSteps
include SharedPaths
include SharedActiveTab
- Then 'the active main tab should be Home' do
- ensure_active_main_tab('Activity')
- end
-
- Then 'the active main tab should be Issues' do
- ensure_active_main_tab('Issues')
- end
-
- Then 'the active main tab should be Merge Requests' do
- ensure_active_main_tab('Merge Requests')
- end
-
- Then 'the active main tab should be Help' do
+ step 'the active main tab should be Help' do
ensure_active_main_tab('Help')
end
end
diff --git a/features/steps/dashboard/shortcuts.rb b/features/steps/dashboard/shortcuts.rb
new file mode 100644
index 00000000000..d4484e7a20f
--- /dev/null
+++ b/features/steps/dashboard/shortcuts.rb
@@ -0,0 +1,6 @@
+class DashboardShortcuts < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedPaths
+ include SharedProject
+ include SharedActiveTab
+end
diff --git a/features/steps/project/active_tab.rb b/features/steps/project/active_tab.rb
index e39c0b65b91..2862256e03b 100644
--- a/features/steps/project/active_tab.rb
+++ b/features/steps/project/active_tab.rb
@@ -3,44 +3,7 @@ class ProjectActiveTab < Spinach::FeatureSteps
include SharedPaths
include SharedProject
include SharedActiveTab
-
- # Main Tabs
-
- Then 'the active main tab should be Home' do
- ensure_active_main_tab('Project')
- end
-
- Then 'the active main tab should be Settings' do
- ensure_active_main_tab('Settings')
- end
-
- Then 'the active main tab should be Files' do
- ensure_active_main_tab('Files')
- end
-
- Then 'the active main tab should be Commits' do
- ensure_active_main_tab('Commits')
- end
-
- Then 'the active main tab should be Network' do
- ensure_active_main_tab('Network')
- end
-
- Then 'the active main tab should be Issues' do
- ensure_active_main_tab('Issues')
- end
-
- Then 'the active main tab should be Merge Requests' do
- ensure_active_main_tab('Merge Requests')
- end
-
- Then 'the active main tab should be Wall' do
- ensure_active_main_tab('Wall')
- end
-
- Then 'the active main tab should be Wiki' do
- ensure_active_main_tab('Wiki')
- end
+ include SharedProjectTab
# Sub Tabs: Home
diff --git a/features/steps/project/project_shortcuts.rb b/features/steps/project/project_shortcuts.rb
new file mode 100644
index 00000000000..ce6e21a4258
--- /dev/null
+++ b/features/steps/project/project_shortcuts.rb
@@ -0,0 +1,36 @@
+class ProjectShortcuts < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedPaths
+ include SharedProject
+ include SharedProjectTab
+
+ step 'I press "g" and "f"' do
+ find('body').native.send_key('g')
+ find('body').native.send_key('f')
+ end
+
+ step 'I press "g" and "c"' do
+ find('body').native.send_key('g')
+ find('body').native.send_key('c')
+ end
+
+ step 'I press "g" and "n"' do
+ find('body').native.send_key('g')
+ find('body').native.send_key('n')
+ end
+
+ step 'I press "g" and "g"' do
+ find('body').native.send_key('g')
+ find('body').native.send_key('g')
+ end
+
+ step 'I press "g" and "s"' do
+ find('body').native.send_key('g')
+ find('body').native.send_key('s')
+ end
+
+ step 'I press "g" and "w"' do
+ find('body').native.send_key('g')
+ find('body').native.send_key('w')
+ end
+end
diff --git a/features/steps/shared/active_tab.rb b/features/steps/shared/active_tab.rb
index e3cd5fcfe85..c776af14e04 100644
--- a/features/steps/shared/active_tab.rb
+++ b/features/steps/shared/active_tab.rb
@@ -24,4 +24,24 @@ module SharedActiveTab
And 'no other sub navs should be active' do
page.should have_selector('div.content ul.nav-stacked-menu li.active', count: 1)
end
+
+ step 'the active main tab should be Home' do
+ ensure_active_main_tab('Activity')
+ end
+
+ step 'the active main tab should be Projects' do
+ ensure_active_main_tab('Projects')
+ end
+
+ step 'the active main tab should be Issues' do
+ ensure_active_main_tab('Issues')
+ end
+
+ step 'the active main tab should be Merge Requests' do
+ ensure_active_main_tab('Merge Requests')
+ end
+
+ step 'the active main tab should be Help' do
+ ensure_active_main_tab('Help')
+ end
end
diff --git a/features/steps/shared/project_tab.rb b/features/steps/shared/project_tab.rb
new file mode 100644
index 00000000000..00630da83a3
--- /dev/null
+++ b/features/steps/shared/project_tab.rb
@@ -0,0 +1,44 @@
+module SharedProjectTab
+ include Spinach::DSL
+ include SharedActiveTab
+
+ step 'the active main tab should be Home' do
+ ensure_active_main_tab('Activity')
+ end
+
+ step 'the active main tab should be Files' do
+ ensure_active_main_tab('Files')
+ end
+
+ step 'the active main tab should be Commits' do
+ ensure_active_main_tab('Commits')
+ end
+
+ step 'the active main tab should be Network' do
+ ensure_active_main_tab('Network')
+ end
+
+ step 'the active main tab should be Graphs' do
+ ensure_active_main_tab('Graphs')
+ end
+
+ step 'the active main tab should be Issues' do
+ ensure_active_main_tab('Issues')
+ end
+
+ step 'the active main tab should be Merge Requests' do
+ ensure_active_main_tab('Merge Requests')
+ end
+
+ step 'the active main tab should be Snippets' do
+ ensure_active_main_tab('Snippets')
+ end
+
+ step 'the active main tab should be Wiki' do
+ ensure_active_main_tab('Wiki')
+ end
+
+ step 'the active main tab should be Settings' do
+ ensure_active_main_tab('Settings')
+ end
+end
diff --git a/features/steps/shared/shortcuts.rb b/features/steps/shared/shortcuts.rb
new file mode 100644
index 00000000000..bbb7afec0ad
--- /dev/null
+++ b/features/steps/shared/shortcuts.rb
@@ -0,0 +1,18 @@
+module SharedActiveTab
+ include Spinach::DSL
+
+ step 'I press "g" and "p"' do
+ find('body').native.send_key('g')
+ find('body').native.send_key('p')
+ end
+
+ step 'I press "g" and "i"' do
+ find('body').native.send_key('g')
+ find('body').native.send_key('i')
+ end
+
+ step 'I press "g" and "m"' do
+ find('body').native.send_key('g')
+ find('body').native.send_key('m')
+ end
+end