Sha256: 7520c168678d4e10b4ecaa491a623944da4f497266282518290b30306c7d9a76

Contents?: true

Size: 1.12 KB

Versions: 23

Compression:

Stored size: 1.12 KB

Contents

$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..')
require 'Win32API'
require 'unittests/setup'

# This test makes sure that the win32ole changes will return
# the dom using GetUnknown, which is added via the win32ole patch
class TC_Win32OLE < Test::Unit::TestCase

  def setup
    # this will find the IEDialog.dll file in its build location
    @iedialog_file = (File.expand_path(File.dirname(__FILE__)) + "/../lib/watir/IEDialog/Release/IEDialog.dll").gsub('/', '\\')

    @ie = Watir::IE.new
    @ie.goto 'www.google.com'
  end

  def teardown
    @ie.close
  end

  def test_win32ole_modifications
    fnGetUnknown = Win32API.new(@iedialog_file, 'GetUnknown', ['p', 'p'], 'v')
    intPointer = " " * 4 # will contain the int value of the IUnknown*
    fnGetUnknown.call(@ie.hwnd, intPointer)
    assert_true intPointer
    intArray = intPointer.unpack('L')
    intUnknown = intArray.first
    htmlDoc = WIN32OLE.connect_unknown(intUnknown);
    scriptEngine = htmlDoc.Script

    # now we get the HTML DOM object!
    body =  scriptEngine.document.body
    assert(body.innerHTML =~ /html/)
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
watir-3.0.0.rc3 unittests/win32ole_so_test.rb
watir-3.0.0.rc2 unittests/win32ole_so_test.rb
watir-3.0.0.rc1 unittests/win32ole_so_test.rb
watir-2.0.4 unittests/win32ole_so_test.rb
watir-2.0.3 unittests/win32ole_so_test.rb
watir-2.0.2 unittests/win32ole_so_test.rb
watir-2.0.2.rc1 unittests/win32ole_so_test.rb
watir-2.0.1 unittests/win32ole_so_test.rb
watir-2.0.0 unittests/win32ole_so_test.rb
watir-2.0.0.rc3 unittests/win32ole_so_test.rb
watir-2.0.0.rc2 unittests/win32ole_so_test.rb
watir-1.9.2 unittests/win32ole_so_test.rb
watir-1.9.2.rc1 unittests/win32ole_so_test.rb
watir-1.9.1 unittests/win32ole_so_test.rb
watir-1.9.1.rc1 unittests/win32ole_so_test.rb
watir-1.9.0 unittests/win32ole_so_test.rb
watir-1.9.0.rc7 unittests/win32ole_so_test.rb
watir-1.9.0.rc6 unittests/win32ole_so_test.rb
watir-1.9.0.rc5 unittests/win32ole_so_test.rb
watir-1.9.0.rc4 unittests/win32ole_so_test.rb