Sha256: f3f2dda652c5fbd4b18e2d86387132dd8b9b7416182c1a542e836f595d90ad53

Contents?: true

Size: 1011 Bytes

Versions: 2

Compression:

Stored size: 1011 Bytes

Contents

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

describe "Dels" 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.dels(:class => "lead").to_a.should == [browser.del(:class => "lead")]
      end
    end
  end
  
  describe "#length" do
    it "returns the number of dels" do
      browser.dels.length.should == 5
    end
  end

  describe "#[]" do
    it "returns the del at the given index" do
      browser.dels[0].id.should == "lead"
    end
  end

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

      browser.dels.each_with_index do |s, index|
        s.id.should == browser.del(:index, index).id
        s.value.should == browser.del(:index, index).value

        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/dels_spec.rb
watir-webdriver-0.1.0 spec/watirspec/dels_spec.rb