Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

40 lines (31 sloc) 1.144 kB
require File.expand_path('watirspec/spec_helper', File.dirname(__FILE__))
describe Watir::Input do
before do
browser.goto WatirSpec.url_for("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
Jump to Line
Something went wrong with that request. Please try again.