Sha256: d2e62a9462d5335c7241be238127ece7a9bad482c83cd27f2bd1118ece9ae4a8

Contents?: true

Size: 826 Bytes

Versions: 12

Compression:

Stored size: 826 Bytes

Contents

# encoding: utf-8
require File.dirname(__FILE__) + '/spec_helper'

describe "FileFields" do

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

  describe "#length" do
    it "returns the correct number of file fields" do
      browser.file_fields.length.should == 2
    end
  end

  describe "#[]" do
    it "returns the file field at the given index" do
      browser.file_fields[0].id.should == "new_user_portrait"
    end
  end

  describe "#each" do
    it "iterates through file fields correctly" do
      browser.file_fields.each_with_index do |f, index|
        f.name.should == browser.file_field(:index, index).name
        f.id.should ==  browser.file_field(:index, index).id
        f.value.should == browser.file_field(:index, index).value
      end
    end
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
watir-webdriver-0.0.6 spec/watirspec/filefields_spec.rb
watir-webdriver-0.0.5 spec/watirspec/filefields_spec.rb
watir-webdriver-0.0.4 spec/watirspec/filefields_spec.rb
watir-webdriver-0.0.3 spec/watirspec/filefields_spec.rb
watir-webdriver-0.0.2 spec/watirspec/filefields_spec.rb
watir-webdriver-0.0.1 spec/watirspec/filefields_spec.rb
watir-webdriver-0.0.1.dev7 spec/watirspec/filefields_spec.rb
watir-webdriver-0.0.1.dev5 spec/watirspec/filefields_spec.rb
watir-webdriver-0.0.1.dev4 spec/watirspec/filefields_spec.rb
watir-webdriver-0.0.1.dev3 spec/watirspec/filefields_spec.rb
watir-webdriver-0.0.1.dev2 spec/watirspec/filefields_spec.rb
watir-webdriver-0.0.1.dev spec/watirspec/filefields_spec.rb