Sha256: f07edca581d94037cd1b678f4b8af741e7b4d80b28e60cb8870f83310b12d866

Contents?: true

Size: 1.12 KB

Versions: 25

Compression:

Stored size: 1.12 KB

Contents

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

describe "SelectLists" do

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

  describe "#length" do
    it "returns the correct number of select lists on the page" do
      browser.select_lists.length.should == 4
    end
  end

  describe "#[]" do
    it "returns the correct item" do
      browser.select_lists[1].value.should == "2"
      browser.select_lists[1].name.should == "new_user_country"
      browser.select_lists[1].type.should == "select-one"
      browser.select_lists[2].type.should == "select-multiple"
    end
  end

  describe "#each" do
    it "iterates through the select lists correctly" do
      index=1
      browser.select_lists.each do |l|
        browser.select_list(:index, index).name.should == l.name
        browser.select_list(:index, index).id.should ==  l.id
        browser.select_list(:index, index).type.should == l.type
        browser.select_list(:index, index).value.should == l.value
        index += 1
      end
      (index - 1).should == browser.select_lists.length
    end
  end

end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
operawatir-0.7.pre4-jruby spec/watir2/select_lists_spec.rb
operawatir-0.7.pre3-jruby spec/watir2/select_lists_spec.rb
operawatir-0.7.pre2-jruby spec/watir2/select_lists_spec.rb
operawatir-0.7.pre1-jruby spec/watir2/select_lists_spec.rb
operawatir-0.6.pre1-jruby spec/watir2/select_lists_spec.rb
operawatir-0.5.1-jruby spec/watir2/select_lists_spec.rb
operawatir-0.5-jruby spec/watir2/select_lists_spec.rb
operawatir-0.5.pre3-jruby spec/watir2/select_lists_spec.rb
operawatir-0.5.pre2-jruby spec/watir2/select_lists_spec.rb
operawatir-0.5.pre1-jruby spec/watir2/select_lists_spec.rb
operawatir-0.4.3.pre1-jruby spec/watir2/select_lists_spec.rb
operawatir-0.4.2-jruby spec/watir2/select_lists_spec.rb
operawatir-0.4.1-jruby spec/watir2/select_lists_spec.rb
operawatir-0.4.1.pre7-jruby spec/watir2/select_lists_spec.rb
operawatir-0.4.1.pre6-jruby spec/watir2/select_lists_spec.rb
operawatir-0.4.1.pre5-jruby spec/watir2/select_lists_spec.rb
operawatir-0.4.1.pre4-jruby spec/watir2/select_lists_spec.rb
operawatir-0.4.1.pre3-jruby spec/watir2/select_lists_spec.rb
operawatir-0.4.1.pre2-jruby spec/watir2/select_lists_spec.rb
operawatir-0.4.1.pre1-jruby spec/watir2/select_lists_spec.rb