Sha256: 581cc31d1852ad4b4b7ed9a84aa610668c5d6b26c0e8001c5d64ff30454dde6a

Contents?: true

Size: 1.06 KB

Versions: 2

Compression:

Stored size: 1.06 KB

Contents

# encoding: utf-8
require File.expand_path('spec_helper', File.dirname(__FILE__))

describe "Dls" do

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

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

  describe "#[]" do
    it "returns the dl at the given index" do
      browser.dls[0].id.should == "experience-list"
    end
  end

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

      browser.dls.each_with_index do |d, index|
        d.text.should == browser.dl(:index, index).text
        d.id.should == browser.dl(:index, index).id
        d.class_name.should == browser.dl(:index, index).class_name

        count += 1
      end

      count.should > 0
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
watir-webdriver-0.1.1 spec/watirspec/dls_spec.rb
watir-webdriver-0.1.0 spec/watirspec/dls_spec.rb