Sha256: 7e83db2f4d2421d835bfac0eaf0aa8a048c70cfae4bca4b74748079b45fd7999

Contents?: true

Size: 826 Bytes

Versions: 25

Compression:

Stored size: 826 Bytes

Contents

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

describe "Strongs" do

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

  describe "#length" do
    it "returns the number of divs" do
      browser.strongs.length.should == 2
    end
  end

  describe "#[]" do
    it "returns the div at the given index" do
      browser.strongs[1].id.should == "descartes"
    end
  end

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

      browser.strongs.each_with_index do |s, index|
        strong = browser.strong(:index, index+1)
        s.name.should       == strong.name
        s.id.should         == strong.id
        s.class_name.should == strong.class_name

        count += 1
      end

      count.should > 0
    end
  end

end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
operawatir-0.4-jruby spec/legacy_watirspec/strongs_spec.rb
operawatir-0.3.7.pre2-jruby spec/legacy_watirspec/strongs_spec.rb
operawatir-0.3.7.pre1-jruby spec/legacy_watirspec/strongs_spec.rb
operawatir-0.3.2-jruby spec/legacy_watirspec/strongs_spec.rb
operawatir-0.3-jruby spec/legacy_watirspec/strongs_spec.rb