watirsplash 2.0.0.rc1 → 2.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,11 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- watirsplash (1.5.0)
4
+ watirsplash (2.0.0.rc1)
5
5
  bundler (~> 1.0)
6
6
  rake (= 0.8.7)
7
7
  require_all
8
- rspec (~> 2.6)
9
8
  syntax
10
9
  thor (~> 0)
11
10
 
@@ -82,6 +81,7 @@ PLATFORMS
82
81
 
83
82
  DEPENDENCIES
84
83
  firewatir (= 1.9.0)
84
+ rspec (~> 2.6.0)
85
85
  watir (= 1.9.0)
86
86
  watir-webdriver (~> 0.2.5)
87
87
  watirsplash!
data/History.rdoc CHANGED
@@ -1,3 +1,18 @@
1
+ === Version 2.0.0 / 2011-07-xx
2
+
3
+ * introducing Page Objects - generate them with `watirsplash page` generator
4
+ * use WatirSplash::Browser.new to open up a browser and set it to RSpec-s formatter too
5
+ * removed ui-test-common functionality - just load it's environment.rb if you really need to use it
6
+ * do not load framework automatically anymore when requiring watirsplash - use WatirSplash::Util.load_framework method in environment.rb or config.rb instead
7
+ * do not maximize browser window anymore automatically
8
+ * load environment.rb directly in .rspec file
9
+ * added :default option for frameworks
10
+ * bumped dependencies for win32screenshot, watir, firewatir and watir-webdriver
11
+ * use Bundler for specifying dependencies from now on
12
+ * moved File.path and File.native_path methods to WatirSplash::Util.file_path and .file_native_path since File.path method conflicts with Ruby 1.9
13
+
14
+ PS! This version is not fully backwards compatible due to some core changes, but it is possible to make your old project working with it.
15
+
1
16
  === Version 1.4.3 / 2011-06-05
2
17
 
3
18
  * fix #change matcher in conjunction with #within for rspec 2.6.0
data/README.rdoc CHANGED
@@ -37,14 +37,14 @@ testing right away!
37
37
  ...
38
38
 
39
39
  5) Create a "search" page class and a spec skeleton for it
40
- C:\my_project\ui-test>watirsplash page search --url http://bing.com
40
+ C:\my_project\ui-test>bundle exec watirsplash page search --url http://bing.com
41
41
  create lib
42
42
  create lib/app/page/search.rb
43
43
  create spec
44
44
  create spec/app/page/search_spec.rb
45
45
 
46
46
  6) Create a "results" page class without spec
47
- C:\Users\jarmo\Desktop\minu\projects\Ruby\my_project\ui-test>watirsplash page results --no-spec
47
+ C:\my_project\ui-test>bundle exec watirsplash page results --no-spec
48
48
  exist lib
49
49
  create lib/app/page/results.rb
50
50
 
@@ -97,7 +97,7 @@ testing right away!
97
97
  end
98
98
 
99
99
  8) Execute all specs
100
- C:\my_project\ui-test>rspec spec
100
+ C:\my_project\ui-test>bundle exec rspec spec
101
101
  Results will be saved into the directory C:/my_project/ui-test/results
102
102
 
103
103
  App::Page::Search @ app/page/search_spec.rb:1 (30.06.2011)
@@ -44,7 +44,7 @@ module Watir
44
44
  RAutomation::Window.new(:title => "File Download").button(:value => "&Save").click
45
45
 
46
46
  save_as_window = RAutomation::Window.new(:title => "Save As")
47
- save_as_window.text_field(:class => "Edit", :index => 0).set(File.native_path(file_path))
47
+ save_as_window.text_field(:class => "Edit", :index => 0).set(WatirSplash::Util.file_native_path(file_path))
48
48
  save_as_window.button(:value => "&Save").click
49
49
 
50
50
  Wait.until {File.exists?(file_path)}
@@ -58,7 +58,7 @@ module Watir
58
58
  assert_exists
59
59
  self.click_no_wait
60
60
  window = RAutomation::Window.new(:title => /choose file( to upload)?/i)
61
- window.text_field(:class => "Edit", :index => 0).set(File.native_path(file_path))
61
+ window.text_field(:class => "Edit", :index => 0).set(WatirSplash::Util.file_native_path(file_path))
62
62
  window.button(:value => "&Open").click
63
63
  end
64
64
  end
