Commits

Anonymous committed 8c719a0

i114271, [Automation]: Adapt export tests to new dialogs

Comments (0)

Files changed (1)

testautomation/graphics/tools/id_tools.inc

 end function
 
 '-------------------------------------------------------------------------------
-
-function fGetSizeXY (sX as string, sY as string, bRetrieveOnly as boolean) as Boolean
-
-    const RC_FAILURE = -1
-
+function fGetSizeXY (sX as string, sY as string, bGet as boolean) as Boolean
     dim sTx as string
     dim sTy as string
+    dim bReturn as boolean
 
-    fGetSizeXY() = True
-
-    if ( hUseAsyncSlot( "ContextPositionAndSize" ) <> RC_FAILURE ) then
-
-        kontext
-        active.SetPage TabPositionAndSize
-
-        kontext "TabPositionAndSize"
-        if ( TabPositionAndSize.exists( 2 ) ) then
-            sTx = Width.GetText()
-            sTy = Height.GetText()
-            hCloseDialog( TabPositionAndSize, "ok" )
-        else
-            warnlog "Couldn't switch tab page :-( "
+    bReturn = True
+    try
+        printlog "Trying to open Position and size Dialog.."
+        ContextPositionAndSize
+    catch
+        warnlog "couldn't call 'ContextPositionAndSize' no object selected ?"
+    endcatch
+    kontext
+    active.SetPage TabPositionAndSize
+    kontext "TabPositionAndSize"
+    printlog "Getting some sizes from Position and Size dialog."
+    if TabPositionAndSize.exists (5) then
+        sTx = Width.GetText
+        printlog "Width, sTx=" & sTx
+        sTy = Height.GetText
+        printlog "Height, sTy=" & sTy
+        TabPositionAndSize.OK
+    else
+        warnlog "Couldn't switch tab page :-( "
+    endif
+    if bGet then  ' Get the Values only
+        sY = sTy
+        printlog "sY=" & sY
+        sX = sTx
+        printlog "sX=" & sX
+    else          ' Get the Values and COMPARE them
+        if (LiberalMeasurement (sX,sTx) <> TRUE) then
+            warnlog "width is different :-( XXXXXXXXXXXXX should: '"+sX+"' is: '"+sTx+"'" + "eventually a result of i35519"
+            bReturn = False
         endif
-
-        if ( bRetrieveOnly ) then  ' Get the Values only
-            sY = sTy
-            sX = sTx
-        else          ' Get the Values and compare them
-            if ( not LiberalMeasurement (sX,sTx) ) then
-                warnlog "width is different :-( should: '"+sX+"' is: '"+sTx+"'" + "eventually a result of i35519"
-                fGetSizeXY() = False
-            endif
-            if (not LiberalMeasurement (sY,sTy) ) then
-                warnlog "hight is different :-( should: '"+sY+"' is: '"+sTy+"'" + "eventually a result of i35519"
-                fGetSizeXY() = False
-            endif
+        if (LiberalMeasurement (sY,sTy) <> TRUE) then
+            warnlog "hight is different :-( xxxxxxxxxxxx should: '"+sY+"' is: '"+sTy+"'" + "eventually a result of i35519"
+            bReturn = False
         endif
-    else
-        warnlog( "Failed to open <Position And Size> dialog" )
+        bGet = bReturn
     endif
-
 end function
 
 '-------------------------------------------------------------------------