watirsplash 0.2.6 → 0.2.7

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 CHANGED
@@ -1,3 +1,7 @@
1
+ === Version 0.2.7 / 2010-09-27
2
+
3
+ * added explicit dependencies for Watir 1.6.5 and RSpec 1.3.0 so upcoming versions wouldn't break things accidentally
4
+
1
5
  === Version 0.2.6 / 2010-09-12
2
6
 
3
7
  * moved a lot of documentation from the README to the wiki at http://github.com/jarmo/watirsplash/wiki
data/Rakefile CHANGED
@@ -27,8 +27,8 @@ Execute "watirsplash generate" under your project's directory to generate defaul
27
27
 
28
28
  #{"*"*25}}
29
29
 
30
- gem.add_dependency("watir", ">=1.6.5")
31
- gem.add_dependency("rspec", ">=1.3.0")
30
+ gem.add_dependency("watir", "=1.6.5")
31
+ gem.add_dependency("rspec", "=1.3.0")
32
32
  gem.add_dependency("diff-lcs")
33
33
  gem.add_dependency("require_all")
34
34
  gem.add_dependency("rmagick")
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.6
1
+ 0.2.7
@@ -9,27 +9,40 @@ module AutoIt
9
9
  end
10
10
 
11
11
  @@autoit = Watir.autoit
12
- attr_reader :title
13
-
14
- def initialize(window_title)
15
- @title = window_title
12
+ attr_reader :locator
13
+
14
+ def initialize(window_locator)
15
+ @locator =
16
+ case window_locator
17
+ when Regexp
18
+ "[REGEXPTITLE:#{window_locator}]"
19
+ when Fixnum
20
+ "[HANDLE:#{window_locator.to_s(16).rjust(8, "0")}]"
21
+ else
22
+ window_locator
23
+ end
24
+ @title = window_locator
16
25
  end
17
26
 
18
27
  # makes window active
19
28
  # * returns true if activation was successful and false otherwise
20
29
  def activate
21
- @@autoit.WinWait(@title, "", 1) == 1 &&
22
- @@autoit.WinActivate(@title) != 0 &&
23
- @@autoit.WinActive(@title) != 0
30
+ @@autoit.WinWait(@locator, "", 1) == 1 &&
31
+ @@autoit.WinActivate(@locator) != 0 &&
32
+ @@autoit.WinActive(@locator) != 0
33
+ end
34
+
35
+ def text
36
+ @@autoit.WinGetText(@locator)
24
37
  end
25
38
 
26
39
  def exists?
27
- @@autoit.WinExists(@title) == 1
40
+ @@autoit.WinExists(@locator) == 1
28
41
  end
29
42
 
30
43
  def close
31
- @@autoit.WinClose(@title)
32
- @@autoit.WinKill(@title)
44
+ @@autoit.WinClose(@locator)
45
+ @@autoit.WinKill(@locator)
33
46
  end
34
47
 
35
48
  def button(name)
@@ -60,8 +73,8 @@ module AutoIt
60
73
  clicked = false
61
74
  wait_until do
62
75
  @window.activate &&
63
- Window.autoit.ControlFocus(@window.title, "", @name) == 1 &&
64
- Window.autoit.ControlClick(@window.title, "", @name) == 1 &&
76
+ Window.autoit.ControlFocus(@window.locator, "", @name) == 1 &&
77
+ Window.autoit.ControlClick(@window.locator, "", @name) == 1 &&
65
78
  clicked = true # is clicked at least once
66
79
 
67
80
  clicked && !exists?
@@ -69,7 +82,7 @@ module AutoIt
69
82
  end
70
83
 
71
84
  def exists?
72
- not Window.autoit.ControlGetHandle(@window.title, "", @name).empty?
85
+ not Window.autoit.ControlGetHandle(@window.locator, "", @name).empty?
73
86
  end
74
87
  end
75
88
 
@@ -87,18 +100,22 @@ module AutoIt
87
100
  def set(text)
88
101
  wait_until do
89
102
  @window.activate &&
90
- Window.autoit.ControlFocus(@window.title, "", @name) == 1 &&
91
- Window.autoit.ControlSetText(@window.title, "", @name, text) == 1 &&
103
+ Window.autoit.ControlFocus(@window.locator, "", @name) == 1 &&
104
+ Window.autoit.ControlSetText(@window.locator, "", @name, text) == 1 &&
92
105
  value == text
93
106
  end
94
107
  end
95
108
 
109
+ def clear
110
+ set ""
111
+ end
112
+
96
113
  def value
97
- Window.autoit.ControlGetText(@window.title, "", @name)
114
+ Window.autoit.ControlGetText(@window.locator, "", @name)
98
115
  end
99
116
 
100
117
  def exists?
101
- not Window.autoit.ControlGetHandle(@window.title, "", @name).empty?
118
+ not Window.autoit.ControlGetHandle(@window.locator, "", @name).empty?
102
119
  end
103
120
  end
104
121
  end
@@ -140,7 +140,7 @@ module Watir
140
140
  raise "#{file_path} has to exist to set!" unless File.exists?(file_path)
141
141
  assert_exists
142
142
  self.click_no_wait
143
- window = AutoIt::Window.new("[REGEXPTITLE:Choose (file|File to Upload)]")
143
+ window = AutoIt::Window.new(/choose file( to upload)?/i)
144
144
  window.text_field("Edit1").set(File.native_path(file_path))
145
145
  window.button("&Open").click
146
146
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watirsplash
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 6
10
- version: 0.2.6
9
+ - 7
10
+ version: 0.2.7
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-09-12 00:00:00 +03:00
18
+ date: 2010-09-27 00:00:00 +03:00
19
19
  default_executable: watirsplash
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -24,7 +24,7 @@ dependencies:
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ">="
27
+ - - "="
28
28
  - !ruby/object:Gem::Version
29
29
  hash: 5
30
30
  segments:
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirement: &id002 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - ">="
43
+ - - "="
44
44
  - !ruby/object:Gem::Version
45
45
  hash: 27
46
46
  segments:
@@ -188,7 +188,7 @@ licenses: []
188
188
  post_install_message: |-
189
189
  *************************
190
190
 
191
- Thank you for installing WatirSplash 0.2.6! Don't forget to take a look at README and History files!
191
+ Thank you for installing WatirSplash 0.2.7! Don't forget to take a look at README and History files!
192
192
 
193
193
  Execute "watirsplash generate" under your project's directory to generate default project structure.
194
194
 
@@ -227,7 +227,7 @@ rubyforge_project:
227
227
  rubygems_version: 1.3.7
228
228
  signing_key:
229
229
  specification_version: 3
230
- summary: watirsplash 0.2.6
230
+ summary: watirsplash 0.2.7
231
231
  test_files:
232
232
  - spec/spec_helper_spec.rb
233
233
  - spec/spec_match_array_spec.rb