[ooo-build-commit] Branch 'ooo/master' - testautomation/framework testautomation/global

Jan Holesovsky kendy at kemper.freedesktop.org
Thu Aug 6 19:47:33 PDT 2009


 testautomation/framework/optional/includes/basic_eventbinding.inc   |    8 
 testautomation/framework/optional/includes/basic_formcontrols.inc   |   71 ++---
 testautomation/framework/optional/includes/basic_library_export.inc |   23 +
 testautomation/framework/required/includes/window_functions.inc     |  140 ++--------
 testautomation/framework/tools/includes/pbrowser_tools.inc          |   51 ++-
 testautomation/global/input/macros.txt                              |    1 
 6 files changed, 116 insertions(+), 178 deletions(-)

New commits:
commit 9995ae2916145c5e204df7bb234b60220648ae04
Author: Release Engineers <releng at openoffice.org>
Date:   Thu Aug 6 11:03:20 2009 +0000

    CWS-TOOLING: integrate CWS ab72
    2009-08-03 14:57:25 +0200 jsk  r274581 : #i103969 - fixed f_windowfunctions.bas
    2009-08-03 13:29:21 +0200 jsk  r274577 : #i103969 - minor stability improvements and a rewrite to use GUI function to install extension (CLI version fails for some unknown reason)
    2009-07-16 10:43:48 +0200 ab  r274033 : #i82918# Added support to pass context explicitely to service ctors
    2009-07-08 16:24:05 +0200 ab  r273839 : CWS-TOOLING: rebase CWS ab72 to trunk at 273468 (milestone: DEV300:m51)
    2009-07-02 13:09:22 +0200 ab  r273641 : #i89740# Fixed resource typos
    2009-07-02 12:21:49 +0200 ab  r273635 : #i99461# Applied patch
    2009-06-23 15:56:08 +0200 ab  r273284 : #i100578# applied patch
    2009-06-23 11:52:45 +0200 ab  r273271 : #i100600# applied patch
    2009-06-22 14:35:15 +0200 ab  r273231 : #i101603# applied patch
    2009-06-22 13:24:22 +0200 ab  r273227 : #i100540# applied patch to remove unused code
    2009-06-10 13:33:20 +0200 ab  r272806 : #i82918# New style service ctor support

diff --git a/testautomation/framework/optional/includes/basic_eventbinding.inc b/testautomation/framework/optional/includes/basic_eventbinding.inc
index 8ef77ac..75771c0 100755
--- a/testautomation/framework/optional/includes/basic_eventbinding.inc
+++ b/testautomation/framework/optional/includes/basic_eventbinding.inc
@@ -234,9 +234,14 @@ endcase
 testcase tAssignComponentFunction
     dim x,i,a as integer
     dim sTemp as string
+    dim sPath as string
+        sPath = gTesttoolPath & "framework\optional\input/eventbinding/"
+    dim sExtension as string
+        sExtension = "DialogComponent.oxt"
     
     sExtensionCLI("list","")
-    sExtensionCLI("add","DialogComponent.oxt",convertPath(gTestToolPath + "framework\optional\input/eventbinding/") )
+    'sExtensionCLI("add","DialogComponent.oxt",convertPath(gTestToolPath + "framework\optional\input/eventbinding/") )
+    hExtensionAddGUI( sPath & sExtension, "" )
     hFileOpen(convertPath(gTestToolPath + "framework\optional\input/eventbinding/DialogComponent.odt"))
     kontext "SecurityWarning"
     if SecurityWarning.exists(5) then
@@ -312,5 +317,6 @@ testcase tAssignComponentFunction
    ' vnd.sun.star.UNO:copyText
     
     sExtensionCLI("remove","DialogComponent.oxt" )
+    'hExtension RemoveGUI( sExtension )
     hCloseDocument()
 endcase
diff --git a/testautomation/framework/optional/includes/basic_formcontrols.inc b/testautomation/framework/optional/includes/basic_formcontrols.inc
index 02179e1..c6c9278 100755
--- a/testautomation/framework/optional/includes/basic_formcontrols.inc
+++ b/testautomation/framework/optional/includes/basic_formcontrols.inc
@@ -39,10 +39,7 @@
 
 testcase tAllControlsOnDialog( cMajor as string )
 
