Sha256: 36bc356c93836bc988c67214bc6b77710f23e856bdf02ad1aad6a1cd38eeb9a0

Contents?: true

Size: 1.6 KB

Versions: 26

Compression:

Stored size: 1.6 KB

Contents

module NotebookSwtHelper
  def notebook_sash
    active_shell.children.to_a.last.children.to_a[0]
  end
  
  def ctab_folders
    notebook_sash.children.to_a.select do |c| 
      c.class == Java::OrgEclipseSwtCustom::CTabFolder
    end
  end
end

World(NotebookSwtHelper)

When /^I make a new notebook$/ do
  Redcar::Top::NewNotebookCommand.new.run
end

When /^I move the tab to the other notebook$/ do
  Redcar::Top::MoveTabToOtherNotebookCommand.new.run
end

When /^I close the current notebook$/ do
  Redcar::Top::CloseNotebookCommand.new.run
end

When /^I switch notebooks$/ do
  Redcar::Top::SwitchNotebookCommand.new.run
end

When /^I focus on the edit_view in the tab in notebook (\d)$/ do |index|
  index = index.to_i - 1
  notebook = Redcar.app.windows.first.notebooks[index]
  edit_view = notebook.focussed_tab.edit_view
  edit_view.controller.swt_focus_gained
end

Then /^there should be (one|two) notebooks?$/ do |count_str|
  count = count_str == "one" ? 1 : 2
  # in the model
  Redcar.app.windows.first.notebooks.length.should == count
  
  # in the GUI
  ctab_folders.length.should == count
end


Then /^notebook (\d) should have (\d) tabs?$/ do |index, tab_count|
  index = index.to_i - 1
  # in the model
  Redcar.app.windows.first.notebooks[index].tabs.length.should == tab_count.to_i
  
  # in the GUI
  ctab_folders[index].children.to_a.length.should == tab_count.to_i
end

Then /^the tab in notebook (\d) should contain "([^\"]*)"$/ do |index, str|
  index = index.to_i - 1
  # in the model
  tab = Redcar.app.windows.first.notebooks[index].focussed_tab
  tab.edit_view.document.to_s.include?(str).should be_true
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
redcar-0.7 plugins/edit_view/features/step_definitions/notebook_steps.rb
redcar-0.6.1 plugins/edit_view/features/step_definitions/notebook_steps.rb
redcar-0.6 plugins/edit_view/features/step_definitions/notebook_steps.rb
redcar-0.6.1dev plugins/edit_view/features/step_definitions/notebook_steps.rb
redcar-0.5.1 plugins/edit_view/features/step_definitions/notebook_steps.rb
redcar-0.5 plugins/edit_view/features/step_definitions/notebook_steps.rb
redcar-0.5.6dev plugins/edit_view/features/step_definitions/notebook_steps.rb
redcar-0.5.5dev plugins/edit_view/features/step_definitions/notebook_steps.rb
redcar-0.5.4dev plugins/edit_view/features/step_definitions/notebook_steps.rb
redcar-0.5.3dev plugins/edit_view/features/step_definitions/notebook_steps.rb
redcar-0.5.2dev plugins/edit_view/features/step_definitions/notebook_steps.rb
redcar-0.5.1dev plugins/edit_view/features/step_definitions/notebook_steps.rb
redcar-0.4.1 plugins/edit_view/features/step_definitions/notebook_steps.rb
redcar-0.4 plugins/edit_view/features/step_definitions/notebook_steps.rb
redcar-0.3.10.1dev plugins/edit_view/features/step_definitions/notebook_steps.rb
redcar-0.3.10.0dev plugins/edit_view/features/step_definitions/notebook_steps.rb
redcar-0.3.9 plugins/edit_view/features/step_definitions/notebook_steps.rb
redcar-0.3.9.0dev plugins/edit_view/features/step_definitions/notebook_steps.rb
redcar-0.3.8.4 plugins/edit_view/features/step_definitions/notebook_steps.rb
redcar-0.3.8.3 plugins/edit_view/features/step_definitions/notebook_steps.rb