rwebspec 1.9.2 → 1.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -1
- data/Rakefile +1 -1
- data/lib/rwebspec/driver.rb +13 -9
- data/lib/rwebspec.rb +4 -4
- metadata +3 -3
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
@@ -70,7 +70,7 @@ end
|
|
70
70
|
spec = Gem::Specification.new do |s|
|
71
71
|
s.platform= Gem::Platform::RUBY
|
72
72
|
s.name = "rwebspec"
|
73
|
-
s.version = "1.9.
|
73
|
+
s.version = "1.9.3"
|
74
74
|
s.summary = "Executable functional specification for web applications in RSpec syntax and Watir"
|
75
75
|
s.description = "Executable functional specification for web applications in RSpec syntax and Watir"
|
76
76
|
|
data/lib/rwebspec/driver.rb
CHANGED
@@ -974,15 +974,20 @@ module RWebSpec
|
|
974
974
|
end
|
975
975
|
end
|
976
976
|
|
977
|
+
|
977
978
|
# use win32screenshot library to save curernt active window, which shall be IE
|
978
979
|
#
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
980
|
+
# opts[:to_dir] => the direcotry to save image under
|
981
|
+
def take_screenshot(opts = {})
|
982
|
+
# puts "calling new take screenshot: #{$screenshot_supported}"
|
983
|
+
unless $screenshot_supported
|
984
|
+
puts " [WARN] Screenhost not supported, check whether win32screenshot gem is installed"
|
985
|
+
return
|
986
|
+
end
|
987
|
+
|
983
988
|
begin
|
984
989
|
screenshot_image_filename = "screenshot_" + Time.now.strftime("%m%d%H%M%S") + ".jpg"
|
985
|
-
the_dump_dir = default_dump_dir
|
990
|
+
the_dump_dir = opts[:to_dir] || default_dump_dir
|
986
991
|
FileUtils.mkdir_p(the_dump_dir) unless File.exists?(the_dump_dir)
|
987
992
|
screenshot_image_filepath = File.join(the_dump_dir, screenshot_image_filename)
|
988
993
|
screenshot_image_filepath.gsub!("/", "\\") if is_windows?
|
@@ -991,7 +996,7 @@ module RWebSpec
|
|
991
996
|
|
992
997
|
if is_firefox? then
|
993
998
|
Win32::Screenshot::Take.of(:window, :title => /mozilla\sfirefox/i).write(screenshot_image_filepath)
|
994
|
-
|
999
|
+
elsif ie
|
995
1000
|
Win32::Screenshot::Take.of(:window, :title => /internet\sexplorer/i).write(screenshot_image_filepath)
|
996
1001
|
else
|
997
1002
|
Win32::Screenshot::Take.of(:foreground).write(screenshot_image_filepath)
|
@@ -1000,10 +1005,9 @@ module RWebSpec
|
|
1000
1005
|
rescue => e
|
1001
1006
|
puts "error on taking screenshot: #{e}"
|
1002
1007
|
end
|
1003
|
-
|
1008
|
+
|
1004
1009
|
end
|
1005
|
-
|
1006
|
-
# end of methods
|
1010
|
+
# end of methods
|
1007
1011
|
|
1008
1012
|
end
|
1009
1013
|
|
data/lib/rwebspec.rb
CHANGED
@@ -24,14 +24,14 @@ require 'active_support/core_ext'
|
|
24
24
|
require 'spec'
|
25
25
|
|
26
26
|
unless defined? RWEBSPEC_VERSION
|
27
|
-
RWEBSPEC_VERSION = RWEBUNIT_VERSION = "1.
|
27
|
+
RWEBSPEC_VERSION = RWEBUNIT_VERSION = "1.9.3"
|
28
28
|
end
|
29
29
|
|
30
|
-
if
|
31
|
-
$
|
30
|
+
if RUBY_PLATFORM =~ /mswin/ or RUBY_PLATFORM =~ /mingw/
|
31
|
+
$screenshot_supported = false
|
32
32
|
begin
|
33
33
|
require 'win32/screenshot'
|
34
|
-
$
|
34
|
+
$screenshot_supported = true
|
35
35
|
rescue LoadError => no_screen_library_error
|
36
36
|
end
|
37
37
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 9
|
8
|
-
-
|
9
|
-
version: 1.9.
|
8
|
+
- 3
|
9
|
+
version: 1.9.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Zhimin Zhan
|
@@ -14,7 +14,7 @@ autorequire: rwebspec
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-
|
17
|
+
date: 2011-10-02 00:00:00 +10:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|