Sha256: 7247ce219198f75e2b3967d8b936cb04a0d98d5d91939dbe15941960ac407ee7

Contents?: true

Size: 950 Bytes

Versions: 14

Compression:

Stored size: 950 Bytes

Contents

$:.unshift File.join(File.dirname(__FILE__), "..", "lib")

require 'test/unit'
require 'rubygems'
require 'mechanize'
require 'test_includes'

class FramesMechTest < Test::Unit::TestCase
  include TestMethods

  def setup
    @agent = WWW::Mechanize.new
  end

  def test_frames
    page = @agent.get("http://localhost:#{PORT}/frame_test.html")
    assert_equal(3, page.frames.size)
    assert_equal("frame1", page.frames[0].name)
    assert_equal("frame2", page.frames[1].name)
    assert_equal("frame3", page.frames[2].name)
    assert_equal("/google.html", page.frames[0].src)
    assert_equal("/form_test.html", page.frames[1].src)
    assert_equal("/file_upload.html", page.frames[2].src)
  end

  def test_iframes
    page = @agent.get("http://localhost:#{PORT}/iframe_test.html")
    assert_equal(1, page.iframes.size)
    assert_equal("frame4", page.iframes.first.name)
    assert_equal("/file_upload.html", page.iframes.first.src)
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
mechanize-0.5.3 test/tc_frames.rb
mechanize-0.5.4 test/tc_frames.rb
mechanize-0.6.0 test/tc_frames.rb
mechanize-0.6.1 test/tc_frames.rb
mechanize-0.6.10 test/tc_frames.rb
mechanize-0.6.5 test/tc_frames.rb
mechanize-0.6.6 test/tc_frames.rb
mechanize-0.6.7 test/tc_frames.rb
mechanize-0.6.2 test/tc_frames.rb
mechanize-0.6.9 test/tc_frames.rb
mechanize-0.6.11 test/tc_frames.rb
mechanize-0.6.3 test/tc_frames.rb
mechanize-0.6.8 test/tc_frames.rb
mechanize-0.6.4 test/tc_frames.rb