Sha256: f536271c318d116cde42996d77f24fe9adcbdfb6d834cc981838095ba8b82e0b

Contents?: true

Size: 748 Bytes

Versions: 2

Compression:

Stored size: 748 Bytes

Contents

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

describe "Lis" do

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

  describe "#length" do
    it "returns the number of lis" do
      browser.lis.length.should == 18
    end
  end

  describe "#[]" do
    it "returns the li at the given index" do
      browser.lis[4].id.should == "non_link_1"
    end
  end

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

      browser.lis.each_with_index do |l, index|
        l.id.should == browser.li(:index, index).id
        l.value.should == browser.li(: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.0.9 spec/watirspec/lis_spec.rb
watir-webdriver-0.0.8 spec/watirspec/lis_spec.rb