goog.testing.ui.style
Module ID |
---|
Tools for testing Closure renderers against static markup spec pages.
Exported Functions
assertStructureMatchesReference( element, referenceId ) → void
void
Tests that the structure, node names, and classes of the given element are the same as the reference structure with the given id. Throws an error if the element doesn't have the same nodes at each level of the DOM with the same classes on each. The test ignores all DOM structure within content nodes.
Parameters |
|
---|
getElementChildren( element ) → Array<Node>
Array<Node>
Returns an array of all element children of a given node.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
getReferenceNode( referenceId ) → (Node|null)
(Node|null)
Returns a reference to the first element child of a node with the given id from the page loaded into the reference iFrame. Used to retrieve a particular reference DOM structure to test against.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
isContentNode( element ) → boolean
boolean
Tests whether a given node is a "content" node of a reference structure, which means it is allowed to have arbitrary children.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
writeReferenceFrame( referencePath ) → void
void
Uses document.write to add an iFrame to the page with the reference path in the src attribute. Used for loading an html file containing reference structures to test against into the page. Should be called within the body of the jsunit test page.
Parameters |
|
---|