From c222f5345b271212e155b48b1bdc6ba4ca5de54b Mon Sep 17 00:00:00 2001 From: "Joerg Skottke [jsk]" Date: Wed, 7 Jul 2010 14:22:48 +0200 Subject: automationdev300m84: #i112987 - Attempted fix for missing dialog (which is a fake, it just became slower) --- .../required/includes/tools_customize.inc | 96 +++++++++------------- 1 file changed, 41 insertions(+), 55 deletions(-) (limited to 'testautomation/framework/required/includes/tools_customize.inc') diff --git a/testautomation/framework/required/includes/tools_customize.inc b/testautomation/framework/required/includes/tools_customize.inc index 6bf31e391f99..f84222da0144 100755 --- a/testautomation/framework/required/includes/tools_customize.inc +++ b/testautomation/framework/required/includes/tools_customize.inc @@ -254,7 +254,7 @@ function hUpdtToolsCustomizeToolbars() const MENUITEM_DELETE = 2 const MENUITEM_MODIFY = 4 - const DIALOG_DELAY = 3 + const DIALOG_DELAY = 2 dim brc as boolean dim iCurrentItem as integer @@ -344,25 +344,7 @@ function hUpdtToolsCustomizeToolbars() kontext "ScriptSelector" if ( ScriptSelector.exists( DIALOG_DELAY ) ) then - - call dialogtest( ScriptSelector ) - - ' This is a workaround that applies when - for some reason - the menu - ' (menubutton: AddCommands) is not open. In this case the ScriptSelector - ' will not open. Before this hack the office was left in an unstable state - ' and the following tests would have failed. Now we get a warning - ' instead. - - printlog( CFN & "Add the default item" ) - try - kontext "ScriptSelector" - hCloseDialog( ScriptSelector, "ok" ) - catch - qaerrorlog( "#i79207# Could not access ok button on ScriptSelector" ) - kontext "ScriptSelector" - if ( ScriptSelector.exists( DIALOG_DELAY ) ) then printlog( "Scriptselector is open" ) - endcatch - + printlog( "ScriptSelector open." ) else LibraryTreeList.typeKeys( "" ) for iCurrentItem = 1 to 5 @@ -372,9 +354,7 @@ function hUpdtToolsCustomizeToolbars() next iCurrentItem endif - ' Note: The Customize dialog in the background is updated immediately. This - ' means that the cancel-button is active but blocked for a moment - 'WaitSlot( 2000 ) + call dialogtest( ScriptSelector ) printlog( CFN & "Close the Script Selector, back to ToolsCustomize dialog" ) hCloseDialog( ScriptSelector, "cancel" ) @@ -382,75 +362,80 @@ function hUpdtToolsCustomizeToolbars() kontext "TabCustomizeToolbars" printlog( CFN & "Click the Modify-button" ) - if ( not hClickCommandButton( 1 ) ) then + if ( hClickCommandButton( 1 ) ) then + + printlog( CFN & "Command button clicked successfully" ) + kontext "CustomizeToolbarsRename" + wait( 100 ) + if ( CustomizeToolbarsRename.exists( DIALOG_DELAY ) ) then + + printlog( CFN & "Rename dialog is open" ) + call dialogtest( CustomizeToolbarsRename ) + EingabeFeld.setText( "Renamed item" ) + + printlog( CFN & "Close the dialog" ) + hCloseDialog( CustomizeToolbarsRename, "ok" ) + else + warnlog( CFN & "CustomizeToolbarsRename could not be accessed" ) + endif + else warnlog( CFN & "Something went wrong when accessing the command button" ) exit function endif - printlog( CFN & "Rename the item" ) - UseBindings - kontext "CustomizeToolbarsRename" - if ( CustomizeToolbarsRename.exists( DIALOG_DELAY ) ) then - call dialogtest( CustomizeToolbarsRename ) - EingabeFeld.setText( "Renamed item" ) - - printlog( CFN & "Close the dialog" ) - hCloseDialog( CustomizeToolbarsRename, "ok" ) - else - warnlog( CFN & "CustomizeToolbarsRename could not be accessed" ) - endif - kontext "TabCustomizeToolbars" - - if ( not hClickCommandButton( 2 ) ) then + if ( hClickCommandButton( 2 ) ) then + printlog( CFN & "Successfully clicked second item on the command button" ) + else warnlog( CFN & "Something went wrong when accessing the command button" ) exit function endif kontext "TabCustomizeToolbars" waitslot - printlog( CFN & "Click the Modify-button" ) - printlog( "******************** 1 ********************" ) + printlog( CFN & "Deselect separator (if this is the current object)" ) hDeselectSeparator() - printlog( "******************** 2 ********************" ) + kontext "TabCustomizeToolbars" if ( not hClickCommandButton( 3 ) ) then warnlog( CFN & "Something went wrong when accessing the command button" ) exit function endif - kontext "TabCustomizeToolbars" waitslot + kontext "TabCustomizeToolbars" printlog( CFN & "Click the Modify-button" ) - -if ( not hClickCommandButton( MENUITEM_MODIFY ) ) then + if ( hClickCommandButton( MENUITEM_MODIFY ) ) then + printlog( CFN & "Successfully selected modify-item on the command button" ) + else warnlog( CFN & "Something went wrong when accessing the command button" ) exit function endif - kontext "TabCustomizeToolbars" WaitSlot + kontext "TabCustomizeToolbars" printlog( CFN & "Click the Modify-button" ) - - if ( not hClickCommandButton( 1 ) ) then + if ( hClickCommandButton( 1 ) ) then + printlog( CFN & "Successfully selected modify-item on the command button" ) + else warnlog( CFN & "Something went wrong when accessing the command button" ) exit function endif - kontext "TabCustomizeToolbars" waitslot + kontext "TabCustomizeToolbars" printlog( CFN & "Click the Modify-button" ) - printlog( "******************** 3 ********************" ) hDeselectSeparator() - printlog( "******************** 4 ********************" ) - if ( not hClickCommandButton( 5 ) ) then + if ( hClickCommandButton( 5 ) ) then + printlog( CFN & "Successfully selected modify-item on the command button" ) + else warnlog( CFN & "Something went wrong when accessing the command button" ) exit function endif - printlog( CFN & "On the Change Icon dialog: Click to import an icon" ) kontext "ChangeIcon" + printlog( CFN & "On the Change Icon dialog: Click to import an icon" ) if ( ChangeIcon.exists( DIALOG_DELAY ) ) then call dialogtest( ChangeIcon ) import.click() @@ -467,11 +452,12 @@ if ( not hClickCommandButton( MENUITEM_MODIFY ) ) then warnlog( CFN & "Could not access Change Icon dialog" ) endif - kontext "TabCustomizeToolbars" waitslot + kontext "TabCustomizeToolbars" printlog( CFN & "Click the Modify-button" ) - if ( not hClickCommandButton( 3 ) ) then + printlog( CFN & "Successfully selected modify-item on the command button" ) + else warnlog( CFN & "Something went wrong when accessing the command button" ) exit function endif -- cgit