Sha256: 4ad8ec4b848914ee832e2ecf580cf5178a2174bc26510fff306a8b75648184be

Contents?: true

Size: 1.66 KB

Versions: 4

Compression:

Stored size: 1.66 KB

Contents

require 'spec_helper'

describe "WinFfi::Checkbox", :if => SpecHelper.adapter == :win_ffi do
  it "#checkbox" do
    RAutomation::Window.new(:title => "MainFormWindow").checkbox(:value => "checkBox").should exist

    RAutomation::Window.wait_timeout = 0.1
    expect {RAutomation::Window.new(:title => "non-existing-window").checkbox(:value => "Something")}.
      to raise_exception(RAutomation::UnknownWindowException)
  end

  it "check for checkbox class" do
    RAutomation::Window.new(:title => "MainFormWindow").checkbox(:id => "textField").should_not exist
  end


  it "#set? & #set" do
    checkbox = RAutomation::Window.new(:title => "MainFormWindow").checkbox(:value => "checkBox")
    checkbox.should_not be_set

    checkbox.set
    checkbox.should be_set
  end

  it "#clear" do
    checkbox = RAutomation::Window.new(:title => "MainFormWindow").checkbox(:value => "checkBox")
    checkbox.set
    checkbox.should be_set

    checkbox.clear
    checkbox.should_not be_set
  end

  it "enabled/disabled" do
    RAutomation::Window.new(:title => "MainFormWindow").checkbox(:id => "checkBox").should be_enabled
    RAutomation::Window.new(:title => "MainFormWindow").checkbox(:id => "checkBox").should_not be_disabled

    RAutomation::Window.new(:title => "MainFormWindow").checkbox(:id => "checkBoxDisabled").should_not be_enabled
    RAutomation::Window.new(:title => "MainFormWindow").checkbox(:id => "checkBoxDisabled").should be_disabled
  end

  it "cannot check a disabled checkbox" do
    lambda {
      RAutomation::Window.new(:title => "MainFormWindow").checkbox(:id => "checkBoxDisabled").set
    }.should raise_error
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

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