Sha256: 07ff36be05a3ead0d34ac15a48a145b179797f312b107e6f14af1d7d4d661ebc

Contents?: true

Size: 810 Bytes

Versions: 25

Compression:

Stored size: 810 Bytes

Contents

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

describe "Ems" do

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

  describe "#length" do
    it "returns the number of ems" do
      browser.ems.length.should == 1
    end
  end

  describe "#[]" do
    it "returns the em at the given index" do
      browser.ems[1].id.should == "important-id"
    end
  end

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

      browser.ems.each_with_index do |e, index|
        e.text.should == browser.em(:index, index+1).text
        e.id.should == browser.em(:index, index+1).id
        e.class_name.should == browser.em(:index, index+1).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.7.pre4-jruby spec/watir2/ems_spec.rb
operawatir-0.7.pre3-jruby spec/watir2/ems_spec.rb
operawatir-0.7.pre2-jruby spec/watir2/ems_spec.rb
operawatir-0.7.pre1-jruby spec/watir2/ems_spec.rb
operawatir-0.6.pre1-jruby spec/watir2/ems_spec.rb
operawatir-0.5.1-jruby spec/watir2/ems_spec.rb
operawatir-0.5-jruby spec/watir2/ems_spec.rb
operawatir-0.5.pre3-jruby spec/watir2/ems_spec.rb
operawatir-0.5.pre2-jruby spec/watir2/ems_spec.rb
operawatir-0.5.pre1-jruby spec/watir2/ems_spec.rb
operawatir-0.4.3.pre1-jruby spec/watir2/ems_spec.rb
operawatir-0.4.2-jruby spec/watir2/ems_spec.rb
operawatir-0.4.1-jruby spec/watir2/ems_spec.rb
operawatir-0.4.1.pre7-jruby spec/watir2/ems_spec.rb
operawatir-0.4.1.pre6-jruby spec/watir2/ems_spec.rb
operawatir-0.4.1.pre5-jruby spec/watir2/ems_spec.rb
operawatir-0.4.1.pre4-jruby spec/watir2/ems_spec.rb
operawatir-0.4.1.pre3-jruby spec/watir2/ems_spec.rb
operawatir-0.4.1.pre2-jruby spec/watir2/ems_spec.rb
operawatir-0.4.1.pre1-jruby spec/watir2/ems_spec.rb