Sha256: dbfe19097bd03d2d267391e99c3067c69f3759735866311ed7f65f46fbb763f5

Contents?: true

Size: 911 Bytes

Versions: 3

Compression:

Stored size: 911 Bytes

Contents

When /^I close tab for page "([^"]*)"$/ do |path|
  tab_id = Capybara.current_session.evaluate_script <<-JS
    Rwiki.tabPanel.findTabByPagePath('#{path}').tabEl.id;
  JS

  close_button = find("li##{tab_id} a.x-tab-strip-close")
  # TODO try fix this workaround see http://groups.google.com/group/ruby-capybara/browse_thread/thread/985b123dc98d27b5
  close_button.click rescue nil
end

When /^I click tab for page "([^"]*)"$/ do |path|
  tab_id = Capybara.current_session.evaluate_script <<-JS
    Rwiki.tabPanel.findTabByPagePath('#{path}').tabEl.id;
  JS

  tab = find("li##{tab_id}")
  tab.click
end

Then /^I should have the following open tabs:$/ do |table|
  actual_table = table(tableish("div.x-tab-panel ul li[@class!='x-tab-edge']", "a.x-tab-right"))
  table.diff!(actual_table)
end

Then /^I should have no open tabs$/ do
  page.all("div.x-tab-panel ul li[class!='x-tab-edge']").size.should == 0
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rwiki-0.2.3 features/step_definitions/tab_panel_steps.rb
rwiki-0.2.2 features/step_definitions/tab_panel_steps.rb
rwiki-0.2.1 features/step_definitions/tab_panel_steps.rb