active_tab.rb 2.9 KB
Newer Older
1 2 3 4 5 6 7 8 9
class ProjectActiveTab < Spinach::FeatureSteps
  include SharedAuthentication
  include SharedPaths
  include SharedProject
  include SharedActiveTab

  # Main Tabs

  Then 'the active main tab should be Home' do
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
10
    ensure_active_main_tab('Project')
11 12
  end

13 14 15 16
  Then 'the active main tab should be Settings' do
    ensure_active_main_tab('Settings')
  end

17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
  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
48
    click_link('Members')
49 50 51 52 53 54 55 56 57 58 59
  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
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
60 61 62
    within '.project-settings-nav' do
      click_link('Project')
    end
63 64 65
  end

  Given 'I click the "Hooks" tab' do
66
    click_link('Web Hooks')
67 68 69 70 71 72
  end

  Given 'I click the "Deploy Keys" tab' do
    click_link('Deploy Keys')
  end

73 74
  Then 'the active sub nav should be Team' do
    ensure_active_sub_nav('Members')
75 76
  end

77
  Then 'the active sub nav should be Edit' do
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
78
    ensure_active_sub_nav('Project')
79 80
  end

81 82
  Then 'the active sub nav should be Hooks' do
    ensure_active_sub_nav('Web Hooks')
83 84
  end

85 86
  Then 'the active sub nav should be Deploy Keys' do
    ensure_active_sub_nav('Deploy Keys')
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
  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