2008-11-24 19:15:28 +00:00
|
|
|
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
|
|
|
|
|
|
|
|
|
|
|
describe "field_by_xpath" do
|
|
|
|
it "should work" do
|
|
|
|
with_html <<-HTML
|
|
|
|
<html>
|
|
|
|
<form>
|
|
|
|
<label for="element_42">The Label</label>
|
|
|
|
<input type="text" id="element_42">
|
|
|
|
</form>
|
|
|
|
</html>
|
|
|
|
HTML
|
|
|
|
|
2008-11-28 05:55:45 +00:00
|
|
|
field = field_by_xpath(".//input")
|
|
|
|
field.should_not be_nil
|
|
|
|
field.id.should == "element_42"
|
2008-11-24 19:15:28 +00:00
|
|
|
end
|
|
|
|
end
|