watirsplash 1.4.3 → 2.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. data/.gitignore +7 -0
  2. data/.rspec +2 -0
  3. data/Gemfile +16 -0
  4. data/Gemfile.lock +88 -0
  5. data/README.rdoc +87 -63
  6. data/Rakefile +3 -41
  7. data/lib/watirsplash.rb +2 -2
  8. data/lib/watirsplash/browser.rb +3 -1
  9. data/lib/watirsplash/cli.rb +22 -26
  10. data/lib/watirsplash/frameworks/firewatir.rb +1 -1
  11. data/lib/watirsplash/frameworks/helper.rb +2 -16
  12. data/lib/watirsplash/frameworks/watir-webdriver.rb +1 -1
  13. data/lib/watirsplash/frameworks/watir-webdriver/chrome.rb +3 -1
  14. data/lib/watirsplash/frameworks/watir-webdriver/firefox.rb +3 -1
  15. data/lib/watirsplash/frameworks/watir-webdriver/ie.rb +3 -1
  16. data/lib/watirsplash/frameworks/watir.rb +1 -3
  17. data/lib/watirsplash/generators/helper.rb +15 -0
  18. data/lib/watirsplash/generators/new_project.rb +14 -13
  19. data/lib/watirsplash/generators/page.rb +64 -0
  20. data/lib/watirsplash/generators/templates/new_project/.rspec +1 -1
  21. data/lib/watirsplash/generators/templates/new_project/config.rb.tt +3 -30
  22. data/lib/watirsplash/generators/templates/new_project/environment.rb.tt +12 -10
  23. data/lib/watirsplash/generators/templates/page/lib/%formatted_namespace%/page/%formatted_page_name%.rb.tt +8 -0
  24. data/lib/watirsplash/generators/templates/page/spec/%formatted_namespace%/page/%formatted_page_name%_spec.rb.tt +5 -0
  25. data/lib/watirsplash/html_formatter.rb +1 -1
  26. data/lib/watirsplash/page/base.rb +41 -0
  27. data/lib/watirsplash/rspec_patches.rb +5 -7
  28. data/lib/watirsplash/spec_helper.rb +5 -12
  29. data/lib/watirsplash/util.rb +3 -35
  30. data/lib/watirsplash/version.rb +10 -0
  31. data/spec/environment.rb +14 -0
  32. data/spec/spec_helper_spec.rb +3 -4
  33. data/spec/spec_match_array_spec.rb +2 -2
  34. data/watirsplash.gemspec +32 -0
  35. metadata +60 -45
  36. data/VERSION +0 -1
  37. data/environment.rb +0 -2
  38. data/lib/watirsplash/generators/migrate_project.rb +0 -25
  39. data/lib/watirsplash/generators/new_common_project.rb +0 -19
  40. data/lib/watirsplash/generators/templates/new_common_project/config.rb.tt +0 -34
  41. data/lib/watirsplash/generators/templates/new_common_project/environment.rb +0 -15
  42. data/lib/watirsplash/generators/templates/new_common_project/lib/common_application_helper.rb +0 -14
  43. data/lib/watirsplash/generators/templates/new_project/spec/%formatted_name%_helper.rb.tt +0 -18
  44. data/lib/watirsplash/generators/templates/new_project/spec/dummy_spec.rb.tt +0 -41
  45. data/spec/util_spec.rb +0 -48
@@ -0,0 +1,10 @@
1
+ module WatirSplash
2
+ module Version
3
+ WATIRSPLASH = "2.0.0.rc1"
4
+
5
+ # possible runtime dependencies
6
+ WATIR = "1.9.0"
7
+ WIN32SCREENSHOT = "~>1.0.4"
8
+ WATIR_WEBDRIVER = "~>0.2.5"
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ require "rubygems"
2
+ require "bundler"
3
+ Bundler.setup
4
+
5
+ require File.dirname(__FILE__) + "/../lib/watirsplash"
6
+ WatirSplash::Util.framework = "default"
7
+ WatirSplash::Util.load_framework
8
+
9
+ RSpec.configure do |config|
10
+ config.before(:all) do
11
+ WatirSplash::Browser.new
12
+ end
13
+ end
14
+
@@ -1,9 +1,8 @@
1
1
  describe WatirSplash::SpecHelper do
2
2
 
3
3
  it "opens browser automatically" do
4
- @browser.should exist
5
- @browser.url.should == "about:blank"
6
- @browser.title.should == ""
4
+ WatirSplash::Util.formatter.browser.should exist
5
+ WatirSplash::Util.formatter.browser.url.should == "about:blank"
7
6
  end
8
7
 
9
8
  it "redirects method calls to Watir::Browser" do
