Sha256: 4874e71e5701c9d199fdda15f122802d7905257c05277f90194a9c8c043466b8

Contents?: true

Size: 1.17 KB

Versions: 169

Compression:

Stored size: 1.17 KB

Contents

module TabHelpers

  def use_tab_file(i)
    eval i
  end

  def visible_tabs
    page.all('.tabs li', :visible => true).map(&:text)
  end

  def visible_subtabs
    page.all('.subtabs li', :visible => true).map(&:text)
  end

  def disabled_tabs
    page.all('.tabs li.disabled', :visible => true).map(&:text)
  end

  def disabled_subtabs
    page.all('.subtabs li.disabled', :visible => true).map(&:text)
  end

  def enabled_tabs
    page.all('.tabs li:not(.disabled)', :visible => true).map(&:text)
  end

  def enabled_subtabs
    page.all('.subtabs li:not(.disabled)', :visible => true).map(&:text)
  end

  def active_tab
    active_tabs = page.all('.tabs li.active', :visible => true)
    raise "more than one active tab" if active_tabs.count > 1
    active_tabs.first.text
  end

  def active_subtab
    active_subtabs = page.all('.subtabs li.active', :visible => true)
    raise "more than one active subtab" if active_subtabs.count > 1
    active_subtabs.first.text
  end

  def subtabs_should_be_present
    page.all('.subtabs', :visible => false).should_not be_empty
  end

  def subtabs_should_not_be_present
    page.all('.subtabs', :visible => false).should be_empty
  end

end

Version data entries

169 entries across 6 versions & 1 rubygems

Version Path
tabulous-2.1.3 spec/applications/custom_renderer/rails_3-0-20/spec/support/tab_helpers.rb
tabulous-2.1.3 spec/applications/bootstrap/rails_4-1-1/spec/support/tab_helpers.rb
tabulous-2.1.3 spec/applications/custom_renderer/rails_4-2-0/spec/support/tab_helpers.rb
tabulous-2.1.3 spec/applications/subtabs/rails_4-1-1/spec/support/tab_helpers.rb
tabulous-2.1.3 spec/applications/subtabs/rails_4-0-5/spec/support/tab_helpers.rb
tabulous-2.1.3 spec/applications/custom_renderer/rails_3-2-13/spec/support/tab_helpers.rb
tabulous-2.1.3 spec/applications/subtabs/rails_4-2-0/spec/support/tab_helpers.rb
tabulous-2.1.3 spec/applications/subtabs/rails_3-1-12/spec/support/tab_helpers.rb
tabulous-2.1.3 spec/applications/bootstrap/rails_3-2-13/spec/support/tab_helpers.rb
tabulous-2.1.3 spec/applications/subtabs/rails_3-2-13/spec/support/tab_helpers.rb
tabulous-2.1.3 spec/applications/universal/spec/support/tab_helpers.rb
tabulous-2.1.3 spec/applications/simple_tabs/rails_4-1-1/spec/support/tab_helpers.rb
tabulous-2.1.3 spec/applications/simple_tabs/rails_4-0-5/spec/support/tab_helpers.rb
tabulous-2.1.3 spec/applications/main/rails_4-1-1/spec/support/tab_helpers.rb
tabulous-2.1.3 spec/applications/simple_tabs/rails_4-2-0/spec/support/tab_helpers.rb
tabulous-2.1.3 spec/applications/main/rails_3-0-20/spec/support/tab_helpers.rb
tabulous-2.1.3 spec/applications/bootstrap/rails_4-0-5/spec/support/tab_helpers.rb
tabulous-2.1.3 spec/applications/multiple_tabsets/rails_3-2-13/spec/support/tab_helpers.rb
tabulous-2.1.3 spec/applications/simple_tabs/rails_3-2-13/spec/support/tab_helpers.rb
tabulous-2.1.3 spec/applications/subtabs/rails_3-0-20/spec/support/tab_helpers.rb