-    '///<h1>Basic test for macro controls</h1>
-    '///<i>This test opens the applications and creates a basic dialog.
-    '///+On this dialog all control are inserted, the document is saved and reloaded
-    '///+to see if the dialog and the controls still exist.</i><br><br>
+    printlog( "Insert all available controls into a BASIC dialog and verify that changed settings persist a save/load cycle" )
 
     dim iApplication as Integer ' numeric expression for gApplication
     dim cApplication as string  ' Name of the current application
@@ -64,29 +61,21 @@ testcase tAllControlsOnDialog( cMajor as string )
     
     const CMODULE = "tacod" ' abbreviation for tAllControlsOnDialog
 
-
-    '///<b>save/load-test for controls on a basic-dialog in all applications</b>
-    '///<ul>
-    '///+<li>open a new doc (for Writer only)</li>
-
-    ' If you want to test all applications, make iApplication = 1 to 6
+    printlog( "Perform the test for one application only: WRITER" )
     for iApplication = 1 to 1
     
-        ' switch documenttype (writer, calc, impress, draw ...)
+        printlog( "Set document type" )
         cApplication = hNumericDoctype( iApplication )
 
-        ' get the name of the workfile dependent on gApplication
-        '///+<li>Build a path and a filename (path from UNO, Suffix from global-module)</li>
+        printlog( "Build the filename" )
         sFile = hGetWorkPath() & "basic" & hGetSuffix( cMajor )
         sFile = ConvertPath( sFile )
         printlog( "Using file: " & sFile )
         
-        ' delete the file if it exists, the outcome has no influence on the test
-        ' so the returnvalue is ignored
+        printlog( "Delete the file, if it exists" )
         hDeleteFile( sFile )
                 
-        ' open a new document to work with (2 open AFTER this)
-        '///+<li>Open a new document to work with</li>
+        printlog( "Open a second document" )
         printlog( "" )
         printlog( cApplication )
         brc = hCreateDocument()
@@ -95,9 +84,9 @@ testcase tAllControlsOnDialog( cMajor as string )
             goto endsub
         endif
 
-        '///+<li>Create a new module for the new document</li>
-        '///+<li>Create a new dialog in BasicIDE</li>
-        '///+<li>Open the macro controls float</li>
+        printlog( "Create a new module for the new document" )
+        printlog( "Create a new dialog in BasicIDE" )
+        printlog( "Open the macro controls float" )
         bOpen = hInitFormControls( CMODULE )
         if ( not bOpen ) then
             printlog( "Aborting due to previous errors" )
@@ -118,7 +107,7 @@ testcase tAllControlsOnDialog( cMajor as string )
         
 
         Kontext "BASICIDE"
-        '///+<li>close the BASIC-IDE</li>
+        printlog( "close the BASIC-IDE" )
         hCloseBasicIde()
         
         
@@ -144,7 +133,7 @@ testcase tAllControlsOnDialog( cMajor as string )
             goto endsub
         endif
             
-        '///+<li>Click 'Edit' to edit the module</li>
+        printlog( "Click 'Edit' to edit the module" )
         printlog( "Edit the module" )
         Bearbeiten.Click()
         if ( WaitSlot <> WSFinished ) then
@@ -152,7 +141,7 @@ testcase tAllControlsOnDialog( cMajor as string )
         endif
 
         kontext "BasicIDE"
-        '///+<li>Find the dialog we created before</li>
+        printlog( "Find the dialog we created before" )
         ' try to find our dialog again by stepping through the tabbar
         bOpen = hFindFirstDialog()
         if ( not bOpen ) then
@@ -162,7 +151,7 @@ testcase tAllControlsOnDialog( cMajor as string )
             goto endsub
         endif
 
-        '///+<li>Open the macro controls float</li>
+        printlog( "Open the macro controls float" )
         ' if the dialog is open, open the macro controls toolbar as well,
         ' we need access to the "properties" button
         bOpen = hShowMacroControls()
@@ -173,7 +162,7 @@ testcase tAllControlsOnDialog( cMajor as string )
             goto endsub
         endif
         
