Sha256: 815cc04c27f01895d025eb5a96bba501ef87afcf5769a4b8bd806777fc935ac7
Contents?: true
Size: 1.21 KB
Versions: 3
Compression:
Stored size: 1.21 KB
Contents
# encoding: utf-8 require "#{File.dirname(__FILE__)}/spec_helper" # describe Watir::XPathBuilder do # def build(selector) # XPathBuilder.build_from(selector) # end # # it "builds an xpath from a tag name and a single attribute" do # build( # :tag_name => "div", # :id => "foo" # ).should == '//div[@id="foo"]' # end # # it "builds an xpath from a tag name and multiple attributes" do # build( # :tag_name => "input", # :type => "radio", # :value => '1' # ).should == '//input[@type="radio" and @value="1"]' # end # # it "builds an xpath from a tag name, an attribute and an index" do # build( # :tag_name => "input", # :type => "text", # :index => 2 # ).should == '//input[@type="text"][3]' # end # # it "builds an xpath from a single attribute" do # build( # :class => 'foo' # ).should == '//*[@class="foo"]' # end # # it "builds an xpath from a tag name and index" do # build( # :tag_name => 'span', # :index => 3 # ).should == '//span[4]' # end # # it "returns nil if any the selector contains a regexp" do # build(:tag_name => /span|div/).should be_nil # end # end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
watir-webdriver-0.0.1.dev3 | spec/xpath_builder_spec.rb |
watir-webdriver-0.0.1.dev2 | spec/xpath_builder_spec.rb |
watir-webdriver-0.0.1.dev | spec/xpath_builder_spec.rb |