Changeset 1452

Show
Ignore:
Timestamp:
2008-01-30 08:06:19 (2 years ago)
Author:
martinkou
Message:

Added regression test casse for #1355.
Fixed JavaScript error when loading regression tests in IE.
Added the ability to check for attribute values when verifying HTML outputs in Selenium engine.

Location:
FCKtest
Files:
23 added
3 modified

Legend:

Unmodified
Added
Removed
  • FCKtest/config.js

    r1044 r1452  
    11var FCKTestConfig =  
    22{ 
    3         BasePath : "/fcktest", 
    4         EditorPath : "/fckeditor" 
     3        BasePath : "/FCKeditor/FCKtest", 
     4        EditorPath : "/FCKeditor/trunk" 
    55}; 
    66 
  • FCKtest/runners/selenium/scripts/user-extensions.js

    r1044 r1452  
    9191 
    9292// 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 ) 
     93Selenium.prototype.doFckCheckSimilarTo = function( url, watchAttributes ) 
    9494{ 
    9595        var win = this.browserbot.getCurrentWindow() ; 
    9696        var editorBody = win.FCK.EditorDocument.body.cloneNode( true ) ; 
    9797        var verifyBody = document.createElement( 'body' ) ; 
     98        if ( watchAttributes && watchAttributes.length ) 
     99                watchAttributes = watchAttributes.split( ',' ) ; 
     100        else 
     101                watchAttributes = [] ; 
    98102        var waitFunc = function() 
    99103        { 
     
    119123                                throw new SeleniumError( "DOM structure mismatch: missing DOM node in verification document - " 
    120124                                               + 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                        } 
    125142                        if ( editorNode.nodeType == 3 && editorNode.nodeValue != verifyNode.nodeValue ) 
    126143                                throw new SeleniumError( "DOM structure mismatch: text node values are different - " 
  • FCKtest/tests.js

    r1276 r1452  
    5656                        "interactive" : 
    5757                        [ 
    58                                 ["1514/test1.html", "#1514: Floating panel positioning"], 
     58                                ["1514/test1.html", "#1514: Floating panel positioning"] 
    5959                        ], 
    6060                        "visual" : 
     
    6666                                                "testcase" :  
    6767                                                [ 
    68                                                         ["loader.html", "Load FCKeditor"] 
     68                                                        ["loader.html", "Load FCKeditor"], 
     69                                                        ["1355/1355.html", "Tests for #1355"] 
    6970                                                ] 
    7071                                        }