Commit cada511f authored by Robert Speicher's avatar Robert Speicher

Add features for checking the "Active Tab" across various pages

parent f814da38
Feature: Admin active tab
Background:
Given I sign in as an admin
Scenario: On Admin Home
Given I visit admin page
Then the active main tab should be Home
And no other main tabs should be active
Scenario: On Admin Projects
Given I visit admin projects page
Then the active main tab should be Projects
And no other main tabs should be active
Scenario: On Admin Users
Given I visit admin users page
Then the active main tab should be Users
And no other main tabs should be active
Scenario: On Admin Logs
Given I visit admin logs page
Then the active main tab should be Logs
And no other main tabs should be active
Scenario: On Admin Hooks
Given I visit admin hooks page
Then the active main tab should be Hooks
And no other main tabs should be active
Scenario: On Admin Resque
Given I visit admin Resque page
Then the active main tab should be Resque
And no other main tabs should be active
Feature: Dashboard active tab
Background:
Given I sign in as a user
Scenario: On Dashboard Home
Given I visit dashboard page
Then the active main tab should be Home
And no other main tabs should be active
Scenario: On Dashboard Issues
Given I visit dashboard issues page
Then the active main tab should be Issues
And no other main tabs should be active
Scenario: On Dashboard Merge Requests
Given I visit dashboard merge requests page
Then the active main tab should be Merge Requests
And no other main tabs should be active
Scenario: On Dashboard Search
Given I visit dashboard search page
Then the active main tab should be Search
And no other main tabs should be active
Scenario: On Dashboard Help
Given I visit dashboard help page
Then the active main tab should be Help
And no other main tabs should be active
Feature: Profile active tab
Background:
Given I sign in as a user
Scenario: On Profile Home
Given I visit profile page
Then the active main tab should be Home
And no other main tabs should be active
Scenario: On Profile Account
Given I visit profile account page
Then the active main tab should be Account
And no other main tabs should be active
Scenario: On Profile SSH Keys
Given I visit profile SSH keys page
Then the active main tab should be SSH Keys
And no other main tabs should be active
Scenario: On Profile Design
Given I visit profile design page
Then the active main tab should be Design
And no other main tabs should be active
Scenario: On Profile History
Given I visit profile history page
Then the active main tab should be History
And no other main tabs should be active
Feature: Project active tab
Background:
Given I sign in as a user
And I own a project
# Main Tabs
Scenario: On Project Home
Given I visit my project's home page
Then the active main tab should be Home
And no other main tabs should be active
Scenario: On Project Files
Given I visit my project's files page
Then the active main tab should be Files
And no other main tabs should be active
Scenario: On Project Commits
Given I visit my project's commits page
Then the active main tab should be Commits
And no other main tabs should be active
Scenario: On Project Network
Given I visit my project's network page
Then the active main tab should be Network
And no other main tabs should be active
Scenario: On Project Issues
Given I visit my project's issues page
Then the active main tab should be Issues
And no other main tabs should be active
Scenario: On Project Merge Requests
Given I visit my project's merge requests page
Then the active main tab should be Merge Requests
And no other main tabs should be active
Scenario: On Project Wall
Given I visit my project's wall page
Then the active main tab should be Wall
And no other main tabs should be active
Scenario: On Project Wiki
Given I visit my project's wiki page
Then the active main tab should be Wiki
And no other main tabs should be active
# Sub Tabs: Home
Scenario: On Project Home/Show
Given I visit my project's home page
Then the active sub tab should be Show
And no other sub tabs should be active
And the active main tab should be Home
Scenario: On Project Home/Team
Given I visit my project's home page
And I click the "Team" tab
Then the active sub tab should be Team
And no other sub tabs should be active
And the active main tab should be Home
Scenario: On Project Home/Attachments
Given I visit my project's home page
And I click the "Attachments" tab
Then the active sub tab should be Attachments
And no other sub tabs should be active
And the active main tab should be Home
Scenario: On Project Home/Snippets
Given I visit my project's home page
And I click the "Snippets" tab
Then the active sub tab should be Snippets
And no other sub tabs should be active
And the active main tab should be Home
Scenario: On Project Home/Edit
Given I visit my project's home page
And I click the "Edit" tab
Then the active sub tab should be Edit
And no other sub tabs should be active
And the active main tab should be Home
Scenario: On Project Home/Hooks
Given I visit my project's home page
And I click the "Hooks" tab
Then the active sub tab should be Hooks
And no other sub tabs should be active
And the active main tab should be Home
Scenario: On Project Home/Deploy Keys
Given I visit my project's home page
And I click the "Deploy Keys" tab
Then the active sub tab should be Deploy Keys
And no other sub tabs should be active
And the active main tab should be Home
# Sub Tabs: Commits
Scenario: On Project Commits/Commits
Given I visit my project's commits page
Then the active sub tab should be Commits
And no other sub tabs should be active
And the active main tab should be Commits
Scenario: On Project Commits/Compare
Given I visit my project's commits page
And I click the "Compare" tab
Then the active sub tab should be Compare
And no other sub tabs should be active
And the active main tab should be Commits
Scenario: On Project Commits/Branches
Given I visit my project's commits page
And I click the "Branches" tab
Then the active sub tab should be Branches
And no other sub tabs should be active
And the active main tab should be Commits
Scenario: On Project Commits/Tags
Given I visit my project's commits page
And I click the "Tags" tab
Then the active sub tab should be Tags
And no other sub tabs should be active
And the active main tab should be Commits
# Sub Tabs: Issues
Scenario: On Project Issues/Browse
Given I visit my project's issues page
Then the active sub tab should be Browse Issues
And no other sub tabs should be active
And the active main tab should be Issues
Scenario: On Project Issues/Milestones
Given I visit my project's issues page
And I click the "Milestones" tab
Then the active sub tab should be Milestones
And no other sub tabs should be active
And the active main tab should be Issues
Scenario: On Project Issues/Labels
Given I visit my project's issues page
And I click the "Labels" tab
Then the active sub tab should be Labels
And no other sub tabs should be active
And the active main tab should be Issues
class AdminActiveTab < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedActiveTab
Then 'the active main tab should be Home' do
ensure_active_main_tab('Stats')
end
Then 'the active main tab should be Projects' do
ensure_active_main_tab('Projects')
end
Then 'the active main tab should be Users' do
ensure_active_main_tab('Users')
end
Then 'the active main tab should be Logs' do
ensure_active_main_tab('Logs')
end
Then 'the active main tab should be Hooks' do
ensure_active_main_tab('Hooks')
end
Then 'the active main tab should be Resque' do
ensure_active_main_tab('Resque')
end
end
class DashboardActiveTab < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedActiveTab
Then 'the active main tab should be Home' do
ensure_active_main_tab('Home')
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 Search' do
ensure_active_main_tab('Search')
end
Then 'the active main tab should be Help' do
ensure_active_main_tab('Help')
end
end
class ProfileActiveTab < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedActiveTab
Then 'the active main tab should be Home' do
ensure_active_main_tab('Profile')
end
Then 'the active main tab should be Account' do
ensure_active_main_tab('Account')
end
Then 'the active main tab should be SSH Keys' do
ensure_active_main_tab('SSH Keys')
end
Then 'the active main tab should be Design' do
ensure_active_main_tab('Design')
end
Then 'the active main tab should be History' do
ensure_active_main_tab('History')
end
end
class ProjectActiveTab < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedProject
include SharedActiveTab
# Main Tabs
Then 'the active main tab should be Home' do
ensure_active_main_tab(@project.name)
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
# Sub Tabs: Home
Given 'I click the "Team" tab' do
click_link('Team')
end
Given 'I click the "Attachments" tab' do
click_link('Attachments')
end
Given 'I click the "Snippets" tab' do
click_link('Snippets')
end
Given 'I click the "Edit" tab' do
click_link('Edit')
end
Given 'I click the "Hooks" tab' do
click_link('Hooks')
end
Given 'I click the "Deploy Keys" tab' do
click_link('Deploy Keys')
end
Then 'the active sub tab should be Show' do
ensure_active_sub_tab('Show')
end
Then 'the active sub tab should be Team' do
ensure_active_sub_tab('Team')
end
Then 'the active sub tab should be Attachments' do
ensure_active_sub_tab('Attachments')
end
Then 'the active sub tab should be Snippets' do
ensure_active_sub_tab('Snippets')
end
Then 'the active sub tab should be Edit' do
ensure_active_sub_tab('Edit')
end
Then 'the active sub tab should be Hooks' do
ensure_active_sub_tab('Hooks')
end
Then 'the active sub tab should be Deploy Keys' do
ensure_active_sub_tab('Deploy Keys')
end
# Sub Tabs: Commits
Given 'I click the "Compare" tab' do
click_link('Compare')
end
Given 'I click the "Branches" tab' do
click_link('Branches')
end
Given 'I click the "Tags" tab' do
click_link('Tags')
end
Then 'the active sub tab should be Commits' do
ensure_active_sub_tab('Commits')
end
Then 'the active sub tab should be Compare' do
ensure_active_sub_tab('Compare')
end
Then 'the active sub tab should be Branches' do
ensure_active_sub_tab('Branches')
end
Then 'the active sub tab should be Tags' do
ensure_active_sub_tab('Tags')
end
# Sub Tabs: Issues
Given 'I click the "Milestones" tab' do
click_link('Milestones')
end
Given 'I click the "Labels" tab' do
click_link('Labels')
end
Then 'the active sub tab should be Browse Issues' do
ensure_active_sub_tab('Browse Issues')
end
Then 'the active sub tab should be Milestones' do
ensure_active_sub_tab('Milestones')
end
Then 'the active sub tab should be Labels' do
ensure_active_sub_tab('Labels')
end
end
module SharedActiveTab
include Spinach::DSL
def ensure_active_main_tab(content)
page.find('ul.main_menu li.current').should have_content(content)
end
And 'no other main tabs should be active' do
page.should have_selector('ul.main_menu li.current', count: 1)
end
end
...@@ -7,4 +7,8 @@ module SharedAuthentication ...@@ -7,4 +7,8 @@ module SharedAuthentication
Given 'I sign in as a user' do Given 'I sign in as a user' do
login_as :user login_as :user
end end
Given 'I sign in as an admin' do
login_as :admin
end
end end
module SharedPaths module SharedPaths
include Spinach::DSL include Spinach::DSL
And 'I visit dashboard search page' do # ----------------------------------------
visit search_path # Dashboard
# ----------------------------------------
Given 'I visit dashboard page' do
visit dashboard_path
end
Given 'I visit dashboard issues page' do
visit dashboard_issues_path
end end
And 'I visit dashboard merge requests page' do Given 'I visit dashboard merge requests page' do
visit dashboard_merge_requests_path visit dashboard_merge_requests_path
end end
And 'I visit dashboard issues page' do Given 'I visit dashboard search page' do
visit dashboard_issues_path visit search_path
end end
When 'I visit dashboard page' do Given 'I visit dashboard help page' do
visit dashboard_path visit help_path
end end
# ----------------------------------------
# Profile
# ----------------------------------------
Given 'I visit profile page' do Given 'I visit profile page' do
visit profile_path visit profile_path
end end
...@@ -25,10 +37,50 @@ module SharedPaths ...@@ -25,10 +37,50 @@ module SharedPaths
visit profile_account_path visit profile_account_path
end end
Given 'I visit profile SSH keys page' do
visit keys_path
end
Given 'I visit profile design page' do
visit profile_design_path
end
Given 'I visit profile history page' do
visit profile_history_path
end
Given 'I visit profile token page' do Given 'I visit profile token page' do
visit profile_token_path visit profile_token_path
end end
# ----------------------------------------
# Admin
# ----------------------------------------
Given 'I visit admin page' do
visit admin_root_path
end
Given 'I visit admin projects page' do
visit admin_projects_path
end
Given 'I visit admin users page' do
visit admin_users_path
end
Given 'I visit admin logs page' do
visit admin_logs_path
end
Given 'I visit admin hooks page' do
visit admin_hooks_path
end
Given 'I visit admin Resque page' do
visit admin_resque_path
end
When 'I visit new project page' do When 'I visit new project page' do
visit new_project_path visit new_project_path
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment