watirsplash 0.2.12 → 0.2.14

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,8 @@
1
+ === Version 0.2.14 / 2011-01-25
2
+
3
+ * use newer RAutomation
4
+ * use newer Win32::Screenshot - you may now uninstall ImageMagick and RMagick
5
+
1
6
  === Version 0.2.12 / 2010-10-15
2
7
 
3
8
  * really fix integration with RAutomation and AutoIt - uninstall all versions of Watir before installing this version of WatirSplash due to the conflicts of Watir's AutoIt version and RAutomation AutoIt version
@@ -127,4 +132,4 @@ This means that you can test easily tables now:
127
132
 
128
133
  === Version 0.1.0 / 2010-04-03
129
134
 
130
- First release of WatiRspec, a small library for combining Watir and RSpec for browser-based functional testing in Ruby.
135
+ First release of WatiRspec, a small library for combining Watir and RSpec for browser-based functional testing in Ruby.
data/README.rdoc CHANGED
@@ -80,16 +80,13 @@ testing right away!
80
80
 
81
81
  == INSTALL
82
82
 
83
- 1) install Ruby 1.8.6:
83
+ 1) install Ruby 1.8:
84
84
  http://rubyinstaller.org/
85
85
 
86
- 2) install ImageMagick with rmagick-win32 gem for saving the screenshots in PNG format:
87
- http://rubyforge.org/frs/?group_id=12&release_id=42049
88
-
89
- 3) install WatirSplash:
86
+ 2) install WatirSplash:
90
87
  gem install watirsplash
91
88
 
92
- 4) in your project's directory:
89
+ 3) in your project's directory:
93
90
  watirsplash generate
94
91
 
95
92
  == WHAT NEXT?
@@ -98,4 +95,4 @@ You can read more information about the usage and features from the wiki at http
98
95
 
99
96
  == COPYRIGHT
100
97
 
101
- Copyright © 2010 Jarmo Pertman. See LICENSE for details.
98
+ Copyright © 2010 Jarmo Pertman. See LICENSE for details.
data/Rakefile CHANGED
@@ -30,12 +30,11 @@ Execute "watirsplash generate" under your project's directory to generate defaul
30
30
  gem.add_dependency("watir", "=1.6.6")
31
31
  gem.add_dependency("rspec", "=1.3.0")
32
32
  gem.add_dependency("diff-lcs")
33
- gem.add_dependency("rautomation", ">=0.0.3")
33
+ gem.add_dependency("rautomation", "~>0.4")
34
34
  gem.add_dependency("require_all")
35
- gem.add_dependency("rmagick")
36
35
  gem.add_dependency("syntax")
37
36
  gem.add_dependency("win32console")
38
- gem.add_dependency("win32screenshot", ">=0.0.4")
37
+ gem.add_dependency("win32screenshot", "~>1.0.2")
39
38
  end
40
39
  Jeweler::GemcutterTasks.new
41
40
  rescue LoadError
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.12
1
+ 0.2.14
data/lib/watirsplash.rb CHANGED
@@ -1,9 +1,6 @@
1
1
  require "rubygems"
2
2
  require "require_all"
3
3
  require "rautomation"
4
- # initialize explicitly RAutomation::Window object to load correct version of AutoIt
5
- RAutomation::Window.new(:title => "sometitle")
6
-
7
4
  gem "rspec", "=1.3.0"
8
5
  require "spec"
9
6
  gem "watir", "=1.6.6"
@@ -1,6 +1,5 @@
1
1
  require 'spec/runner/formatter/html_formatter'
2
2
  require 'win32/screenshot'
3
- require 'rmagick'
4
3
  require 'pathname'
5
4
  require 'fileutils'
6
5
 
@@ -62,9 +61,9 @@ module WatirSplash
62
61
  end
63
62
 
64
63
  def save_html # :nodoc:
64
+ file_name = file_path("browser.html")
65
65
  begin
66
66
  html = @browser.html
67
- file_name = file_path("browser.html")
68
67
  File.open(file_name, 'w') {|f| f.puts html}
