watirloo 0.0.7
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/.gitignore +22 -0
- data/History.txt +44 -0
- data/Manifest.txt +59 -0
- data/README.rdoc +94 -0
- data/Rakefile +68 -0
- data/VERSION +1 -0
- data/lib/watirloo/browsers.rb +73 -0
- data/lib/watirloo/desktop.rb +44 -0
- data/lib/watirloo/extension/firewatir_ducktape.rb +194 -0
- data/lib/watirloo/extension/object.rb +32 -0
- data/lib/watirloo/extension/watir_ducktape.rb +552 -0
- data/lib/watirloo/extension/watir_reflector.rb +83 -0
- data/lib/watirloo/locker.rb +85 -0
- data/lib/watirloo/page.rb +140 -0
- data/lib/watirloo.rb +16 -0
- data/spec/browser_spec.rb +38 -0
- data/spec/browser_threads_spec.rb +45 -0
- data/spec/checkbox_group_spec.rb +136 -0
- data/spec/checkbox_groups_spec.rb +55 -0
- data/spec/checkboxes_value_spec.rb +35 -0
- data/spec/desktop_spec.rb +54 -0
- data/spec/extra/browser_events_spec.rb +76 -0
- data/spec/extra/page_objects_metrics.rb +139 -0
- data/spec/face_mixing_spec.rb +55 -0
- data/spec/firewatir/attach_instance_test.rb +38 -0
- data/spec/firewatir/spec_results.html +263 -0
- data/spec/firewatir/spec_results.txt +23 -0
- data/spec/firewatir/spec_results_failed.txt +3 -0
- data/spec/html/census.html +332 -0
- data/spec/html/checkbox_group1.html +33 -0
- data/spec/html/frameset1.html +17 -0
- data/spec/html/labels.html +53 -0
- data/spec/html/no_title.html +13 -0
- data/spec/html/person.html +37 -0
- data/spec/html/radio_group.html +35 -0
- data/spec/html/select_lists.html +82 -0
- data/spec/input_element_spec.rb +51 -0
- data/spec/label_spec.rb +65 -0
- data/spec/locker_spec.rb +49 -0
- data/spec/page_spec.rb +91 -0
- data/spec/person_def_wrappers_spec.rb +40 -0
- data/spec/radio_group_spec.rb +95 -0
- data/spec/radio_groups_spec.rb +55 -0
- data/spec/reflector_spec.rb +82 -0
- data/spec/select_list_options_spec.rb +40 -0
- data/spec/select_lists_spec.rb +151 -0
- data/spec/spec_helper.rb +20 -0
- data/spec/spec_helper_ff.rb +5 -0
- data/spec/spec_helper_runner.rb +13 -0
- data/spec/spec_results.html +556 -0
- data/spec/spec_results.txt +175 -0
- data/spec/spec_results_failed.txt +1 -0
- data/spec/text_fields_spec.rb +56 -0
- data/watirloo.gemspec +122 -0
- metadata +150 -0
@@ -0,0 +1,139 @@
|
|
1
|
+
# see this;http://blog.jayfields.com/2008/02/ruby-dynamically-define-method.html
|
2
|
+
if VERSION <= '1.8.6'
|
3
|
+
class Object
|
4
|
+
module InstanceExecHelper; end
|
5
|
+
include InstanceExecHelper
|
6
|
+
# instance_exec method evaluates a block of code relative to the specified object, with parameters whom come from outside the object.
|
7
|
+
def instance_exec(*args, &block)
|
8
|
+
begin
|
9
|
+
old_critical, Thread.critical = Thread.critical, true
|
10
|
+
n = 0
|
11
|
+
n += 1 while respond_to?(mname="__instance_exec#{n}")
|
12
|
+
InstanceExecHelper.module_eval{ define_method(mname, &block) }
|
13
|
+
ensure
|
14
|
+
Thread.critical = old_critical
|
15
|
+
end
|
16
|
+
begin
|
17
|
+
ret = send(mname, *args)
|
18
|
+
ensure
|
19
|
+
InstanceExecHelper.module_eval{ remove_method(mname) } rescue nil
|
20
|
+
end
|
21
|
+
ret
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# Need to rethink this page adapter idea
|
27
|
+
# I can make shortcuts to page elements with either blocks or defs or some hashmaps.
|
28
|
+
# def is the easiest most versitile I think
|
29
|
+
#
|
30
|
+
# what does it buy me to have this mechanism for defining pageobjects?
|
31
|
+
# pageobject(:name) {browser.text_field(:name, 'somename')}
|
32
|
+
# The way someone works with tests is they will define code like this
|
33
|
+
# browser.text_field(:name, 'somename')
|
34
|
+
# Then you can wrap it as a proc and tag it with a name as above.
|
35
|
+
# on the other hand how about storing access to objects in yaml files?
|
36
|
+
#
|
37
|
+
# ---
|
38
|
+
# :bla:
|
39
|
+
# - :text_field
|
40
|
+
# - :name
|
41
|
+
# - bla
|
42
|
+
#
|
43
|
+
# ---
|
44
|
+
# object_name: bla
|
45
|
+
# - :text_field
|
46
|
+
# - :name
|
47
|
+
# - bla
|
48
|
+
|
49
|
+
#
|
50
|
+
#
|
51
|
+
|
52
|
+
require 'benchmark'
|
53
|
+
result = Benchmark.bmbm do |test|
|
54
|
+
|
55
|
+
test.report('class eval block') do
|
56
|
+
class PageByClassEval
|
57
|
+
def self.face(name, *args, &definition)
|
58
|
+
class_eval do
|
59
|
+
define_method(name) do |*args|
|
60
|
+
instance_exec(*args, &definition)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
def browser
|
65
|
+
Watirloo.browser
|
66
|
+
end
|
67
|
+
face(:last_0) { browser.text_field(:name, "last_name0") }
|
68
|
+
#face(:last_arg) { |i| browser.text_field(:name, "last_name#{i}") }
|
69
|
+
end
|
70
|
+
10000.times do
|
71
|
+
page = PageByClassEval.new
|
72
|
+
page.last_0.value
|
73
|
+
#page.last_arg(0).value
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
test.report('regular def') do
|
78
|
+
class PageByDef
|
79
|
+
def browser
|
80
|
+
Watirloo.browser
|
81
|
+
end
|
82
|
+
def last(cc="0")
|
83
|
+
browser.text_field(:name, "last_name#{cc}")
|
84
|
+
end
|
85
|
+
end
|
86
|
+
10000.times do
|
87
|
+
page = PageByDef.new
|
88
|
+
page.last.value
|
89
|
+
#page.last(0).value
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
|
94
|
+
test.report('class eval string') do
|
95
|
+
class PageByClassEvalString
|
96
|
+
def browser
|
97
|
+
Watirloo.browser
|
98
|
+
end
|
99
|
+
def self.face(hash)
|
100
|
+
method_name = hash.keys[0]
|
101
|
+
watir_element, how, what = hash.values[0]
|
102
|
+
class_eval "def #{method_name}
|
103
|
+
browser.#{watir_element}(:#{how}, \"#{what}\")
|
104
|
+
end"
|
105
|
+
|
106
|
+
end
|
107
|
+
face :last => [:text_field, :name, "last_name0"]
|
108
|
+
end
|
109
|
+
10000.times do
|
110
|
+
page = PageByClassEvalString.new
|
111
|
+
page.last.value
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
end
|
118
|
+
|
119
|
+
|
120
|
+
puts total = result.inject(0.0) { |mem, bm| mem + bm.real }
|
121
|
+
puts "total : " + total.to_s
|
122
|
+
puts "average: " + (total/result.size.to_f).to_s
|
123
|
+
|
124
|
+
=begin
|
125
|
+
Rehearsal -----------------------------------------------------
|
126
|
+
class eval block 4.344000 1.656000 6.000000 ( 14.656000)
|
127
|
+
regular def 3.781000 1.625000 5.406000 ( 13.344000)
|
128
|
+
class eval string 3.500000 1.531000 5.031000 ( 13.375000)
|
129
|
+
------------------------------------------- total: 16.437000sec
|
130
|
+
|
131
|
+
user system total real
|
132
|
+
class eval block 4.422000 1.406000 5.828000 ( 13.953000)
|
133
|
+
regular def 3.313000 1.485000 4.798000 ( 13.344000)
|
134
|
+
class eval string 3.875000 1.171000 5.046000 ( 13.328000)
|
135
|
+
40.6250002384186
|
136
|
+
total : 40.6250002384186
|
137
|
+
average: 13.5416667461395
|
138
|
+
|
139
|
+
=end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
+
|
3
|
+
|
4
|
+
describe "Class client mixing interfaces from other modules" do
|
5
|
+
|
6
|
+
# Examples of Interface usage in Watirloo
|
7
|
+
# define interface to first and last name
|
8
|
+
module FullName
|
9
|
+
include Watirloo::Page
|
10
|
+
face(:first) {text_field(:name, 'first_nm')}
|
11
|
+
face(:last) {text_field(:name, 'last_nm')}
|
12
|
+
end
|
13
|
+
|
14
|
+
# this Address defines street name
|
15
|
+
module Address
|
16
|
+
include Watirloo::Page
|
17
|
+
face :street do
|
18
|
+
text_field(:name, 'addr1')
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# this page is a composition of interfaces that may appear by themselves
|
23
|
+
# as pages in an application.
|
24
|
+
# think of a Page as some container. It can be entire page or part of Page
|
25
|
+
# This page is composed of interfaces that appear in Address, FullName
|
26
|
+
# but become interface to PersonalInfo
|
27
|
+
# method face is shortcut for interface
|
28
|
+
class PersonalInfo
|
29
|
+
include Address
|
30
|
+
include FullName
|
31
|
+
include Watirloo::Page
|
32
|
+
face( :dob ) { text_field(:name, 'dob') }
|
33
|
+
face( :gender ) { select_list(:name, 'sex_cd') }
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
before :each do
|
38
|
+
@page = PersonalInfo.new
|
39
|
+
@page.browser.goto testfile('person.html')
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'spray and scrape example' do
|
43
|
+
data = {
|
44
|
+
:first => 'Inzynier',
|
45
|
+
:last => 'Maliniak',
|
46
|
+
:gender => 'M',
|
47
|
+
:dob => '03/25/1956',
|
48
|
+
:street => '1313 Lucky Ave'
|
49
|
+
}
|
50
|
+
@page.spray data # send params to the page to enter the data
|
51
|
+
data_return = @page.scrape data.keys
|
52
|
+
data_return.should == data
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../lib/watirloo/firewatir_ducktape'
|
2
|
+
|
3
|
+
# TESTS FIXME kill all browsers before and after the test
|
4
|
+
require 'test/spec'
|
5
|
+
|
6
|
+
describe 'firefox.new has option key :attach that does not start new browser' do
|
7
|
+
|
8
|
+
before :each do
|
9
|
+
@b = FireWatir::Firefox.start 'file:///' + File.dirname(__FILE__) + '/../html/person.html'
|
10
|
+
sleep 5
|
11
|
+
end
|
12
|
+
|
13
|
+
after :each do
|
14
|
+
@b.close
|
15
|
+
sleep 5
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'new with option :atach => true attaches to existing window and does not start new window' do
|
19
|
+
@b.title.should == 'Person'
|
20
|
+
b = FireWatir::Firefox.new :attach => true
|
21
|
+
b.title.should == 'Person'
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'why does attach instance method throw exception when only one window exists on the desktop' do
|
25
|
+
assert_raise(Watir::Exception::NoMatchingWindowFoundException) do
|
26
|
+
b = @b.attach :title, 'Person'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'why does attach instance method throw exception when attaching to original window while another exists' do
|
31
|
+
b = FireWatir::Firefox.start 'file:///' + File.dirname(__FILE__) + '/../html/census.html'
|
32
|
+
sleep 3
|
33
|
+
assert_raise(Watir::Exception::NoMatchingWindowFoundException) do
|
34
|
+
c = b.attach :title, 'Person' #attach to the setup window
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
@@ -0,0 +1,263 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
5
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
6
|
+
<head>
|
7
|
+
<title>RSpec results</title>
|
8
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
9
|
+
<meta http-equiv="Expires" content="-1" />
|
10
|
+
<meta http-equiv="Pragma" content="no-cache" />
|
11
|
+
<style type="text/css">
|
12
|
+
body {
|
13
|
+
margin: 0;
|
14
|
+
padding: 0;
|
15
|
+
background: #fff;
|
16
|
+
font-size: 80%;
|
17
|
+
}
|
18
|
+
</style>
|
19
|
+
<script type="text/javascript">
|
20
|
+
// <![CDATA[
|
21
|
+
function moveProgressBar(percentDone) {
|
22
|
+
document.getElementById("rspec-header").style.width = percentDone +"%";
|
23
|
+
}
|
24
|
+
function makeRed(element_id) {
|
25
|
+
document.getElementById(element_id).style.background = '#C40D0D';
|
26
|
+
document.getElementById(element_id).style.color = '#FFFFFF';
|
27
|
+
}
|
28
|
+
|
29
|
+
function makeYellow(element_id) {
|
30
|
+
if (element_id == "rspec-header" && document.getElementById(element_id).style.background != '#C40D0D')
|
31
|
+
{
|
32
|
+
document.getElementById(element_id).style.background = '#FAF834';
|
33
|
+
document.getElementById(element_id).style.color = '#000000';
|
34
|
+
}
|
35
|
+
else
|
36
|
+
{
|
37
|
+
document.getElementById(element_id).style.background = '#FAF834';
|
38
|
+
document.getElementById(element_id).style.color = '#000000';
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
// ]]>
|
43
|
+
</script>
|
44
|
+
<style type="text/css">
|
45
|
+
#rspec-header {
|
46
|
+
background: #65C400; color: #fff; height: 4em;
|
47
|
+
}
|
48
|
+
|
49
|
+
.rspec-report h1 {
|
50
|
+
margin: 0px 10px 0px 10px;
|
51
|
+
padding: 10px;
|
52
|
+
font-family: "Lucida Grande", Helvetica, sans-serif;
|
53
|
+
font-size: 1.8em;
|
54
|
+
position: absolute;
|
55
|
+
}
|
56
|
+
|
57
|
+
#summary {
|
58
|
+
margin: 0; padding: 5px 10px;
|
59
|
+
font-family: "Lucida Grande", Helvetica, sans-serif;
|
60
|
+
text-align: right;
|
61
|
+
top: 0px;
|
62
|
+
right: 0px;
|
63
|
+
float:right;
|
64
|
+
}
|
65
|
+
|
66
|
+
#summary p {
|
67
|
+
margin: 0 0 0 2px;
|
68
|
+
}
|
69
|
+
|
70
|
+
#summary #totals {
|
71
|
+
font-size: 1.2em;
|
72
|
+
}
|
73
|
+
|
74
|
+
.example_group {
|
75
|
+
margin: 0 10px 5px;
|
76
|
+
background: #fff;
|
77
|
+
}
|
78
|
+
|
79
|
+
dl {
|
80
|
+
margin: 0; padding: 0 0 5px;
|
81
|
+
font: normal 11px "Lucida Grande", Helvetica, sans-serif;
|
82
|
+
}
|
83
|
+
|
84
|
+
dt {
|
85
|
+
padding: 3px;
|
86
|
+
background: #65C400;
|
87
|
+
color: #fff;
|
88
|
+
font-weight: bold;
|
89
|
+
}
|
90
|
+
|
91
|
+
dd {
|
92
|
+
margin: 5px 0 5px 5px;
|
93
|
+
padding: 3px 3px 3px 18px;
|
94
|
+
}
|
95
|
+
|
96
|
+
dd.spec.passed {
|
97
|
+
border-left: 5px solid #65C400;
|
98
|
+
border-bottom: 1px solid #65C400;
|
99
|
+
background: #DBFFB4; color: #3D7700;
|
100
|
+
}
|
101
|
+
|
102
|
+
dd.spec.failed {
|
103
|
+
border-left: 5px solid #C20000;
|
104
|
+
border-bottom: 1px solid #C20000;
|
105
|
+
color: #C20000; background: #FFFBD3;
|
106
|
+
}
|
107
|
+
|
108
|
+
dd.spec.not_implemented {
|
109
|
+
border-left: 5px solid #FAF834;
|
110
|
+
border-bottom: 1px solid #FAF834;
|
111
|
+
background: #FCFB98; color: #131313;
|
112
|
+
}
|
113
|
+
|
114
|
+
dd.spec.pending_fixed {
|
115
|
+
border-left: 5px solid #0000C2;
|
116
|
+
border-bottom: 1px solid #0000C2;
|
117
|
+
color: #0000C2; background: #D3FBFF;
|
118
|
+
}
|
119
|
+
|
120
|
+
.backtrace {
|
121
|
+
color: #000;
|
122
|
+
font-size: 12px;
|
123
|
+
}
|
124
|
+
|
125
|
+
a {
|
126
|
+
color: #BE5C00;
|
127
|
+
}
|
128
|
+
|
129
|
+
/* Ruby code, style similar to vibrant ink */
|
130
|
+
.ruby {
|
131
|
+
font-size: 12px;
|
132
|
+
font-family: monospace;
|
133
|
+
color: white;
|
134
|
+
background-color: black;
|
135
|
+
padding: 0.1em 0 0.2em 0;
|
136
|
+
}
|
137
|
+
|
138
|
+
.ruby .keyword { color: #FF6600; }
|
139
|
+
.ruby .constant { color: #339999; }
|
140
|
+
.ruby .attribute { color: white; }
|
141
|
+
.ruby .global { color: white; }
|
142
|
+
.ruby .module { color: white; }
|
143
|
+
.ruby .class { color: white; }
|
144
|
+
.ruby .string { color: #66FF00; }
|
145
|
+
.ruby .ident { color: white; }
|
146
|
+
.ruby .method { color: #FFCC00; }
|
147
|
+
.ruby .number { color: white; }
|
148
|
+
.ruby .char { color: white; }
|
149
|
+
.ruby .comment { color: #9933CC; }
|
150
|
+
.ruby .symbol { color: white; }
|
151
|
+
.ruby .regex { color: #44B4CC; }
|
152
|
+
.ruby .punct { color: white; }
|
153
|
+
.ruby .escape { color: white; }
|
154
|
+
.ruby .interp { color: white; }
|
155
|
+
.ruby .expr { color: white; }
|
156
|
+
|
157
|
+
.ruby .offending { background-color: gray; }
|
158
|
+
.ruby .linenum {
|
159
|
+
width: 75px;
|
160
|
+
padding: 0.1em 1em 0.2em 0;
|
161
|
+
color: #000000;
|
162
|
+
background-color: #FFFBD3;
|
163
|
+
}
|
164
|
+
|
165
|
+
</style>
|
166
|
+
</head>
|
167
|
+
<body>
|
168
|
+
<div class="rspec-report">
|
169
|
+
|
170
|
+
<div id="rspec-header">
|
171
|
+
<div id="label">
|
172
|
+
<h1>RSpec Code Examples</h1>
|
173
|
+
</div>
|
174
|
+
|
175
|
+
<div id="summary">
|
176
|
+
<p id="totals"> </p>
|
177
|
+
<p id="duration"> </p>
|
178
|
+
</div>
|
179
|
+
</div>
|
180
|
+
|
181
|
+
<div class="results">
|
182
|
+
<div class="example_group">
|
183
|
+
<dl>
|
184
|
+
<dt id="example_group_1">text field wrapped in label tag without for attribute defined</dt>
|
185
|
+
<script type="text/javascript">makeRed('rspec-header');</script>
|
186
|
+
<script type="text/javascript">makeRed('example_group_1');</script>
|
187
|
+
<script type="text/javascript">moveProgressBar('0.9');</script>
|
188
|
+
<dd class="spec failed">
|
189
|
+
<span class="failed_spec_name">parent of text_field should be Watir Element</span>
|
190
|
+
<div class="failure" id="failure_1">
|
191
|
+
<div class="message"><pre>undefined method `kind_of??' for "":String</pre></div>
|
192
|
+
<div class="backtrace"><pre>./spec/label_spec.rb:17:</pre></div>
|
193
|
+
<pre class="ruby"><code><span class="linenum">15</span> <span class="keyword">if</span> <span class="ident">browser</span><span class="punct">.</span><span class="ident">kind_of?</span><span class="punct">(</span><span class="constant">FireWatir</span><span class="punct">::</span><span class="constant">Firefox</span><span class="punct">)</span>
|
194
|
+
<span class="linenum">16</span> <span class="ident">first</span><span class="punct">.</span><span class="ident">parent</span><span class="punct">.</span><span class="ident">should</span> <span class="ident">be_kind_of</span><span class="punct">(</span><span class="constant">String</span><span class="punct">)</span>
|
195
|
+
<span class="offending"><span class="linenum">17</span> <span class="ident">last</span><span class="punct">.</span><span class="ident">parent</span><span class="punct">.</span><span class="ident">should</span> <span class="ident">be_kind_of?</span><span class="punct">(</span><span class="constant">String</span><span class="punct">)</span></span>
|
196
|
+
<span class="linenum">18</span> <span class="ident">flunk</span><span class="punct">('</span><span class="string">FIXME Firefox returns String for parent and not Element</span><span class="punct">')</span>
|
197
|
+
<span class="linenum">19</span> </code></pre>
|
198
|
+
</div>
|
199
|
+
</dd>
|
200
|
+
<script type="text/javascript">moveProgressBar('1.8');</script>
|
201
|
+
<dd class="spec failed">
|
202
|
+
<span class="failed_spec_name">parent tagName should be a LABEL</span>
|
203
|
+
<div class="failure" id="failure_2">
|
204
|
+
<div class="message"><pre>undefined method `flunk' for #<Spec::Example::ExampleGroup::Subclass_1:0x33ca070></pre></div>
|
205
|
+
<div class="backtrace"><pre>./spec/label_spec.rb:33:</pre></div>
|
206
|
+
<pre class="ruby"><code><span class="linenum">31</span>
|
207
|
+
<span class="linenum">32</span> <span class="keyword">elsif</span> <span class="ident">browser</span><span class="punct">.</span><span class="ident">kind_of?</span><span class="punct">(</span><span class="constant">FireWatir</span><span class="punct">::</span><span class="constant">Firefox</span><span class="punct">)</span>
|
208
|
+
<span class="offending"><span class="linenum">33</span> <span class="ident">flunk</span><span class="punct">('</span><span class="string">FIXME Firefox returns String for parent and not Element</span><span class="punct">')</span></span>
|
209
|
+
<span class="linenum">34</span> <span class="keyword">end</span>
|
210
|
+
<span class="linenum">35</span> <span class="keyword">end</span></code></pre>
|
211
|
+
</div>
|
212
|
+
</dd>
|
213
|
+
<script type="text/javascript">moveProgressBar('2.7');</script>
|
214
|
+
<dd class="spec failed">
|
215
|
+
<span class="failed_spec_name">parent text returns text of label</span>
|
216
|
+
<div class="failure" id="failure_3">
|
217
|
+
<div class="message"><pre>undefined method `flunk' for #<Spec::Example::ExampleGroup::Subclass_1:0x3324cd8></pre></div>
|
218
|
+
<div class="backtrace"><pre>./spec/label_spec.rb:43:</pre></div>
|
219
|
+
<pre class="ruby"><code><span class="linenum">41</span>
|
220
|
+
<span class="linenum">42</span> <span class="keyword">elsif</span> <span class="ident">browser</span><span class="punct">.</span><span class="ident">kind_of?</span><span class="punct">(</span><span class="constant">FireWatir</span><span class="punct">::</span><span class="constant">Firefox</span><span class="punct">)</span>
|
221
|
+
<span class="offending"><span class="linenum">43</span> <span class="ident">flunk</span><span class="punct">('</span><span class="string">FIXME Firefox returns String for parent and not Element.</span><span class="punct">')</span></span>
|
222
|
+
<span class="linenum">44</span> <span class="keyword">end</span>
|
223
|
+
<span class="linenum">45</span> <span class="keyword">end</span></code></pre>
|
224
|
+
</div>
|
225
|
+
</dd>
|
226
|
+
</dl>
|
227
|
+
</div>
|
228
|
+
<div class="example_group">
|
229
|
+
<dl>
|
230
|
+
<dt id="example_group_2">label for text field not wrapped</dt>
|
231
|
+
<script type="text/javascript">moveProgressBar('3.6');</script>
|
232
|
+
<dd class="spec passed"><span class="passed_spec_name">text value of label</span></dd>
|
233
|
+
</dl>
|
234
|
+
</div>
|
235
|
+
<div class="example_group">
|
236
|
+
<dl>
|
237
|
+
<dt id="example_group_3">SelectList selections</dt>
|
238
|
+
<script type="text/javascript">moveProgressBar('4.5');</script>
|
239
|
+
<dd class="spec passed"><span class="passed_spec_name">selected returns preselected item in single select</span></dd>
|
240
|
+
<script type="text/javascript">moveProgressBar('5.4');</script>
|
241
|
+
<dd class="spec passed"><span class="passed_spec_name">selected returns preselected value in single select</span></dd>
|
242
|
+
<script type="text/javascript">moveProgressBar('6.3');</script>
|
243
|
+
<dd class="spec passed"><span class="passed_spec_name">selected returns nil for none selected items in multi select</span></dd>
|
244
|
+
<script type="text/javascript">moveProgressBar('7.2');</script>
|
245
|
+
<dd class="spec passed"><span class="passed_spec_name">selected returns nil for none selected values in multi select</span></dd>
|
246
|
+
<script type="text/javascript">moveProgressBar('8.1');</script>
|
247
|
+
<dd class="spec passed"><span class="passed_spec_name">set item text and find selected item and text for multiselect</span></dd>
|
248
|
+
<script type="text/javascript">moveProgressBar('9.0');</script>
|
249
|
+
<dd class="spec passed"><span class="passed_spec_name">set value and find selected item and value for multiselect</span></dd>
|
250
|
+
<script type="text/javascript">moveProgressBar('10.0');</script>
|
251
|
+
<dd class="spec passed"><span class="passed_spec_name">set and query option by text for single select</span></dd>
|
252
|
+
<script type="text/javascript">moveProgressBar('10.9');</script>
|
253
|
+
<dd class="spec passed"><span class="passed_spec_name">set and query option by value for single select</span></dd>
|
254
|
+
<script type="text/javascript">moveProgressBar('11.8');</script>
|
255
|
+
<dd class="spec passed"><span class="passed_spec_name">set by text multple items for multiselect selects each item</span></dd>
|
256
|
+
<script type="text/javascript">moveProgressBar('12.7');</script>
|
257
|
+
<dd class="spec passed"><span class="passed_spec_name">set by value multple items for multiselect selects each item</span></dd>
|
258
|
+
<script type="text/javascript">moveProgressBar('13.6');</script>
|
259
|
+
<dd class="spec passed"><span class="passed_spec_name">set items array for single select selects each in turn. selected is the last item in array</span></dd>
|
260
|
+
<script type="text/javascript">moveProgressBar('14.5');</script>
|
261
|
+
<dd class="spec passed"><span class="passed_spec_name">set item after multiple items were set returns all values selected for multiselect</span></dd>
|
262
|
+
<script type="text/javascript">moveProgressBar('15.4');</script>
|
263
|
+
<dd class="spec passed"><span class="passed_spec_name">set using position for multiselect</span></dd>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
text field wrapped in label tag without for attribute defined
|
3
|
+
- parent of text_field should be Watir Element (FAILED - 1)
|
4
|
+
- parent tagName should be a LABEL (FAILED - 2)
|
5
|
+
- parent text returns text of label (FAILED - 3)
|
6
|
+
|
7
|
+
label for text field not wrapped
|
8
|
+
- text value of label
|
9
|
+
|
10
|
+
SelectList selections
|
11
|
+
- selected returns preselected item in single select
|
12
|
+
- selected returns preselected value in single select
|
13
|
+
- selected returns nil for none selected items in multi select
|
14
|
+
- selected returns nil for none selected values in multi select
|
15
|
+
- set item text and find selected item and text for multiselect
|
16
|
+
- set value and find selected item and value for multiselect
|
17
|
+
- set and query option by text for single select
|
18
|
+
- set and query option by value for single select
|
19
|
+
- set by text multple items for multiselect selects each item
|
20
|
+
- set by value multple items for multiselect selects each item
|
21
|
+
- set items array for single select selects each in turn. selected is the last item in array
|
22
|
+
- set item after multiple items were set returns all values selected for multiselect
|
23
|
+
- set using position for multiselect
|
@@ -0,0 +1,3 @@
|
|
1
|
+
text field wrapped in label tag without for attribute defined parent of text_field should be Watir Element
|
2
|
+
text field wrapped in label tag without for attribute defined parent tagName should be a LABEL
|
3
|
+
text field wrapped in label tag without for attribute defined parent text returns text of label
|