@@ -8,7 +8,7 @@ require "watirsplash"
8
8
  # Load the framework specified by the environment variable WATIRSPLASH_FRAMEWORK or WatirSplash::Util.framework
9
9
  WatirSplash::Util.load_framework
10
10
 
11
- require_all File.join(File.dirname(__FILE__), "lib/**/*.rb")
11
+ require_all Dir.glob(File.join(File.dirname(__FILE__), "lib/**/*.rb"))
12
12
  require_rel "config.rb"
13
13
 
14
14
  # Add all your require statements into this file to avoid unnecessary
@@ -2,6 +2,20 @@ module WatirSplash
2
2
  # class for common functionality
3
3
  class Util
4
4
  class << self
5
+ # returns unique file path for use in the examples
6
+ #
7
+ # all file names generated with this method will
8
+ # be shown on the report upon test failure.
9
+ def file_path(file_name, description=nil)
10
+ WatirSplash::Util.formatter.file_path(file_name, description)
11
+ end
12
+
13
+ # returns native file path
14
+ # e.g. on Windows:
15
+ # file_native_path("c:/blah/blah2/file.txt") => c:\\blah\\blah2\\file.txt
16
+ def file_native_path(file_path)
17
+ File::ALT_SEPARATOR ? file_path.gsub(File::SEPARATOR, File::ALT_SEPARATOR) : file_path
18
+ end
5
19
 
6
20
  # configure RSpec to use documentation and WatirSplash::HtmlFormatter formatters
7
21
  def configure_rspec_formatters
@@ -1,6 +1,6 @@
1
1
  module WatirSplash
2
2
  module Version
3
- WATIRSPLASH = "2.0.0.rc1"
3
+ WATIRSPLASH = "2.0.0.rc2"
4
4
 
5
5
  # possible runtime dependencies
6
6
  WATIR = "1.9.0"
data/lib/watirsplash.rb CHANGED
@@ -4,7 +4,6 @@ require "rspec"
4
4
  require "pathname"
5
5
  require_rel "watirsplash/version" unless defined? WatirSplash::Version
6
6
  require_rel "watirsplash/browser"
7
- require_rel "watirsplash/file_helper"
8
7
  require_rel "watirsplash/spec_helper"
9
8
  require_rel "watirsplash/rspec_patches"
10
9
  require_rel "watirsplash/util"
data/spec/util_spec.rb ADDED
@@ -0,0 +1,19 @@
1
+ describe WatirSplash::Util do
2
+
3
+ before :all do
4
+ @file_name = "blah.temp"
5
+ @ext = File.extname(@file_name)
6
+ @base = File.basename(@file_name, @ext)
7
+ end
8
+
9
+ it ".file_path returns unique file path" do
10
+ expected_path = File.join(Dir.pwd, "results/files/#{@base}_.*#{@ext}")
11
+ WatirSplash::Util.file_path(@file_name).should =~ Regexp.new(expected_path)
12
+ end
13
+
14
+ it ".file_native_path returns unique file path with native path separator" do
15
+ expected_path = File.join(Dir.pwd, "results/files/#{@base}_.*#{@ext}").gsub("/", "\\")
16
+ WatirSplash::Util.file_native_path(WatirSplash::Util.file_path(@file_name)).should =~ Regexp.new(Regexp.escape(expected_path).gsub("\\.\\*", ".*"))
17
+ end
18
+
19
+ end
@@ -8,7 +8,7 @@ describe "Watir::IE", :if => WatirSplash::Util.framework == :watir do
8
8
  context "#save_as" do
9
9
  it "saves file with the browser" do
10
10
  begin
11
- file_path = link(:text => "Download").save_as(File.path("download.zip"))
11
+ file_path = link(:text => "Download").save_as(WatirSplash::Util.file_path("download.zip"))
12
12
  File.read(file_path).should == "this is a 'zip' file!"
13
13
  ensure
14
14
  FileUtils.rm file_path rescue nil
data/watirsplash.gemspec CHANGED
@@ -10,13 +10,6 @@ Gem::Specification.new do |s|
10
10
  s.email = %q{jarmo.p@gmail.com}
