sikuli 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -86,8 +86,44 @@ module Sikuli
86
86
  )
87
87
  end
88
88
 
89
+ # Public: Simulates turning of the mouse wheel up
90
+ #
91
+ # steps - Fixnum representing the number of steps to turn the mouse wheel
92
+ #
93
+ # Examples
94
+ #
95
+ # region.wheel_up(10)
96
+ #
97
+ # Returns nothing
98
+ def wheel_up(steps = 1)
99
+ @java_obj.wheel(-1, steps)
100
+ end
101
+
102
+ # Public: Simulates turning of the mouse wheel down
103
+ #
104
+ # steps - Fixnum representing the number of steps to turn the mouse wheel
105
+ #
106
+ # Examples
107
+ #
108
+ # region.wheel_down(10)
109
+ #
110
+ # Returns nothing
111
+ def wheel_down(steps = 1)
112
+ @java_obj.wheel(1, steps)
113
+ end
114
+
89
115
  private
90
116
 
117
+ # Private: turns the mouse wheel
118
+ #
119
+ # direction - Fixnum represeting direction to turn wheel
120
+ # steps - the number of steps to turn the mouse wheel
121
+ #
122
+ # Returns nothing
123
+ def wheel(direction, steps)
124
+ @java_obj.wheel(direction, steps)
125
+ end
126
+
91
127
  # Private: clicks on a matched Region based on an image based search
92
128
  #
93
129
  # filename - A String representation of the filename of the region to
@@ -1,3 +1,5 @@
1
+ require 'java'
2
+
1
3
  # These constants represent keyboard codes for interacting with the keyboard.
2
4
  # Keyboard interaction is defined in the Sikuli::Typeable module.
3
5
  #
@@ -1,3 +1,3 @@
1
1
  module Sikuli
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -29,12 +29,20 @@ describe Sikuli::Region, "#Clickable" do
29
29
  lambda { @region.click("apple.png") }.should
30
30
  raise_error(Sikuli::ImageNotFound, "The image 'apple.png' did not match in this region.")
31
31
  end
32
-
32
+
33
33
  it "should perform a click and hold on an image" do
34
34
  lambda { @region.click_and_hold(2, "green_apple.png") }.should_not raise_error
35
35
  end
36
-
36
+
37
37
  it "should perform a click and hold on a point" do
38
38
  lambda { @region.click_and_hold(2, 100, 100) }.should_not raise_error
39
39
  end
40
+
41
+ it "should simulate a mouse scroll wheel up event" do
42
+ lambda { @region.wheel_up(10) }.should_not raise_error
43
+ end
44
+
45
+ it "should simulate a mouse scroll wheel down event" do
46
+ lambda { @region.wheel_down(10) }.should_not raise_error
47
+ end
40
48
  end
metadata CHANGED
@@ -1,98 +1,104 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: sikuli
3
- version: !ruby/object:Gem::Version
4
- version: 0.2.2
3
+ version: !ruby/object:Gem::Version
5
4
  prerelease:
5
+ version: 0.2.3
6
6
  platform: ruby
7
- authors:
8
- - Chas Lemley
7
+ authors:
8
+ - Chas Lemley
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-04 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: rspec
16
- requirement: &2152562440 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :development
23
- prerelease: false
24
- version_requirements: *2152562440
25
- description: Sikuli allows you to interact with your application's user interface
26
- using image based search to automate user actions.
27
- email:
28
- - chas.lemley@gmail.com
12
+
13
+ date: 2012-02-06 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rspec
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ type: :development
25
+ version_requirements: *id001
26
+ description: Sikuli allows you to interact with your application's user interface using image based search to automate user actions.
27
+ email:
28
+ - chas.lemley@gmail.com
29
29
  executables: []
30
+
30
31
  extensions: []
32
+
31
33
  extra_rdoc_files: []
