Sha256: 30b1b7cc068d9b884c1c5c32c801f2757115b265cfbedec369dcb1d86e9baaf8

Contents?: true

Size: 824 Bytes

Versions: 25

Compression:

Stored size: 824 Bytes

Contents

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

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 == 12
    end
  end

  describe "#[]" do
    it "returns the div at the given index" do
      browser.divs[2].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.name.should == browser.div(:index, index+1).name
        d.id.should == browser.div(:index, index+1).id
        d.class_name.should == browser.div(:index, index+1).class_name

        count += 1
      end

      count.should > 0
    end
  end

end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
operawatir-0.4-jruby spec/legacy_watirspec/divs_spec.rb
operawatir-0.3.7.pre2-jruby spec/legacy_watirspec/divs_spec.rb
operawatir-0.3.7.pre1-jruby spec/legacy_watirspec/divs_spec.rb
operawatir-0.3.2-jruby spec/legacy_watirspec/divs_spec.rb
operawatir-0.3-jruby spec/legacy_watirspec/divs_spec.rb