Sha256: 7fe33dde96fc41556604d5b67eca79e234aab2fd66a98d0976889ba38eea8421

Contents?: true

Size: 916 Bytes

Versions: 1

Compression:

Stored size: 916 Bytes

Contents

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

describe "Forms" do

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

  describe "#length" do
    it "returns the number of forms in the container" do
      browser.forms.length.should == 2
    end
  end

  describe "#[]n" do
    it "provides access to the nth form" do
      browser.forms[0].action.should == 'post_to_me'
      browser.forms[0].attribute_value('method').should == 'post'
    end
  end

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

      browser.forms.each_with_index do |f, index|
        f.name.should == browser.form(:index, index).name
        f.id.should == browser.form(:index, index).id
        f.class_name.should == browser.form(:index, index).class_name

		count += 1
      end

      count.should > 0
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
watir-webdriver-0.0.7 spec/watirspec/forms_spec.rb