Sha256: 7259b5ef489867e56d5d83b44a62e53bad573b39c37474b5471305ab851ad56c

Contents?: true

Size: 902 Bytes

Versions: 25

Compression:

Stored size: 902 Bytes

Contents

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

describe "Tables" do

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

  describe "#length" do
    it "returns the number of tables" do
      browser.tables.length.should == 4
    end
  end

  describe "#[]" do
    it "returns the p at the given index" do
      browser.tables[1].id.should == "axis_example"
      browser.tables[2].id.should == "outer"
      browser.tables[3].id.should == "inner"
    end
  end

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

      browser.tables.each_with_index do |t, index|
        t.name.should == browser.table(:index, index+1).name
        t.id.should == browser.table(:index, index+1).id
        t.value.should == browser.table(:index, index+1).value

        count += 1
      end

      count.should > 0
    end
  end

end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
operawatir-0.7.pre4-jruby spec/watir2/tables_spec.rb
operawatir-0.7.pre3-jruby spec/watir2/tables_spec.rb
operawatir-0.7.pre2-jruby spec/watir2/tables_spec.rb
operawatir-0.7.pre1-jruby spec/watir2/tables_spec.rb
operawatir-0.6.pre1-jruby spec/watir2/tables_spec.rb
operawatir-0.5.1-jruby spec/watir2/tables_spec.rb
operawatir-0.5-jruby spec/watir2/tables_spec.rb
operawatir-0.5.pre3-jruby spec/watir2/tables_spec.rb
operawatir-0.5.pre2-jruby spec/watir2/tables_spec.rb
operawatir-0.5.pre1-jruby spec/watir2/tables_spec.rb
operawatir-0.4.3.pre1-jruby spec/watir2/tables_spec.rb
operawatir-0.4.2-jruby spec/watir2/tables_spec.rb
operawatir-0.4.1-jruby spec/watir2/tables_spec.rb
operawatir-0.4.1.pre7-jruby spec/watir2/tables_spec.rb
operawatir-0.4.1.pre6-jruby spec/watir2/tables_spec.rb
operawatir-0.4.1.pre5-jruby spec/watir2/tables_spec.rb
operawatir-0.4.1.pre4-jruby spec/watir2/tables_spec.rb
operawatir-0.4.1.pre3-jruby spec/watir2/tables_spec.rb
operawatir-0.4.1.pre2-jruby spec/watir2/tables_spec.rb
operawatir-0.4.1.pre1-jruby spec/watir2/tables_spec.rb