Sha256: e04383611f7d6aa853a4c34a0f7aee2bc88ffb4a4d0a60b1c98e95b924bc5b06

Contents?: true

Size: 1.52 KB

Versions: 13

Compression:

Stored size: 1.52 KB

Contents

require 'spec_helper'

describe "MsUia::RadioButton", :if => SpecHelper.adapter == :ms_uia do

  it "#exist?" do
    RAutomation::Window.new(:title => "MainFormWindow").radio(:value => "Option 1").should exist

    RAutomation::Window.wait_timeout = 0.1
    expect {RAutomation::Window.new(:title => "non-existent-window").
            radio(:value => "Option 1")}.
            to raise_exception(RAutomation::UnknownWindowException)
  end

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


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

    radio.set
    radio.should be_set
  end

  it "enabled/disabled" do
    RAutomation::Window.new(:title => "MainFormWindow").radio(:value => "Option 1").should be_enabled
    RAutomation::Window.new(:title => "MainFormWindow").radio(:value => "Option 1").should_not be_disabled

    RAutomation::Window.new(:title => "MainFormWindow").radio(:value => "Option Disabled").should_not be_enabled
    RAutomation::Window.new(:title => "MainFormWindow").radio(:value => "Option Disabled").should be_disabled
  end

  it "cannot set a disabled radio button" do
    lambda { RAutomation::Window.new(:title => "MainFormWindow").radio(:value => "Option Disabled").set }.should raise_error
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rautomation-0.12.0 spec/adapter/ms_uia/radio_spec.rb
rautomation-0.11.0 spec/adapter/ms_uia/radio_spec.rb
rautomation-0.10.0 spec/adapter/ms_uia/radio_spec.rb
rautomation-0.9.4 spec/adapter/ms_uia/radio_spec.rb
rautomation-0.9.3 spec/adapter/ms_uia/radio_spec.rb
rautomation-0.9.2 spec/adapter/ms_uia/radio_spec.rb
rautomation-0.9.1 spec/adapter/ms_uia/radio_spec.rb
rautomation-0.9.0 spec/adapter/ms_uia/radio_spec.rb
rautomation-0.8.0 spec/adapter/ms_uia/radio_spec.rb
rautomation-0.7.3 spec/adapter/ms_uia/radio_spec.rb
rautomation-0.7.2 spec/adapter/ms_uia/radio_spec.rb
rautomation-0.7.1 spec/adapter/ms_uia/radio_spec.rb
rautomation-0.7.0 spec/adapter/ms_uia/radio_spec.rb