-        '///+<li>Select every control, open its properties and verify its name, close properties</li>
+        printlog( "Select every control, open its properties and verify its name, close properties" )
         for iCurrentControl = 1 to ICONTROLCOUNT
 
             if ( instr( gtSysName, "Solaris" ) > 0 ) then
@@ -191,7 +180,7 @@ testcase tAllControlsOnDialog( cMajor as string )
         ' we need to delete the list-content otherwise we run into index-problems
         ListAllDelete( lsControlNames() )
        
-        '///+<li>Cleanup: Close the BASIC-IDE</li>
+        printlog( "Cleanup: Close the BASIC-IDE" )
         printlog( "Close the BASIC IDE" )
         hCloseBasicIde()        
         
@@ -200,25 +189,22 @@ testcase tAllControlsOnDialog( cMajor as string )
         endif 
 
         printlog "Save the document"
-        '///+<li>save the document</li>
+        printlog( "save the document" )
         Call hFileSaveAsKill( sFile )
 
         printlog "Close it"
-        '///+<li>close the document</li>
-        '///</ul>
+        printlog( "close the document" )
         brc = hDestroyDocument()
 
         printlog( "" ) 
         printlog( "Test case 2: Verify that all items keep their names after close and reload of the document" )
         
-        '///<b>check all controls in the saved document</b>
-        printlog "Open the file again"
-        '///<ul>
-        '///+<li>open the document</li>
+        printlog( "Open the file again" )
+        printlog( "Open the document" )
         hFileOpen( sFile )
 
         printlog "Open tools/macro and select the last module for the current document"
-        '///+<li>open the basic-IDE of this document, open controls, activate 'Select-mode' and open the properties</li>
+        printlog( "open the basic-IDE of this document, open controls, activate 'Select-mode' and open the properties" )
         ToolsMacro_uno
         kontext "Makro"
         irc = hSelectNodeByName( MakroAus , CMODULE )
@@ -238,7 +224,7 @@ testcase tAllControlsOnDialog( cMajor as string )
             goto endsub
         endif
             
-        '///+<li>Click 'Edit' to edit the module</li>
+        printlog( "Click 'Edit' to edit the module" )
         printlog( "Edit the module" )
         Bearbeiten.Click()
         if ( WaitSlot <> WSFinished ) then
@@ -246,7 +232,7 @@ testcase tAllControlsOnDialog( cMajor as string )
         endif
 
         kontext "BasicIDE"
-        '///+<li>Find the dialog we created before</li>
+        printlog( "Find the dialog we created before" )
         ' try to find our dialog again by stepping through the tabbar
         bOpen = hFindFirstDialog()
         if ( not bOpen ) then
@@ -256,7 +242,7 @@ testcase tAllControlsOnDialog( cMajor as string )
             goto endsub
         endif
 
-        '///+<li>Open the macro controls float</li>
+        printlog( "Open the macro controls float" )
         ' if the dialog is open, open the macro controls toolbar as well,
         ' we need access to the "properties" button
         bOpen = hShowMacroControls()
@@ -267,7 +253,7 @@ testcase tAllControlsOnDialog( cMajor as string )
             goto endsub
         endif
         
-        '///+<li>Select every control, open its properties and verify its name, close properties</li>
+        printlog( "Select every control, open its properties and verify its name, close properties" )
         for iCurrentControl = 1 to ICONTROLCOUNT
 
             if ( instr( gtSysName, "Solaris" ) > 0 ) then
@@ -285,19 +271,18 @@ testcase tAllControlsOnDialog( cMajor as string )
         ' we need to delete the list-content otherwise we run into index-problems
         ListAllDelete( lsControlNames() )
        
-        '///+<li>Cleanup: Close the BASIC-IDE</li>
+        printlog( "Cleanup: Close the BASIC-IDE" )
         printlog( "Close the BASIC IDE" )
         hCloseBasicIde()
         
-        '///+<li>Cleanup: Close the document</li>
+        printlog( "Cleanup: Close the document" )
         printlog( "Close the document" )
         brc = hDestroyDocument()
         
-        '///+<li>Cleanup: Delete the file we created</li>
+        printlog( "Cleanup: Delete the file we created" )
         hDeleteFile( sFile )
         
