wsl 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +18 -0
- data/README.txt +18 -0
- data/Rakefile +15 -0
- data/examples/ClickExample.rb +37 -0
- data/examples/DemoExample.rb +41 -0
- data/examples/DemoTestSuite.rb +18 -0
- data/examples/GoogleSearchExample_WSL.rb +19 -0
- data/examples/SelectExample.rb +50 -0
- data/examples/SuiteCleanup.rb +9 -0
- data/examples/SuiteStartup.rb +9 -0
- data/lib/IEContext.rb +73 -0
- data/lib/utils/Logger.rb +311 -0
- data/lib/utils/TestSuiteCleanup.rb +24 -0
- data/lib/utils/TestSuiteStartup.rb +29 -0
- data/lib/wsl.rb +600 -0
- data/lib/wslPrivate.rb +40 -0
- data/lib/wslSuite.rb +32 -0
- data/wsl.gemspec +34 -0
- metadata +91 -0
data/lib/wslPrivate.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# This file contains any support functions the browser language file uses.
|
2
|
+
# It is to keep the code clean and seperated from the browser language file.
|
3
|
+
# These functions should not be called directly in any test scripts.
|
4
|
+
# TODO: work out how to make these 'private' so cannot be called in test scripts.
|
5
|
+
|
6
|
+
##
|
7
|
+
# Called by assert_url.
|
8
|
+
#
|
9
|
+
def assert_url_conditions(currentUrl, url, timeout, orFailValue=nil)
|
10
|
+
# Pass: url matches
|
11
|
+
if currentUrl.to_s.downcase == url.to_s.downcase
|
12
|
+
@myBrowser.logger.logActualResult(Wsl::CustomLogger::pass, "'" +
|
13
|
+
url + "' is current url.")
|
14
|
+
return true
|
15
|
+
# Fail: orFailValue found in url.
|
16
|
+
elsif currentUrl.to_s.downcase == orFailValue.to_s.downcase then
|
17
|
+
@myBrowser.logger.logActualResult(Wsl::CustomLogger::fail, "'" +
|
18
|
+
url + "' is same as fail value: '" + orFailValue + "'")
|
19
|
+
return false
|
20
|
+
# Fail: orFailValue found in body text.
|
21
|
+
elsif orFailValue != nil && defined? @myBrowser.assert_text_in_body(orFailValue) then
|
22
|
+
@myBrowser.logger.logActualResult(Wsl::CustomLogger::fail, "'" +
|
23
|
+
orFailValue + "' found in body text.")
|
24
|
+
return false
|
25
|
+
# Fail: timeout period expired.
|
26
|
+
else
|
27
|
+
@myBrowser.logger.logActualResult(Wsl::CustomLogger::fail,
|
28
|
+
" Failed because of timeout (" + timeout.to_s + " secs).")
|
29
|
+
return false
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# TODO: make this a closure.
|
34
|
+
def check_for_text(text)
|
35
|
+
begin
|
36
|
+
return @myBrowser.assert_text_in_body(text) == nil
|
37
|
+
rescue => ex
|
38
|
+
return false
|
39
|
+
end
|
40
|
+
end
|
data/lib/wslSuite.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
##
|
2
|
+
# Declare the startup scripts here.
|
3
|
+
#
|
4
|
+
# scripts: The startup scripts to load.
|
5
|
+
#
|
6
|
+
def startup_script(*scripts)
|
7
|
+
scripts.each do |script|
|
8
|
+
require script
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
##
|
13
|
+
# Declare the test suite here.
|
14
|
+
#
|
15
|
+
# tests: The tests to load and execute.
|
16
|
+
#
|
17
|
+
def test_suite(*tests)
|
18
|
+
tests.each do |test|
|
19
|
+
require test
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
##
|
24
|
+
# Declare the cleanup scripts here.
|
25
|
+
#
|
26
|
+
# scripts: The cleanup scripts to load.
|
27
|
+
#
|
28
|
+
def cleanup_script(*scripts)
|
29
|
+
scripts.each do |script|
|
30
|
+
require script
|
31
|
+
end
|
32
|
+
end
|
data/wsl.gemspec
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{wsl}
|
5
|
+
s.version = "0.1.4"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Wadud Ruf"]
|
9
|
+
s.date = %q{2009-06-22}
|
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
|
+
s.email = %q{wadud.ruf@xqoob.com}
|
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", "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"]
|
14
|
+
s.has_rdoc = true
|
15
|
+
s.homepage = %q{http://wsl.xqoob.com}
|
16
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Wsl", "--main", "README.txt"]
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
s.rubyforge_project = %q{wsl}
|
19
|
+
s.rubygems_version = %q{1.3.1}
|
20
|
+
s.summary = %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.}
|
21
|
+
|
22
|
+
if s.respond_to? :specification_version then
|
23
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
24
|
+
s.specification_version = 2
|
25
|
+
|
26
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
27
|
+
s.add_runtime_dependency(%q<watir>, [">= 1.6.2"])
|
28
|
+
else
|
29
|
+
s.add_dependency(%q<watir>, [">= 1.6.2"])
|
30
|
+
end
|
31
|
+
else
|
32
|
+
s.add_dependency(%q<watir>, [">= 1.6.2"])
|
33
|
+
end
|
34
|
+
end
|
metadata
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: wsl
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Wadud Ruf
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-06-22 00:00:00 +01:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: watir
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.6.2
|
24
|
+
version:
|
25
|
+
description: WSL (WATiR Scripting Language) is a DSL built on top of WATiR that allows for the automation of web application testing through Internet Explorer.
|
26
|
+
email: wadud.ruf@xqoob.com
|
27
|
+
executables: []
|
28
|
+
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files:
|
32
|
+
- lib/IEContext.rb
|
33
|
+
- lib/utils/Logger.rb
|
34
|
+
- lib/utils/TestSuiteCleanup.rb
|
35
|
+
- lib/utils/TestSuiteStartup.rb
|
36
|
+
- lib/wsl.rb
|
37
|
+
- lib/wslPrivate.rb
|
38
|
+
- lib/wslSuite.rb
|
39
|
+
- README.txt
|
40
|
+
files:
|
41
|
+
- examples/ClickExample.rb
|
42
|
+
- examples/DemoExample.rb
|
43
|
+
- examples/DemoTestSuite.rb
|
44
|
+
- examples/GoogleSearchExample_WSL.rb
|
45
|
+
- examples/SelectExample.rb
|
46
|
+
- examples/SuiteCleanup.rb
|
47
|
+
- examples/SuiteStartup.rb
|
48
|
+
- lib/IEContext.rb
|
49
|
+
- lib/utils/Logger.rb
|
50
|
+
- lib/utils/TestSuiteCleanup.rb
|
51
|
+
- lib/utils/TestSuiteStartup.rb
|
52
|
+
- lib/wsl.rb
|
53
|
+
- lib/wslPrivate.rb
|
54
|
+
- lib/wslSuite.rb
|
55
|
+
- Manifest
|
56
|
+
- Rakefile
|
57
|
+
- README.txt
|
58
|
+
- wsl.gemspec
|
59
|
+
has_rdoc: true
|
60
|
+
homepage: http://wsl.xqoob.com
|
61
|
+
post_install_message:
|
62
|
+
rdoc_options:
|
63
|
+
- --line-numbers
|
64
|
+
- --inline-source
|
65
|
+
- --title
|
66
|
+
- Wsl
|
67
|
+
- --main
|
68
|
+
- README.txt
|
69
|
+
require_paths:
|
70
|
+
- lib
|
71
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: "0"
|
76
|
+
version:
|
77
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: "1.2"
|
82
|
+
version:
|
83
|
+
requirements: []
|
84
|
+
|
85
|
+
rubyforge_project: wsl
|
86
|
+
rubygems_version: 1.3.1
|
87
|
+
signing_key:
|
88
|
+
specification_version: 2
|
89
|
+
summary: WSL (WATiR Scripting Language) is a DSL built on top of WATiR that allows for the automation of web application testing through Internet Explorer.
|
90
|
+
test_files: []
|
91
|
+
|