Sha256: ffa1826e217e130d95b11c0219814e68b595ba79f3ae040525183aa83d4f3215

Contents?: true

Size: 1005 Bytes

Versions: 3

Compression:

Stored size: 1005 Bytes

Contents

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

describe "Uls" 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.uls(:class => "navigation").to_a.should == [browser.ul(:class => "navigation")]
      end
    end
  end
  
  describe "#length" do
    it "returns the number of uls" do
      browser.uls.length.should == 2
    end
  end

  describe "#[]" do
    it "returns the ul at the given index" do
      browser.uls[0].id.should == "navbar"
    end
  end

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

      browser.uls.each_with_index do |ul, index|
        ul.id.should == browser.ul(:index, index).id
        ul.value.should == browser.ul(:index, index).value

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