Sha256: 36f677e8c716c9e5f1f58fd05c4f22f7e5c0256d84fd9c47dbd493b29d9b3897

Contents?: true

Size: 1.17 KB

Versions: 2

Compression:

Stored size: 1.17 KB

Contents

require File.dirname(__FILE__) + '/spec_helper'

describe 'setting and getting values for individual checkboxes with value attributes in face definitions' do

  # in watir you have to access each checkbox, we now have checkbox_group for this
  # in Watirloo you can access CheckboxGroup as shortcut using
  # :pets => [:checkbox_group, 'pets']
  include Watirloo::Page
  face(:pets_cat) { checkbox(:name, 'pets', 'cat') }
  face(:pets_dog) { checkbox(:name, 'pets', 'dog') }
  face(:pets_zook) { checkbox(:name, 'pets', 'zook') }
  face(:pets_zebra) { checkbox(:name, 'pets', 'zebra') }
  face(:pets_wumpa) { checkbox(:name, 'pets', 'wumpa') }
  
  before do
    browser.goto testfile('checkbox_group1.html')
  end
  
  it 'semantic name accesses individual CheckBox' do
    if browser.kind_of?(FireWatir::Firefox)
      pets_cat.should be_kind_of(FireWatir::CheckBox)
      
    elsif browser.kind_of?(Watir::IE)
      pets_cat.should be_kind_of(Watir::CheckBox)
    end
  end
  
  it 'set individual checkbox does not set other checkboxes sharing the same name' do
    pets_dog.should_not be_checked
    pets_dog.set true
    pets_dog.should be_checked
    pets_cat.should_not be_checked
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
watirloo-0.0.8 spec/checkboxes_value_spec.rb
watirloo-0.0.7 spec/checkboxes_value_spec.rb