-        '///+<li>Repeat this for every application</li>
-        '///</ul>
+        printlog( "Repeat this for every application" )
         
     next iApplication
 
diff --git a/testautomation/framework/optional/includes/basic_library_export.inc b/testautomation/framework/optional/includes/basic_library_export.inc
index 4110482..779e9ba 100755
--- a/testautomation/framework/optional/includes/basic_library_export.inc
+++ b/testautomation/framework/optional/includes/basic_library_export.inc
@@ -163,15 +163,20 @@ testcase tBasicLibraryExport
         
     printlog( "Close the macro/libraries organizer" )
     kontext "TabBibliotheken"
-    TabBibliotheken.cancel()
-    
-    printlog( "Cancel macro organizer" )
-    kontext "Makro"
-    Makro.cancel()
-    
-    while( getDocumentCount > 0 ) 
-        hDestroyDocument()
-    wend
+    if ( TabBibliotheken.exists( 1 ) ) then
+        TabBibliotheken.cancel()
+        
+        printlog( "Cancel macro organizer" )
+        kontext "Makro"
+        Makro.cancel()
+        
+        while( getDocumentCount > 0 ) 
+            hDestroyDocument()
+        wend
+    else
+        warnlog( "Dialog <TabBibliotheken> could not be accessed" )
+        call exitRestartTheOffice()
+    endif
     
 endcase
 
diff --git a/testautomation/framework/required/includes/window_functions.inc b/testautomation/framework/required/includes/window_functions.inc
index e4f6de4..b562120 100755
--- a/testautomation/framework/required/includes/window_functions.inc
+++ b/testautomation/framework/required/includes/window_functions.inc
@@ -39,180 +39,114 @@
 
 testcase tWindowFunctions
 
+    printlog( "Update test for window functions" )
+
     if ( gtSysName = "Mac OS X" ) then
         printlog( "No testing for Mac as some Window attributes do not exist" )
         goto endsub
     endif
 
-    '///<h1>Update test for window functionality</h1>
-    '///<ul>
-    dim brc as boolean
     
-    '///+<li>Verify that we have one initial document open</li>
     printlog( "Create initial document" )
     gApplication = "WRITER"
     hInitSingleDoc()
     hInitWriteDocIdentifier( "F_updt_windowfuncs.bas" )
     
-    '///+<li>Create a new document</li>
     printlog( "New document" )
-    hCreateDocument()
+    hNewDocument()
     if ( getDocumentCount <> 2 ) then
         warnlog( "Two open documents were expected, found " & getDocumentCount )
     endif    
 
-    DocumentWriter.restore()
-
-    '///+<li>Use .close()-method to close document</li>
-    kontext "documentwriter"
+    kontext "DocumentWriter"
     printlog( "Close document" )
     DocumentWriter.close()
 
-    '///+<li>Verify that the document is closed</li>
     if ( getDocumentCount <> 1 ) then
         warnlog( "One open document was expected, found " & getDocumentCount )
     endif
 
-    '///+<li>Create a new document</li>
     printlog( "New document" )
-    hCreateDocument()
+    hNewDocument()
     if ( getDocumentCount <> 2) then
         warnlog( "Two open documents were expected, found " & getDocumentCount )
     endif    
 
-    '///+<li>Write some text into the second writer document</li>
-    '///+<li>Use .close()-method to close document</li>
     printlog( "Enter some text into the second writer document" )
-    kontext "documentwriter"
+    kontext "DocumentWriter"
     DocumentWriter.TypeKeys( "test" )
     DocumentWriter.close()
 
-    '///+<li>Close the message (Document changed)</li>
     kontext "active"
     if ( Active.exists() ) then
+        printlog( "Close messagebox with Cancel (leaves the document open)" )
         Active.Cancel()
-        printlog( "Close messagebox" )
     else
         warnlog( "No warning that data will be lost on close of this document" )
     endif
     
-    '///+<li>Verify that exactly two documents are open</li>
+    kontext "DocumentWriter"    
     if ( getDocumentCount = 2 ) then
