Sha256: 6eed1b5fde4cdf6236502931744206f5f432059a8ef702f99c6c510b8801bfba

Contents?: true

Size: 1.08 KB

Versions: 21

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

describe "Win32::Button", :if => SpecHelper.adapter == :win_32 do
  it "enabled/disabled" do
    window = RAutomation::Window.new(:title => SpecHelper::DATA[:window1_title])
    window.button(:value => "Enabled").should be_enabled
    window.button(:value => "Enabled").should_not be_disabled

    window.button(:value => "Disabled").should be_disabled
    window.button(:value => "Disabled").should_not be_enabled
  end

  it "#focus" do
    button = RAutomation::Window.new(:title => SpecHelper::DATA[:window1_title]).button(:value => "Enabled")
    button.should_not be_focused
    button.focus
    button.should be_focused
  end

  it "cannot click disabled button" do
    window = RAutomation::Window.new(:title => SpecHelper::DATA[:window1_title])
    lambda { window.button(:value => "Disabled").click }.should raise_error
  end

  it "cannot set focus to disabled button" do
    window = RAutomation::Window.new(:title => SpecHelper::DATA[:window1_title])
    lambda { window.button(:value => "Disabled").focus }.should raise_error
  end

end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rautomation-1.1.0 spec/adapter/win_32/button_spec.rb
rautomation-1.0.0 spec/adapter/win_32/button_spec.rb
rautomation-0.17.0 spec/adapter/win_32/button_spec.rb
rautomation-0.16.0 spec/adapter/win_32/button_spec.rb
rautomation-0.15.0 spec/adapter/win_32/button_spec.rb
rautomation-0.14.1 spec/adapter/win_32/button_spec.rb
rautomation-0.14.0 spec/adapter/win_32/button_spec.rb
rautomation-0.13.0 spec/adapter/win_32/button_spec.rb
rautomation-0.12.0 spec/adapter/win_32/button_spec.rb
rautomation-0.11.0 spec/adapter/win_32/button_spec.rb
rautomation-0.10.0 spec/adapter/win_32/button_spec.rb
rautomation-0.9.4 spec/adapter/win_32/button_spec.rb
rautomation-0.9.3 spec/adapter/win_32/button_spec.rb
rautomation-0.9.2 spec/adapter/win_32/button_spec.rb
rautomation-0.9.1 spec/adapter/win_32/button_spec.rb
rautomation-0.9.0 spec/adapter/win_32/button_spec.rb
rautomation-0.8.0 spec/adapter/win_32/button_spec.rb
rautomation-0.7.3 spec/adapter/win_32/button_spec.rb
rautomation-0.7.2 spec/adapter/win_32/button_spec.rb
rautomation-0.7.1 spec/adapter/win_32/button_spec.rb