Sha256: b98c7acb6b4d22127527e0eb9fac799a168f0036ef412867f08cf73956431116

Contents?: true

Size: 695 Bytes

Versions: 12

Compression:

Stored size: 695 Bytes

Contents

# encoding: utf-8
require File.dirname(__FILE__) + '/spec_helper'

describe "Divs" do

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

  describe "#length" do
    it "returns the number of divs" do
      browser.divs.length.should == 10
    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
      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
      end
    end
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
watir-webdriver-0.0.6 spec/watirspec/divs_spec.rb
watir-webdriver-0.0.5 spec/watirspec/divs_spec.rb
watir-webdriver-0.0.4 spec/watirspec/divs_spec.rb
watir-webdriver-0.0.3 spec/watirspec/divs_spec.rb
watir-webdriver-0.0.2 spec/watirspec/divs_spec.rb
watir-webdriver-0.0.1 spec/watirspec/divs_spec.rb
watir-webdriver-0.0.1.dev7 spec/watirspec/divs_spec.rb
watir-webdriver-0.0.1.dev5 spec/watirspec/divs_spec.rb
watir-webdriver-0.0.1.dev4 spec/watirspec/divs_spec.rb
watir-webdriver-0.0.1.dev3 spec/watirspec/divs_spec.rb
watir-webdriver-0.0.1.dev2 spec/watirspec/divs_spec.rb
watir-webdriver-0.0.1.dev spec/watirspec/divs_spec.rb