Sha256: 3a3afb49dcb1a565a8c7aacb7996b96936222bab07de19ade038f17fb010efcf

Contents?: true

Size: 996 Bytes

Versions: 3

Compression:

Stored size: 996 Bytes

Contents

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

describe "Areas" do

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

  bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
    describe "with selectors" do
      it "returns the matching elements" do
        browser.areas(:alt => "Tables").to_a.should == [browser.area(:alt => "Tables")]
      end
    end
  end
  
  describe "#length" do
    it "returns the number of areas" do
      browser.areas.length.should == 3
    end
  end

  describe "#[]" do
    it "returns the area at the given index" do
      browser.areas[0].id.should == "NCE"
    end
  end

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

      browser.areas.each_with_index do |a, index|
        a.id.should == browser.area(:index, index).id
        a.title.should == browser.area(:index, index).title

        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/areas_spec.rb
watir-webdriver-0.1.3 spec/watirspec/areas_spec.rb
watir-webdriver-0.1.2 spec/watirspec/areas_spec.rb