Sha256: 32d7c5d985c92986ea5007573e3d1a98c64f83c0d54660373f1a241bcc4b98f4

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 KB

Contents

# encoding: utf-8
require File.expand_path('spec_helper', File.dirname(__FILE__))

describe "Divs" 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.divs(:id => "header").to_a.should == [browser.div(:id => "header")]
      end
    end
  end
  
  describe "#length" do
    it "returns the number of divs" do
      browser.divs.length.should == 12
    end
  end

  describe "#[]" do
    it "returns the div at the given index" do
      browser.divs[1].id.should == "outer_container"
    end
  end

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

      browser.divs.each_with_index do |d, index|
        d.id.should == browser.div(:index, index).id
        d.class_name.should == browser.div(:index, index).class_name

        count += 1
      end

      count.should > 0
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
watir-webdriver-0.1.1 spec/watirspec/divs_spec.rb
watir-webdriver-0.1.0 spec/watirspec/divs_spec.rb