firewatir 1.6.7 → 1.7.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +16 -2
- data/README.rdoc +5 -5
- data/VERSION +1 -1
- data/lib/firewatir/element.rb +10 -0
- data/lib/firewatir/element_collections.rb +5 -1
- data/unittests/html/a.html +13 -0
- data/unittests/html_case_sensitive_tags_test.rb +29 -0
- data/unittests/xhtml_case_sensitive_tags_test.rb +30 -0
- metadata +19 -12
data/CHANGES
CHANGED
@@ -1,9 +1,23 @@
|
|
1
|
+
== Version 1.7.0 - 2010/12/20
|
2
|
+
|
3
|
+
=== IE improvements
|
4
|
+
|
5
|
+
* Fixed Watir::IE#close_all. Closes http://jira.openqa.org/browse/WTR-463 (Jarmo Pertman)
|
6
|
+
* IE#wait waits now again until browser has a state of READYSTATE_COMPLETE due to strange timing issues. Closes http://jira.openqa.org/browse/WTR-466 (Jarmo Pertman)
|
7
|
+
* Added CSS3 selectors with usage like browser.text_field(:css => "input[name='text1']") (Jonas Tingeborn)
|
8
|
+
* Updated bundled version of AutoIt to 3.3.6.1. Closes http://jira.openqa.org/browse/WTR-440 (Jarmo Pertman)
|
9
|
+
|
10
|
+
=== Firefox improvements
|
11
|
+
|
12
|
+
* Fixed Element#exists? for cases where nested elements were used for locating (Alok Menghrajani)
|
13
|
+
* Ignore uppercase tags in XHTML when searching for elements (Alok Menghrajani)
|
14
|
+
|
1
15
|
== Version 1.6.7 - 2010/10/26
|
2
16
|
|
3
17
|
=== General improvements
|
4
18
|
|
5
|
-
* added new waiting methods
|
6
|
-
* added new waiting methods
|
19
|
+
* added new waiting methods for Watir::Element: #when_present, #wait_until_present and #wait_while_present (Jari Bakken and Jarmo Pertman)
|
20
|
+
* added new waiting methods for Watir::IE and Watir::Firefox: #wait_until and #wait_while (Jari Bakken and Jarmo Pertman)
|
7
21
|
* added method #present? for Watir::Element (Jari Bakken and Jarmo Pertman)
|
8
22
|
* deprecated old waiting methods in Watir::Waiter which will be removed in some future version - use Watir::Wait instead (Jarmo Pertman)
|
9
23
|
|
data/README.rdoc
CHANGED
@@ -46,11 +46,11 @@ To install Firefox driver:
|
|
46
46
|
|
47
47
|
Some examples from http://watir.com/examples
|
48
48
|
|
49
|
-
|
49
|
+
Loading Watir gem to drive Internet Explorer on Windows
|
50
50
|
|
51
51
|
require 'watir'
|
52
52
|
|
53
|
-
|
53
|
+
Loading FireWatir gem to drive Firefox on Windows/Mac/Linux
|
54
54
|
|
55
55
|
require 'firewatir'
|
56
56
|
|
@@ -69,8 +69,8 @@ Setting a multi-line text box
|
|
69
69
|
|
70
70
|
Setting and clearing a radio button
|
71
71
|
|
72
|
-
browser.radio(:value => "
|
73
|
-
browser.radio(:value => "
|
72
|
+
browser.radio(:value => "Watir").set
|
73
|
+
browser.radio(:value => "Watir").clear
|
74
74
|
|
75
75
|
Setting and clearing check boxes
|
76
76
|
|
@@ -94,7 +94,7 @@ Clicking a button
|
|
94
94
|
|
95
95
|
Checking for text in a page
|
96
96
|
|
97
|
-
puts browser.text.include?
|
97
|
+
puts browser.text.include?("Your response has been recorded.")
|
98
98
|
|
99
99
|
Checking the title of a page
|
100
100
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.7.0.rc1
|
data/lib/firewatir/element.rb
CHANGED
@@ -264,6 +264,9 @@ module FireWatir
|
|
264
264
|
jssh_command = "var isButtonElement = false;"
|
265
265
|
end
|
266
266
|
|
267
|
+
# In HTML, getElementsByTagName is case insensitive. However, in XHTML, it needs to be lowercase.
|
268
|
+
tag = tag.downcase
|
269
|
+
|
267
270
|
# Because in both the below cases we need to get element with respect to document.
|
268
271
|
# when we locate a frame document is automatically adjusted to point to HTML inside the frame
|
269
272
|
if(@container.class == FireWatir::Firefox || @container.class == Frame)
|
@@ -278,6 +281,13 @@ module FireWatir
|
|
278
281
|
#puts "container name is: " + @container.element_name
|
279
282
|
#locate if defined? locate
|
280
283
|
#@container.locate
|
284
|
+
|
285
|
+
# We cannot assume that the container exists at this point, because code like:
|
286
|
+
# b.div(:id, "something_that_does_not_exist").h2(:text, /foobar/).exists? would return true
|
287
|
+
if (!@container.exists?)
|
288
|
+
return nil
|
289
|
+
end
|
290
|
+
|
281
291
|
jssh_command << "var elements_#{@@current_level}_#{tag} = #{@container.element_name}.getElementsByTagName(\"#{tag}\");"
|
282
292
|
if(types != nil and (types.include?("textarea") or types.include?("button") ) )
|
283
293
|
jssh_command << "elements_#{@@current_level}_#{tag} = #{@container.element_name}.getElementsByTagName(\"*\");"
|
@@ -39,7 +39,7 @@ module FireWatir
|
|
39
39
|
end
|
40
40
|
|
41
41
|
|
42
|
-
# Return all the elements of
|
42
|
+
# Return all the elements of given tag and type inside the container.
|
43
43
|
#
|
44
44
|
# Input:
|
45
45
|
# tag - tag name of the elements
|
@@ -66,6 +66,10 @@ module FireWatir
|
|
66
66
|
else
|
67
67
|
search_tag = tag
|
68
68
|
end
|
69
|
+
|
70
|
+
# In HTML, getElementsByTagName is case insensitive. However, in XHTML, it needs to be lowercase.
|
71
|
+
search_tag = search_tag.downcase
|
72
|
+
|
69
73
|
jssh_command << "var #{elements_tag} = null; "
|
70
74
|
jssh_command << "#{elements_tag} = #{container_name}.getElementsByTagName(\"#{search_tag}\");"
|
71
75
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<html>
|
2
|
+
<body>
|
3
|
+
|
4
|
+
<ul>
|
5
|
+
<li><a href="http://watir.com/" id="link1">lowercase link</a></li>
|
6
|
+
<li><A href="http://watir.com/" id="link2">uppercase link</A></li>
|
7
|
+
<li><a href="http://watir.com/" ID="link3">another lowercase link</a></li>
|
8
|
+
<li><A href="http://watir.com/" ID="link4">another uppercase link</A></li>
|
9
|
+
</ul>
|
10
|
+
|
11
|
+
</body>
|
12
|
+
</html>
|
13
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
|
2
|
+
require 'unittests/setup'
|
3
|
+
|
4
|
+
class TC_HTML_Case_Sensitive_Tags < Test::Unit::TestCase
|
5
|
+
include Watir::Exception
|
6
|
+
location __FILE__
|
7
|
+
|
8
|
+
def setup
|
9
|
+
uses_page "a.html"
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_html
|
13
|
+
# HTML is not case sensitive, so all the links on the page should exist.
|
14
|
+
assert browser.link(:id, "link1").exists?, "Could not find link1 by :id"
|
15
|
+
assert browser.link(:id, "link2").exists?, "Could not find link2 by :id"
|
16
|
+
assert browser.link(:id, "link3").exists?, "Could not find link3 by :id"
|
17
|
+
assert browser.link(:id, "link4").exists?, "Could not find link4 by :id"
|
18
|
+
|
19
|
+
links = browser.links
|
20
|
+
assert(links.size == 4, "Links did not find 2 elements")
|
21
|
+
|
22
|
+
links_text = [links[0].text, links[1].text, links[2].text, links[3].text].sort
|
23
|
+
|
24
|
+
assert(links_text[0] == "another lowercase link", "Links did not find link3")
|
25
|
+
assert(links_text[1] == "another uppercase link", "Links did not find link4")
|
26
|
+
assert(links_text[2] == "lowercase link", "Links did not find link1")
|
27
|
+
assert(links_text[3] == "uppercase link", "Links did not find link2")
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
|
2
|
+
require 'unittests/setup'
|
3
|
+
|
4
|
+
class TC_XHTML_Case_Sensitive_Tags < Test::Unit::TestCase
|
5
|
+
include Watir::Exception
|
6
|
+
location __FILE__
|
7
|
+
|
8
|
+
def setup
|
9
|
+
uses_page "a.xhtml"
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_html
|
13
|
+
# XHTML is case sensitive, so only link 1 is valid.
|
14
|
+
# link3 will work if you use ":ID"
|
15
|
+
|
16
|
+
assert browser.link(:id, "link1").exists?, "Could not find link1 by :id"
|
17
|
+
assert !browser.link(:id, "link2").exists?, "Found link2 by :id"
|
18
|
+
assert !browser.link(:id, "link3").exists?, "Found link3 by :id"
|
19
|
+
assert browser.link(:ID, "link3").exists?, "Could not find link3 by :ID"
|
20
|
+
assert !browser.link(:id, "link4").exists?, "Found link4 by :id"
|
21
|
+
|
22
|
+
links = browser.links
|
23
|
+
assert(links.size == 2, "Links did not find 2 elements")
|
24
|
+
|
25
|
+
links_text = [links[0].text, links[1].text].sort
|
26
|
+
|
27
|
+
assert(links_text[0] == "another lowercase link", "Links did not find link1")
|
28
|
+
assert(links_text[1] == "lowercase link", "Links did not find link3")
|
29
|
+
end
|
30
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: firewatir
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 977940582
|
5
|
+
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
- 6
|
9
8
|
- 7
|
10
|
-
|
9
|
+
- 0
|
10
|
+
- rc1
|
11
|
+
version: 1.7.0.rc1
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- Angrez Singh
|
@@ -15,7 +16,7 @@ autorequire:
|
|
15
16
|
bindir: bin
|
16
17
|
cert_chain: []
|
17
18
|
|
18
|
-
date: 2010-
|
19
|
+
date: 2010-12-21 00:00:00 +02:00
|
19
20
|
default_executable:
|
20
21
|
dependencies:
|
21
22
|
- !ruby/object:Gem::Dependency
|
@@ -26,12 +27,13 @@ dependencies:
|
|
26
27
|
requirements:
|
27
28
|
- - "="
|
28
29
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
30
|
+
hash: 977940582
|
30
31
|
segments:
|
31
32
|
- 1
|
32
|
-
- 6
|
33
33
|
- 7
|
34
|
-
|
34
|
+
- 0
|
35
|
+
- rc1
|
36
|
+
version: 1.7.0.rc1
|
35
37
|
type: :runtime
|
36
38
|
version_requirements: *id001
|
37
39
|
- !ruby/object:Gem::Dependency
|
@@ -100,6 +102,7 @@ files:
|
|
100
102
|
- unittests/frame_test.rb
|
101
103
|
- unittests/hidden_test.rb
|
102
104
|
- unittests/hidden_xpath_test.rb
|
105
|
+
- unittests/html_case_sensitive_tags_test.rb
|
103
106
|
- unittests/images_test.rb
|
104
107
|
- unittests/images_xpath_test.rb
|
105
108
|
- unittests/javascript_test.rb
|
@@ -117,6 +120,8 @@ files:
|
|
117
120
|
- unittests/table_xpath_test.rb
|
118
121
|
- unittests/textfields_test.rb
|
119
122
|
- unittests/textfields_xpath_test.rb
|
123
|
+
- unittests/xhtml_case_sensitive_tags_test.rb
|
124
|
+
- unittests/html/a.html
|
120
125
|
- unittests/html/blankpage.html
|
121
126
|
- unittests/html/buttons1.html
|
122
127
|
- unittests/html/checkboxes1.html
|
@@ -208,12 +213,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
208
213
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
209
214
|
none: false
|
210
215
|
requirements:
|
211
|
-
- - "
|
216
|
+
- - ">"
|
212
217
|
- !ruby/object:Gem::Version
|
213
|
-
hash:
|
218
|
+
hash: 25
|
214
219
|
segments:
|
215
|
-
-
|
216
|
-
|
220
|
+
- 1
|
221
|
+
- 3
|
222
|
+
- 1
|
223
|
+
version: 1.3.1
|
217
224
|
requirements:
|
218
225
|
- Mozilla Firefox browser 1.5 or later.
|
219
226
|
rubyforge_project: Watir
|