32
- files:
33
- - .gitignore
34
- - Gemfile
35
- - README.md
36
- - Rakefile
37
- - lib/sikuli.rb
38
- - lib/sikuli/app.rb
39
- - lib/sikuli/clickable.rb
40
- - lib/sikuli/config.rb
41
- - lib/sikuli/exception.rb
42
- - lib/sikuli/key_code.rb
43
- - lib/sikuli/region.rb
44
- - lib/sikuli/screen.rb
45
- - lib/sikuli/searchable.rb
46
- - lib/sikuli/sikuli-script.jar
47
- - lib/sikuli/typeable.rb
48
- - lib/sikuli/version.rb
49
- - sikuli.gemspec
50
- - spec/sikuli/app_spec.rb
51
- - spec/sikuli/clickable_spec.rb
52
- - spec/sikuli/config_spec.rb
53
- - spec/sikuli/region_spec.rb
54
- - spec/sikuli/screen_spec.rb
55
- - spec/sikuli/searchable_spec.rb
56
- - spec/sikuli/typeable_spec.rb
57
- - spec/spec_helper.rb
58
- - spec/support/images/apple.png
59
- - spec/support/images/green_apple.png
60
- - spec/support/images/smiley_face.png
61
- - spec/support/images/test_area.jpg
34
+
35
+ files:
36
+ - .gitignore
37
+ - Gemfile
38
+ - README.md
39
+ - Rakefile
40
+ - lib/sikuli.rb
41
+ - lib/sikuli/app.rb
42
+ - lib/sikuli/clickable.rb
43
+ - lib/sikuli/config.rb
44
+ - lib/sikuli/exception.rb
45
+ - lib/sikuli/key_code.rb
46
+ - lib/sikuli/region.rb
47
+ - lib/sikuli/screen.rb
48
+ - lib/sikuli/searchable.rb
49
+ - lib/sikuli/sikuli-script.jar
50
+ - lib/sikuli/typeable.rb
51
+ - lib/sikuli/version.rb
52
+ - sikuli.gemspec
53
+ - spec/sikuli/app_spec.rb
54
+ - spec/sikuli/clickable_spec.rb
55
+ - spec/sikuli/config_spec.rb
56
+ - spec/sikuli/region_spec.rb
57
+ - spec/sikuli/screen_spec.rb
58
+ - spec/sikuli/searchable_spec.rb
59
+ - spec/sikuli/typeable_spec.rb
60
+ - spec/spec_helper.rb
61
+ - spec/support/images/apple.png
62
+ - spec/support/images/green_apple.png
63
+ - spec/support/images/smiley_face.png
64
+ - spec/support/images/test_area.jpg
62
65
  homepage: https://github.com/chaslemley/sikuli_ruby
63
66
  licenses: []
67
+
64
68
  post_install_message:
65
69
  rdoc_options: []
66
- require_paths:
67
- - lib
68
- required_ruby_version: !ruby/object:Gem::Requirement
70
+
71
+ require_paths:
72
+ - lib
73
+ required_ruby_version: !ruby/object:Gem::Requirement
69
74
  none: false
70
- requirements:
71
- - - ! '>='
72
- - !ruby/object:Gem::Version
73
- version: '0'
74
- required_rubygems_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: "0"
79
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
80
  none: false
76
- requirements:
77
- - - ! '>='
78
- - !ruby/object:Gem::Version
79
- version: '0'
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: "0"
80
85
  requirements: []
86
+
81
87
  rubyforge_project: sikuli
82
- rubygems_version: 1.8.10
88
+ rubygems_version: 1.8.9
83
89
  signing_key:
84
90
  specification_version: 3
85
91
  summary: Ruby wrapper for Sikuli GUI automation library
86
- test_files:
87
- - spec/sikuli/app_spec.rb
88
- - spec/sikuli/clickable_spec.rb
89
- - spec/sikuli/config_spec.rb
90
- - spec/sikuli/region_spec.rb
91
- - spec/sikuli/screen_spec.rb
92
- - spec/sikuli/searchable_spec.rb
93
- - spec/sikuli/typeable_spec.rb
94
- - spec/spec_helper.rb
95
- - spec/support/images/apple.png
96
- - spec/support/images/green_apple.png
97
- - spec/support/images/smiley_face.png
98
- - spec/support/images/test_area.jpg
92
+ test_files:
93
+ - spec/sikuli/app_spec.rb
94
+ - spec/sikuli/clickable_spec.rb
95
+ - spec/sikuli/config_spec.rb
96
+ - spec/sikuli/region_spec.rb
97
+ - spec/sikuli/screen_spec.rb
98
+ - spec/sikuli/searchable_spec.rb
99
+ - spec/sikuli/typeable_spec.rb
100
+ - spec/spec_helper.rb
101
+ - spec/support/images/apple.png
102
+ - spec/support/images/green_apple.png
103
+ - spec/support/images/smiley_face.png
104
+ - spec/support/images/test_area.jpg