69
68
  rescue => e
70
69
  $stderr.puts "saving of html failed: #{e.message}"
@@ -73,15 +72,11 @@ module WatirSplash
73
72
  end
74
73
 
75
74
  def save_screenshot(description="Screenshot", hwnd=nil) # :nodoc:
75
+ file_name = file_path("screenshot.png", description)
76
+ hwnd ||= @browser.hwnd
77
+ @browser.bring_to_front
76
78
  begin
77
- hwnd ||= @browser.hwnd
78
- @browser.bring_to_front
79
- Win32::Screenshot.hwnd(hwnd) do |width, height, blob|
80
- file_name = file_path("screenshot.png", description)
81
- img = Magick::ImageList.new
82
- img.from_blob(blob)
83
- img.write(file_name)
84
- end
79
+ Win32::Screenshot::Take.of(:window, :hwnd => hwnd).write(file_name)
85
80
  rescue => e
86
81
  $stderr.puts "saving of screenshot failed: #{e.message}"
87
82
  end
@@ -121,4 +116,4 @@ module WatirSplash
121
116
  end
122
117
 
123
118
  end
124
- end
119
+ end
@@ -23,7 +23,7 @@ module WatirSplash
23
23
  module_function :formatter
24
24
 
25
25
  def method_missing name, *args #:nodoc:
26
- @browser.respond_to?(name) ? @browser.send(name, *args) : super
26
+ @browser.respond_to?(name) ? @browser.send(name, *args) {yield} : super
27
27
  end
28
28
 
29
29
  # make sure that using method 'p' will be invoked on @browser
@@ -30,8 +30,7 @@ module Watir
30
30
  download_window.button(:value => "&Save").click
31
31
 
32
32
  save_as_window = RAutomation::Window.new(:title => "Save As")
33
- WaitHelper.wait_until {save_as_window.present?}
34
- save_as_window.text_field(:class_name => "Edit1").set(File.native_path(file_path))
33
+ save_as_window.text_field(:class => "Edit", :index => 0).set(File.native_path(file_path))
35
34
  save_as_window.button(:value => "&Save").click
36
35
 
37
36
  WaitHelper.wait_until {File.exists?(file_path)}
@@ -45,8 +44,7 @@ module Watir
45
44
  assert_exists
46
45
  self.click_no_wait
47
46
  window = RAutomation::Window.new(:title => /choose file( to upload)?/i)
48
- WaitHelper.wait_until {window.present?}
49
- window.text_field(:class_name => "Edit1").set(File.native_path(file_path))
47
+ window.text_field(:class => "Edit", :index => 0).set(File.native_path(file_path))
50
48
  window.button(:value => "&Open").click
51
49
  end
52
50
  end
@@ -26,20 +26,20 @@ describe Watir::IE do
26
26
  end
27
27
  end
28
28
 