-        printlog( "One document open. Good." )
+        printlog( "Two documents open. Good." )
     else
         warnlog( "Incorrect document count. Expected two, found " & getDocumentCount )
     endif
 
-    '///+<li>Close the document using FileClose</li>
-    hDestroyDocument() ' note tha hCloseDoc/hDestroyDocument use FileClose
+    kontext "DocumentWriter"
+    printlog( "Close the document" )
+    FileClose()
     
-    '///+<li>Verify that exactly one document is open</li>
+    kontext "Active"
+    if ( Active.exists() ) then  
+        printlog( "Do not save the document" )
+        Active.No()
+    else
+        warnlog( "Warning: No data loss warning" )
+    endif
+    
+    kontext "DocumentWriter"
     if ( getDocumentCount = 1 ) then
         printlog( "One document open. Good." )
     else
         warnlog( "Incorrect document count. Expected one, found " & getDocumentCount )
     endif    
 
-    '///+<li>Create a new document</li>
-    printlog( "New document" )
-    brc = hCreateDocument()
-    if ( not brc ) then
-        warnlog( "Two open documents were expected, found " & getDocumentCount() )
-    endif    
-
-
-    kontext "documentwriter"
-    '///+<li>Maximize Window</li>
-    '///<ul>
-    printlog( "Maximize window" )
-    DocumentWriter.Maximize()
-    sleep( 2 )
-    
-    '///+<li>Verify state: Maximized (true)</li>
-    if ( DocumentWriter.IsMax() ) then
-        printlog( " * Window is maximized" )
-    else
-        warnlog( " * Window not maximized" )
-    endif
-
-
-    '///+<li>Verify state: Minimized (false)</li>
-    if ( DocumentWriter.IsMin() ) then
-        warnlog( " * Window is minimized" )
-    else
-        printlog( " * Window not minimized" )
-    endif
-
-    '///+<li>Verify state: Restored (false)</li>
-    if ( DocumentWriter.IsRestore() ) then
-        warnlog( " * Window is Restored" )
-    else
-        printlog( " * Window not Restored" )
-    endif
-    '///</ul>
-
-    '///<li>Minimize Window</li>
-    '///<ul>
+    Kontext "DocumentWriter"
     printlog( "Minimize window" )
     DocumentWriter.Minimize()
-    sleep( 2 )
+    Wait( 2000 )
 
-    '///+<li>Verify state: Minimized (true)</li>
+    kontext "DocumentWriter"
     if ( DocumentWriter.IsMin() ) then
-        printlog( " * Window is minimized" )
+        printlog( "Window is minimized" )
     else
         qaerrorlog( "#i32672# Window not minimized" )
     endif
 
-    '///+<li>Verify state: Maximized (false)</li>
-    if ( DocumentWriter.IsMax() ) then
-        warnlog( " * Window is maximized" )
-    else
-        printlog( " * Window not maximized" )
-    endif
-
-    '///+<li>Verify state: Restored (false)</li>
-    if ( DocumentWriter.IsRestore() ) then
-        qaerrorlog( "#i32672# Window is Restored" )
-    else
-        printlog( " * Window not Restored" )
-    endif
-    '///</ul>
-
-    '///<li>Restore Window</li>
-    '///<ul>
+    kontext "DocumentWriter"
     printlog( "Restore window" )
     DocumentWriter.Restore()
-    sleep( 2 )
+    Wait( 2000 )
 
-    '///+<li>Verify state: Restored (true)</li>
     if ( DocumentWriter.IsRestore() ) then
-        printlog( " * Window is Restored" )
+        printlog( "Window is Restored" )
     else
         warnlog( " * Window not Restored" )
     endif
 
-    '///+<li>Verify state: Maximized (false)</li>
+    kontext "DocumentWriter"
+    printlog( "Maximize window" )
+    DocumentWriter.Maximize()
+    Wait( 2000 )
+    
+    kontext "DocumentWriter"
     if ( DocumentWriter.IsMax() ) then
-        warnlog( " * Window is maximized" )
-    else
-        printlog( " * Window not maximized" )
-    endif
-
-    '///+<li>Verify state: Minimized (false)</li>
-    if ( DocumentWriter.IsMin() ) then
-        warnlog( " * Window is minimized" )
+        printlog( "Window is maximized" )
     else
