Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Not A Bug
-
Affects Version/s: 0.6.0
-
Fix Version/s: 0.6.1
-
Component/s: Core, Manual/Documentation
-
Labels:None
-
Number of attachments :
Description
Ref: http://markmail.org/thread/atmnaqk2kqthecux
At http://www.gebish.org/manual/current/navigator.html#accessing_tag_name_attributes_text_and_classes we have:
"""
$("p").classes() == ["a", "para"]
"""
This implies that classes() returns a List. As far as I can see, it is actually a java.util.HashSet.
For example, this had me briefly flummoxed:
"""
resultLink.with
"""
Gives:
—
C:\DEVELOPMENT\Geb>groovy Transentia.geb
Caught: Assertion failed:
assert l.parent().classes() == ['entry-title']
| false | ||
| [entry-title] | ||
| [<h3 class="entry-title">] [<a href="http://wordpress.transentia.com.au/wordpress/2011/07/10/groovyg rails-live-snippets/">] |
at Transentia$_run_closure2_closure4.doCall(Transentia.geb:40)
at Transentia$_run_closure2.doCall(Transentia.geb:37)
at Transentia$_run_closure2.doCall(Transentia.geb)
at geb.Browser.drive(Browser.groovy:538)
at geb.Browser.drive(Browser.groovy:508)
at Transentia.run(Transentia.geb:14)
—
While:
"""
resultLink.with
"""
Works OK.
"""
println l.parent().classes().dump()
"""
Gives:
—
<java.util.HashSet@7b41a13d map=[entry-title:java.lang.Object@319762c8]>
—
Maybe the doco needs a quick tweak?
Issue Links
- is superceded by
-
GEB-125
Make Navigator.classes() return List<String> and sort it alphabetically.
-
I'm going to change this to explicitly return a sorted list, and have opened a new issue for this which is linked to this one.