I'm going to address jarib's gist at http://gist.github.com/207724
for the stuff under 'discussion', I discuss inline (and generally say the
route I took in my fork of watir); for the bugs, I mostly just say whether
they are fixed in my fork.

>  Discussion
>
>    - [bug guard WTR-346] Should Image#{width,height,file_size} return
>    String or Integer?
>
> Integer. mine does this.

>
>    - [bug guard WTR-347] {Button,Image}#src returns full path in IE,
>    actual attribute in Celerity - add deviation guard? (This also affects the
>    Image#file_created_date spec)
>
> tricky, I think IE and firefox behave differently there too.

>
>    - [deviation guard] Element#style returns actual style string on
>    Celerity, calculated style in IE
>
> I think it should return the object, so that you can do
element.style.backgroundColor and the like.

>
>    - [bug guard WTR-348] Browser#status does not return the value of
>    window.status
>
> yeah, we should probably make #status return this; make some other method
return @ie.statusText.

>
>    - [bug guard WTR-350] Element#to_s includes tag name in Celerity, not
>    in Watir. Perhaps these should be changed anyway?
>
> Should include tag name. mine does.

>
>    - [bug guard WTR-351] Element.new raises ArgumentError with wrong
>    message
>
> fixed in mine; all Elements use the same initialize method. though it takes
3 arguments, one optional.

>
>    - [deviation guard] Div#text should return an empty string if the div
>    is hidden. Or should it?
>
> I can't see why it should. if I want the text, I use #text regardless of
visibility; if I want to know if it's visible I use #visible?. If I want to
know what text is visible, I'd use both methods. If I want to know what text
exists even if it's not visible, this would take away that capability. The
two aren't related and #text shouldn't be affected. Maybe a new method,
#visible_text ?

Somewhat tangentially, #visible? seems to return false if a thing is
disabled - from #visible? (in Element class for IE-watir)
  if object.invoke('isDisabled')
    return false
  end
This seems wrong to me. Disabled is different than visible; disabled
elements are still visible (well, except when they aren't).

>
>    - Container#option should be available from top level (Browser) or not?
>
> Yes. It is in mine.

>
>    - Container#cells,rows should only be available on Table elements?
>
> Yes. Mine has:
- Table#cells - returns cells of this table (not in any nested tables)
- Table#rows - returns rows of this table (not in any nested tables)
- TableRow#cells - cells of this row (not in any nested tables)
- Container#table_cells - any <td> or <th> element (if called on a Table,
this does go into nested ones)
- Container#table_rows - any <tr> element (if called on a Table, this does
go into nested ones)

>
> Watir bugs
>
>    - [bug guard WTR-343] Browser#element_by_xpath not returning Watir
>    objects
>
> I changed this to #element_object_by_xpath in mine, as it returns an ole
object or jssh object. Element objects are returned by container methods,
for example container.div(:xpath, whatever')

>
>    - [bug guard WTR-344] Browser#elements_by_xpath doesn't support
>    wildcard xpaths
>
> Yeah, I started looking for a more thorough xpath implementation briefly,
but stopped because my application doesn't really use xpath.

>
>    - [bug guard WTR-327] Browser#element_by_xpath should return a
>    Watir::Element if there are no matching elements, not nil
>
> container.div(:xpath, 'whatever') does this. Mine doesn't have an
#element_by_xpath anymore, so doesn't really apply.

>
>    - [bug guard WTR-328] Browser#elements_by_xpath should return an empty
>    Array if there are no matching elements
>
> Maybe we should come up with a better standard for specifying by xpath. for
single elements, container methods with how=:xpath is good and consistent, I
think, but for collections, I don't have a solution currently. My watir
usage doesn't really use xpath at the moment, so haven't done much with
this.

>
>    - [bug guard WTR-349] Buttons#length is missing two buttons
>
> this should work in mine

>
>    - [bug guard WTR-349] Buttons#last fails
>
> this should work in mine

>
>    - [bug guard WTR-355] Form should accept 'class' as how argument
>
> works in mine

>
>    - [bug guard WTR-356] Form#exists? should raise TypeError on invalid
>    'what' argument.
>
> shouldn't this raise MissingWayOfFindingException on #initialize if 'what'
is invalid? thus not be instantiated with invalid 'what'

>
>    - [bug guard WTR-352] Element#parent should return the correct Watir
>    object type if possible.
>
> works in mine

>
>    - [bug guaard WTR-353] TextField#visible? should return false if
>    type='hidden'
>
> works in mine

>
>    - [bug guard WTR-354]TableRow#length,Table#row_count, 
> TableRows#lengthshould return the correct number of cells
>
> TableRow#length isn't defined in mine, though I don't think that's a good
method name. table_row.cell_count is good (and is defined in mine - I think
it is in Watir too), but #length seems confusing, it's not really apparent
whether that would mean length of the cells collection. why not the length
of the text of the row, for example? stick to #cell_count, I say.
Table#row_count works; #length on the collection works in mine.

>
>    - Not implemented:
>       - [not compliant guard] Element#{double,right}_click
>
> not in mine yet

>
>    -
>       - [not compliant guard] Frame#exist?, Frame#exists?
>
> should work in mine, I'm not sure what the problem is though

>
>    -
>       - [not compliant guard] Frame#execute_script
>
> not in mine yet

>
>    -
>       - [not compliant guard] Frame#element_by_xpath,
>       Frames#element_by_xpath
>
> see above

>
>    -
>       - [not compliant guard] Container#frames
>
> works in mine

>
>    -
>       - [not compliant guard] Frame#to_s
>
> mine is consistent with any other element

>
>    -
>       - [bug guard WTR-229] Option#selected?
>
> #selected works in mine; can alias to #selected?

>
>    -
>       -
>       - [bug guard WTR-331] Option#class_name
>
> works in mine

>
>    -
>       - [bug guard WTR-357] Browser#{body,bodies} for table bodies.
>
> #tbody, #tbodies works in mine (I think #body is wrong and confusing as
there is a <body> tag, which can be represented by a watir element).