@@ -23,4 +22,4 @@ describe WatirSplash::SpecHelper do
23
22
  paragraph.text.should == "This is a paragraph!"
24
23
  end
25
24
 
26
- end
25
+ end
@@ -9,10 +9,10 @@ describe "Array match_array matcher" do
9
9
  ["1", ["2", "55"], "3"].should match_array(expected_ary)
10
10
  end
11
11
 
12
- it "doesn't work with other objects than Array" do
12
+ it "doesn't work with other objects except Array" do
13
13
  lambda {"".should match_array("")}.should raise_exception
14
14
  lambda {[].should match_array("")}.should raise_exception
15
15
  lambda {"".should match_array([])}.should raise_exception
16
16
  end
17
17
 
18
- end
18
+ end
@@ -0,0 +1,32 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "watirsplash/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = %q{watirsplash}
7
+ version = WatirSplash::Version::WATIRSPLASH
8
+ s.version = version
9
+ s.authors = [%q{Jarmo Pertman}]
10
+ s.email = %q{jarmo.p@gmail.com}
11
+ s.description = %q{WatirSplash makes testing of web applications splashin' easy by combining best features of Watir, RSpec and Ruby!}
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
+ s.summary = %Q{watirsplash #{version}}
21
+ s.files = `git ls-files`.split("\n")
22
+ s.test_files = `git ls-files -- spec/*`.split("\n")
23
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
24
+ s.require_paths = ["lib"]
25
+
26
+ s.add_dependency("rake", "0.8.7")
27
+ s.add_dependency("bundler", "~>1.0")
28
+ s.add_dependency("thor", "~>0")
29
+ s.add_dependency("require_all")
30
+ s.add_dependency("syntax")
31
+ end
32
+
metadata CHANGED
@@ -1,13 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watirsplash
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
5
- prerelease:
4
+ hash: 15424087
5
+ prerelease: 6
6
6
  segments:
7
+ - 2
8
+ - 0
9
+ - 0
10
+ - rc
7
11
  - 1
8
- - 4
9
- - 3
10
- version: 1.4.3
12
+ version: 2.0.0.rc1
11
13
  platform: ruby
12
14
  authors:
13
15
  - Jarmo Pertman
@@ -15,27 +17,43 @@ autorequire:
15
17
  bindir: bin
16
18
  cert_chain: []
17
19
 
18
- date: 2011-06-05 00:00:00 Z
20
+ date: 2011-07-01 00:00:00 Z
19
21
  dependencies:
20
22
  - !ruby/object:Gem::Dependency
21
- name: rspec
23
+ name: rake
22
24
  prerelease: false
23
25
  requirement: &id001 !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - "="
29
+ - !ruby/object:Gem::Version
30
+ hash: 49
31
+ segments:
32
+ - 0
33
+ - 8
34
+ - 7
35
+ version: 0.8.7
36
+ type: :runtime
37
+ version_requirements: *id001
38
+ - !ruby/object:Gem::Dependency
39
+ name: bundler
40
+ prerelease: false
41
+ requirement: &id002 !ruby/object:Gem::Requirement
24
42
  none: false
25
43
  requirements:
26
44
  - - ~>
27
45
  - !ruby/object:Gem::Version
28
46
  hash: 15
29
47
  segments:
30
- - 2
31
- - 6
32
- version: "2.6"
48
+ - 1
49
+ - 0
50
+ version: "1.0"
33
51
  type: :runtime
34
- version_requirements: *id001
52
+ version_requirements: *id002
35
53
  - !ruby/object:Gem::Dependency
36
54
  name: thor
37
55
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
56
+ requirement: &id003 !ruby/object:Gem::Requirement
39
57
  none: false
40
58
  requirements:
41
59
  - - ~>
@@ -45,11 +63,11 @@ dependencies:
45
63
  - 0
46
64
  version: "0"
47
65
  type: :runtime
48
- version_requirements: *id002
66
+ version_requirements: *id003
49
67
  - !ruby/object:Gem::Dependency
50
68
  name: require_all
51
69
  prerelease: false
52
- requirement: &id003 !ruby/object:Gem::Requirement
70
+ requirement: &id004 !ruby/object:Gem::Requirement
53
71
  none: false
54
72
  requirements:
55
73
  - - ">="
@@ -59,11 +77,11 @@ dependencies:
59
77
  - 0
60
78
  version: "0"
61
79
  type: :runtime
62
- version_requirements: *id003
80
+ version_requirements: *id004
63
81
  - !ruby/object:Gem::Dependency
64
82
  name: syntax
65
83
  prerelease: false
66
- requirement: &id004 !ruby/object:Gem::Requirement
84
+ requirement: &id005 !ruby/object:Gem::Requirement
67
85
  none: false
68
86
  requirements:
69
87
  - - ">="
@@ -73,25 +91,25 @@ dependencies:
73
91
  - 0
74
92
  version: "0"
75
93
  type: :runtime
76
- version_requirements: *id004
94
+ version_requirements: *id005
77
95
  description: WatirSplash makes testing of web applications splashin' easy by combining best features of Watir, RSpec and Ruby!
78
96
  email: jarmo.p@gmail.com
79
97
  executables:
80
98
  - watirsplash
81
99
  extensions: []
82
100
 
83
- extra_rdoc_files:
84
- - History.rdoc
85
- - License.txt
86
- - README.rdoc
101
+ extra_rdoc_files: []
102
+
87
103
  files:
104
+ - .gitignore
105
+ - .rspec
106
+ - Gemfile
107
+ - Gemfile.lock
88
108
  - History.rdoc
89
109
  - License.txt
90
110
  - README.rdoc
91
111
  - Rakefile
92
- - VERSION
93
112
  - bin/watirsplash
94
- - environment.rb
95
113
  - lib/watirsplash.rb
96
114
  - lib/watirsplash/browser.rb
97
115
  - lib/watirsplash/cli.rb
@@ -103,46 +121,41 @@ files:
103
121
  - lib/watirsplash/frameworks/watir-webdriver/firefox.rb
104
122
  - lib/watirsplash/frameworks/watir-webdriver/ie.rb
105
123
  - lib/watirsplash/frameworks/watir.rb
106
- - lib/watirsplash/generators/migrate_project.rb
107
- - lib/watirsplash/generators/new_common_project.rb
124
+ - lib/watirsplash/generators/helper.rb
108
125
  - lib/watirsplash/generators/new_project.rb
109
- - lib/watirsplash/generators/templates/new_common_project/config.rb.tt
110
- - lib/watirsplash/generators/templates/new_common_project/environment.rb
111
- - lib/watirsplash/generators/templates/new_common_project/lib/common_application_helper.rb
126
+ - lib/watirsplash/generators/page.rb
112
127
  - lib/watirsplash/generators/templates/new_project/.rspec
113
128
  - lib/watirsplash/generators/templates/new_project/config.rb.tt
114
129
  - lib/watirsplash/generators/templates/new_project/environment.rb.tt
115
- - lib/watirsplash/generators/templates/new_project/spec/%formatted_name%_helper.rb.tt
116
- - lib/watirsplash/generators/templates/new_project/spec/dummy_spec.rb.tt
130
+ - lib/watirsplash/generators/templates/page/lib/%formatted_namespace%/page/%formatted_page_name%.rb.tt
131
+ - lib/watirsplash/generators/templates/page/spec/%formatted_namespace%/page/%formatted_page_name%_spec.rb.tt
117
132
  - lib/watirsplash/html_formatter.rb
118
133
  - lib/watirsplash/mini_magick_patch.rb
134
+ - lib/watirsplash/page/base.rb
119
135
  - lib/watirsplash/rspec_patches.rb
120
136
  - lib/watirsplash/spec_helper.rb
121
137
  - lib/watirsplash/util.rb
138
+ - lib/watirsplash/version.rb
139
+ - spec/environment.rb
122
140
  - spec/file_helper_spec.rb
123
141
  - spec/rspec_patches_spec.rb
124
142
  - spec/spec_helper_spec.rb
125
143
  - spec/spec_match_array_spec.rb
126
- - spec/util_spec.rb
127
144
  - spec/watir_ie_spec.rb
145
+ - watirsplash.gemspec
128
146
  homepage: http://github.com/jarmo/WatirSplash
129
147
  licenses: []
130
148
 
131
149
  post_install_message: |-
132
150
  *************************
133
151
 
134
- Thank you for installing WatirSplash 1.4.3! Don't forget to take a look at the README and History files!
152
+ Thank you for installing WatirSplash 2.0.0.rc1! Don't forget to take a look at the README and History files!
135
153
 
136
154
  Execute `watirsplash new` under your project's directory to generate a default project structure.
137
155
 
138
156
  *************************
139
- rdoc_options:
140
- - --main
141
- - README.rdoc
142
- - --template
143
- - hanna
144
- - --inline-source
145
- - --format=html
157
+ rdoc_options: []
158
+
146
159
  require_paths:
147
160
  - lib
148
161
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -157,23 +170,25 @@ required_ruby_version: !ruby/object:Gem::Requirement
157
170
  required_rubygems_version: !ruby/object:Gem::Requirement
158
171
  none: false
159
172
  requirements:
160
- - - ">="
173
+ - - ">"
161
174
  - !ruby/object:Gem::Version
162
- hash: 3
175
+ hash: 25
163
176
  segments:
164
- - 0
165
- version: "0"
177
+ - 1
178
+ - 3
179
+ - 1
180
+ version: 1.3.1
166
181
  requirements: []
167
182
 
168
183
  rubyforge_project:
169
184
  rubygems_version: 1.8.4
170
185
  signing_key:
171
186
  specification_version: 3
172
- summary: watirsplash 1.4.3
187
+ summary: watirsplash 2.0.0.rc1
173
188
  test_files:
189
+ - spec/environment.rb
174
190
  - spec/file_helper_spec.rb
175
191
  - spec/rspec_patches_spec.rb
176
192
  - spec/spec_helper_spec.rb
177
193
  - spec/spec_match_array_spec.rb
178
- - spec/util_spec.rb
179
194
  - spec/watir_ie_spec.rb
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 1.4.3
@@ -1,2 +0,0 @@
1
- WatirSplash::Util.framework = "watir"
2
-
@@ -1,25 +0,0 @@
1
- require "pathname"
2
-
3
- module WatirSplash
4
- module Generators
5
- class MigrateProject < Thor::Group
6
- include Thor::Actions
7
-
8
- argument :dir
9
-
10
- def self.source_root
11
- File.dirname(__FILE__) + "/templates"
12
- end
13
-
14
- def migrate
15
- gsub_file("config.rb", /^(\s*)Spec::Runner\./, "\\1RSpec.")
16
-
17
- if File.basename(Dir.pwd) == "ui-test"
18
- remove_file "spec/spec.opts"
19
- template "new_project/.rspec", ".rspec"
20
- end
21
- end
22
-
23
- end
24
- end
25
- end
@@ -1,19 +0,0 @@
1
- module WatirSplash
2
- module Generators
3
- class NewCommonProject < Thor::Group
4
- include Thor::Actions
5
-
6
- argument :url
7
- argument :framework
8
-
9
- def self.source_root
10
- File.dirname(__FILE__) + "/templates"
11
- end
12
-
13
- def generate
14
- directory("new_common_project", "ui-test-common")
15
- end
16
-
17
- end
18
- end
19
- end
@@ -1,34 +0,0 @@
1
- # What framework to use? Possible values are:
2
- # * watir
3
- # * firewatir
4
- # * watir-webdriver/ie
5
- # * watir-webdriver/firefox
6
- # * watir-webdriver/chrome
7
- <%= "WatirSplash::Util.framework = \"#{framework}\"" %>
8
-
9
- =begin
10
- Global configuration constants
11
- For example, you can use the URL constant below from your projects' config.rb like this:
12
-
13
- module Config
14
- module YourApplication
15
- URL = Config.full_url("my_subpage/index.html") # => "http://localhost/my_subpage/index.html
16
- end
17
- end
18
- =end
19
-
20
- require "uri"
21
-
22
- module Config
23
- module GlobalApplication
24
- URL = <%= %Q["#{url}"] %>
25
- end
26
-
27
- def Config.full_url relative_url
28
- URI.join(GlobalApplication::URL, relative_url).to_s
29
- end
30
- end
31
-
32
- RSpec.configure do |config|
33
- config.include(CommonApplicationHelper)
34
- end
@@ -1,15 +0,0 @@
1
- =begin
2
- You have to load this file from your projects' environment.rb, which
3
- would like to use common functionality.
4
-
5
- Use the following line to do it automatically:
6
- WatirSplash::Util.load_common
7
-
8
- Add all your global require statements into this file to avoid unnecessary
9
- code in your other projects' files
10
-
11
- By default everything in lib directory will be loaded
12
- =end
13
-
14
- require_rel "lib/"
15
- require_rel "config.rb"
@@ -1,14 +0,0 @@
1
- # You can create common libraries/helpers/methods under this directory
2
- # to use within your specs within different projects
3
-
4
- module CommonApplicationHelper
5
-
6
- # You can use methods declared in this module inside of your it-blocks
7
- # it "does something" do
8
- # new_global_method.should == "it just works"
9
- # end
10
- def new_global_method
11
- "it just works"
12
- end
13
-
14
- end
@@ -1,18 +0,0 @@
1
- # <%= name %>Helper module has helper methods for easy use in specs
2
- # see usages in spec/dummy_spec.rb
3
-
4
- module <%= name %>Helper
5
-
6
- def helper_method_one
7
- "one"
8
- end
9
-
10
- def has_second_method?
11
- true
12
- end
13
-
14
- def correct?
15
- false
16
- end
17
-
18
- end