Changeset 1452 for FCKtest/runners
- Timestamp:
- 2008-01-30 08:06:19 (7 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
FCKtest/runners/selenium/scripts/user-extensions.js
r1044 r1452 91 91 92 92 // I can't implement the following as an isXyz function in Selenium because it involves Ajax calls and thus timeouts 93 Selenium.prototype.doFckCheckSimilarTo = function( url )93 Selenium.prototype.doFckCheckSimilarTo = function( url, watchAttributes ) 94 94 { 95 95 var win = this.browserbot.getCurrentWindow() ; 96 96 var editorBody = win.FCK.EditorDocument.body.cloneNode( true ) ; 97 97 var verifyBody = document.createElement( 'body' ) ; 98 if ( watchAttributes && watchAttributes.length ) 99 watchAttributes = watchAttributes.split( ',' ) ; 100 else 101 watchAttributes = [] ; 98 102 var waitFunc = function() 99 103 { … … 119 123 throw new SeleniumError( "DOM structure mismatch: missing DOM node in verification document - " 120 124 + editorNode.nodeName + " expected." ) ; 121 if ( editorNode.nodeType == 1 && editorNode.nodeName != verifyNode.nodeName ) 122 throw new SeleniumError( "DOM structure mismatch: element tags are different - " 123 + editorNode.nodeName + " encountered in editor document while " 124 + verifyNode.nodeName + " is expected by verification document." ) ; 125 if ( editorNode.nodeType == 1 ) 126 { if ( editorNode.nodeName != verifyNode.nodeName ) 127 throw new SeleniumError( "DOM structure mismatch: element tags are different - " 128 + editorNode.nodeName + " encountered in editor document while " 129 + verifyNode.nodeName + " is expected by verification document." ) ; 130 for ( var i = 0 ; i < watchAttributes.length ; i++ ) 131 { 132 var attrName = watchAttributes[i] ; 133 if ( editorNode.getAttribute( attrName ) != verifyNode.getAttribute( attrName ) ) 134 throw new SeleniumError( "DOM structure mismatch: Element attribute \"" + attrName + 135 "\" is different - " + 136 attrName + "=" + editorNode.getAttribute( attrName ) + 137 " encountered in editor document while " + 138 attrName + "=" + verifyNode.getAttribute( attrName ) + 139 " is expected by verification document." ) ; 140 } 141 } 125 142 if ( editorNode.nodeType == 3 && editorNode.nodeValue != verifyNode.nodeValue ) 126 143 throw new SeleniumError( "DOM structure mismatch: text node values are different - "