Sha256: 615872d8d11482068b2e52948880628388d481641df999cc933547f5631c1c98

Contents?: true

Size: 1.18 KB

Versions: 17

Compression:

Stored size: 1.18 KB

Contents

describe "Watir::IE", :if => WatirSplash::Util.framework == :watir do

  before :each do
    goto "http://dl.dropbox.com/u/2731643/WatirSplash/test.html"
  end

  context "Watir::Element" do
    context "#save_as" do
      it "saves file with the browser" do
        begin
          file_path = link(:text => "Download").save_as(WatirSplash::Util.file_path("download.zip"))
          File.read(file_path).should == "this is a 'zip' file!"
        ensure
          FileUtils.rm file_path rescue nil
        end
      end

      it "allows only absolute paths" do
        expect {link(:text => "Download").save_as("download.zip")}.to raise_exception
      end
    end
  end

  context "Watir::FileField" do
    context "#set" do
      it "sets the file to upload with the browser" do
        field = file_field(:id => "upload")
        file_path = File.expand_path(__FILE__)
        field.set file_path
        wait_until(5) {field.value =~ /#{File.basename(__FILE__)}/}
      end

      it "doesn't allow to use with non existing files" do
        field = file_field(:id => "upload")
        expect {field.set "upload.zip"}.to raise_exception
      end
    end
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
watirsplash-2.4.4 spec/watir_ie_spec.rb
watirsplash-2.4.3 spec/watir_ie_spec.rb
watirsplash-2.4.2 spec/watir_ie_spec.rb
watirsplash-2.4.1 spec/watir_ie_spec.rb
watirsplash-2.4.0 spec/watir_ie_spec.rb
watirsplash-2.3.2 spec/watir_ie_spec.rb
watirsplash-2.3.1 spec/watir_ie_spec.rb
watirsplash-2.3.0 spec/watir_ie_spec.rb
watirsplash-2.2.0 spec/watir_ie_spec.rb
watirsplash-2.1.1 spec/watir_ie_spec.rb
watirsplash-2.1.0 spec/watir_ie_spec.rb
watirsplash-2.0.1.rc5 spec/watir_ie_spec.rb
watirsplash-2.0.1.rc4 spec/watir_ie_spec.rb
watirsplash-2.0.1.rc3 spec/watir_ie_spec.rb
watirsplash-2.0.1.rc1 spec/watir_ie_spec.rb
watirsplash-2.0.0 spec/watir_ie_spec.rb
watirsplash-2.0.0.rc2 spec/watir_ie_spec.rb