11
11
  s.description = %q{WatirSplash makes testing of web applications splashin' easy by combining best features of Watir, RSpec and Ruby!}
12
12
  s.homepage = %q{http://github.com/jarmo/WatirSplash}
13
- s.post_install_message = %Q{*************************
14
-
15
- Thank you for installing WatirSplash #{version}! Don't forget to take a look at the README and History files!
16
-
17
- Execute `watirsplash new` under your project's directory to generate a default project structure.
18
-
19
- *************************}
20
13
  s.summary = %Q{watirsplash #{version}}
21
14
  s.files = `git ls-files`.split("\n")
22
15
  s.test_files = `git ls-files -- spec/*`.split("\n")
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watirsplash
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15424087
4
+ hash: 15424081
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
9
  - 0
10
10
  - rc
11
- - 1
12
- version: 2.0.0.rc1
11
+ - 2
12
+ version: 2.0.0.rc2
13
13
  platform: ruby
14
14
  authors:
15
15
  - Jarmo Pertman
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-07-01 00:00:00 Z
20
+ date: 2011-07-03 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rake
@@ -113,7 +113,6 @@ files:
113
113
  - lib/watirsplash.rb
114
114
  - lib/watirsplash/browser.rb
115
115
  - lib/watirsplash/cli.rb
116
- - lib/watirsplash/file_helper.rb
117
116
  - lib/watirsplash/frameworks/firewatir.rb
118
117
  - lib/watirsplash/frameworks/helper.rb
119
118
  - lib/watirsplash/frameworks/watir-webdriver.rb
@@ -137,23 +136,16 @@ files:
137
136
  - lib/watirsplash/util.rb
138
137
  - lib/watirsplash/version.rb
139
138
  - spec/environment.rb
140
- - spec/file_helper_spec.rb
141
139
  - spec/rspec_patches_spec.rb
142
140
  - spec/spec_helper_spec.rb
143
141
  - spec/spec_match_array_spec.rb
142
+ - spec/util_spec.rb
144
143
  - spec/watir_ie_spec.rb
145
144
  - watirsplash.gemspec
146
145
  homepage: http://github.com/jarmo/WatirSplash
147
146
  licenses: []
148
147
 
149
- post_install_message: |-
150
- *************************
151
-
152
- Thank you for installing WatirSplash 2.0.0.rc1! Don't forget to take a look at the README and History files!
153
-
154
- Execute `watirsplash new` under your project's directory to generate a default project structure.
155
-
156
- *************************
148
+ post_install_message:
157
149
  rdoc_options: []
158
150
 
159
151
  require_paths:
@@ -184,11 +176,11 @@ rubyforge_project:
184
176
  rubygems_version: 1.8.4
185
177
  signing_key:
186
178
  specification_version: 3
187
- summary: watirsplash 2.0.0.rc1
179
+ summary: watirsplash 2.0.0.rc2
188
180
  test_files:
189
181
  - spec/environment.rb
190
- - spec/file_helper_spec.rb
191
182
  - spec/rspec_patches_spec.rb
192
183
  - spec/spec_helper_spec.rb
193
184
  - spec/spec_match_array_spec.rb
185
+ - spec/util_spec.rb
194
186
  - spec/watir_ie_spec.rb
@@ -1,18 +0,0 @@
1
- class File
2
- class << self
3
- # returns unique file path for use in the examples
4
- #
5
- # all file names generated with this method will
6
- # be shown on the report upon test failure.
7
- def path(file_name, description=nil)
8
- WatirSplash::Util.formatter.file_path(file_name, description)
9
- end
10
-
11
- # returns native file path
12
- # e.g. on Windows:
13
- # native_file_path("c:/blah/blah2/file.txt") => c:\\blah\\blah2\\file.txt
14
- def native_path(file_path)
15
- File::ALT_SEPARATOR ? file_path.gsub(File::SEPARATOR, File::ALT_SEPARATOR) : file_path
16
- end
17
- end
18
- end
@@ -1,19 +0,0 @@
1
- describe File do
2
-
3
- before :all do
4
- @file_name = "blah.temp"
5
- @ext = File.extname(@file_name)
6
- @base = File.basename(@file_name, @ext)
7
- end
8
-
9
- it ".path returns unique file path" do
10
- expected_path = File.join(Dir.pwd, "results/files/#{@base}_.*#{@ext}")
11
- File.path(@file_name).should =~ Regexp.new(expected_path)
12
- end
13
-
14
- it ".native_path returns unique file path with native path separator" do
15
- expected_path = File.join(Dir.pwd, "results/files/#{@base}_.*#{@ext}").gsub("/", "\\")
16
- File.native_path(File.path(@file_name)).should =~ Regexp.new(Regexp.escape(expected_path).gsub("\\.\\*", ".*"))
17
- end
18
-
19
- end