Sha256: 8d5e7f35da040122bf95c0e6ccee1d14aa313d9be9b97ed3a7f7876ec91bd9b7

Contents?: true

Size: 1.3 KB

Versions: 16

Compression:

Stored size: 1.3 KB

Contents

require "spec_helper"

describe "Win32::Mouse", :if => SpecHelper.adapter == :win_32 do

  it "#click" do
    window = RAutomation::Window.new(:title => "MainFormWindow")

    popup = RAutomation::Window.new(:title => "About")
    popup.should_not be_present

    window.maximize
    mouse = window.mouse
    mouse.move :x => 60, :y => 65
    mouse.click

    RAutomation::WaitHelper.wait_until {popup.present?}
  end

  it "#position" do
    window = RAutomation::Window.new(:title => "MainFormWindow")
    mouse = window.mouse

    mouse.move :x => 13, :y => 16
    mouse.position.should == {:x => 13, :y => 16}
  end

  it "#press/#release" do
    window = RAutomation::Window.new(:title => "MainFormWindow")
    window.maximize

    text_field = window.text_field(:index => 2)
    text_field.set("start string")
    text_field.value.should == "start string"

    mouse = window.mouse
    mouse.move :x => 146, :y => 125
    mouse.press
    mouse.move :x => 194
    mouse.release
    window.send_keys [:control, "c"]

    text_field.set("new string")
    text_field.value.should == "new string"

    mouse.move :x => 146
    mouse.press
    mouse.move :x => 194
    mouse.release
    window.send_keys [:control, "v"]

    text_field.value.should == "start string"
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rautomation-1.1.0 spec/adapter/win_32/mouse_spec.rb
rautomation-1.0.0 spec/adapter/win_32/mouse_spec.rb
rautomation-0.17.0 spec/adapter/win_32/mouse_spec.rb
rautomation-0.16.0 spec/adapter/win_32/mouse_spec.rb
rautomation-0.15.0 spec/adapter/win_32/mouse_spec.rb
rautomation-0.14.1 spec/adapter/win_32/mouse_spec.rb
rautomation-0.14.0 spec/adapter/win_32/mouse_spec.rb
rautomation-0.13.0 spec/adapter/win_32/mouse_spec.rb
rautomation-0.12.0 spec/adapter/win_32/mouse_spec.rb
rautomation-0.11.0 spec/adapter/win_32/mouse_spec.rb
rautomation-0.10.0 spec/adapter/win_32/mouse_spec.rb
rautomation-0.9.4 spec/adapter/win_32/mouse_spec.rb
rautomation-0.9.3 spec/adapter/win_32/mouse_spec.rb
rautomation-0.9.2 spec/adapter/win_32/mouse_spec.rb
rautomation-0.9.1 spec/adapter/win_32/mouse_spec.rb
rautomation-0.9.0 spec/adapter/win_32/mouse_spec.rb