Sha256: bf15ce128cd332930d4da8c51449a4f216618bba7fa47e2e5597b3843544e97a

Contents?: true

Size: 1.12 KB

Versions: 36

Compression:

Stored size: 1.12 KB

Contents

require File.expand_path('watirspec/spec_helper', File.dirname(__FILE__))

describe Watir::Input do

  before do
    browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
  end

  describe "#to_subtype" do
    it "returns a CheckBox instance" do
      e = browser.input(:xpath => "//input[@type='checkbox']").to_subtype
      e.should be_kind_of(Watir::CheckBox)
    end

    it "returns a Radio instance" do
      e = browser.input(:xpath => "//input[@type='radio']").to_subtype
      e.should be_kind_of(Watir::Radio)
    end

    it "returns a Button instance" do
      es = [
        browser.input(:xpath => "//input[@type='button']").to_subtype,
        browser.input(:xpath => "//input[@type='submit']").to_subtype
      ]

      es.all? { |e| e.should be_kind_of(Watir::Button) }
    end

    it "returns a TextField instance" do
      e = browser.input(:xpath => "//input[@type='text']").to_subtype
      e.should be_kind_of(Watir::TextField)
    end

    it "returns a TextField instance" do
      e = browser.input(:xpath => "//input[@type='file']").to_subtype
      e.should be_kind_of(Watir::FileField)
    end
  end
end

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
watir-webdriver-0.5.0 spec/input_spec.rb
watir-webdriver-0.4.1 spec/input_spec.rb
watir-webdriver-0.4.0 spec/input_spec.rb
watir-webdriver-0.3.9 spec/input_spec.rb
watir-webdriver-0.3.8 spec/input_spec.rb
watir-webdriver-0.3.7 spec/input_spec.rb
watir-webdriver-0.3.6 spec/input_spec.rb
watir-webdriver-0.3.5 spec/input_spec.rb
watir-webdriver-0.3.4 spec/input_spec.rb
watir-webdriver-0.3.3 spec/input_spec.rb
watir-webdriver-0.3.2 spec/input_spec.rb
watir-webdriver-0.3.1 spec/input_spec.rb
watir-webdriver-0.3.0 spec/input_spec.rb
watir-webdriver-0.2.9 spec/input_spec.rb
watir-webdriver-0.2.8 spec/input_spec.rb
watir-webdriver-0.2.7 spec/input_spec.rb
watir-webdriver-0.2.6 spec/input_spec.rb
watir-webdriver-0.2.5 spec/input_spec.rb
watir-webdriver-0.2.4 spec/input_spec.rb
watir-webdriver-0.2.3 spec/input_spec.rb