rautomation 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.rdoc +8 -0
- data/VERSION +1 -1
- data/lib/rautomation/implementations/autoit/button.rb +5 -2
- data/lib/rautomation/implementations/autoit/window.rb +4 -1
- data/rautomation.gemspec +3 -2
- data/spec/button_spec.rb +8 -8
- metadata +5 -4
data/History.rdoc
ADDED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
@@ -6,9 +6,12 @@ module RAutomation
|
|
6
6
|
include Locators
|
7
7
|
|
8
8
|
# Special-cased locators
|
9
|
-
LOCATORS = {
|
9
|
+
LOCATORS = {
|
10
|
+
:class_name => :classnn,
|
11
|
+
:value => :text
|
12
|
+
}
|
10
13
|
|
11
|
-
# Possible locators are :
|
14
|
+
# Possible locators are :value, :id, :class, :class_name and :instance.
|
12
15
|
def initialize(window, locators)
|
13
16
|
@window = window
|
14
17
|
extract(locators)
|
@@ -36,9 +36,12 @@ module RAutomation
|
|
36
36
|
extract(locators)
|
37
37
|
end
|
38
38
|
|
39
|
+
# Returns handle of the found window.
|
40
|
+
# Searches only for visible windows with having some text at all.
|
39
41
|
def hwnd #:nodoc:
|
40
42
|
@hwnd ||= @@autoit.WinList(@locators, @locator_text).pop.compact.
|
41
|
-
find {|handle| self.class.new(:hwnd => handle.hex).visible?}.
|
43
|
+
find {|handle| w = self.class.new(:hwnd => handle.hex); w.visible? && !w.text.empty?}.
|
44
|
+
hex rescue nil
|
42
45
|
end
|
43
46
|
|
44
47
|
def title #:nodoc:
|
data/rautomation.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rautomation}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jarmo Pertman"]
|
12
|
-
s.date = %q{2010-10-
|
12
|
+
s.date = %q{2010-10-14}
|
13
13
|
s.description = %q{RAutomation tries to be a small and easy to use library for helping out to automate windows and their controls
|
14
14
|
for automated testing.
|
15
15
|
|
@@ -26,6 +26,7 @@ RAutomation aims to provide:
|
|
26
26
|
s.files = [
|
27
27
|
".document",
|
28
28
|
".gitignore",
|
29
|
+
"History.rdoc",
|
29
30
|
"LICENSE",
|
30
31
|
"README.rdoc",
|
31
32
|
"Rakefile",
|
data/spec/button_spec.rb
CHANGED
@@ -3,30 +3,30 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
3
3
|
describe RAutomation::Button do
|
4
4
|
it "#button" do
|
5
5
|
RAutomation::Window.new(:title => SpecHelper::DATA[:window2_title]).
|
6
|
-
button(:
|
7
|
-
lambda {RAutomation::Window.new(:title => "non-existing-window").button(:
|
6
|
+
button(:value => SpecHelper::DATA[:window2_button_text]).should exist
|
7
|
+
lambda {RAutomation::Window.new(:title => "non-existing-window").button(:value => "Something")}.
|
8
8
|
should raise_exception(RAutomation::UnknownWindowException)
|
9
9
|
end
|
10
10
|
|
11
11
|
it "#value" do
|
12
12
|
RAutomation::Window.new(:title => SpecHelper::DATA[:window2_title]).
|
13
|
-
button(:
|
14
|
-
lambda {RAutomation::Window.new(:title => SpecHelper::DATA[:window2_title]).button(:
|
13
|
+
button(:value => SpecHelper::DATA[:window2_button_text]).value.should == SpecHelper::DATA[:window2_button_text]
|
14
|
+
lambda {RAutomation::Window.new(:title => SpecHelper::DATA[:window2_title]).button(:value => "non-existent-button").value}.
|
15
15
|
should raise_exception(RAutomation::UnknownButtonException)
|
16
16
|
end
|
17
17
|
|
18
18
|
it "#exists?" do
|
19
19
|
window = RAutomation::Window.new(:title => SpecHelper::DATA[:window2_title])
|
20
|
-
window.button(:
|
21
|
-
window.button(:
|
20
|
+
window.button(:value => SpecHelper::DATA[:window2_button_text]).should exist
|
21
|
+
window.button(:value => "non-existent-button").should_not exist
|
22
22
|
end
|
23
23
|
|
24
24
|
it "#click" do
|
25
25
|
window = RAutomation::Window.new(:title => SpecHelper::DATA[:window2_title])
|
26
|
-
lambda{window.button(:
|
26
|
+
lambda{window.button(:value => "non-existent-button").click}.
|
27
27
|
should raise_exception(RAutomation::UnknownButtonException)
|
28
28
|
|
29
|
-
button = window.button(:
|
29
|
+
button = window.button(:value => SpecHelper::DATA[:window2_button_text])
|
30
30
|
button.should exist
|
31
31
|
button.click
|
32
32
|
button.should_not exist
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rautomation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jarmo Pertman
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-10-
|
18
|
+
date: 2010-10-14 00:00:00 +03:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -54,6 +54,7 @@ extra_rdoc_files:
|
|
54
54
|
files:
|
55
55
|
- .document
|
56
56
|
- .gitignore
|
57
|
+
- History.rdoc
|
57
58
|
- LICENSE
|
58
59
|
- README.rdoc
|
59
60
|
- Rakefile
|