Sha256: b88e66d45b308a87bd759bdcfca0bad22236977dbbbb8852f8b1dee03e04fd53

Contents?: true

Size: 1.18 KB

Versions: 4

Compression:

Stored size: 1.18 KB

Contents

require 'spec_helper'

describe "WinFfi::Table", :if => SpecHelper.adapter == :win_ffi do
  before :each do
    window = RAutomation::Window.new(:title => "MainFormWindow")
    window.button(:value => "Data Entry Form").click { RAutomation::Window.new(:title => "DataEntryForm").exists? }
  end

  it "#table" do
    table = RAutomation::Window.new(:title => "DataEntryForm").table(:id => "personListView")
    table.should exist
    
    RAutomation::Window.wait_timeout = 0.1
    expect {RAutomation::Window.new(:title => "non-existent-window").
            table(:class => /SysListView32/i)}.
            to raise_exception(RAutomation::UnknownWindowException)
  end

  it "#strings" do
    table = RAutomation::Window.new(:title => "DataEntryForm").table(:id => "personListView")

    table.strings.should == [
        ["Name", "Date of birth", "State"],
        ["John Doe", "12/15/1967", "FL"],
        ["Anna Doe", "3/4/1975", ""]
    ]
  end

  it "#select" do
    table = RAutomation::Window.new(:title => "DataEntryForm").table(:id => "personListView")

    table.selected?(2).should == false

    table.select(2)
    table.selected?(2).should == true
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rautomation-0.6.3 spec/adapter/win_ffi/table_spec.rb
rautomation-0.6.2 spec/adapter/win_ffi/table_spec.rb
rautomation-0.6.1 spec/adapter/win_ffi/table_spec.rb
rautomation-0.6.0 spec/adapter/win_ffi/table_spec.rb