Sha256: 4cdfec79b063337a9bc1de3ce7fab5e5790437dd90add565c974a4fafa477ba8

Contents?: true

Size: 1 KB

Versions: 3

Compression:

Stored size: 1 KB

Contents

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

describe "Dts" 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.dts(:class => "current-industry").to_a.should == [browser.dt(:class => "current-industry")]
      end
    end
  end
  
  describe "#length" do
    it "returns the number of dts" do
      browser.dts.length.should == 11
    end
  end

  describe "#[]" do
    it "returns the dt at the given index" do
      browser.dts[0].id.should == "experience"
    end
  end

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

      browser.dts.each_with_index do |d, index|
        d.id.should == browser.dt(:index, index).id
        d.class_name.should == browser.dt(:index, index).class_name

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