Commit cada511f8b88671bb8a99600ed314c3beb5a36f4
1 parent
f814da38
Exists in
master
and in
4 other branches
Add features for checking the "Active Tab" across various pages
Showing
11 changed files
with
535 additions
and
7 deletions
Show diff stats
@@ -0,0 +1,33 @@ | @@ -0,0 +1,33 @@ | ||
1 | +Feature: Admin active tab | ||
2 | + Background: | ||
3 | + Given I sign in as an admin | ||
4 | + | ||
5 | + Scenario: On Admin Home | ||
6 | + Given I visit admin page | ||
7 | + Then the active main tab should be Home | ||
8 | + And no other main tabs should be active | ||
9 | + | ||
10 | + Scenario: On Admin Projects | ||
11 | + Given I visit admin projects page | ||
12 | + Then the active main tab should be Projects | ||
13 | + And no other main tabs should be active | ||
14 | + | ||
15 | + Scenario: On Admin Users | ||
16 | + Given I visit admin users page | ||
17 | + Then the active main tab should be Users | ||
18 | + And no other main tabs should be active | ||
19 | + | ||
20 | + Scenario: On Admin Logs | ||
21 | + Given I visit admin logs page | ||
22 | + Then the active main tab should be Logs | ||
23 | + And no other main tabs should be active | ||
24 | + | ||
25 | + Scenario: On Admin Hooks | ||
26 | + Given I visit admin hooks page | ||
27 | + Then the active main tab should be Hooks | ||
28 | + And no other main tabs should be active | ||
29 | + | ||
30 | + Scenario: On Admin Resque | ||
31 | + Given I visit admin Resque page | ||
32 | + Then the active main tab should be Resque | ||
33 | + And no other main tabs should be active |
@@ -0,0 +1,28 @@ | @@ -0,0 +1,28 @@ | ||
1 | +Feature: Dashboard active tab | ||
2 | + Background: | ||
3 | + Given I sign in as a user | ||
4 | + | ||
5 | + Scenario: On Dashboard Home | ||
6 | + Given I visit dashboard page | ||
7 | + Then the active main tab should be Home | ||
8 | + And no other main tabs should be active | ||
9 | + | ||
10 | + Scenario: On Dashboard Issues | ||
11 | + Given I visit dashboard issues page | ||
12 | + Then the active main tab should be Issues | ||
13 | + And no other main tabs should be active | ||
14 | + | ||
15 | + Scenario: On Dashboard Merge Requests | ||
16 | + Given I visit dashboard merge requests page | ||
17 | + Then the active main tab should be Merge Requests | ||
18 | + And no other main tabs should be active | ||
19 | + | ||
20 | + Scenario: On Dashboard Search | ||
21 | + Given I visit dashboard search page | ||
22 | + Then the active main tab should be Search | ||
23 | + And no other main tabs should be active | ||
24 | + | ||
25 | + Scenario: On Dashboard Help | ||
26 | + Given I visit dashboard help page | ||
27 | + Then the active main tab should be Help | ||
28 | + And no other main tabs should be active |
@@ -0,0 +1,28 @@ | @@ -0,0 +1,28 @@ | ||
1 | +Feature: Profile active tab | ||
2 | + Background: | ||
3 | + Given I sign in as a user | ||
4 | + | ||
5 | + Scenario: On Profile Home | ||
6 | + Given I visit profile page | ||
7 | + Then the active main tab should be Home | ||
8 | + And no other main tabs should be active | ||
9 | + | ||
10 | + Scenario: On Profile Account | ||
11 | + Given I visit profile account page | ||
12 | + Then the active main tab should be Account | ||
13 | + And no other main tabs should be active | ||
14 | + | ||
15 | + Scenario: On Profile SSH Keys | ||
16 | + Given I visit profile SSH keys page | ||
17 | + Then the active main tab should be SSH Keys | ||
18 | + And no other main tabs should be active | ||
19 | + | ||
20 | + Scenario: On Profile Design | ||
21 | + Given I visit profile design page | ||
22 | + Then the active main tab should be Design | ||
23 | + And no other main tabs should be active | ||
24 | + | ||
25 | + Scenario: On Profile History | ||
26 | + Given I visit profile history page | ||
27 | + Then the active main tab should be History | ||
28 | + And no other main tabs should be active |
@@ -0,0 +1,147 @@ | @@ -0,0 +1,147 @@ | ||
1 | +Feature: Project active tab | ||
2 | + Background: | ||
3 | + Given I sign in as a user | ||
4 | + And I own a project | ||
5 | + | ||
6 | + # Main Tabs | ||
7 | + | ||
8 | + Scenario: On Project Home | ||
9 | + Given I visit my project's home page | ||
10 | + Then the active main tab should be Home | ||
11 | + And no other main tabs should be active | ||
12 | + | ||
13 | + Scenario: On Project Files | ||
14 | + Given I visit my project's files page | ||
15 | + Then the active main tab should be Files | ||
16 | + And no other main tabs should be active | ||
17 | + | ||
18 | + Scenario: On Project Commits | ||
19 | + Given I visit my project's commits page | ||
20 | + Then the active main tab should be Commits | ||
21 | + And no other main tabs should be active | ||
22 | + | ||
23 | + Scenario: On Project Network | ||
24 | + Given I visit my project's network page | ||
25 | + Then the active main tab should be Network | ||
26 | + And no other main tabs should be active | ||
27 | + | ||
28 | + Scenario: On Project Issues | ||
29 | + Given I visit my project's issues page | ||
30 | + Then the active main tab should be Issues | ||
31 | + And no other main tabs should be active | ||
32 | + | ||
33 | + Scenario: On Project Merge Requests | ||
34 | + Given I visit my project's merge requests page | ||
35 | + Then the active main tab should be Merge Requests | ||
36 | + And no other main tabs should be active | ||
37 | + | ||
38 | + Scenario: On Project Wall | ||
39 | + Given I visit my project's wall page | ||
40 | + Then the active main tab should be Wall | ||
41 | + And no other main tabs should be active | ||
42 | + | ||
43 | + Scenario: On Project Wiki | ||
44 | + Given I visit my project's wiki page | ||
45 | + Then the active main tab should be Wiki | ||
46 | + And no other main tabs should be active | ||
47 | + | ||
48 | + # Sub Tabs: Home | ||
49 | + | ||
50 | + Scenario: On Project Home/Show | ||
51 | + Given I visit my project's home page | ||
52 | + Then the active sub tab should be Show | ||
53 | + And no other sub tabs should be active | ||
54 | + And the active main tab should be Home | ||
55 | + | ||
56 | + Scenario: On Project Home/Team | ||
57 | + Given I visit my project's home page | ||
58 | + And I click the "Team" tab | ||
59 | + Then the active sub tab should be Team | ||
60 | + And no other sub tabs should be active | ||
61 | + And the active main tab should be Home | ||
62 | + | ||
63 | + Scenario: On Project Home/Attachments | ||
64 | + Given I visit my project's home page | ||
65 | + And I click the "Attachments" tab | ||
66 | + Then the active sub tab should be Attachments | ||
67 | + And no other sub tabs should be active | ||
68 | + And the active main tab should be Home | ||
69 | + | ||
70 | + Scenario: On Project Home/Snippets | ||
71 | + Given I visit my project's home page | ||
72 | + And I click the "Snippets" tab | ||
73 | + Then the active sub tab should be Snippets | ||
74 | + And no other sub tabs should be active | ||
75 | + And the active main tab should be Home | ||
76 | + | ||
77 | + Scenario: On Project Home/Edit | ||
78 | + Given I visit my project's home page | ||
79 | + And I click the "Edit" tab | ||
80 | + Then the active sub tab should be Edit | ||
81 | + And no other sub tabs should be active | ||
82 | + And the active main tab should be Home | ||
83 | + | ||
84 | + Scenario: On Project Home/Hooks | ||
85 | + Given I visit my project's home page | ||
86 | + And I click the "Hooks" tab | ||
87 | + Then the active sub tab should be Hooks | ||
88 | + And no other sub tabs should be active | ||
89 | + And the active main tab should be Home | ||
90 | + | ||
91 | + Scenario: On Project Home/Deploy Keys | ||
92 | + Given I visit my project's home page | ||
93 | + And I click the "Deploy Keys" tab | ||
94 | + Then the active sub tab should be Deploy Keys | ||
95 | + And no other sub tabs should be active | ||
96 | + And the active main tab should be Home | ||
97 | + | ||
98 | + # Sub Tabs: Commits | ||
99 | + | ||
100 | + Scenario: On Project Commits/Commits | ||
101 | + Given I visit my project's commits page | ||
102 | + Then the active sub tab should be Commits | ||
103 | + And no other sub tabs should be active | ||
104 | + And the active main tab should be Commits | ||
105 | + | ||
106 | + Scenario: On Project Commits/Compare | ||
107 | + Given I visit my project's commits page | ||
108 | + And I click the "Compare" tab | ||
109 | + Then the active sub tab should be Compare | ||
110 | + And no other sub tabs should be active | ||
111 | + And the active main tab should be Commits | ||
112 | + | ||
113 | + Scenario: On Project Commits/Branches | ||
114 | + Given I visit my project's commits page | ||
115 | + And I click the "Branches" tab | ||
116 | + Then the active sub tab should be Branches | ||
117 | + And no other sub tabs should be active | ||
118 | + And the active main tab should be Commits | ||
119 | + | ||
120 | + Scenario: On Project Commits/Tags | ||
121 | + Given I visit my project's commits page | ||
122 | + And I click the "Tags" tab | ||
123 | + Then the active sub tab should be Tags | ||
124 | + And no other sub tabs should be active | ||
125 | + And the active main tab should be Commits | ||
126 | + | ||
127 | + # Sub Tabs: Issues | ||
128 | + | ||
129 | + Scenario: On Project Issues/Browse | ||
130 | + Given I visit my project's issues page | ||
131 | + Then the active sub tab should be Browse Issues | ||
132 | + And no other sub tabs should be active | ||
133 | + And the active main tab should be Issues | ||
134 | + | ||
135 | + Scenario: On Project Issues/Milestones | ||
136 | + Given I visit my project's issues page | ||
137 | + And I click the "Milestones" tab | ||
138 | + Then the active sub tab should be Milestones | ||
139 | + And no other sub tabs should be active | ||
140 | + And the active main tab should be Issues | ||
141 | + | ||
142 | + Scenario: On Project Issues/Labels | ||
143 | + Given I visit my project's issues page | ||
144 | + And I click the "Labels" tab | ||
145 | + Then the active sub tab should be Labels | ||
146 | + And no other sub tabs should be active | ||
147 | + And the active main tab should be Issues |
@@ -0,0 +1,29 @@ | @@ -0,0 +1,29 @@ | ||
1 | +class AdminActiveTab < Spinach::FeatureSteps | ||
2 | + include SharedAuthentication | ||
3 | + include SharedPaths | ||
4 | + include SharedActiveTab | ||
5 | + | ||
6 | + Then 'the active main tab should be Home' do | ||
7 | + ensure_active_main_tab('Stats') | ||
8 | + end | ||
9 | + | ||
10 | + Then 'the active main tab should be Projects' do | ||
11 | + ensure_active_main_tab('Projects') | ||
12 | + end | ||
13 | + | ||
14 | + Then 'the active main tab should be Users' do | ||
15 | + ensure_active_main_tab('Users') | ||
16 | + end | ||
17 | + | ||
18 | + Then 'the active main tab should be Logs' do | ||
19 | + ensure_active_main_tab('Logs') | ||
20 | + end | ||
21 | + | ||
22 | + Then 'the active main tab should be Hooks' do | ||
23 | + ensure_active_main_tab('Hooks') | ||
24 | + end | ||
25 | + | ||
26 | + Then 'the active main tab should be Resque' do | ||
27 | + ensure_active_main_tab('Resque') | ||
28 | + end | ||
29 | +end |
@@ -0,0 +1,25 @@ | @@ -0,0 +1,25 @@ | ||
1 | +class DashboardActiveTab < Spinach::FeatureSteps | ||
2 | + include SharedAuthentication | ||
3 | + include SharedPaths | ||
4 | + include SharedActiveTab | ||
5 | + | ||
6 | + Then 'the active main tab should be Home' do | ||
7 | + ensure_active_main_tab('Home') | ||
8 | + end | ||
9 | + | ||
10 | + Then 'the active main tab should be Issues' do | ||
11 | + ensure_active_main_tab('Issues') | ||
12 | + end | ||
13 | + | ||
14 | + Then 'the active main tab should be Merge Requests' do | ||
15 | + ensure_active_main_tab('Merge Requests') | ||
16 | + end | ||
17 | + | ||
18 | + Then 'the active main tab should be Search' do | ||
19 | + ensure_active_main_tab('Search') | ||
20 | + end | ||
21 | + | ||
22 | + Then 'the active main tab should be Help' do | ||
23 | + ensure_active_main_tab('Help') | ||
24 | + end | ||
25 | +end |
@@ -0,0 +1,25 @@ | @@ -0,0 +1,25 @@ | ||
1 | +class ProfileActiveTab < Spinach::FeatureSteps | ||
2 | + include SharedAuthentication | ||
3 | + include SharedPaths | ||
4 | + include SharedActiveTab | ||
5 | + | ||
6 | + Then 'the active main tab should be Home' do | ||
7 | + ensure_active_main_tab('Profile') | ||
8 | + end | ||
9 | + | ||
10 | + Then 'the active main tab should be Account' do | ||
11 | + ensure_active_main_tab('Account') | ||
12 | + end | ||
13 | + | ||
14 | + Then 'the active main tab should be SSH Keys' do | ||
15 | + ensure_active_main_tab('SSH Keys') | ||
16 | + end | ||
17 | + | ||
18 | + Then 'the active main tab should be Design' do | ||
19 | + ensure_active_main_tab('Design') | ||
20 | + end | ||
21 | + | ||
22 | + Then 'the active main tab should be History' do | ||
23 | + ensure_active_main_tab('History') | ||
24 | + end | ||
25 | +end |
@@ -0,0 +1,146 @@ | @@ -0,0 +1,146 @@ | ||
1 | +class ProjectActiveTab < Spinach::FeatureSteps | ||
2 | + include SharedAuthentication | ||
3 | + include SharedPaths | ||
4 | + include SharedProject | ||
5 | + include SharedActiveTab | ||
6 | + | ||
7 | + # Main Tabs | ||
8 | + | ||
9 | + Then 'the active main tab should be Home' do | ||
10 | + ensure_active_main_tab(@project.name) | ||
11 | + end | ||
12 | + | ||
13 | + Then 'the active main tab should be Files' do | ||
14 | + ensure_active_main_tab('Files') | ||
15 | + end | ||
16 | + | ||
17 | + Then 'the active main tab should be Commits' do | ||
18 | + ensure_active_main_tab('Commits') | ||
19 | + end | ||
20 | + | ||
21 | + Then 'the active main tab should be Network' do | ||
22 | + ensure_active_main_tab('Network') | ||
23 | + end | ||
24 | + | ||
25 | + Then 'the active main tab should be Issues' do | ||
26 | + ensure_active_main_tab('Issues') | ||
27 | + end | ||
28 | + | ||
29 | + Then 'the active main tab should be Merge Requests' do | ||
30 | + ensure_active_main_tab('Merge Requests') | ||
31 | + end | ||
32 | + | ||
33 | + Then 'the active main tab should be Wall' do | ||
34 | + ensure_active_main_tab('Wall') | ||
35 | + end | ||
36 | + | ||
37 | + Then 'the active main tab should be Wiki' do | ||
38 | + ensure_active_main_tab('Wiki') | ||
39 | + end | ||
40 | + | ||
41 | + # Sub Tabs: Home | ||
42 | + | ||
43 | + Given 'I click the "Team" tab' do | ||
44 | + click_link('Team') | ||
45 | + end | ||
46 | + | ||
47 | + Given 'I click the "Attachments" tab' do | ||
48 | + click_link('Attachments') | ||
49 | + end | ||
50 | + | ||
51 | + Given 'I click the "Snippets" tab' do | ||
52 | + click_link('Snippets') | ||
53 | + end | ||
54 | + | ||
55 | + Given 'I click the "Edit" tab' do | ||
56 | + click_link('Edit') | ||
57 | + end | ||
58 | + | ||
59 | + Given 'I click the "Hooks" tab' do | ||
60 | + click_link('Hooks') | ||
61 | + end | ||
62 | + | ||
63 | + Given 'I click the "Deploy Keys" tab' do | ||
64 | + click_link('Deploy Keys') | ||
65 | + end | ||
66 | + | ||
67 | + Then 'the active sub tab should be Show' do | ||
68 | + ensure_active_sub_tab('Show') | ||
69 | + end | ||
70 | + | ||
71 | + Then 'the active sub tab should be Team' do | ||
72 | + ensure_active_sub_tab('Team') | ||
73 | + end | ||
74 | + | ||
75 | + Then 'the active sub tab should be Attachments' do | ||
76 | + ensure_active_sub_tab('Attachments') | ||
77 | + end | ||
78 | + | ||
79 | + Then 'the active sub tab should be Snippets' do | ||
80 | + ensure_active_sub_tab('Snippets') | ||
81 | + end | ||
82 | + | ||
83 | + Then 'the active sub tab should be Edit' do | ||
84 | + ensure_active_sub_tab('Edit') | ||
85 | + end | ||
86 | + | ||
87 | + Then 'the active sub tab should be Hooks' do | ||
88 | + ensure_active_sub_tab('Hooks') | ||
89 | + end | ||
90 | + | ||
91 | + Then 'the active sub tab should be Deploy Keys' do | ||
92 | + ensure_active_sub_tab('Deploy Keys') | ||
93 | + end | ||
94 | + | ||
95 | + # Sub Tabs: Commits | ||
96 | + | ||
97 | + Given 'I click the "Compare" tab' do | ||
98 | + click_link('Compare') | ||
99 | + end | ||
100 | + | ||
101 | + Given 'I click the "Branches" tab' do | ||
102 | + click_link('Branches') | ||
103 | + end | ||
104 | + | ||
105 | + Given 'I click the "Tags" tab' do | ||
106 | + click_link('Tags') | ||
107 | + end | ||
108 | + | ||
109 | + Then 'the active sub tab should be Commits' do | ||
110 | + ensure_active_sub_tab('Commits') | ||
111 | + end | ||
112 | + | ||
113 | + Then 'the active sub tab should be Compare' do | ||
114 | + ensure_active_sub_tab('Compare') | ||
115 | + end | ||
116 | + | ||
117 | + Then 'the active sub tab should be Branches' do | ||
118 | + ensure_active_sub_tab('Branches') | ||
119 | + end | ||
120 | + | ||
121 | + Then 'the active sub tab should be Tags' do | ||
122 | + ensure_active_sub_tab('Tags') | ||
123 | + end | ||
124 | + | ||
125 | + # Sub Tabs: Issues | ||
126 | + | ||
127 | + Given 'I click the "Milestones" tab' do | ||
128 | + click_link('Milestones') | ||
129 | + end | ||
130 | + | ||
131 | + Given 'I click the "Labels" tab' do | ||
132 | + click_link('Labels') | ||
133 | + end | ||
134 | + | ||
135 | + Then 'the active sub tab should be Browse Issues' do | ||
136 | + ensure_active_sub_tab('Browse Issues') | ||
137 | + end | ||
138 | + | ||
139 | + Then 'the active sub tab should be Milestones' do | ||
140 | + ensure_active_sub_tab('Milestones') | ||
141 | + end | ||
142 | + | ||
143 | + Then 'the active sub tab should be Labels' do | ||
144 | + ensure_active_sub_tab('Labels') | ||
145 | + end | ||
146 | +end |
@@ -0,0 +1,11 @@ | @@ -0,0 +1,11 @@ | ||
1 | +module SharedActiveTab | ||
2 | + include Spinach::DSL | ||
3 | + | ||
4 | + def ensure_active_main_tab(content) | ||
5 | + page.find('ul.main_menu li.current').should have_content(content) | ||
6 | + end | ||
7 | + | ||
8 | + And 'no other main tabs should be active' do | ||
9 | + page.should have_selector('ul.main_menu li.current', count: 1) | ||
10 | + end | ||
11 | +end |
features/steps/shared/authentication.rb
features/steps/shared/paths.rb
1 | module SharedPaths | 1 | module SharedPaths |
2 | include Spinach::DSL | 2 | include Spinach::DSL |
3 | 3 | ||
4 | - And 'I visit dashboard search page' do | ||
5 | - visit search_path | 4 | + # ---------------------------------------- |
5 | + # Dashboard | ||
6 | + # ---------------------------------------- | ||
7 | + | ||
8 | + Given 'I visit dashboard page' do | ||
9 | + visit dashboard_path | ||
10 | + end | ||
11 | + | ||
12 | + Given 'I visit dashboard issues page' do | ||
13 | + visit dashboard_issues_path | ||
6 | end | 14 | end |
7 | 15 | ||
8 | - And 'I visit dashboard merge requests page' do | 16 | + Given 'I visit dashboard merge requests page' do |
9 | visit dashboard_merge_requests_path | 17 | visit dashboard_merge_requests_path |
10 | end | 18 | end |
11 | 19 | ||
12 | - And 'I visit dashboard issues page' do | ||
13 | - visit dashboard_issues_path | 20 | + Given 'I visit dashboard search page' do |
21 | + visit search_path | ||
14 | end | 22 | end |
15 | 23 | ||
16 | - When 'I visit dashboard page' do | ||
17 | - visit dashboard_path | 24 | + Given 'I visit dashboard help page' do |
25 | + visit help_path | ||
18 | end | 26 | end |
19 | 27 | ||
28 | + # ---------------------------------------- | ||
29 | + # Profile | ||
30 | + # ---------------------------------------- | ||
31 | + | ||
20 | Given 'I visit profile page' do | 32 | Given 'I visit profile page' do |
21 | visit profile_path | 33 | visit profile_path |
22 | end | 34 | end |
@@ -25,10 +37,50 @@ module SharedPaths | @@ -25,10 +37,50 @@ module SharedPaths | ||
25 | visit profile_account_path | 37 | visit profile_account_path |
26 | end | 38 | end |
27 | 39 | ||
40 | + Given 'I visit profile SSH keys page' do | ||
41 | + visit keys_path | ||
42 | + end | ||
43 | + | ||
44 | + Given 'I visit profile design page' do | ||
45 | + visit profile_design_path | ||
46 | + end | ||
47 | + | ||
48 | + Given 'I visit profile history page' do | ||
49 | + visit profile_history_path | ||
50 | + end | ||
51 | + | ||
28 | Given 'I visit profile token page' do | 52 | Given 'I visit profile token page' do |
29 | visit profile_token_path | 53 | visit profile_token_path |
30 | end | 54 | end |
31 | 55 | ||
56 | + # ---------------------------------------- | ||
57 | + # Admin | ||
58 | + # ---------------------------------------- | ||
59 | + | ||
60 | + Given 'I visit admin page' do | ||
61 | + visit admin_root_path | ||
62 | + end | ||
63 | + | ||
64 | + Given 'I visit admin projects page' do | ||
65 | + visit admin_projects_path | ||
66 | + end | ||
67 | + | ||
68 | + Given 'I visit admin users page' do | ||
69 | + visit admin_users_path | ||
70 | + end | ||
71 | + | ||
72 | + Given 'I visit admin logs page' do | ||
73 | + visit admin_logs_path | ||
74 | + end | ||
75 | + | ||
76 | + Given 'I visit admin hooks page' do | ||
77 | + visit admin_hooks_path | ||
78 | + end | ||
79 | + | ||
80 | + Given 'I visit admin Resque page' do | ||
81 | + visit admin_resque_path | ||
82 | + end | ||
83 | + | ||
32 | When 'I visit new project page' do | 84 | When 'I visit new project page' do |
33 | visit new_project_path | 85 | visit new_project_path |
34 | end | 86 | end |