Sha256: ab4d858aa9cbba1a84cff4413a80fcbca7e8e7801910ac6f14920f1002e82c4f

Contents?: true

Size: 1000 Bytes

Versions: 3

Compression:

Stored size: 1000 Bytes

Contents

# encoding: utf-8
require File.expand_path("../spec_helper", __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

3 entries across 3 versions & 1 rubygems

Version Path
watir-webdriver-0.1.4 spec/watirspec/dels_spec.rb
watir-webdriver-0.1.3 spec/watirspec/dels_spec.rb
watir-webdriver-0.1.2 spec/watirspec/dels_spec.rb