Sha256: 356456828b39a23d1aea11593542b08a8cfebea6691fb3e40e1efe438a41d8ce

Contents?: true

Size: 739 Bytes

Versions: 37

Compression:

Stored size: 739 Bytes

Contents

# encoding: utf-8
module Watir
  class Radio < Input
    #
    # Select this radio button.
    #

    def set
      assert_exists
      assert_enabled

      @element.click unless set?
    end

    #
    # Is this radio set?
    #

    def set?
      assert_exists
      @element.selected?
    end
  end # Radio

  module Container
    def radio(*args)
      Radio.new(self, extract_selector(args).merge(:tag_name => "input", :type => "radio"))
    end

    def radios(*args)
      RadioCollection.new(self, extract_selector(args).merge(:tag_name => "input", :type => "radio" ))
    end
  end # Container

  class RadioCollection < InputCollection
    private

    def element_class
      Radio
    end
  end # RadioCollection
end # Watir

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
watir-webdriver-0.6.1 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.6.0 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.5.8 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.5.7 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.5.6 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.5.5 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.5.4 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.5.3 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.5.2 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.5.1 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.5.0 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.4.1 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.4.0 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.3.9 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.3.8 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.3.7 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.3.6 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.3.5 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.3.4 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.3.3 lib/watir-webdriver/elements/radio.rb