-        printlog( " * Window not minimized" )
+        warnlog( " * Window not maximized" )
     endif
 
-    '///</ul>
-    
-    '///+<li>Close the documents</li>
-    brc = hDestroyDocument()
-    brc = hDestroyDocument()
-
-    '///</ul>
+    hDestroyDocument()
 
 endcase
 
diff --git a/testautomation/framework/tools/includes/pbrowser_tools.inc b/testautomation/framework/tools/includes/pbrowser_tools.inc
index 2e30722..dbf9122 100755
--- a/testautomation/framework/tools/includes/pbrowser_tools.inc
+++ b/testautomation/framework/tools/includes/pbrowser_tools.inc
@@ -69,28 +69,34 @@ function hOpenPropertyBrowser() as boolean
     const CFN = "hOpenPropertyBrowser::"
     
     '///+<li>Open the property browser (call slot)</li>
-    ContextProperties
-    
-    '///+<li>Verify that the property browser is open</li>
-    kontext "ControlPropertiesTabControl"
-    if ( ControlPropertiesTabControl.exists( 2 ) ) then
+    try
+        ContextProperties
         
-        '///+<li>Activate General-tabpage</li>
-        ControlPropertiesTabControl.setPage( TabGeneralControl )
-    
-        '///+<li>Verify that the General-tabpage is visible</li>
-        kontext "TabGeneralControl"
-        if ( TabGeneralControl.isVisible() ) then
-            printlog( CFN & "ok" )
-            hOpenPropertyBrowser() = true
+        '///+<li>Verify that the property browser is open</li>
+        kontext "ControlPropertiesTabControl"
+        if ( ControlPropertiesTabControl.exists( 2 ) ) then
+            
+            '///+<li>Activate General-tabpage</li>
+            ControlPropertiesTabControl.setPage( TabGeneralControl )
+        
+            '///+<li>Verify that the General-tabpage is visible</li>
+            kontext "TabGeneralControl"
+            if ( TabGeneralControl.isVisible() ) then
+                printlog( CFN & "ok" )
+                hOpenPropertyBrowser() = true
+            else
+                printlog( CFN & "General-tab is not visible." )
+                hOpenPropertyBrowser() = false
+            endif   
         else
-            printlog( CFN & "General-tab is not visible." )
-            hOpenPropertyBrowser() = false
-        endif   
-    else
-        printlog( CFN & "Could not open property browser" )
-        hOpenPropertyBrowser() = false    
-    endif
+            printlog( CFN & "Could not open property browser" )
+            hOpenPropertyBrowser() = false    
+        endif
+    catch
+        hOpenPropertyBrowser() = false
+        printlog( CFN & "Slot <ContextProperties> not available" )
+    endcatch
+    
     '///</ul>
     
 end function
@@ -127,7 +133,7 @@ function hClosePropertyBrowser() as boolean
 
     '///+<li>Verify that the property browser is open</li>
     kontext "ControlPropertiesTabControl"
-    if ( ControlPropertiesTabControl.exists() ) then
+    if ( ControlPropertiesTabControl.exists( 1 ) ) then
     
         '///+<li>Execute the ContextProperties slot</li>
         ContextProperties
@@ -183,9 +189,10 @@ function hPBSetControlName( cControl as string ) as boolean
         '///+<li>Set the new name</li>
         WaitSlot()
         
+        ' Name the control and append some Spaces which should be truncated.
         printlog( CFN & "Naming control: " & cControl )
         NameText.setText( cControl )
-        TabGeneralControl.typeKeys( "<RETURN>" )
+        TabGeneralControl.typeKeys( "   <RETURN>" )
         WaitSlot()
         
         printlog( CFN & "Verifying rename..." )
diff --git a/testautomation/global/input/macros.txt b/testautomation/global/input/macros.txt
index 45514c4..d3f000e 100755
--- a/testautomation/global/input/macros.txt
+++ b/testautomation/global/input/macros.txt
@@ -218,3 +218,4 @@ MsgBox ("Value : " & CDbl(v))
 End Sub
 
 # ---------------------------------------------------------------------------- #
+


More information about the ooo-build-commit mailing list