29
- it "allows only absolute paths for #save_as" do
30
- lambda {link(:text => "Download").save_as("download.zip")}.should raise_exception
31
- end
32
-
33
- it "works with FileField#set" do
34
- field = file_field(:id => "upload")
35
- file_path = File.expand_path(__FILE__)
36
- field.set file_path
37
- field.value.should match(/#{File.basename(__FILE__)}/)
38
- end
39
-
40
- it "doesn't allow to use FileField#set with non existing file" do
41
- field = file_field(:id => "upload")
42
- lambda {field.set "upload.zip"}.should raise_exception
29
+ context Watir::FileField do
30
+ context "#set" do
31
+ it "sets the file to upload with the browser" do
32
+ field = file_field(:id => "upload")
33
+ file_path = File.expand_path(__FILE__)
34
+ field.set file_path
35
+ wait_until(5) {field.value =~ /#{File.basename(__FILE__)}/}
36
+ end
37
+
38
+ it "doesn't allow to use FileField#set with non existing file" do
39
+ field = file_field(:id => "upload")
40
+ lambda {field.set "upload.zip"}.should raise_exception
41
+ end
42
+ end
43
43
  end
44
44
 
45
45
  it "has wait_until" do
@@ -54,4 +54,4 @@ describe Watir::IE do
54
54
  @browser.should_not exist
55
55
  end
56
56
 
57
- end
57
+ 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: 15
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 12
10
- version: 0.2.12
9
+ - 14
10
+ version: 0.2.14
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-15 00:00:00 +03:00
18
+ date: 2011-01-26 00:00:00 +02:00
19
19
  default_executable: watirsplash
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -70,14 +70,13 @@ dependencies:
70
70
  requirement: &id004 !ruby/object:Gem::Requirement
71
71
  none: false
72
72
  requirements:
73
- - - ">="
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
- hash: 25
75
+ hash: 3
76
76
  segments:
77
77
  - 0
78
- - 0
79
- - 3
80
- version: 0.0.3
78
+ - 4
79
+ version: "0.4"
81
80
  type: :runtime
82
81
  version_requirements: *id004
83
82
  - !ruby/object:Gem::Dependency
@@ -95,7 +94,7 @@ dependencies:
95
94
  type: :runtime
96
95
  version_requirements: *id005
97
96
  - !ruby/object:Gem::Dependency
98
- name: rmagick
97
+ name: syntax
99
98
  prerelease: false
100
99
  requirement: &id006 !ruby/object:Gem::Requirement
101
100
  none: false
@@ -109,7 +108,7 @@ dependencies:
109
108
  type: :runtime
110
109
  version_requirements: *id006
111
110
  - !ruby/object:Gem::Dependency
112
- name: syntax
111
+ name: win32console
113
112
  prerelease: false
114
113
  requirement: &id007 !ruby/object:Gem::Requirement
115
114
  none: false
@@ -123,35 +122,21 @@ dependencies:
123
122
  type: :runtime
124
123
  version_requirements: *id007
125
124
  - !ruby/object:Gem::Dependency
126
- name: win32console
125
+ name: win32screenshot
127
126
  prerelease: false
128
127
  requirement: &id008 !ruby/object:Gem::Requirement
129
128
  none: false
130
129
  requirements:
131
- - - ">="
130
+ - - ~>
132
131
  - !ruby/object:Gem::Version
133
- hash: 3
132
+ hash: 19
134
133
  segments:
134
+ - 1
135
135
  - 0
136
- version: "0"
136
+ - 2
137
+ version: 1.0.2
137
138
  type: :runtime
138
139
  version_requirements: *id008
139
- - !ruby/object:Gem::Dependency
140
- name: win32screenshot
141
- prerelease: false
142
- requirement: &id009 !ruby/object:Gem::Requirement
143
- none: false
144
- requirements:
145
- - - ">="
146
- - !ruby/object:Gem::Version
147
- hash: 23
148
- segments:
149
- - 0
150
- - 0
151
- - 4
152
- version: 0.0.4
153
- type: :runtime
154
- version_requirements: *id009
155
140
  description: WatirSplash makes testing of web applications splashin' easy by combining best features of Watir, RSpec and Ruby!
156
141
  email: jarmo.p@gmail.com
157
142
  executables:
@@ -202,7 +187,7 @@ licenses: []
202
187
  post_install_message: |-
203
188
  *************************
204
189
 
205
- Thank you for installing WatirSplash 0.2.12! Don't forget to take a look at README and History files!
190
+ Thank you for installing WatirSplash 0.2.14! Don't forget to take a look at README and History files!
206
191
 
207
192
  Execute "watirsplash generate" under your project's directory to generate default project structure.
208
193
 
@@ -241,7 +226,7 @@ rubyforge_project:
241
226
  rubygems_version: 1.3.7
242
227
  signing_key:
243
228
  specification_version: 3
244
- summary: watirsplash 0.2.12
229
+ summary: watirsplash 0.2.14
245
230
  test_files:
246
231
  - spec/spec_helper_spec.rb
247
232
  - spec/spec_match_array_spec.rb