wsl 0.1.5 → 0.1.6
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.txt +5 -1
- data/Manifest +3 -0
- data/README.txt +10 -2
- data/Rakefile +1 -1
- data/lib/IEContext.rb +17 -9
- data/lib/utils/Logger.rb +2 -0
- data/lib/wsl.rb +141 -54
- data/lib/wslSuite.rb +20 -3
- data/misc/index.html +15 -0
- data/misc/rubyforge-ssh-svn.txt +6 -0
- data/misc/wsl-gem-creation.txt +26 -0
- data/wsl.gemspec +3 -3
- metadata +5 -2
data/History.txt
CHANGED
data/Manifest
CHANGED
data/README.txt
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
-
WSL is released under the GNU Public Licence.
|
1
|
+
WSL is released under the GNU Public Licence (http://www.gnu.org/copyleft/gpl.html).
|
2
2
|
|
3
|
-
|
3
|
+
The WATiR Scripting Language is a domain specific language for WATiR.
|
4
|
+
WSL lowers the barrier to entry in using WATiR.
|
5
|
+
WSL hides most of the complexities of WATiR tests and is accessible enough for non-developers to use.
|
6
|
+
|
7
|
+
More information on WSL can be found at http://wsl.xqoob.com
|
8
|
+
The source code can be downloaded from http://rubyforge.org/projects/wsl/
|
4
9
|
|
5
10
|
NOTE: if after installing WSL you get the following error -
|
6
11
|
"C:/Ruby/lib/ruby/gems/1.8/gems/windows-pr-0.9.3/lib/windows/thread.rb:59:
|
@@ -8,3 +13,6 @@ NOTE: if after installing WSL you get the following error -
|
|
8
13
|
run these commands-
|
9
14
|
$> Gem uninstall windows-pr
|
10
15
|
$> Gem install windows-pr
|
16
|
+
|
17
|
+
Last updated 24 June 2009
|
18
|
+
Wadud Ruf
|
data/Rakefile
CHANGED
data/lib/IEContext.rb
CHANGED
@@ -2,8 +2,12 @@ require "watir"
|
|
2
2
|
require "watir/watir_simple"
|
3
3
|
require "utils/Logger"
|
4
4
|
|
5
|
-
|
6
|
-
class
|
5
|
+
##
|
6
|
+
# IEBrowserContext is an extension of Watir::Simple and is the core class
|
7
|
+
# through which all calls to Internet Explorer are made.
|
8
|
+
# IEBrowserContext should not be referred to directly within any WSL test scripts.
|
9
|
+
#
|
10
|
+
class IEBrowserContext
|
7
11
|
include Watir::Simple
|
8
12
|
include Watir
|
9
13
|
include Test::Unit::Assertions
|
@@ -12,13 +16,12 @@ class BrowserContext
|
|
12
16
|
attr_reader :logger # Readonly access to logger.
|
13
17
|
|
14
18
|
##
|
15
|
-
# Initialises a new
|
19
|
+
# Initialises a new IEBrowserContext object.
|
16
20
|
# Essentially this is inherits from Watir.Simple,
|
17
|
-
# and uses it's class variable
|
21
|
+
# and uses it's class variable #browser.
|
18
22
|
#
|
19
|
-
# testName: The name you want to give the test.
|
20
|
-
# logFile: The file you want to log to. Defaults to
|
21
|
-
# a log file with the same name as the script in the logs directory.
|
23
|
+
# * testName: The name you want to give the test.
|
24
|
+
# * logFile: The file you want to log to. Defaults to a log file with the same name as the script in the logs directory.
|
22
25
|
#
|
23
26
|
def initialize(testName=nil, logFile=nil)
|
24
27
|
# Set the test name.
|
@@ -50,7 +53,7 @@ class BrowserContext
|
|
50
53
|
end
|
51
54
|
|
52
55
|
##
|
53
|
-
# Provides access to the browser class variable.
|
56
|
+
# Provides access to the Watir::Simple::browser class variable.
|
54
57
|
#
|
55
58
|
def browser
|
56
59
|
return @@browser
|
@@ -58,15 +61,20 @@ class BrowserContext
|
|
58
61
|
|
59
62
|
##
|
60
63
|
# Attaches to a titled browser window.
|
64
|
+
# * windowTitle: The titled window to attach to.
|
61
65
|
#
|
62
66
|
def attach(windowTitle)
|
63
67
|
@@browser = Watir::IE.attach(:title, windowTitle)
|
64
68
|
end
|
65
69
|
|
66
70
|
##
|
67
|
-
# The tags which are
|
71
|
+
# The tags which are within scope of the browser context.
|
72
|
+
# First class functions make calls based on this.
|
73
|
+
#
|
68
74
|
# Note: Ordering of the tags is important.
|
69
75
|
#
|
76
|
+
# * Returns an arraylist of string objects referring to the Watir::Simple tags that are within scope.
|
77
|
+
#
|
70
78
|
def tagsInContext()
|
71
79
|
%w[button link image div span text_field checkbox radio select_list]
|
72
80
|
end
|
data/lib/utils/Logger.rb
CHANGED
@@ -20,9 +20,11 @@ module Wsl
|
|
20
20
|
@@HEADER = "======"
|
21
21
|
@@localCacheFile = ".\\logs\\.cache\\TestSummary.dat"
|
22
22
|
|
23
|
+
#--
|
23
24
|
# Static methods to get log level (cannot assign to these).
|
24
25
|
# Within class, but outside of method, use 'self.debug' to call.
|
25
26
|
# within method use 'CustomLogger.debug' to call.
|
27
|
+
#++
|
26
28
|
def self.debug; "debug"; end
|
27
29
|
def self.info; "info"; end
|
28
30
|
def self.warn; "warn"; end
|
data/lib/wsl.rb
CHANGED
@@ -1,21 +1,27 @@
|
|
1
|
+
##
|
2
|
+
# This file contains the core WSL keywords that are used to write test scripts.
|
3
|
+
# Refer to http://wsl.xqoob.com for examples on how to use these.
|
4
|
+
##
|
5
|
+
|
1
6
|
require "IEContext"
|
2
7
|
require "wslPrivate"
|
3
8
|
require "watir/contrib/visible"
|
4
9
|
|
5
10
|
##
|
6
|
-
# Starts the test.
|
11
|
+
# Starts the test. All test scripts should have this as the
|
12
|
+
# first statement.
|
7
13
|
#
|
8
|
-
# testName: the name of the test.
|
9
|
-
# logFile: the file to log to.
|
14
|
+
# * testName: the name of the test.
|
15
|
+
# * logFile: the file to log to.
|
10
16
|
#
|
11
17
|
def start(testName, logFile=nil)
|
12
|
-
@myBrowser =
|
18
|
+
@myBrowser = IEBrowserContext.new(testName, logFile)
|
13
19
|
end
|
14
20
|
|
15
21
|
##
|
16
22
|
# Opens a new browser with the given url.
|
17
23
|
#
|
18
|
-
# url:
|
24
|
+
# * url: The url to point the browser to.
|
19
25
|
#
|
20
26
|
def open_url(url)
|
21
27
|
@myBrowser.logger.logStep("Opening browser at url: '" + url + "'")
|
@@ -35,7 +41,9 @@ end
|
|
35
41
|
|
36
42
|
##
|
37
43
|
# Attaches the test to a new browser window
|
44
|
+
#--
|
38
45
|
# TODO: How to close the old window?
|
46
|
+
#++
|
39
47
|
#
|
40
48
|
# windowTitle: the name of the new window to attach to
|
41
49
|
#
|
@@ -47,8 +55,9 @@ end
|
|
47
55
|
##
|
48
56
|
# Closes the attached browser window.
|
49
57
|
#
|
58
|
+
# * windowTitle: Closes the currently active browser window, unless the title of another browser window is specified.
|
59
|
+
#
|
50
60
|
def close(windowTitle=nil)
|
51
|
-
|
52
61
|
# Attach to the browser with the name passed in.
|
53
62
|
attach(windowTitle) if windowTitle != nil
|
54
63
|
|
@@ -59,7 +68,7 @@ end
|
|
59
68
|
##
|
60
69
|
# Navigates to the given url.
|
61
70
|
#
|
62
|
-
# url: the url to navigate to.
|
71
|
+
# * url: the url to navigate to.
|
63
72
|
#
|
64
73
|
def go_to(url)
|
65
74
|
@myBrowser.logger.logStep("Navigating to url: '" + url + "'")
|
@@ -92,7 +101,7 @@ end
|
|
92
101
|
#
|
93
102
|
def total_summary
|
94
103
|
if ! defined? @myBrowser then
|
95
|
-
@myBrowser =
|
104
|
+
@myBrowser = IEBrowserContext.new()
|
96
105
|
end
|
97
106
|
|
98
107
|
@myBrowser.logger.totalSummary
|
@@ -106,7 +115,7 @@ end
|
|
106
115
|
#
|
107
116
|
def clear_cache
|
108
117
|
if ! defined? @myBrowser then
|
109
|
-
@myBrowser =
|
118
|
+
@myBrowser = IEBrowserContext.new()
|
110
119
|
end
|
111
120
|
|
112
121
|
# Clear the test cache so as not to corrupt the test summary.
|
@@ -115,13 +124,17 @@ end
|
|
115
124
|
|
116
125
|
##
|
117
126
|
# Enters text in the named field.
|
118
|
-
#
|
119
|
-
#
|
127
|
+
# * what: The value of the attribute used to identify the element
|
128
|
+
# * how: The attribute used to identify the element
|
129
|
+
# * value: The text you want to enter.
|
120
130
|
#
|
131
|
+
#--
|
121
132
|
# def enter_text_in(field, value)
|
122
133
|
# @myBrowser.logger.logStep("Entering text into field '" + field + "' with value '" + value + "'")
|
123
134
|
# @myBrowser.enter_text_into_field_with_id(field, value)
|
124
135
|
# end
|
136
|
+
#++
|
137
|
+
#
|
125
138
|
def enter_text_in(what, how=":id", value=nil)
|
126
139
|
@myBrowser.logger.logStep("Entering text into html element with #{how} '" + what + "'")
|
127
140
|
|
@@ -150,9 +163,9 @@ TEMPLATE
|
|
150
163
|
end
|
151
164
|
|
152
165
|
##
|
153
|
-
# Fires
|
166
|
+
# Fires a javascript onKeyPress event for the given textbox.
|
154
167
|
#
|
155
|
-
# field: The textbox to fire the event for (HTML id).
|
168
|
+
# * field: The textbox to fire the event for (HTML id).
|
156
169
|
#
|
157
170
|
def key_press_in(field)
|
158
171
|
@myBrowser.logger.logStep("Firing onKeyPress event for: '" + field + "'")
|
@@ -160,9 +173,9 @@ def key_press_in(field)
|
|
160
173
|
end
|
161
174
|
|
162
175
|
##
|
163
|
-
# Fires
|
176
|
+
# Fires a javascript onKeyUp event for the given textbox.
|
164
177
|
#
|
165
|
-
# field: The textbox to fire the event for (HTML id).
|
178
|
+
# * field: The textbox to fire the event for (HTML id).
|
166
179
|
#
|
167
180
|
def key_up_in(field)
|
168
181
|
@myBrowser.logger.logStep("Firing onKeyPress event for: '" + field + "'")
|
@@ -170,9 +183,9 @@ def key_up_in(field)
|
|
170
183
|
end
|
171
184
|
|
172
185
|
##
|
173
|
-
# Fires a onMouseOver event for the given textbox.
|
186
|
+
# Fires a javascript onMouseOver event for the given textbox.
|
174
187
|
#
|
175
|
-
# field: The textbox to fire the event for (HTML id).
|
188
|
+
# * field: The textbox to fire the event for (HTML id).
|
176
189
|
#
|
177
190
|
def mouse_over(field)
|
178
191
|
@myBrowser.logger.logStep("Firing onMouseOver event for: '" + field + "'")
|
@@ -180,9 +193,9 @@ def mouse_over(field)
|
|
180
193
|
end
|
181
194
|
|
182
195
|
##
|
183
|
-
# Fires a onMouseDown event for the given textbox.
|
196
|
+
# Fires a javascript onMouseDown event for the given textbox.
|
184
197
|
#
|
185
|
-
# field: The textbox to fire the event for (HTML id).
|
198
|
+
# * field: The textbox to fire the event for (HTML id).
|
186
199
|
#
|
187
200
|
def mouse_down(field)
|
188
201
|
@myBrowser.logger.logStep("Firing onMouseDown event for: '" + field + "'")
|
@@ -190,10 +203,14 @@ def mouse_down(field)
|
|
190
203
|
end
|
191
204
|
|
192
205
|
##
|
193
|
-
# Selects the named element
|
206
|
+
# Selects the named element ideally should be used with checkboxes, radio
|
207
|
+
# buttons and dropdown lists. When set to true will select the checkbox
|
208
|
+
# or radio button. When selecting a value from a dropdown list it uses
|
209
|
+
# the passed in value.
|
194
210
|
#
|
195
|
-
# what:
|
196
|
-
#
|
211
|
+
# * what: the attribute value of the element we want to click
|
212
|
+
# * how: the attribute we want to use to uniquely identify the element
|
213
|
+
# * value: defaults to true, otherwise the value of the dropdown list.
|
197
214
|
#
|
198
215
|
def select(what, how=":id", value=true)
|
199
216
|
@myBrowser.logger.logStep("Selecting html element with #{how} '" + what + "'")
|
@@ -224,8 +241,11 @@ end
|
|
224
241
|
|
225
242
|
##
|
226
243
|
# Clicks the HTML element with the id specified. Note if multiple elements
|
227
|
-
# are present it will click the first occurence of it only. The
|
228
|
-
# searches in is
|
244
|
+
# are present it will click the first occurence of it only. The scope and
|
245
|
+
# order it searches in is viewable by calling elements_in_context.
|
246
|
+
#
|
247
|
+
# * what: the attribute value of the element we want to click
|
248
|
+
# * how: the attribute we want to use to uniquely identify the element
|
229
249
|
#
|
230
250
|
def click(what, how=":id")
|
231
251
|
@myBrowser.logger.logStep("Clicking on html element with #{how} '" + what + "'")
|
@@ -250,12 +270,15 @@ TEMPLATE
|
|
250
270
|
end
|
251
271
|
|
252
272
|
##
|
253
|
-
# Waits for the HTML element
|
273
|
+
# Waits for the HTML element to exist on screen.
|
254
274
|
# Note if multiple elements are present it will look for the first occurence
|
255
275
|
# of it only or until the timeout (in seconds) is exceeded.
|
256
276
|
#
|
257
|
-
# The order it searches in is
|
258
|
-
#
|
277
|
+
# The scope and order it searches in is viewable by calling elements in context.
|
278
|
+
#
|
279
|
+
# * what: the attribute value of the element we want to click
|
280
|
+
# * how: the attribute we want to use to uniquely identify the element
|
281
|
+
# * timout: maximum amount of time to wait for (default is 60 secs).
|
259
282
|
#
|
260
283
|
def wait_for(what, how=":id", timeout=60)
|
261
284
|
@myBrowser.logger.logStep("Waiting to load: '" + what + "'")
|
@@ -287,6 +310,8 @@ end
|
|
287
310
|
# Waits for the browser to catch up. Useful for ajax calls
|
288
311
|
# where the browser loads up some javascript.
|
289
312
|
#
|
313
|
+
# * aMoment: How long to wait for in seconds.
|
314
|
+
#
|
290
315
|
def wait(aMoment=0)
|
291
316
|
if aMoment == 0 then
|
292
317
|
@myBrowser.logger.logStep("Waiting for browser to catch up")
|
@@ -299,12 +324,16 @@ def wait(aMoment=0)
|
|
299
324
|
end
|
300
325
|
|
301
326
|
##
|
302
|
-
# Waits for
|
327
|
+
# Waits for the element to become visible or until the timeout
|
303
328
|
# period has elapsed.
|
304
|
-
# what: The id of the HTML div tag.
|
305
|
-
# timout: maximum amount of time to wait for (default is 60 secs).
|
306
329
|
#
|
330
|
+
# * what: the attribute value of the element we want to click
|
331
|
+
# * how: the attribute we want to use to uniquely identify the element
|
332
|
+
# * timout: maximum amount of time to wait for (default is 60 secs).
|
333
|
+
#
|
334
|
+
#--
|
307
335
|
# TODO: Merge with wait_for method (add visible? to if condition)
|
336
|
+
#++
|
308
337
|
#
|
309
338
|
def wait_until_visible(what, how=":id", timeout=60)
|
310
339
|
@myBrowser.logger.logStep("Waiting for : '" + what + "' to become visible")
|
@@ -336,12 +365,26 @@ TEMPLATE
|
|
336
365
|
end
|
337
366
|
|
338
367
|
##
|
339
|
-
# Records expected result, then asserts whether the
|
340
|
-
#
|
341
|
-
#
|
342
|
-
#
|
343
|
-
#
|
344
|
-
#
|
368
|
+
# Records expected result, then asserts whether the text is displayed
|
369
|
+
# on screen to verify the expected result. This keyword polls the browser
|
370
|
+
# for the specified amount of time until the text exists on screen.
|
371
|
+
# If the text doesn't exist within the timeout period a fail is recorded.
|
372
|
+
#
|
373
|
+
# Typical usage -
|
374
|
+
# assert_text "Welcome Back", "Exists on screen for a successful login."
|
375
|
+
#
|
376
|
+
# You can also use this within conditional statements within your test script.
|
377
|
+
# If you want to do so do not enter an expectedResult for brevities sake.
|
378
|
+
# Typical usage in a conditional statement -
|
379
|
+
# if assert_text "Welcome Back" then
|
380
|
+
# click "myMail"
|
381
|
+
# else
|
382
|
+
# click "forgottenPwd"
|
383
|
+
# end
|
384
|
+
#
|
385
|
+
# * text: The text to look for on screen.
|
386
|
+
# * expectedResult: The expected result we are trying to verify.
|
387
|
+
# * timeout: how long to try asserting for until we log a fail in seconds.
|
345
388
|
#
|
346
389
|
def assert_text(text, expectedResult=nil, timeout=60)
|
347
390
|
@myBrowser.logger.logExpectedResult("'" + text + "' " + expectedResult) if expectedResult != nil
|
@@ -374,12 +417,15 @@ def assert_text(text, expectedResult=nil, timeout=60)
|
|
374
417
|
end
|
375
418
|
|
376
419
|
##
|
420
|
+
#--
|
377
421
|
# Records expected result, then asserts whether the
|
378
422
|
# text is NOT displayed on screen to verify the expected
|
379
423
|
# result.
|
380
424
|
#
|
381
425
|
# text: The text to look for on screen.
|
382
426
|
# expectedResult: The expected result we are trying to verify. - This could potentially be factored out???
|
427
|
+
#++
|
428
|
+
# Do not use this is to be deprecated.
|
383
429
|
#
|
384
430
|
def assert_text!(text, expectedResult=nil)
|
385
431
|
@myBrowser.logger.logExpectedResult("'" + text+ "' " + expectedResult) if expectedResult != nil
|
@@ -408,6 +454,15 @@ def assert_text!(text, expectedResult=nil)
|
|
408
454
|
end
|
409
455
|
end
|
410
456
|
|
457
|
+
##
|
458
|
+
# Asserts that all the text in the args array exists on screen.
|
459
|
+
#
|
460
|
+
# Example usage -
|
461
|
+
# assert_all_text ["value1", "value2", "value3"]
|
462
|
+
#
|
463
|
+
# * Returns true if all the text exists, false if at least one of
|
464
|
+
# values in doesn't exist.
|
465
|
+
#
|
411
466
|
def assert_all_text(args)
|
412
467
|
@myBrowser.logger.logExpectedResult("Asserting all text is shown on screen...")
|
413
468
|
|
@@ -432,10 +487,10 @@ end
|
|
432
487
|
# currently there is no way to determine a response for an ajax call using
|
433
488
|
# Watir (There is an outstanding development request regarding this).
|
434
489
|
#
|
435
|
-
# url: The url to match on.
|
436
|
-
# expectedResult: The expected result message to show on screen.
|
437
|
-
# timeout: period in seconds before registering a failed assertion.
|
438
|
-
# orFailValue: a value if found in the url or body text registers a fail.
|
490
|
+
# * url: The url to match on.
|
491
|
+
# * expectedResult: The expected result message to show on screen.
|
492
|
+
# * timeout: period in seconds before registering a failed assertion.
|
493
|
+
# * orFailValue: a value if found in the url or body text registers a fail.
|
439
494
|
#
|
440
495
|
def assert_url(url, expectedResult="is current url.", timeout=60, orFailValue=nil)
|
441
496
|
# Get rid of the query string portion.
|
@@ -479,13 +534,41 @@ end
|
|
479
534
|
##
|
480
535
|
# Logs a comment.
|
481
536
|
#
|
482
|
-
# text: The comment to log.
|
537
|
+
# * text: The comment to log.
|
483
538
|
#
|
484
539
|
def rem(text)
|
485
540
|
@myBrowser.logger.logComment(text)
|
486
541
|
end
|
487
542
|
|
488
|
-
|
543
|
+
##
|
544
|
+
# A manual test is a fall back strategy when it is
|
545
|
+
# difficult to write automated step(s). For example you
|
546
|
+
# may have to interact with an external site as part of your
|
547
|
+
# script to click on an email link, or when registering enter a
|
548
|
+
# captcha code.
|
549
|
+
#
|
550
|
+
# manual_test is a workaround for such tricky scenarios. Essentially
|
551
|
+
# you list some steps to perform within the manual_test then record
|
552
|
+
# whether it is a pass or a fail. Note that irrespective of how many manual
|
553
|
+
# tests you have you can only record one pass or fail for all steps
|
554
|
+
# within it.
|
555
|
+
#
|
556
|
+
# Example usage -
|
557
|
+
# some automated steps
|
558
|
+
# ...
|
559
|
+
# rem "Register on the site"
|
560
|
+
# ...
|
561
|
+
# manual_test "enter the captcha"
|
562
|
+
# click "submitBtn"
|
563
|
+
# manual_test "submit registration",
|
564
|
+
# "login into email account",
|
565
|
+
# "click on registration email link"
|
566
|
+
# ...
|
567
|
+
#
|
568
|
+
# * steps: The steps to perform within the manual test.
|
569
|
+
# Textual values comma separated for each step.
|
570
|
+
#
|
571
|
+
def manual_test(*steps)
|
489
572
|
@myBrowser.logger.log(" Manual steps to perform:")
|
490
573
|
|
491
574
|
# Log the steps
|
@@ -514,7 +597,9 @@ end
|
|
514
597
|
##
|
515
598
|
# Records a PASS if the link exists
|
516
599
|
#
|
517
|
-
# what: The HTML id of the link
|
600
|
+
# * what: The HTML id of the link
|
601
|
+
# * expectedResult: The expected result of this assertion
|
602
|
+
# * returns true if link exists on screen
|
518
603
|
#
|
519
604
|
def assert_link_exists(what, expectedResult)
|
520
605
|
@myBrowser.logger.logExpectedResult(expectedResult)
|
@@ -531,7 +616,9 @@ end
|
|
531
616
|
##
|
532
617
|
# Records a PASS if the button exists
|
533
618
|
#
|
534
|
-
# what: The HTML id of the button
|
619
|
+
# * what: The HTML id of the button
|
620
|
+
# * expectedResult: The expected result of this assertion
|
621
|
+
# * returns true if button exists on screen
|
535
622
|
#
|
536
623
|
def assert_button_exists(what, expectedResult)
|
537
624
|
@myBrowser.logger.logExpectedResult(expectedResult)
|
@@ -552,21 +639,19 @@ end
|
|
552
639
|
# conditions are not met then call retryable_steps_error with appropriate message
|
553
640
|
# to prompt for a repeat.
|
554
641
|
#
|
555
|
-
# -------------------------------------------------------------------------------
|
556
642
|
# Example usage:
|
557
|
-
#
|
558
|
-
#
|
559
|
-
#
|
560
|
-
#
|
643
|
+
# retryable_steps{
|
644
|
+
# Do some steps here
|
645
|
+
# ...
|
646
|
+
# if pass condition is fail then
|
561
647
|
# Do any further steps if needed
|
562
648
|
# ...
|
563
649
|
# # Record the error with message
|
564
650
|
# retryable_steps_error "The steps failed you need to retry again"
|
565
|
-
#
|
566
|
-
#}
|
567
|
-
# -------------------------------------------------------------------------------
|
651
|
+
# end
|
652
|
+
# }
|
568
653
|
#
|
569
|
-
# &block: The block of code to pass in (must be surrounded by '{' and '}')
|
654
|
+
# * &block: The block of code to pass in (must be surrounded by '{' and '}')
|
570
655
|
#
|
571
656
|
def retryable_steps(&block)
|
572
657
|
begin
|
@@ -584,7 +669,7 @@ end
|
|
584
669
|
# If in the retryable steps the condition(s) to determine
|
585
670
|
# pass/fail of the steps fails then call this.
|
586
671
|
#
|
587
|
-
# message: The message to display before retrying.
|
672
|
+
# * message: The message to display before retrying.
|
588
673
|
#
|
589
674
|
def retryable_steps_error(message)
|
590
675
|
# TODO: Create a custom error/exception?
|
@@ -593,6 +678,8 @@ end
|
|
593
678
|
|
594
679
|
##
|
595
680
|
# Shows all the elements in context in the order they are searched through.
|
681
|
+
# Essentially this is showing use the scope of certain keywords such as click,
|
682
|
+
# select, etc.
|
596
683
|
#
|
597
684
|
def elements_in_context
|
598
685
|
rem "elements in context in order of precedence: \n[" +
|
data/lib/wslSuite.rb
CHANGED
@@ -1,7 +1,24 @@
|
|
1
|
+
##
|
2
|
+
# This file contains the WSL keywords that are used to write suites
|
3
|
+
# for test scripts.
|
4
|
+
# Typical WSL test suite script -
|
5
|
+
# require "wslSuite"
|
6
|
+
#
|
7
|
+
# startup_script "SuiteStartup"
|
8
|
+
#
|
9
|
+
# test_suite "DemoExample",
|
10
|
+
# "ClickExample",
|
11
|
+
# "SelectExample"
|
12
|
+
#
|
13
|
+
# cleanup_script "SuiteCleanup"
|
14
|
+
#
|
15
|
+
# Refer to http://wsl.xqoob.com for examples on how to use these.
|
16
|
+
##
|
17
|
+
|
1
18
|
##
|
2
19
|
# Declare the startup scripts here.
|
3
20
|
#
|
4
|
-
# scripts: The startup scripts to load.
|
21
|
+
# * scripts: The startup scripts to load.
|
5
22
|
#
|
6
23
|
def startup_script(*scripts)
|
7
24
|
scripts.each do |script|
|
@@ -12,7 +29,7 @@ end
|
|
12
29
|
##
|
13
30
|
# Declare the test suite here.
|
14
31
|
#
|
15
|
-
# tests: The tests to load and execute.
|
32
|
+
# * tests: The tests to load and execute.
|
16
33
|
#
|
17
34
|
def test_suite(*tests)
|
18
35
|
tests.each do |test|
|
@@ -23,7 +40,7 @@ end
|
|
23
40
|
##
|
24
41
|
# Declare the cleanup scripts here.
|
25
42
|
#
|
26
|
-
# scripts: The cleanup scripts to load.
|
43
|
+
# * scripts: The cleanup scripts to load.
|
27
44
|
#
|
28
45
|
def cleanup_script(*scripts)
|
29
46
|
scripts.each do |script|
|
data/misc/index.html
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
<html>
|
2
|
+
<!-- Redirect to wsl homepage -->
|
3
|
+
<!-- need to scp this into /var/www/gforge-projects/wsl/index.html -->
|
4
|
+
<script>
|
5
|
+
<!--
|
6
|
+
function autoChange()
|
7
|
+
{
|
8
|
+
var timeID = setTimeout("location.href= 'http://wsl.xqoob.com'", 0)
|
9
|
+
}
|
10
|
+
//-->
|
11
|
+
</script>
|
12
|
+
|
13
|
+
<body onload="autoChange()">
|
14
|
+
</body>
|
15
|
+
</html>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
to check code in and out of rubyforge you need svn set up with
|
2
|
+
ssh tunnelling. To use tortoise svn without having to annoyingly
|
3
|
+
type in the password everytime you need putty and the plink utility.
|
4
|
+
|
5
|
+
A how to to get this setup can be found here -
|
6
|
+
http://rubyforge.org/docman/view.php/5/460/faq.html#scm
|
@@ -0,0 +1,26 @@
|
|
1
|
+
This document outlines how to create a wsl gem using rake and how to install it.
|
2
|
+
the steps are taken from http://www.linuxjournal.com/article/8967
|
3
|
+
|
4
|
+
1. delete any existing gems WSL/pkg directory.
|
5
|
+
2. from root dir run "rake gem" to build gem.
|
6
|
+
3. uninstall existing wsl gem using "gem uninstall wsl"
|
7
|
+
4. cd in pkg dir and run "gem install wsl-<version>.gem" using the correct version number.
|
8
|
+
|
9
|
+
== 22/06/2009
|
10
|
+
Update: Since moving to rubyforge and open sourcing the project wsl now uses echoe
|
11
|
+
to release. refer to https://wikihub.berkeley.edu/display/istas/How+to+Publish+a+Gem+on+Rubyforge
|
12
|
+
for details.
|
13
|
+
|
14
|
+
You need the echoe and rubyforge gems installed and configured correctly, see above url for more
|
15
|
+
details.
|
16
|
+
|
17
|
+
The steps are:-
|
18
|
+
|
19
|
+
* create manifest using "rake manifest"
|
20
|
+
* install gem locally "rake install"
|
21
|
+
* create the release package using "rubyforge create_package wsl wsl"
|
22
|
+
* release the gem using "rake release"
|
23
|
+
* create rdoc locally using "rake docs"
|
24
|
+
* release the rdoc using "rake publish_docs"
|
25
|
+
|
26
|
+
|
data/wsl.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{wsl}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.6"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Wadud Ruf"]
|
9
|
-
s.date = %q{2009-
|
9
|
+
s.date = %q{2009-08-18}
|
10
10
|
s.description = %q{WSL (WATiR Scripting Language) is a DSL built on top of WATiR that allows for the automation of web application testing through Internet Explorer.}
|
11
11
|
s.email = %q{wadud.ruf@xqoob.com}
|
12
12
|
s.extra_rdoc_files = ["lib/IEContext.rb", "lib/utils/Logger.rb", "lib/utils/TestSuiteCleanup.rb", "lib/utils/TestSuiteStartup.rb", "lib/wsl.rb", "lib/wslPrivate.rb", "lib/wslSuite.rb", "README.txt"]
|
13
|
-
s.files = ["examples/ClickExample.rb", "examples/DemoExample.rb", "examples/DemoTestSuite.rb", "examples/GoogleSearchExample_WSL.rb", "examples/SelectExample.rb", "examples/SuiteCleanup.rb", "examples/SuiteStartup.rb", "History.txt", "lib/IEContext.rb", "lib/utils/Logger.rb", "lib/utils/TestSuiteCleanup.rb", "lib/utils/TestSuiteStartup.rb", "lib/wsl.rb", "lib/wslPrivate.rb", "lib/wslSuite.rb", "Manifest", "Rakefile", "README.txt", "wsl.gemspec"]
|
13
|
+
s.files = ["examples/ClickExample.rb", "examples/DemoExample.rb", "examples/DemoTestSuite.rb", "examples/GoogleSearchExample_WSL.rb", "examples/SelectExample.rb", "examples/SuiteCleanup.rb", "examples/SuiteStartup.rb", "History.txt", "lib/IEContext.rb", "lib/utils/Logger.rb", "lib/utils/TestSuiteCleanup.rb", "lib/utils/TestSuiteStartup.rb", "lib/wsl.rb", "lib/wslPrivate.rb", "lib/wslSuite.rb", "Manifest", "misc/index.html", "misc/rubyforge-ssh-svn.txt", "misc/wsl-gem-creation.txt", "Rakefile", "README.txt", "wsl.gemspec"]
|
14
14
|
s.has_rdoc = true
|
15
15
|
s.homepage = %q{http://wsl.xqoob.com}
|
16
16
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Wsl", "--main", "README.txt"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wadud Ruf
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-08-18 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -54,6 +54,9 @@ files:
|
|
54
54
|
- lib/wslPrivate.rb
|
55
55
|
- lib/wslSuite.rb
|
56
56
|
- Manifest
|
57
|
+
- misc/index.html
|
58
|
+
- misc/rubyforge-ssh-svn.txt
|
59
|
+
- misc/wsl-gem-creation.txt
|
57
60
|
- Rakefile
|
58
61
|
- README.txt
|
59
62
|
- wsl.gemspec
|