################################################################### # Copyright (C) 1995 Taligent, Inc. All rights reserved. # # $Revision: 1.3 $ # # File : GrafEditBAT.Event # # Created by : Patience Chu Sep. 1994, # Adopt by Amitabh for UnitTest # # Purpose : Automate GrafEdit UnitTest # # Usage : # %GUIDriver UTMarsTest.Event # # Description : # UTMarsTest.Event - a tcl script to automate UnitTest # - q # No image comparision done as similar test is run # from BAT # # # ##################################################################### source $env(TaligentTestRoot)/Tests/ATMTools/AutoTestEnvVars source $env(TaligentTestRoot)/Tests/GUIAppIncludes/Atoms.i source $env(TaligentTestRoot)/Tests/GUIAppIncludes/BasicGUI.i source $env(TaligentTestRoot)/Tests/UnitTests/GrafEditTests/UTGrafEditBasic.i source $env(TaligentTestRoot)/Tests/UnitTests/GrafEditTests/UTGrafEditTest.i set Ignore 0 if { $argc != 0 } { set Ignore 1 } # # Initialize Device # echo ">Init Mouse Device" echo ">Init Keyboard Device" set gTolerance 0.5 set globalSleep 0 m movedelay 64 k typingspeed 5 m buttondelay 16 #m clickdelay 64 # # Cleare the screen # catch { exec $env(TaligentBinaries)/ClearScreen } catch { exec xpt -size 680 600 Foo } ################################################# # # Coordinat initialization # ################################################# # # Menu Tilte coordinates # # Main Menu echo "Menu setup" set MarsXtl [ lindex ${MARS.Window.DefaultPos} 0 ] set MarsYtl [ lindex ${MARS.Window.DefaultPos} 1 ] set MarsXbr [ expr $MarsXtl + [ lindex ${MARS.Window.DefaultSize} 0 ] ] set MarsYbr [ expr $MarsYtl + [ lindex ${MARS.Window.DefaultSize} 1 ] ] set marsapp [MARS.Window.Create ${MARS.Window.DefaultPos} ${MARS.Window.DefaultSize}] set marsapp.MainMenu [ CreateMainMenu ${MARS.MainMenu} ${MARS.MainMenu.DefaultPos} ] set marsapp.MainMenu.Edit [ CreateSubmenu ${marsapp.MainMenu} ${MARS.MainMenu.Edit} Edit ] set marsapp.MainMenu.Tools [ CreateSubmenu ${marsapp.MainMenu} ${MARS.MainMenu.Tools} Tools ] set marsapp.MainMenu.Color [ CreateSubmenu ${marsapp.MainMenu} ${MARS.MainMenu.Color} Color ] set marsapp.MainMenu.Pen [ CreateSubmenu ${marsapp.MainMenu} ${MARS.MainMenu.Pen} Pen ] set marsapp.MainMenu.Test [ CreateSubmenu ${marsapp.MainMenu} ${MARS.MainMenu.Test} Test ] set marsapp.MainMenu.Text [ CreateSubmenu ${marsapp.MainMenu} ${MARS.MainMenu.Text} Text ] ################################################### # # Start Testing # #################################################### # # Initialize Pink Window and Mars # echo ">Pink Window initialization" # Set up the boundary of mars window RegisterDoc marsapp TestEditGrafDoc # # Delete old TestEditGrafDoc # echo "Delete Old Document" DeleteDoc marsapp catch { exec sleep 3 } # # Create Mars # echo "> Create MarsTestApp" CreateDoc marsapp ${MARS.Library.Info} ${MARS.Library.File} # # Bring the App to the screen # OpenDoc marsapp echo "waiting for menu to come up" catch { exec sleep 15 } ######################################### # Step 0 : Tear off menus ######################################### echo ">-------- Step 1 : Tear Menus ----" # -- Edit mehu ---- echo "> Tear off the Edit menu" ClickOn marsapp.MainMenu Edit DragOn marsapp.MainMenu.Edit MTitle 420 -42 # -- Tool Menu------ echo "> Tear off the Tool menu" ClickOn marsapp.MainMenu Tools DragOn marsapp.MainMenu.Tools MTitle -70 132 # # --- Color Menu ------------ # echo "> Tear off the Color menu" ClickOn marsapp.MainMenu Color #DragOn marsapp.MainMenu.Color MTitle 25 290 DragOn marsapp.MainMenu.Color MTitle 420 160 # # ---- Pen Menu ---------- # echo "> Tear off the Pen menu" ClickOn marsapp.MainMenu Pen DragOn marsapp.MainMenu.Pen MTitle 420 300 ####################################### # 1 : Text ####################################### echo ">Select Text" SelectText OMove 14 55 Click k typing "Taligent Inc" SelectArrow OMove 10 10 Click OMove 14 55 ODrag 180 230 echo ">rotate" OMove 180 230 ODrag 134 135 MouseUndo MouseRedo echo ">resize" OMove 104 130 ODrag 114 145 ODrag 64 165 MouseUndo MouseRedo SelectBlueFill MouseUndo MouseRedo SelectRedFrame MouseUndo MouseRedo ######################################### # Step 2 : Draw a line ######################################### echo ">-------Step 2 : Line ------------" SelectLine OMove 64 65 ODrag 164 165 SelectArrow OMove 59 60 ODrag 169 170 #echo ">rotate" OMove 153 160 ODrag 64 265 MouseUndo MouseRedo #echo ">resize" OMove 149 163 ODrag 114 145 MouseUndo MouseRedo SelectRedFrame MouseUndo MouseRedo Point10Pen MouseUndo MouseRedo # Select All MouseSelectAll MouseDelete MouseUndo MouseRedo ######################################### # Step 3 : Rectangle ######################################### echo ">-------Step 3 : Rectangle -----------" SelectRect OMove 64 215 ODrag 164 165 MouseUndo MouseRedo SelectArrow OMove 50 150 ODrag 180 230 echo ">rotate" OMove 164 195 ODrag 134 135 MouseUndo MouseRedo echo ">resize" OMove 104 130 ODrag 114 145 ODrag 64 165 MouseUndo MouseRedo SelectBlueFill MouseUndo MouseRedo SelectRedFrame MouseUndo MouseRedo Point4Pen # # Check Image # # Select All MouseSelectAll MouseDelete MouseUndo MouseRedo ######################################### # Step 4 : Ellipse ######################################### echo ">-------Step 4 : Elipse-----------" SelectEllipse OMove 14 115 ODrag 44 35 MouseUndo MouseRedo SelectArrow OMove 38 97 Click SelectGreenFill SelectRedFrame MouseUndo MouseRedo Point8Pen echo ">Move the elipse" OMove 24 75 ODrag 64 165 MouseUndo MouseRedo echo ">Resize" OMove 86 205 ODrag 114 215 MouseUndo MouseRedo echo ">Rotate" OMove 94 215 ODrag 164 195 MouseUndo MouseRedo # # Check Image # # Select All MouseSelectAll MouseDelete MouseUndo MouseRedo ######################################### # Step 5 : PolyLine ######################################### echo "> ------- Step 5 : PolyLine -----" SelectPolyline OMove 14 65 ODrag 14 115 ODrag 114 115 ODrag 114 215 ODrag 64 215 ODrag 64 165 ODrag 164 215 ODrag 164 115 DoubleClick MouseUndo MouseRedo Sleep 1 SelectArrow # Select Object OMove 164 115 Click Point10Pen echo ">Rotate" OMove 164 195 ODrag 214 165 echo ">Resize" OMove 184 185 ODrag 214 215 OMove 214 65 Click # Select All MouseSelectAll MouseDelete MouseUndo MouseRedo ######################################### # Step 6 : Polygon ######################################### echo ">----- Step 6 : Polygon --------" #echo "> Resize the canvas" #DragOn marsapp WResizeLR 20 100 SelectPolygon OMove 14 115 ODrag 64 215 ODrag 114 65 ODrag 134 235 ODrag 14 115 DoubleClick MouseUndo MouseRedo Sleep 1 SelectArrow # Select Object OMove 39 165 Click Point10Pen SelectBlueFrame SelectGreenFill echo ">resize" OMove 14 65 ODrag 24 95 echo ">rotate" OMove 64 95 ODrag 114 65 echo ">Move" OMove 64 165 ODrag 164 115 # Select All MouseSelectAll MouseDelete MouseUndo MouseRedo ######################################### # Step 7 : Play wity Curves ######################################### echo ">-------Step 7 : Curves --------" #echo "> Resize the canvas" #DragOn marsapp WResizeLR -20 -20 SelectCurve # Draw Curve OMove 14 55 Down OMove 64 105 OMove 134 115 OMove 174 35 Up DoubleClick Sleep 1 SelectCurve # Draw Curve OMove 94 45 Down OMove 154 105 OMove 154 155 OMove 114 205 Up DoubleClick Sleep 1 MouseUndo MouseRedo SelectArrow # Select Object OMove 152 114 Click echo ">Move " OMove 134 145 ODrag 214 145 echo ">rotate" OMove 214 43 ODrag 64 105 Point10Pen SelectRedFrame # Select Object echo ">Resize" OMove 194 115 Click OMove 124 150 ODrag 134 195 OMove 14 115 Click echo ">Select other curves" OMove 194 385 Click SelectArrow OMove 171 44 Click ODrag 114 35 SelectGreenFrame MouseUndo MouseRedo Point4Pen # Select All MouseSelectAll MouseDelete MouseUndo MouseRedo ######################################### # Step 8 : Undo/Redo ######################################### echo ">Step 8 : Undo" echo ">5 Mouse Undo" set cnt 5 while { $cnt > 0} { # Undo MouseUndo set cnt [expr $cnt - 1 ] } set cnt 5 while { $cnt > 0} { # Undo MouseRedo set cnt [expr $cnt - 1 ] } echo ">5 keyboard Undo" set cnt 5 while { $cnt > 0 } { # Undo KeyboardUndo set cnt [expr $cnt - 1 ] } ####################################### # Step 9 : TestAllClasses ####################################### SelectTestAllClasses ########################################## # Step 11 :Close Mars ########################################## echo ">----- Step 9 : Close Mars ---" CloseDoc marsapp Sleep 2 ClickOn marsapp WClose # # Remove the document from the persistent storage # Sleep 2 DeleteDoc marsapp UnRegisterDoc marsapp # # Clean up the interface devices # CleanUpProc echo "UTMarsTest - Pass" exit 0