Sha256: d7a3e5fd24c9055f6be15f30efb3f06ff5d9f6aa93ad84568a56e5a8dcaa3b92

Contents?: true

Size: 1012 Bytes

Versions: 3

Compression:

Stored size: 1012 Bytes

Contents

# encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)

describe "Spans" do

  before :each do
    browser.goto(WatirSpec.files + "/non_control_elements.html")
  end

  bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
    describe "with selectors" do
      it "returns the matching elements" do
        browser.spans(:class => "footer").to_a.should == [browser.span(:class => "footer")]
      end
    end
  end
  
  describe "#length" do
    it "returns the number of spans" do
      browser.spans.length.should == 6
    end
  end

  describe "#[]" do
    it "returns the p at the given index" do
      browser.spans[0].id.should == "lead"
    end
  end

  describe "#each" do
    it "iterates through spans correctly" do
      count = 0

      browser.spans.each_with_index do |s, index|
        s.id.should == browser.span(:index, index).id
        s.value.should == browser.span(:index, index).value

        count += 1
      end

      count.should > 0
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
watir-webdriver-0.1.4 spec/watirspec/spans_spec.rb
watir-webdriver-0.1.3 spec/watirspec/spans_spec.rb
watir-webdriver-0.1.2 spec/watirspec/spans_spec.rb