zhimin-rwebspec 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,298 @@
1
+ CHANGELOG
2
+ =========
3
+ 1.4.0
4
+ Renamed to rwebspec
5
+
6
+ 1.3.1
7
+ [Enhancement] better absolutize the hyperlinks in dumped page source
8
+ [Fixes] logic in allowing method
9
+
10
+ 1.3
11
+ add new syntax for including pages
12
+ extend RWebSpec::UsingPages
13
+ pages :login_page, :receipt_page, :page_dir => 'c:/temp'
14
+
15
+ 1.2.4
16
+ Generate new rdoc
17
+
18
+ 1.2.3
19
+ New - support_unicode
20
+ More alias assert_select_label_not_present assert_option_not_present
21
+ New - click_button_with_name
22
+
23
+ 1.2.2
24
+
25
+ save_current_page save to ITEST2
26
+
27
+ 1.2.1 (2009-04-02)
28
+
29
+ Fixes - base_url is file://
30
+ New - set_hidden_field
31
+ New - allowing
32
+ New - try { } handles boolean values as well
33
+ Doc update
34
+
35
+ 1.2
36
+ REVISIT all APIs
37
+ - assertions
38
+ - assert_not (new)
39
+ - assert_text_field_value (new)
40
+ - assert_text_present_in_table (renamed)
41
+ - assert_element_present (removed, use assert div(:id, "").exists?)
42
+ - driver.rb
43
+ - wait_until (new)
44
+ - repeat_try_util (new)
45
+ - try (add more clear messages when block failed)
46
+ - add unit tests
47
+ - run unit test against the test page in Firefox Browser
48
+ - major documentation update
49
+
50
+ 1.1.3
51
+ add open_existing_browser
52
+
53
+ 1.1.2 (2009-03-13)
54
+ added goto_url
55
+
56
+ 1.1.1
57
+ add open_browser.rb, check for firefox with jssh is running
58
+ added assert_exists, assert_not_exists
59
+
60
+ 1.1
61
+
62
+ Changed dependency (Assertions) for test-unit 2.0.2, ruby 1.9.1 ready
63
+ Extract popup.rb out
64
+ Added repeat_try in driver.rb
65
+ remove should_not_allow, should_allow. Important!!! don't define methods start with should_not_, should_
66
+
67
+ 1.0.4
68
+ Added: WebBrowser.html WebBrowser.text
69
+ Added: random method in test_utils
70
+ Enhancemet: close_browser works even no browser started in the test
71
+ move open_browser to driver.rb
72
+ fixed include rwebspec causing stack too deep error
73
+
74
+ 1.0.3
75
+ - New set of samples (real life tests)
76
+
77
+ 1.0.2
78
+ - add more unit tests
79
+ Fixes cell_with_id
80
+
81
+ 1.0.1
82
+ [Enhancement] Normalize windows file path before setting upload
83
+
84
+ 1.0 (2008-11-25)
85
+
86
+ TODO:
87
+ Firefox: check the element is hidden or showing,
88
+ Checkfor driver.rb: ajax_call_complete_after_element_hidden
89
+ does not support outerHtml yet
90
+ Firefox: attach browser,
91
+ Unfortundately, Firewatir does not support attaching current window
92
+ Firefox Workaround: element_by_id
93
+
94
+ 0.10.3
95
+ - added label_with_id, span_with_id, cell_with_id
96
+ - better fixes for enabled_popup
97
+
98
+ 0.10.1 (2008-11-08)
99
+ - Upgrade to support Firewatir 1.6.2
100
+ - Work around Firefox reuse one window browser issue
101
+ - Exclude watir/contrib/enabled_popup, user can add themselves
102
+
103
+ 0.9.10 (2008-10-28)
104
+ [Feature] Better support reuse IE window for testing
105
+
106
+ 0.9.9.1
107
+ [Feature] Support pausing in iTest2
108
+
109
+ == 0.9.9
110
+ [Fixes] add "area" method for running tests against Firefox
111
+ [Enhancement] Pass browser type and base_utl when calling attach_browser
112
+
113
+ == 0.9.8
114
+ [New] 'assert_title' to check page title
115
+ [Fixes] Not same two same messages to iTest in a row
116
+
117
+ == 0.9.7
118
+ [TODO] support should.contains?(JAMEs)
119
+ [WORKING] maybe yield to suport
120
+ - add prepare_to_click_button_in_popup() in driver.rb
121
+ - refactor web_tester.rb to use dynamicly create test cases
122
+ - rename web_tester.rb to web_browser.rb
123
+ - add alias visit (goto_page)
124
+ - WebBrowser.attach_browser return rWebUnit WebBrowser instance instead of Watir or Firefox
125
+ - expect_page(Class, argument) added to support one more additional argument
126
+
127
+ == 0.9.6
128
+ - using global variable instead of environment variable passing between rwebspec and iTest
129
+ - add debug()
130
+
131
+ == 0.9.5
132
+ - Add support for iTest to trace execution
133
+
134
+ == 0.9.4 (2008-08-20)
135
+ - change test_context => context, avoid confusing Ruby test
136
+ - refactored driver.rb
137
+
138
+ == 0.9.3
139
+ - add method failsafe {}
140
+
141
+ == 0.9.2
142
+ - sleep 0.5 seconds after clicking popup window
143
+ - save current page
144
+ - (0.9.1.1) support rspec 1.1.4: at exit hook
145
+
146
+ == 0.9.1 (2008-05-26)
147
+ - support storing page source during execution
148
+
149
+ == 0.9 (2008-05-21)
150
+ - support new syntax
151
+ spec "" do
152
+ scenario "1" do
153
+ end
154
+
155
+ story "2" do
156
+ end
157
+ end
158
+
159
+ == 0.8.9
160
+ - support Watir 1.5.4 zippy mode, set it as default
161
+
162
+ == 0.8.8
163
+ - support iTest hiding browse option
164
+
165
+ == 0.8.7
166
+ - support delay between operations (must be click_... type operation) for iTest2
167
+
168
+ == 0.8.6
169
+ - Add dependency on activesupport 2.0.x, xml_simple to support 1.days.ago
170
+ - RSpec Helper, overwrite rspec patch
171
+
172
+ == 0.8.5
173
+ - click button with image
174
+ - better handling new pop up window
175
+ - fixes links_with_text
176
+
177
+ == 0.8.4
178
+ - better support for iTest
179
+ - for firefox support, don't do slow typing, just set text in textfield
180
+
181
+ == 0.8.2
182
+ - fixed assert_link_not_present has .Text
183
+
184
+ == 0.8.1
185
+ - fixed attach_browser issue
186
+
187
+ == 0.8 (2008-01-18)
188
+ - change click_link to click_link_with_text, to for id click, use click_link_with_id
189
+ - change click_button to click_button_with_text, to for id click, use click_button_with_id
190
+
191
+ == 0.7.2 (2007-12-31)
192
+ - Change dependency from Watir => Watir or FireWatir
193
+ Now can run on Mac or Linux
194
+ - Fixes: shall_not_allow syntax error
195
+
196
+ == 0.7.1 (2007-12-24)
197
+ - Fixes error when firefox is not available
198
+
199
+ == 0.7 (2007-12-18)
200
+ - support Firefox using FireWatir
201
+
202
+ == 0.6.9
203
+ - add shall_not_allow
204
+ - more watir wrapper methods
205
+
206
+ == 0.6.4 (2007-11-30)
207
+ - updated rwebspec 0.6.4
208
+ - support javascript window
209
+ - support watir td, tr...
210
+
211
+ == 0.6.0 (2007-11-18)
212
+ - support watir convenient methods
213
+
214
+ == 0.5.4 (2007-11-12)
215
+ - fixed element_by_id
216
+
217
+ == 0.5.3 (2007-11-07)
218
+ - fixed ajax_wait_element with web_tester changes
219
+ - added wait_for_element
220
+
221
+ == 0.5.2 (2007-09-27)
222
+ - added element_text
223
+
224
+ == 0.5.1 (2007-09-21)
225
+ - add wrap of Watir methods, such as buttons, button(...)
226
+ - expose Watir low level methods to test/spec through Driver.rb
227
+ - removed old way using array and comparision to access individual control
228
+ - renamed html_title to page_title
229
+ - add method contains_text
230
+ - make faster checkbox operations
231
+ - make faster radio operations
232
+ - added radio operation in driver.rb
233
+ - renamed ajax_wait_for_element
234
+ - added some comments
235
+
236
+ == 0.5.0
237
+ - Support Watir 1.5.2
238
+
239
+ == 0.4.5
240
+ - support checkboxes with same name
241
+
242
+ == 0.4.2
243
+
244
+ New Features
245
+ - Drop support for java syntax methods
246
+ - remove assert helper methods in web_tester
247
+ - improve support for RSpecs
248
+
249
+ == 0.4.0 (2007-05-29)
250
+
251
+ New features
252
+ - Support RSpec
253
+
254
+ == 0.3.1 (2007-04-18)
255
+
256
+ Bug fix reelase
257
+
258
+ == 0.3.0 (2007-02-16)
259
+
260
+ New features
261
+ - Deprecated Java like method name, use ruby naming convention instead, beginAt => begin_at
262
+ - More ajax related calls: ajax_wait_for_element_show, ajax_wait_for_element_hide, assert_position_in_list
263
+
264
+ == 0.2.0 (2006-11-28)
265
+
266
+ New features:
267
+ - wait_ajax_udpate(elem_id, seconds) - use indicator image id to determine whether the ajax request is completed or not
268
+ - browser_opened?
269
+
270
+ A number of general fixes and code improvements.
271
+
272
+ == 0.1.1
273
+
274
+ New jWebUnit API methods implemented:
275
+ assertOptionEquals(selectName, optionLabel)
276
+ assertOptionValueEquals(selectName, optionValue)
277
+ assertCheckboxNotSelected(checkBoxName)
278
+ assertCheckboxSelected(checkBoxName)
279
+ assertLinkPresentWithExactText(linkText)
280
+ assertLinkNotPresentWithExactText(linkText)
281
+ assertRadioOptionNotPresent(radioGroup, radioOption)
282
+ assertRadioOptionPresent(radioGroup, radioOption)
283
+ assertRadioOptionSelected(radioGroup, radioOption)
284
+ assertRadioOptionNotSelected(radioGroup, radioOption)
285
+ assertTextInTable(tableId, text)
286
+ assertTextNotInTable(tableId, text)
287
+
288
+ API methods modified:
289
+ assertLinkPresentWithText(linkText):
290
+ assertLinkNotPresentWithText(linkText):
291
+
292
+ New rWebUnit API :
293
+ clickRadioOption(radioGroup, radioOption): this method is protected in jWebUnit
294
+
295
+ == 0.1.0
296
+
297
+ * Initial release.
298
+ * Most common web actions and assertions implemented.
@@ -0,0 +1,21 @@
1
+ Copyright (c) 2006-2008 Zhimin Zhan, zhimin@zhimin.com
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
data/README ADDED
@@ -0,0 +1,33 @@
1
+
2
+ rWebUnit wraps the popular web testing framework WATIR with RSpec Syntax to provide better easy to read automated web test cases. By using iTest/Watir recorder, the rWebUnit test scripts can be recorded in Firefox. iTest2 makes editing/executing test cases with ease.
3
+
4
+ Sample rWebUnit Test:
5
+
6
+ require 'rwebspec'
7
+
8
+ spec "Locate a Suncorp Branch" do
9
+ include RWebSpec::RSpecHelper
10
+
11
+ before(:all) do
12
+ open_browser_with("http://suncorp.com.au/")
13
+ end
14
+
15
+ before(:each) do
16
+ goto_page("/locator")
17
+ end
18
+
19
+ after(:all) do
20
+ close_browser
21
+ end
22
+
23
+ scenario "Find by extended trading hours" do
24
+ checkbox(:id, "OpenExtendedTradingHoursSerivceId").click # using Watir directly
25
+ enter_text("Postcode_Locator__Postcode", "4061")
26
+ click_button_with_image("search_button.gif")
27
+ page_source.should include("Queen St Mall")
28
+ end
29
+ end
30
+
31
+
32
+ iTest2 Homepage: http://www.itest2.com
33
+
@@ -0,0 +1,82 @@
1
+ require 'rubygems'
2
+ require 'spec/rake/spectask'
3
+ require 'rake/rdoctask'
4
+ require 'rake/gempackagetask'
5
+ require 'rdoc' # require rdoc 2
6
+ gem 'darkfish-rdoc'
7
+ # require 'darkfish-rdoc'
8
+
9
+ $:.unshift(File.dirname(__FILE__) + "/lib")
10
+ #require 'rwebspec'
11
+
12
+ desc "Default task"
13
+ task :default => [ :clean, :spec, :gem]
14
+ # task :default => [ :clean, :spec, :rdoc, :gem]
15
+
16
+ desc "Clean generated files"
17
+ task :clean do
18
+ rm_rf 'pkg'
19
+ rm_rf 'doc'
20
+ end
21
+
22
+ desc 'Run all specs'
23
+ Spec::Rake::SpecTask.new('spec') do |t|
24
+ t.spec_opts = ['--format', 'specdoc', '--colour']
25
+ # t.libs = ["lib", "server/lib" ]
26
+ t.spec_files = Dir['spec/**/*_spec.rb'].sort
27
+ end
28
+
29
+ # Generate the RDoc documentation
30
+ # Rake::RDocTask.new { |rdoc|
31
+ # rdoc.rdoc_dir = 'doc'
32
+ # rdoc.title = 'rWebUnit'
33
+ # rdoc.template = "#{ENV['template']}.rb" if ENV['template']
34
+ # rdoc.rdoc_files.include('README')
35
+ # rdoc.rdoc_files.include('lib/rwebspec.rb')
36
+ # rdoc.rdoc_files.include('lib/rwebspec/*.rb')
37
+ # }
38
+
39
+ # using DarkFish - http://deveiate.org/projects/Darkfish-Rdoc/
40
+ Rake::RDocTask.new do |rdoc|
41
+ rdoc.rdoc_dir = 'doc'
42
+ rdoc.title = 'rWebUnit'
43
+ rdoc.rdoc_files.include('lib/rwebspec.rb')
44
+ rdoc.rdoc_files.include('lib/rwebspec/*.rb')
45
+ rdoc.options += [
46
+ '-SHN',
47
+ '-f', 'darkfish', # This is the important bit
48
+ ]
49
+ end
50
+
51
+ spec = Gem::Specification.new do |s|
52
+ s.platform= Gem::Platform::RUBY
53
+ s.name = "rwebspec"
54
+ s.version = "1.4.0"
55
+ s.summary = "Executable functional specification for web applications in RSpec syntax and Watir"
56
+ # s.description = ""
57
+
58
+ s.author = "Zhimin Zhan"
59
+ s.email = "zhimin@agileway.net"
60
+ s.homepage= "http://github.com/zhimin/rwebspec/tree/master"
61
+ s.rubyforge_project = "rwebspec"
62
+
63
+ s.has_rdoc = true
64
+ s.requirements << 'none'
65
+ s.require_path = "lib"
66
+ s.autorequire = "rwebspec"
67
+
68
+ s.files = [ "Rakefile", "README", "CHANGELOG", "MIT-LICENSE" ]
69
+ s.files = s.files + Dir.glob( "lib/**/*" )
70
+ s.files = s.files + Dir.glob( "test/**/*" )
71
+ s.files = s.files + Dir.glob( "sample/**/*")
72
+ s.files = s.files + Dir.glob( "docs/**/*" )
73
+ s.add_dependency(%q<rspec>, ["= 1.1.12"])
74
+ s.add_dependency("commonwatir", ">= 1.6.2")
75
+ s.add_dependency("test-unit", ">= 2.0.2")
76
+ # s.add_dependency("watir", ">= 1.6.2")
77
+ # s.add_dependency("firewatir", ">= 1.6.2")
78
+ end
79
+
80
+ Rake::GemPackageTask.new(spec) do |pkg|
81
+ pkg.need_zip = true
82
+ end
@@ -0,0 +1,51 @@
1
+ module Spec
2
+ module Extensions
3
+ module Main
4
+
5
+ alias :spec :describe
6
+ alias :specification :describe
7
+ alias :test_suite :describe
8
+ alias :suite :describe
9
+
10
+ end
11
+ end
12
+ end
13
+
14
+ # For RSpec 1.1.12
15
+ module Spec
16
+ module DSL
17
+ module Main
18
+
19
+ alias :spec :describe
20
+ alias :specification :describe
21
+ alias :test_suite :describe
22
+ alias :suite :describe
23
+
24
+ end
25
+ end
26
+ end
27
+
28
+ # ZZ patches to RSpec 1.1.4
29
+ # - add to_s method to example_group
30
+ module Spec
31
+ module Example
32
+ class ExampleGroup
33
+ def to_s
34
+ @_defined_description
35
+ end
36
+ end
37
+ end
38
+ end
39
+
40
+ module Spec
41
+ module Example
42
+ module ExampleGroupMethods
43
+
44
+ alias_method :scenario, :it
45
+ alias_method :story, :it
46
+ alias_method :test_case, :it
47
+ alias_method :use_case, :it
48
+ alias_method :test, :it
49
+ end
50
+ end
51
+ end