>
>    -
>       - [bug guard WTR-358] Browser#{tfoot,tfoots} for table footers.
>
> not in mine

>
>    -
>       - [bug guard WTR-358] Browser#{thead,theads} for table headers.
>
> not in mine

>
>    -
>       - [bug guard WTR-359]TableRow#child_cell
>
> not sure what this would do - looking at the ticket, seems like
table_row.child_cell(n) is equivalent to table_row.cells[n], which works in
mine. I may be interpreting wrong though.

>
>    -
>       - [bug guard WTR-359]TableRow#each_with_index
>
> you can do table_row.cells.each_with_index. isn't that good enough?

>
>    -
>       - [bug guard WTR-359] TableBodies#each_with_index
>
> same with tbody.rows.each_with_index

>
>    -
>    - Missing tags:
>       - [bug guard WTR-332] Uls (collection)
>
> is in mine

>
>    -
>       - [bug guard WTR-333] ol
>
> is in mine

>
>    -
>       - [bug guard WTR-334] meta
>
> not in mine

>
>    -
>       - [bug guard WTR-345] header collections h1,h2,h3..h6
>
> is in mine

>
>    -
>    - [bug guard WTR-330] "Option does not support attribute id" (add:
>    Option should be Element subclass)
>
> is in mine

>
>    - Events:
>
>
>    -
>       - [bug guard WTR-335] Option#select fires onclick event
>
> mine just fires onchange on the select list if changed. does the browser
fire the click event on the option or the select list?

>
>    -
>       - [bug guard WTR-337] Radio#set fires the onchange event
>
> Mine does if it changes

>
>    -
>       - [bug guard WTR-338] TableRow#click fires the rows's onclick event
>
> mine calls #click is on the Element - I'm not sure if this fires the
#onclick event? I think this is the same as the watir trunk, so I guess it
would probably fail on mine too.

>
>    -
>       - [bug guard WTR-338] TableCell#click fires the table's onclick
>       event
>
> same

>
>    -
>       - [bug guard WTR-338] Table#click fires the table's onclick event
>
> same

>
>    -
>       - [bug guard WTR-341] TextField#set fires events
>
> this looks like it's not taking into account that watir fires an initial
one when clearing before setting, simulating hitting the delete key on
selected text.

>
>    -
>    - [bug guard WTR-339] SelectList#{options,selected_options,select} does
>    not take Option's label attribute into account
>
> label attribute? I'm not sure what this means, options have a label
attribute? I thought they were just #text and #value.

>
>    - [bug guard WTR-340] Image#save and FileField#set should fix windows
>    path
>
> not sure what this one is.

>
>    - [bug guard WTR-361] default how for Label should be :text
>
> yeah, probably. isn't in mine.

>
>    - missing default how for Link?
>
> what should this be? text?

>
>    - Link#url as alias for href
>    - [bug guard WTR-362] SelectList#{select,select_value} should select
>    multiple items when given (:name, /regexp/)
>
> mine does

>
>    - [bug guard WTR-363] SelectList#select returns the value selected
>
> I think mine returns nil

>
>    - [bug guard WTR-363] SelectList#select returns the first matching
>    value if there are multiple matches
>
> same as above

>
>    - [bug guard WTR-364] SelectList#select shouldn't fire the onchange
>    event when selecting an already selected item
>
> mine correctly does not.



Lots of stuff. I'll look into fixing the rest of these in my fork. I look
forward to hearing back on the discussion points.

-Ethan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to