GitHub Issue | n/a |
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-08-04T17:36:40.000+0000 |
Affected Version/s | Release 1.8.0 |
Fix Version/s | Sprint 2011-31 |
Components | iOS |
Labels | attribute, drillbit, element, tagName, xml |
Reporter | Natalie Huynh |
Assignee | Natalie Huynh |
Created | 2011-08-02T14:24:51.000+0000 |
Updated | 2011-08-04T17:43:08.000+0000 |
Steps to Reproduce:
1. Run drillbit Ti.XML test
Actual Result:
xmlElement false 942 should be: "dessert", was: "undefined"
Expected Result:
Should pass
Talked with Natalie on this. Turns out the confusion is that, by spec, getElementsByTagName returns a nodelist, not an element ( http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-745549614 ). Nodelist does not have a tagname, only length and items ( http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-536297177 ). The test, as such, should check for the tagName of an item within the nodelist results of getElementsByTagName.
Turns out that the test was looking at the wrong object of the wrong type, which does not nor should not have a tagName attribute.
Works when calling valueOf(elements.item(0).tagName).shouldBe("dessert")