summaryrefslogtreecommitdiff
path: root/testautomation/framework/optional/includes
diff options
context:
space:
mode:
Diffstat (limited to 'testautomation/framework/optional/includes')
-rw-r--r--testautomation/framework/optional/includes/CJK_FeatureSwitchTest_1.inc111
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_delete_modules.inc18
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_dialog_i18n_copy_control.inc256
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_documents.inc48
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_formcontrols.inc216
-rwxr-xr-xtestautomation/framework/optional/includes/basic_gridcontrol.inc38
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_ide.inc430
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_library_export.inc6
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_library_import.inc32
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_macros.inc563
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_modulehide.inc76
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_modulenames.inc310
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_package_export.inc30
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_package_import.inc34
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_protected_libraries.inc4
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_spectemplate.inc58
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_usertemplate.inc68
-rwxr-xr-xtestautomation/framework/optional/includes/basic_vba-compat_application-union.inc13
-rwxr-xr-xtestautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc3
-rwxr-xr-xtestautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc3
-rwxr-xr-xtestautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc3
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/extras_file_open.inc6
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/extras_labels.inc60
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/extras_modify_objects.inc27
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/extras_table_autoformat.inc9
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_cjk_files.inc3
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_document_properties.inc66
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_filternames.inc16
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/filedlg_passwords.inc9
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/help_compare_applications.inc8
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/help_compare_content.inc8
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/help_compare_topics.inc14
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/help_search.inc50
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/ole_3.inc39
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/ole_tools.inc47
-rw-r--r--testautomation/framework/optional/includes/options_ls_2.inc307
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/options_ooo_general.inc574
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/options_ooo_security.inc16
-rw-r--r--testautomation/framework/optional/includes/scripting_basics.inc73
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/scripting_organizers.inc13
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/security_certification_dialogs.inc20
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/security_certified_docs.inc14
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/security_incorrect_password.inc32
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/security_macrosecurity.inc81
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/security_recommend_password.inc8
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/standardbar2.inc5
-rw-r--r--testautomation/framework/optional/includes/w_grid_layout1.inc280
47 files changed, 1564 insertions, 2541 deletions
diff --git a/testautomation/framework/optional/includes/CJK_FeatureSwitchTest_1.inc b/testautomation/framework/optional/includes/CJK_FeatureSwitchTest_1.inc
index d144b7cdb88a..b8ddc55e012a 100644
--- a/testautomation/framework/optional/includes/CJK_FeatureSwitchTest_1.inc
+++ b/testautomation/framework/optional/includes/CJK_FeatureSwitchTest_1.inc
@@ -78,7 +78,7 @@ testcase tWriterUIChangesTest1
TabAusrichtungAbsatz.Cancel
'/// turn off "Asian Language support" , check if checkbox "Snap to text grid" isn't enable
- if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ if ( not hSystemHasAsianLocale() ) then
Call CheckAsianLanguageSupport("Off")
Kontext
@@ -96,27 +96,30 @@ testcase tWriterUIChangesTest1
TabAusrichtungAbsatz.Cancel
end if
- TabAusrichtungAbsatz.Cancel
+ ' JSK I have no idea why the tabpage was closed a second time so i do not fix it
+ ' but make closing the tabpage optional. I hate this.
+ kontext "TabAusrichtungAbsatz"
+ hCloseDialog( TabAusrichtungAbsatz, "cancel,optional" )
- if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
- Call CheckAsianLanguageSupport("Off")
+ if ( not hSystemHasAsianLocale() ) then
+ Call CheckAsianLanguageSupport("Off")
- Kontext
- FormatParagraph
- Active.SetPage TabAusrichtungAbsatz
- Kontext "TabAusrichtungAbsatz"
+ Kontext
+ FormatParagraph
+ Active.SetPage TabAusrichtungAbsatz
+ Kontext "TabAusrichtungAbsatz"
- try
- if TextrasterFangen.IsChecked = TRUE Or TextrasterFangen.IsChecked <> TRUE then
- warnlog "Something wrong in checkbox 'snap to text grid'"
- end if
- catch
- endcatch
+ try
+ if TextrasterFangen.IsChecked = TRUE Or TextrasterFangen.IsChecked <> TRUE then
+ warnlog "Something wrong in checkbox 'snap to text grid'"
+ end if
+ catch
+ endcatch
- TabAusrichtungAbsatz.Cancel
- end if
+ TabAusrichtungAbsatz.Cancel
+ end if
- Call hCloseDocument
+ Call hCloseDocument
endcase
'-------------------------------------------------------------------------
@@ -143,7 +146,7 @@ testcase tWriterUIChangesTest2
endcatch
'/// turn off "Asian Language support" , check if tabpage "Asian Typography" disappear
- if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ if ( not hSystemHasAsianLocale() ) then
Call CheckAsianLanguageSupport("Off")
Kontext
@@ -186,7 +189,7 @@ testcase tWriterUIChangesTest3
TabFont.Cancel
'/// turn off "Asian Language support" , Check if list box "Asian text font" disappear
- if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ if ( not hSystemHasAsianLocale() ) then
Call CheckAsianLanguageSupport("Off")
Kontext
@@ -227,7 +230,7 @@ testcase tWriterUIChangesTest4
TabFontEffects.Cancel
'/// turn off "Asian Language support" , Check if list box "Emphasis mark" disappear
- if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ if ( not hSystemHasAsianLocale() ) then
Call CheckAsianLanguageSupport("Off")
Kontext
@@ -264,7 +267,7 @@ testcase tWriterUIChangesTest5
ExtrasOptionenDlg.Cancel
'/// turn on "Asian Language support" , Check if tabpage "Searching in Japanese" disappear
- if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ if ( not hSystemHasAsianLocale() ) then
Call CheckAsianLanguageSupport("Off")
ToolsOptions
@@ -299,7 +302,7 @@ testcase tWriterUIChangesTest6
ExtrasOptionenDlg.Cancel
'/// turn off "Asian Language support" , Check if tabpage "Asian Layout" disappear
- if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ if ( not hSystemHasAsianLocale() ) then
Call CheckAsianLanguageSupport("Off")
ToolsOptions
@@ -335,7 +338,7 @@ testcase tWriterUIChangesTest7
endcatch
'/// turn off "Asian Language support" , Check if menu format/Ruby is inactived
- if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ if ( not hSystemHasAsianLocale() ) then
Call CheckAsianLanguageSupport("Off")
try
@@ -390,7 +393,7 @@ testcase tWriterUIChangesTest8
endcatch
'/// turn off "Asian Language support" , Check if submenus in format/change case is inactived
- if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ if ( not hSystemHasAsianLocale() ) then
Call CheckAsianLanguageSupport("Off")
try
@@ -424,7 +427,7 @@ endcase
'-------------------------------------------------------------------------
testcase tWriterUIChangesTest9
- call hNewDocument
+ call hNewDocument
'/// turn on "Asian Language support" , Check if list box text direction appear
Call CheckAsianLanguageSupport("On")
@@ -442,7 +445,7 @@ testcase tWriterUIChangesTest9
TabSeite.Cancel
'/// turn off "Asian Language support" , Check if list box text direction disappear
- if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ if ( not hSystemHasAsianLocale() ) then
Call CheckAsianLanguageSupport("Off")
FormatPageWriter
@@ -485,7 +488,7 @@ testcase tWriterUIChangesTest10
endcatch
'/// turn off "Asian Language support" , Check if vertical text box and callout disappear
- if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ if ( not hSystemHasAsianLocale() ) then
Call CheckAsianLanguageSupport("Off")
Kontext "Drawbar"
try
@@ -507,12 +510,12 @@ endcase
'-------------------------------------------------------------------------
testcase tWriterUIChangesTest11
- Dim iHopeNumber1 , iHopeNumber2 as Integer
- dim i as integer
- dim iCount as integer
- iHopeNumber1 = 38
- iHopeNumber2 = 19
+ dim i as integer
+ dim iCount as integer
+
+ const iHopeNumber1 = 42
+ const iHopeNumber2 = 23
'/// Check if the number in listbox numbering is right or not.
'/// [if the number of the listbox numbering is changed, this case should be modified according]
@@ -543,16 +546,11 @@ testcase tWriterUIChangesTest11
Active.Ok
QAErrorLog "No Default-Printer!"
Kontext "Printing"
- if ( Printing.exists( 1 ) ) then
- Printing.cancel()
- endif
+ hCloseDialog( Printing, "cancel,optional" )
end if
else
Kontext "Printing"
- if ( Printing.exists( 2 ) ) then
- Printing.cancel()
- Printing.notExists( 5 )
- endif
+ hCloseDialog( Printing, "cancel,optional" )
endif
else
for i =1 to iCount
@@ -561,14 +559,14 @@ testcase tWriterUIChangesTest11
'Referenze:
TabOptionenNumerierung.Cancel
qaerrorlog "the number of list box numbering is wrong when Asian Language support is on; expected: " + iHopeNumber1 + "; is: " + iCount
- end if
-
- 'print warning if no printer is available
- kontext
- if active.exists(5) then
- qaErrorlog "print warning: '" + active.getText + "'"
- active.ok
- endif
+ end if
+
+ 'print warning if no printer is available
+ kontext
+ if active.exists(5) then
+ qaErrorlog "print warning: '" + active.getText + "'"
+ active.ok
+ endif
'print warning if no printer is available
kontext
@@ -578,7 +576,7 @@ testcase tWriterUIChangesTest11
endif
'/// turn off "Asian Language support" , Check if the number in listbox numbering is right
- if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ if ( not hSystemHasAsianLocale() ) then
Call CheckAsianLanguageSupport("Off")
FormatNumberingBullets
@@ -613,7 +611,7 @@ testcase tProlongedVowelsTest1
ToolsOptions
Call hToolsOptions("LANGUAGESETTINGS","SEARCHINGINJAPANESE")
- if ProlongedSoundmarks.IsChecked <> TRUE then
+ if ( not ProlongedSoundmarks.IsChecked ) then
warnlog "The default setting of 'Prolonged vowels (ka-/kaa)' isn't ACTIVATED."
end if
@@ -648,7 +646,7 @@ testcase tCalcUIChangesTest_10
endcatch
'/// turn off "Asian Language support" , Check if vertical text box and callout disappear
- if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ if ( not hSystemHasAsianLocale() ) then
Call CheckAsianLanguageSupport("Off")
Kontext "Drawbar"
try
@@ -686,7 +684,7 @@ testcase tImpressUIChangesTest_10
endcatch
'/// turn off "Asian Language support" , Check if vertical text box disappear
- if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ if ( not hSystemHasAsianLocale() ) then
Call CheckAsianLanguageSupport("Off")
sleep(1)
Kontext "Drawbar"
@@ -719,7 +717,7 @@ testcase tDrawUIChangesTest_10
endcatch
'/// turn off "Asian Language support" , Check if vertical text box disappear
- if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ if ( not hSystemHasAsianLocale() ) then
Call CheckAsianLanguageSupport("Off")
Kontext "Drawbar"
try
@@ -734,3 +732,12 @@ testcase tDrawUIChangesTest_10
endcase
'-------------------------------------------------------------------------
+
+function hSystemHasAsianLocale() as boolean
+
+ select case ( iSystemSprache )
+ case 81, 82, 86, 88 : hSystemHasAsianLocale() = true
+ case else : hSystemHasAsianLocale() = false
+ end select
+
+end function \ No newline at end of file
diff --git a/testautomation/framework/optional/includes/basic_delete_modules.inc b/testautomation/framework/optional/includes/basic_delete_modules.inc
index 3fe642ea8ec6..5418c322ce96 100644..100755
--- a/testautomation/framework/optional/includes/basic_delete_modules.inc
+++ b/testautomation/framework/optional/includes/basic_delete_modules.inc
@@ -35,6 +35,8 @@ testcase tDeleteModulesAtRunningBasic
printlog( "Delete BASIC module while BASIC is running" )
+ const RAISE_MESSAGEBOX = 1
+
dim brc as boolean
const MAX_WAIT = 3000
dim iMenuItemCount as integer
@@ -44,11 +46,7 @@ testcase tDeleteModulesAtRunningBasic
Call hNewDocument()
printlog( "Open the BASIC Organizer" )
- brc = hOpenBasicOrganizerFromDoc()
- if ( not brc ) then
- warnlog( "Unable to open BASIC organizer for the document" )
- goto endsub
- endif
+ ToolsMacro_uno
printlog( "Create a new module for the current document" )
brc = hCreateModuleForDoc()
@@ -58,7 +56,7 @@ testcase tDeleteModulesAtRunningBasic
endif
printlog( "Insert a short script (1. page)" )
- brc = hInsertMacro( 1 )
+ brc = hInsertMacro( RAISE_MESSAGEBOX )
if ( not brc ) then
warnlog( "Unable to create a basic module for the document" )
goto endsub
@@ -79,10 +77,10 @@ testcase tDeleteModulesAtRunningBasic
iMenuItemCount = hMenuItemGetCount()
select case ( iMenuItemCount )
- case 2 : printlog( "Correct number of items in menu: " & iMenuItemCount )
- case 3 : warnlog ( "Delete is active in context menu for a running macro => BUG!" )
- case 5 : warnlog ( "#i101972# - Disabled entries are shown in context menu on tab bar" )
- default : warnlog ( "Incorrect itemcount in context menu: " & iMenuItemCount )
+ case 2 : printlog( "Correct number of items in menu: " & iMenuItemCount )
+ case 3 : warnlog ( "Delete is active in context menu for a running macro => BUG!" )
+ case 5 : warnlog ( "#i101972# - Disabled entries are shown in context menu on tab bar" )
+ case else : warnlog ( "Incorrect itemcount in context menu: " & iMenuItemCount )
end select
catch
warnlog( "Unable to retrieve the number of menuitems" )
diff --git a/testautomation/framework/optional/includes/basic_dialog_i18n_copy_control.inc b/testautomation/framework/optional/includes/basic_dialog_i18n_copy_control.inc
index 1a47c8296588..c3db79efc08d 100644..100755
--- a/testautomation/framework/optional/includes/basic_dialog_i18n_copy_control.inc
+++ b/testautomation/framework/optional/includes/basic_dialog_i18n_copy_control.inc
@@ -38,6 +38,7 @@ testcase tBasicDialogI18nCopyControl
const DIALOG_NAME = "DialogExport" ' Name of the first module
const LANGUAGES_TO_COPY = 5 ' Only copy n languages
const TARGET_DIALOG = "Target" ' The name of the dialog the control is pasted to
+ const DEFAULT_TIMEOUT = 2
dim cLanguageList( LANGUAGES_TO_COPY ) as string ' Note: Index 0 is used
dim iCurrentLanguage as integer
@@ -56,146 +57,145 @@ testcase tBasicDialogI18nCopyControl
' These are the IDE internal coordinates of the control, used to restore
' identical coordinates in the source and target dialogs
dim iOriginalCoordinates( 4 ) as integer
-
- ' Some multi purpose returncode
- dim brc as boolean
hCreateDocument()
printlog( "Test init: Setting up environment" )
- brc = hInitFormControls( DIALOG_NAME )
- if ( not brc ) then
- warnlog( "Failed to initialize BASIC IDE/Dialog editor, aborting" )
- goto endsub
- endif
-
- hDrawControlOnDialog( COMMAND_BUTTON )
-
- hOpenPropertyBrowser()
- kontext "TabGeneralControl"
- printlog( "Get internal coordinates for the control" )
- iOriginalCoordinates( 1 ) = height.getText()
- iOriginalCoordinates( 2 ) = width.getText()
- iOriginalCoordinates( 3 ) = PosX.getText()
- iOriginalCoordinates( 4 ) = PosY.getText()
- printlog( "Height: " & iOriginalCoordinates( 1 ) )
- printlog( "Width.: " & iOriginalCoordinates( 2 ) )
- printlog( "Pos X.: " & iOriginalCoordinates( 3 ) )
- printlog( "Pos Y.: " & iOriginalCoordinates( 4 ) )
- hClosePropertyBrowser()
-
- qaerrorlog( "#i80456# properties button not enabled when a formcontrol is inserted via keyboard" )
-
- kontext "ToolsCollectionBar"
- ManageLanguage.click()
-
- kontext "ManageUILanguages"
- if ( ManageUILanguages.exists( 2 ) ) then
-
- add.click()
-
- kontext "SetDefaultLanguage"
- if ( SetDefaultLanguage.exists( 1 ) ) then
- SetDefaultLanguage.ok()
+ if ( hInitFormControls( DIALOG_NAME ) ) then
+
+ printlog( "Draw a commandbutton on the dialog" )
+ hDrawControlOnDialog( COMMAND_BUTTON )
+
+ printlog( "Open the property browser" )
+ hOpenPropertyBrowser()
+ kontext "TabGeneralControl"
+ printlog( "Get internal coordinates for the control" )
+ iOriginalCoordinates( 1 ) = height.getText()
+ iOriginalCoordinates( 2 ) = width.getText()
+ iOriginalCoordinates( 3 ) = PosX.getText()
+ iOriginalCoordinates( 4 ) = PosY.getText()
+ printlog( "Height: " & iOriginalCoordinates( 1 ) )
+ printlog( "Width.: " & iOriginalCoordinates( 2 ) )
+ printlog( "Pos X.: " & iOriginalCoordinates( 3 ) )
+ printlog( "Pos Y.: " & iOriginalCoordinates( 4 ) )
+ hClosePropertyBrowser()
+
+ qaerrorlog( "#i80456# properties button not enabled when a formcontrol is inserted via keyboard" )
+
+ kontext "ToolsCollectionBar"
+ printlog( "Click <Manage Languages>" )
+ ManageLanguage.click()
+
+ kontext "ManageUILanguages"
+ if ( ManageUILanguages.exists( DEFAULT_TIMEOUT ) ) then
+
+ printlog( "Click <Add>" )
+ hClickButton( Add )
+
+ kontext "SetDefaultLanguage"
+ if ( SetDefaultLanguage.exists( DEFAULT_TIMEOUT ) ) then
+ hCloseDialog( SetDefaultLanguage, "ok" )
+ else
+ warnlog( "Set Default Language dialog is missing" )
+ endif
else
- warnlog( "Set Default Language dialog is missing" )
+ warnlog( "Unable to open Manage UI Languages dialog" )
endif
- else
- warnlog( "Unable to open Manage UI Languages dialog" )
- endif
-
- kontext "ManageUILanguages"
- if ( ManageUILanguages.exists( 1 ) ) then
-
- add.click()
-
- kontext "AddUserInterface"
- if ( AddUserInterface.exists( 1 ) ) then
- for iCurrentLanguage = 1 to LANGUAGES_TO_COPY
- AddNewControl.select( iCurrentLanguage )
- AddNewControl.check()
- next iCurrentLanguage
- AddUserInterface.ok()
+
+ kontext "ManageUILanguages"
+ if ( ManageUILanguages.exists( DEFAULT_TIMEOUT ) ) then
+
+ printlog( "Click <Add>" )
+ hClickButton( Add )
+
+ kontext "AddUserInterface"
+ if ( AddUserInterface.exists( DEFAULT_TIMEOUT ) ) then
+ for iCurrentLanguage = 1 to LANGUAGES_TO_COPY
+ AddNewControl.select( iCurrentLanguage )
+ AddNewControl.check()
+ next iCurrentLanguage
+ hCloseDialog( AddUserInterface, "ok" )
+ else
+ warnlog( "Add User Interface Language dialog is missing" )
+ endif
else
- warnlog( "Add User Interface Language dialog is missing" )
+ warnlog( "Unable to open Manage UI Languages dialog" )
endif
- else
- warnlog( "Unable to open Manage UI Languages dialog" )
- endif
-
- kontext "ManageUILanguages"
- for iCurrentLanguage = 0 to LANGUAGES_TO_COPY
- PresentLanguages.select( iCurrentLanguage + 1 )
- cLanguageList( iCurrentLanguage ) = PresentLanguages.getSelText()
- printlog( iCurrentLanguage & ": " & cLanguageList( iCurrentLanguage ) )
- next iCurrentLanguage
-
- kontext "ManageUILanguages"
- ManageUILanguages.close()
-
- printlog( "Localizing control" )
- for iCurrentLanguage = 0 to LANGUAGES_TO_COPY
- kontext "TranslationBar"
- CurrentLanguage.select( iCurrentLanguage + 1 )
- kontext "BasicIde"
- hSelectControl( COMMAND_BUTTON )
+
+ kontext "ManageUILanguages"
+ for iCurrentLanguage = 0 to LANGUAGES_TO_COPY
+ PresentLanguages.select( iCurrentLanguage + 1 )
+ cLanguageList( iCurrentLanguage ) = PresentLanguages.getSelText()
+ printlog( iCurrentLanguage & ": " & cLanguageList( iCurrentLanguage ) )
+ next iCurrentLanguage
+
+ kontext "ManageUILanguages"
+ hCloseDialog( ManageUILanguages, "close" )
+
+ printlog( "Localizing control" )
+ for iCurrentLanguage = 0 to LANGUAGES_TO_COPY
+ kontext "TranslationBar"
+ CurrentLanguage.select( iCurrentLanguage + 1 )
+ kontext "BasicIde"
+ hSelectControl( COMMAND_BUTTON )
+ hOpenPropertyBrowser()
+ printlog( "Setting string: " & cIDStrings( iCurrentLanguage ) )
+ kontext "TabGeneralControl"
+ NameText.typeKeys( cIDStrings( iCurrentLanguage ) & "<RETURN>" )
+ hClosePropertyBrowser()
+ next iCurrentLanguage
+
+ printlog( "Copy control" )
+ hUseAsyncSlot( "EditCopy" )
+
+ printlog( "New dialog" )
+ hNewDialog()
+
+ printlog( "Paste control" )
+ hUseAsyncSlot( "EditPaste" )
+
hOpenPropertyBrowser()
- printlog( "Setting string: " & cIDStrings( iCurrentLanguage ) )
kontext "TabGeneralControl"
- NameText.typeKeys( cIDStrings( iCurrentLanguage ) & "<RETURN>" )
+ printlog( "Set coordinates to be identical with those from the source control" )
+ PosX.typeKeys ( )
+ PosX.typeKeys ( "<HOME><SHIFT END>" & iOriginalCoordinates( 3 ) & "<RETURN>" )
+ PosY.typeKeys ( "<HOME><SHIFT END>" & iOriginalCoordinates( 4 ) & "<RETURN>" )
+ Height.typeKeys( "<HOME><SHIFT END>" & iOriginalCoordinates( 1 ) & "<RETURN>" )
+ Width.typeKeys ( "<HOME><SHIFT END>" & iOriginalCoordinates( 2 ) & "<RETURN>" )
+ hClosePropertyBrowser
+
+
+ hOpenPropertyBrowser()
+ kontext "TabGeneralControl"
+ printlog( "Get internal coordinates for the control" )
+ iOriginalCoordinates( 1 ) = height.getText()
+ iOriginalCoordinates( 2 ) = width.getText()
+ iOriginalCoordinates( 3 ) = PosX.getText()
+ iOriginalCoordinates( 4 ) = PosY.getText()
+ printlog( "Height: " & iOriginalCoordinates( 1 ) )
+ printlog( "Width.: " & iOriginalCoordinates( 2 ) )
+ printlog( "Pos X.: " & iOriginalCoordinates( 3 ) )
+ printlog( "Pos Y.: " & iOriginalCoordinates( 4 ) )
hClosePropertyBrowser()
- next iCurrentLanguage
-
- printlog( "Copy control" )
- EditCopy
-
- printlog( "New dialog" )
- Call hNewDialog()
-
- printlog( "Paste control" )
- EditPaste
-
- hOpenPropertyBrowser()
- kontext "TabGeneralControl"
- printlog( "Set coordinates to be identical with those from the source control" )
- PosX.typeKeys ( )
- PosX.typeKeys ( "<HOME><SHIFT END>" & iOriginalCoordinates( 3 ) & "<RETURN>" )
- PosY.typeKeys ( "<HOME><SHIFT END>" & iOriginalCoordinates( 4 ) & "<RETURN>" )
- Height.typeKeys( "<HOME><SHIFT END>" & iOriginalCoordinates( 1 ) & "<RETURN>" )
- Width.typeKeys ( "<HOME><SHIFT END>" & iOriginalCoordinates( 2 ) & "<RETURN>" )
- hClosePropertyBrowser
-
-
- hOpenPropertyBrowser()
- kontext "TabGeneralControl"
- printlog( "Get internal coordinates for the control" )
- iOriginalCoordinates( 1 ) = height.getText()
- iOriginalCoordinates( 2 ) = width.getText()
- iOriginalCoordinates( 3 ) = PosX.getText()
- iOriginalCoordinates( 4 ) = PosY.getText()
- printlog( "Height: " & iOriginalCoordinates( 1 ) )
- printlog( "Width.: " & iOriginalCoordinates( 2 ) )
- printlog( "Pos X.: " & iOriginalCoordinates( 3 ) )
- printlog( "Pos Y.: " & iOriginalCoordinates( 4 ) )
- hClosePropertyBrowser()
-
- kontext "TranslationBar"
- for iCurrentLanguage = 0 to LANGUAGES_TO_COPY
- CurrentLanguage.select( iCurrentLanguage + 1 )
- cTempString = CurrentLanguage.getSelText()
- if ( cTempString = cLanguageList( iCurrentLanguage ) ) then
- printlog( "Language <" & cTempString & "> was successfully copied" )
- else
- warnlog( "Either a language was lost or the sort order changed" )
- printlog( "Expected: " & cLanguageList( iCurrentLanguage ) )
- printlog( "Found...: " & cTempString )
- endif
- next iCurrentLanguage
-
-
- kontext "BasicIde"
- hDestroyDocument()
+
+ kontext "TranslationBar"
+ for iCurrentLanguage = 0 to LANGUAGES_TO_COPY
+ CurrentLanguage.select( iCurrentLanguage + 1 )
+ cTempString = CurrentLanguage.getSelText()
+ if ( cTempString = cLanguageList( iCurrentLanguage ) ) then
+ printlog( "Language <" & cTempString & "> was successfully copied" )
+ else
+ warnlog( "Either a language was lost or the sort order changed" )
+ printlog( "Expected: " & cLanguageList( iCurrentLanguage ) )
+ printlog( "Found...: " & cTempString )
+ endif
+ next iCurrentLanguage
+
+ hCloseBasicIDE()
+ else
+ warnlog( "Failed to initialize dialog" )
+ endif
hDestroyDocument()
endcase
diff --git a/testautomation/framework/optional/includes/basic_documents.inc b/testautomation/framework/optional/includes/basic_documents.inc
index d5d12b1aa12f..13dd3567716a 100644..100755
--- a/testautomation/framework/optional/includes/basic_documents.inc
+++ b/testautomation/framework/optional/includes/basic_documents.inc
@@ -37,7 +37,6 @@ testcase tBasicDocuments
const CFN = "tBasicDocuments::"
- dim brc as boolean
dim sFileWriter as string
dim sFileCalc as string
dim iDocumentCount as integer
@@ -62,32 +61,32 @@ testcase tBasicDocuments
gApplication = "WRITER"
printlog( "Create a Writer workfilename (build path and filename)" )
- brc = hCreateBasicWorkFiles()
+ hCreateBasicWorkFiles()
sFileWriter = hGetBasicWorkFile( "current" )
gApplication = "CALC"
printlog( "Create a Calc workfilename (build path and filename)" )
- brc = hCreateBasicWorkFiles()
+ hCreateBasicWorkFiles()
sFileCalc = hGetBasicWorkFile( "current" )
printlog( "Open the writer file" )
- brc = hFileOpen( sFileWriter )
- brc = hAllowMacroExecution()
- if ( not brc ) then
+ hFileOpen( sFileWriter )
+ if ( not hAllowMacroExecution() ) then
warnlog( "Missing Macro execution dialog. Please check the file/security settings" )
endif
printlog( "Open the Calc file" )
- brc = hFileOpen( sFileCalc )
- brc = hAllowMacroExecution()
- if ( not brc ) then
+ hFileOpen( sFileCalc )
+ if ( not hAllowMacroExecution() ) then
warnlog( "Missing Macro execution dialog. Please check the file/security settings" )
endif
printlog( "Open the BASIC organizer" )
- brc = hOpenBasicOrganizerFromDoc()
+ ToolsMacro_uno
+ WaitSlot()
printlog( "Retreive the names of all nodes from the treelist" )
+ kontext "Makro"
hGetVisibleNodeNames( MakroAus , cNodeListA() )
printlog( "Verify that both documents are listed - one Writer, one Calc with identical names" )
@@ -97,10 +96,10 @@ testcase tBasicDocuments
endif
printlog( "Click Manage..." )
- verwalten.click()
+ hClickButton( verwalten )
printlog( "Get the nodes list from the object organizer tabs - first tab" )
- brc = hSelectBasicObjectOrganizerTab( 1 )
+ hSelectBasicObjectOrganizerTab( 1 )
ListAllDelete( cNodeListB() )
hGetVisibleNodeNames( ModulListe , cNodeListB() )
@@ -111,7 +110,7 @@ testcase tBasicDocuments
endif
printlog( "Switch to second tab" )
- brc = hSelectBasicObjectOrganizerTab( 2 )
+ hSelectBasicObjectOrganizerTab( 2 )
ListAllDelete( cNodeListB() )
hGetVisibleNodeNames( ModuleList , cNodeListB() )
if ( listcount( cNodeListB() ) <> 5 ) then
@@ -126,22 +125,22 @@ testcase tBasicDocuments
endif
printlog( "Third tab (should not list the document" )
- brc = hSelectBasicObjectOrganizerTab( 3 )
- brc = hTestLibraryListBox( cNodeListA() )
+ hSelectBasicObjectOrganizerTab( 3 )
+ hTestLibraryListBox( cNodeListA() )
printlog( CFN & "Closing dialogs..." )
- TabBibliotheken.cancel()
+ hCloseDialog( TabBibliotheken, "cancel" )
printlog( "Cleanup: Close macro organizer" )
Kontext "Makro"
- Makro.cancel()
+ hCloseDialog( Makro, "cancel" )
printlog( "Cleanup: Close all files" )
hFileCloseAll()
printlog( "Cleanup: Remove workfiles" )
- brc = hDeleteFile( sFileWriter )
- brc = hDeleteFile( sFileCalc )
+ hDeleteFile( sFileWriter )
+ hDeleteFile( sFileCalc )
printlog( "Rest macro security level" )
hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT )
@@ -153,17 +152,19 @@ endcase
function hTestLibraryListBox( cNodeList() ) as boolean
const CFN = "hTestLibraryListBox::"
+ const EXACT_MATCH = 1
dim iEntry as integer
dim cEntry as string
- dim brc as boolean : brc = true
dim irc as integer
+
+ hTestLibraryListBox() = true
if ( bibliothek.getItemCount() <> IDOCS ) then
warnlog( CFN & "Incorrect number of items in listbox" )
printlog( CFN & "Expected: " & bibliothek.getItemCount() )
printlog( CFN & "Found...: " & listcount( cNodeList() ) )
- brc = false
+ hTestLibraryListBox() = false
endif
for iEntry = 3 to IDOCS
@@ -171,11 +172,10 @@ function hTestLibraryListBox( cNodeList() ) as boolean
Bibliothek.select( iEntry )
cEntry = Bibliothek.getSelText()
- irc = hCompareSubStrings( cNodeList( iEntry ) , cEntry )
- if ( irc <> 1 ) then
+ if ( hCompareSubStrings( cNodeList( iEntry ) , cEntry ) <> EXACT_MATCH ) then
warnlog( CFN & "Comparision failed" )
printlog( CFN & "Expected: " & cNodeList( iEntry ) & "<>" & cEntry )
- brc = false
+ hTestLibraryListBox() = false
else
printlog( CFN & "Comparision succeeded:" & cEntry )
endif
diff --git a/testautomation/framework/optional/includes/basic_formcontrols.inc b/testautomation/framework/optional/includes/basic_formcontrols.inc
index 01af07357d52..f755d645b888 100644..100755
--- a/testautomation/framework/optional/includes/basic_formcontrols.inc
+++ b/testautomation/framework/optional/includes/basic_formcontrols.inc
@@ -31,18 +31,18 @@
'*
'\******************************************************************************
+private const ICONTROLCOUNT = 22
+
testcase tAllControlsOnDialog( cMajor as string )
printlog( "Insert all available controls into a BASIC dialog and verify that changed settings persist a save/load cycle" )
- qaerrorlog( "#i105685# - Test disabled" )
- goto endsub
+ 'qaerrorlog( "#i105685# - Test disabled" )
+ 'goto endsub
dim iApplication as Integer ' numeric expression for gApplication
dim cApplication as string ' Name of the current application
- dim lsControlNames( 30 ) as string ' list containing the names of the controls
-
' number of controls and the name of the current control
dim iCurrentControl as integer
dim sCurrentControl as string
@@ -50,44 +50,30 @@ testcase tAllControlsOnDialog( cMajor as string )
' the workfile and the filter (Tested for 569, 645, 680)
dim sFile as string
- ' errorstatus: if false, something went wrong and the test cancels
- ' trying to recover somehow
- dim bOpen as boolean
- dim brc as boolean
- dim irc as integer
-
const CMODULE = "tacod" ' abbreviation for tAllControlsOnDialog
+ const BUTTON_TIMEOUT = -1
+ const UPPER_BOUNDARY = 1 ' 1 = only writer, increase to add Calc, Impress, Draw...
- printlog( "Perform the test for one application only: WRITER" )
- for iApplication = 1 to 1
+ ' Currently set to test writer only. Increase upper boundary to add applications
+ ' Up to 4 should be useful
+ for iApplication = 1 to UPPER_BOUNDARY
- printlog( "Set document type" )
cApplication = hNumericDoctype( iApplication )
+ printlog( "Document type: " & cApplication )
- printlog( "Build the filename" )
- sFile = hGetWorkPath() & "basic" & hGetSuffix( cMajor )
- sFile = ConvertPath( sFile )
+ sFile = convertpath( hGetWorkPath() & "basic" & hGetSuffix( cMajor ) )
printlog( "Using file: " & sFile )
printlog( "Delete the file, if it exists" )
hDeleteFile( sFile )
printlog( "Open a second document" )
- printlog( "" )
- printlog( cApplication )
- brc = hCreateDocument()
- if ( not brc ) then
- warnlog( "Failed to create a new document, aborting" )
- goto endsub
- endif
+ hCreateDocument()
- 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( "Create a new module for the new document, new dialog, open macro controls" )
+ if ( not hInitFormControls( CMODULE ) ) then
printlog( "Aborting due to previous errors" )
- call hCloseDocument()
+ hDestroyDocument()
goto endsub
endif
@@ -95,192 +81,150 @@ testcase tAllControlsOnDialog( cMajor as string )
for iCurrentControl = 1 to ICONTROLCOUNT
sCurrentControl = hDrawControlOnDialog( iCurrentControl )
- listappend( lsControlNames() , sCurrentControl )
- hOpenPropertyBrowser()
- hPBSetControlName( sCurrentControl )
- hClosePropertyBrowser()
+ hUseAsyncSlot( "ContextProperties" )
+ kontext "ControlPropertiesTabControl"
+ if ( ControlPropertiesTabControl.exists( 1 ) ) then
+ hPBSetControlName( sCurrentControl )
+ hUseAsyncSlot( "ContextProperties" )
+ else
+ warnlog( "Property browser not open" )
+ endif
next iCurrentControl
-
Kontext "BASICIDE"
printlog( "close the BASIC-IDE" )
hCloseBasicIde()
-
printlog( "" )
printlog( "Test case 1: Verify that settings survive a close and reopen of the BASIC IDE" )
ToolsMacro_uno
kontext "Makro"
- irc = hSelectNodeByName( MakroAus , CMODULE )
- if ( irc = 0 ) then
+ if ( hSelectNodeByName( MakroAus , CMODULE ) ) then
+ printlog( "The node was found. Good." )
+ else
qaerrorlog( "Searching node by name failed. Using fallback" )
hSelectTheLastnode( MakroAus )
- else
- printlog( "The node was found. Good." )
endif
- brc = hIsMacroEditButtonEnabled()
- if ( not brc ) then
+ printlog( "Edit the module" )
+ if ( hClickButton( Bearbeiten ) = BUTTON_TIMEOUT ) then
warnlog( "Edit-Button is not enabled, the test cannot continue" )
kontext "Makro"
- Makro.cancel()
- brc = hDestroyDocument()
+ hCloseDialog( Makro, "cancel" )
+ hDestroyDocument()
goto endsub
endif
-
- printlog( "Click 'Edit' to edit the module" )
- printlog( "Edit the module" )
- Bearbeiten.Click()
- if ( WaitSlot <> WSFinished ) then
- warnlog( "Slot not finished after 1 second" )
- endif
kontext "BasicIDE"
printlog( "Find the dialog we created before" )
- ' try to find our dialog again by stepping through the tabbar
- bOpen = hFindFirstDialog()
- if ( not bOpen ) then
- warnlog( "Could access dialog, aborting test" )
+ if ( hFindFirstDialog() ) then
+ printlog( "First dialog found. Good." )
+ else
+ warnlog( "Could not access dialog, aborting test" )
hCloseBasicIde()
- brc = hDestroyDocument()
+ hDestroyDocument()
goto endsub
endif
- 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()
- if ( not bOpen ) then
- warnlog( "Could not open macro controls, aborting" )
- hCloseBasicIde()
- brc = hDestroyDocument()
- goto endsub
- endif
-
printlog( "Select every control, open its properties and verify its name, close properties" )
for iCurrentControl = 1 to ICONTROLCOUNT
- if ( instr( gtSysName, "Solaris" ) > 0 ) then
- qaerrorlog( "Skipping frame control on Solaris" )
+ sCurrentControl = hGetControlName( iCurrentControl )
+ if ( hSelectControl( iCurrentControl ) ) then
+ kontext "ControlPropertiesTabControl"
+ if ( ControlPropertiesTabControl.exists( 5 ) ) then
+ wait( 300 )
+ hPBGetControlName( sCurrentControl )
+ hUseAsyncSlot( "ContextProperties" )
+ kontext "ControlPropertiesTabControl" : ControlPropertiesTabControl.notExists( 3 )
+ else
+ warnlog( "Property browser not open for " & sCurrentControl )
+ endif
else
- hSelectControl( iCurrentControl )
- hOpenPropertyBrowser()
- sCurrentControl = lsControlNames( iCurrentControl )
- hPBGetControlName( sCurrentControl )
- hClosePropertyBrowser()
+ warnlog( "Failed to select control: " & sCurrentControl )
endif
next iCurrentControl
-
- ' we need to delete the list-content otherwise we run into index-problems
- ListAllDelete( lsControlNames() )
- printlog( "Cleanup: Close the BASIC-IDE" )
- printlog( "Close the BASIC IDE" )
+ printlog( "Close the BASIC-IDE" )
hCloseBasicIde()
- if ( getDocumentCount <> 1 ) then
- warnlog( "Number of open documents is incorrect, expected one only" )
- endif
+ if ( getDocumentCount <> 1 ) then warnlog( "Number of open documents is incorrect, expected one only" )
- printlog "Save the document"
- printlog( "save the document" )
+ printlog( "Save the document" )
Call hFileSaveAsKill( sFile )
- printlog "Close it"
- printlog( "close the document" )
- brc = hDestroyDocument()
+ printlog( "Close the document" )
+ hDestroyDocument()
printlog( "" )
printlog( "Test case 2: Verify that all items keep their names after close and reload of the document" )
printlog( "Open the file again" )
- printlog( "Open the document" )
hFileOpen( sFile )
- printlog "Open tools/macro and select the last module for the current document"
- printlog( "open the basic-IDE of this document, open controls, activate 'Select-mode' and open the properties" )
+ printlog( "Open the basic-IDE from this document, open controls, activate 'Select-mode' and open the properties" )
ToolsMacro_uno
+
kontext "Makro"
- irc = hSelectNodeByName( MakroAus , CMODULE )
- if ( irc = 0 ) then
+ if ( hSelectNodeByName( MakroAus , CMODULE ) ) then
+ printlog( "The node was found. Good." )
+ else
qaerrorlog( "Searching node by name failed. Using fallback" )
hSelectTheLastnode( MakroAus )
- else
- printlog( "The node was found. Good." )
endif
- brc = hIsMacroEditButtonEnabled()
- if ( not brc ) then
+ printlog( "Edit the module" )
+ if ( hClickButton( Bearbeiten ) = BUTTON_TIMEOUT ) then
warnlog( "Edit-Button is not enabled, the test cannot continue" )
kontext "Makro"
- Makro.cancel()
- brc = hDestroyDocument()
+ hCloseDialog( Makro, "cancel" )
+ hDestroyDocument()
goto endsub
endif
-
- printlog( "Click 'Edit' to edit the module" )
- printlog( "Edit the module" )
- Bearbeiten.Click()
- if ( WaitSlot <> WSFinished ) then
- warnlog( "Slot not finished after 1 second" )
- endif
kontext "BasicIDE"
printlog( "Find the dialog we created before" )
- ' try to find our dialog again by stepping through the tabbar
- bOpen = hFindFirstDialog()
- if ( not bOpen ) then
- warnlog( "Could access dialog, aborting test" )
+ if ( hFindFirstDialog() ) then
+ printlog( "First dialog found. Good." )
+ else
+ warnlog( "Could not access dialog, aborting test" )
hCloseBasicIde()
- brc = hDestroyDocument()
+ hDestroyDocument()
goto endsub
endif
- 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()
- if ( not bOpen ) then
- warnlog( "Could not open macro controls, aborting" )
- hCloseBasicIde()
- brc = hDestroyDocument()
- goto endsub
- endif
-
printlog( "Select every control, open its properties and verify its name, close properties" )
for iCurrentControl = 1 to ICONTROLCOUNT
- if ( instr( gtSysName, "Solaris" ) > 0 ) then
- qaerrorlog( "Skipping frame control on Solaris" )
+ sCurrentControl = hGetControlName( iCurrentControl )
+ if ( hSelectControl( iCurrentControl ) ) then
+ kontext "ControlPropertiesTabControl"
+ if ( ControlPropertiesTabControl.exists( 5 ) ) then
+ wait( 300 )
+ hPBGetControlName( sCurrentControl )
+ hUseAsyncSlot( "ContextProperties" )
+ kontext "ControlPropertiesTabControl" : ControlPropertiesTabControl.notExists( 3 )
+ else
+ warnlog( "Property browser not open for " & sCurrentControl )
+ endif
else
- hSelectControl( iCurrentControl )
- hOpenPropertyBrowser()
- sCurrentControl = lsControlNames( iCurrentControl )
- hPBGetControlName( sCurrentControl )
- hClosePropertyBrowser()
+ warnlog( "Failed to select control: " & sCurrentControl )
endif
next iCurrentControl
-
- ' we need to delete the list-content otherwise we run into index-problems
- ListAllDelete( lsControlNames() )
-
+
printlog( "Cleanup: Close the BASIC-IDE" )
- printlog( "Close the BASIC IDE" )
hCloseBasicIde()
printlog( "Cleanup: Close the document" )
- printlog( "Close the document" )
- brc = hDestroyDocument()
+ hDestroyDocument()
printlog( "Cleanup: Delete the file we created" )
hDeleteFile( sFile )
- printlog( "Repeat this for every application" )
-
next iApplication
endcase
diff --git a/testautomation/framework/optional/includes/basic_gridcontrol.inc b/testautomation/framework/optional/includes/basic_gridcontrol.inc
index b23e2318d657..7f914ba9dafc 100755
--- a/testautomation/framework/optional/includes/basic_gridcontrol.inc
+++ b/testautomation/framework/optional/includes/basic_gridcontrol.inc
@@ -32,26 +32,22 @@
'\******************************************************************************
testcase tGridcontrolLoad
- dim sLocation as string
- dim i,x,a as integer
- dim sTemp as string
- dim lFiles(200) as string
- dim bTemp as boolean
- dim iError, iOK as integer
+
+ const MACRO_NAME = "VclTestTool"
+ const MACRO_NOT_FOUND = 0
+ const FILE_NAME = "framework/optional/input/gridcontrol.odt"
+
+ dim iPos as integer
- sLocation = "framework/optional/include/basic_gridcontrol.inc::"
+ printlog( "Open the test document: " & FILE_NAME )
+ call hFileOpen( gTestToolPath & FILE_NAME )
- hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_LOW )
+ printlog( "Open the <Run Macro> dialog" )
+ ToolsMacrosRunMacro
- printlog "Open the test document"
- call hFileOpen(convertPath(gTestToolPath + "framework/optional/input/gridcontrol.odt"))
- printlog "Security dialog might come up"
- kontext "SecurityWarning"
- if SecurityWarning.exists(5) then
- printlog "Allow to run macros"
- SecurityWarning.ok
- endif
- call sleep 1
+ printlog( "Find the document, its library and the test macro, run the macro" )
+ Kontext "ScriptSelector"
+ if ( ScriptSelector.exists( 10 ) ) then
printlog "Start the macro, that performs the test"
Kontext "GridControlDialogStarter"
@@ -100,11 +96,9 @@ testcase tGridcontrolLoad
warnlog "Gridcontrol Dialog did not come up after pressing button"
endif
- printlog "clean up"
- printlog "Close the document, else an error about the navigator will be thrown"
- if getDocumentcount > 0 then
- call hCloseDocument()
- endif
+ printlog( "Test exit, cleanup" )
+ hFileCloseAll()
+
endcase
diff --git a/testautomation/framework/optional/includes/basic_ide.inc b/testautomation/framework/optional/includes/basic_ide.inc
index 799260201257..c8db670e8cc3 100644..100755
--- a/testautomation/framework/optional/includes/basic_ide.inc
+++ b/testautomation/framework/optional/includes/basic_ide.inc
@@ -33,116 +33,129 @@
testcase tBasic_IDE_Toolbar_Module
- qaerrorlog( "Replace this test asap, the approach is unusable" )
+ printlog( "BASIC toolbars for modules" )
+
+ const DIALOG_DELAY = 2
+ const RC_FAILURE = -1
+
+ dim cTargetFile as string
+ cTargetFile = convertpath( gOfficepath & "user\work\global_test.bas" )
- dim brc as boolean
dim cSourceFile as string
cSourceFile = gTesttoolpath & "framework\optional\input\resetregistration.txt"
cSourceFile = convertpath( cSourceFile )
-
-
-
printlog "open a new writer-doc"
gApplication = "WRITER"
hCreateDocument()
- brc = hOpenBasicOrganizerFromDoc()
- brc = hCreateModuleForDoc()
-
+ if ( hInitBasicIDE( "tBasic_IDE_Toolbar_Module" ) ) then
- kontext "macrobar"
- printlog "- compile"
- hClickToolbarButton( Compile )
-
- printlog "- Run Basic"
- hClickToolbarButton( BasicRun )
-
- printlog "- Step Procedure"
- hClickToolbarButton( ProcedureStep )
-
- printlog "- Stop Basic"
- hClickToolbarButton( BasicStop )
+ kontext "macrobar"
+ printlog "- compile"
+ hClickButton( Compile )
- printlog "- Single Step"
- hClickToolbarButton( SingleStep )
+ printlog "- Run Basic"
+ hClickButton( BasicRun )
- printlog "- Step Back"
- hClickToolbarButton( StepBack )
+ printlog "- Step Procedure"
+ hClickButton( ProcedureStep )
- printlog "- Breakpoint => activate"
- hClickToolbarButton( Breakpoint )
+ printlog "- Stop Basic"
+ hClickButton( BasicStop )
+ printlog "- Single Step"
+ hClickButton( SingleStep )
- printlog "- Breakpoint => deactivate"
- hClickToolbarButton( Breakpoint )
+ printlog "- Step Back"
+ hClickButton( StepBack )
- printlog "- Add Watch => deactivate"
- hClickToolbarButton( AddWatch )
+ printlog "- Breakpoint => activate"
+ hClickButton( Breakpoint )
- printlog "- Find Paranthese"
- kontext "macrobar"
- hClickToolbarButton( FindParanthese )
+ printlog "- Breakpoint => deactivate"
+ hClickButton( Breakpoint )
- try
- Controls.TearOff()
- warnlog "Controls are active in a module window => bug!"
- catch
- printlog( "Controls are not active->OK" )
- endcatch
- if ( WaitSlot <> WSFinished ) then
- warnlog( "Slot not finished within 1 second" )
- endif
+ printlog "- Add Watch => deactivate"
+ hClickButton( AddWatch )
- printlog( "- Insert Source Text (" & cSourceFile & ")" )
+ printlog "- Find Paranthese"
+ kontext "macrobar"
+ hClickButton( FindParanthese )
- InsertSourceText.Click()
- kontext "oeffnendlg"
- if ( OeffnenDlg.exists( 1 ) ) then
- Dateiname.SetText( cSourceFile )
- Oeffnen.click()
- else
- warnlog( "File Open dialog did not open" )
- endif
-
- ' possible 'could not read from file' error-message -> this is a bug
- kontext "Active"
- if ( Active.exists( 1 ) ) then
- warnlog( "Unexpected active: " & active.gettext() )
- active.ok()
- endif
+ try
+ Controls.TearOff()
+ warnlog "Controls are active in a module window => bug!"
+ catch
+ printlog( "Controls are not active->OK" )
+ endcatch
+ if ( WaitSlot <> WSFinished ) then
+ warnlog( "Slot not finished within 1 second" )
+ endif
- kontext "macrobar"
- printlog "- Save Source Test "
+ kontext "MacroBar"
+ printlog( "- Insert Source Text (" & cSourceFile & ")" )
+ if ( hClickButton( InsertSourceText ) <> RC_FAILURE ) then
+
+ kontext "oeffnendlg"
+ if ( OeffnenDlg.exists( DIALOG_DELAY ) ) then
+ Dateiname.SetText( cSourceFile )
+ Oeffnen.click()
+ WaitSlot( 5000 )
+ else
+ warnlog( "File Open dialog did not open" )
+ endif
+
+ ' possible 'could not read from file' error-message -> this is a bug
+ kontext "Active"
+ if ( Active.exists( DIALOG_DELAY ) ) then
+ warnlog( "Unexpected active: " & active.gettext() )
+ active.ok()
+ endif
+ else
+ warnlog( "<File Open> dialog is not open, <Insert Source Text> button failed" )
+ endif
- hClickToolbarButton( SaveSourceTest )
+ kontext "macrobar"
+ printlog "- Save Source Text "
+ if ( hClickButton( SaveSourceText ) <> RC_FAILURE ) then
+
+ kontext "speicherndlg"
+ if ( SpeichernDlg.exists( DIALOG_DELAY ) ) then
+ Dateiname.SetText( cTargetFile )
+ Speichern.click()
+ else
+ warnlog( "File Save dialog is missing" )
+ endif
+
+ kontext "active"
+ if ( Active.Exists( DIALOG_DELAY ) ) then
+ printlog( "Closing Messagebox with <Yes>")
+ Active.Yes()
+ endif
+ else
+ warnlog( "<File Save> dialog did not open, slot <SaveSourceText> did not work" )
+ endif
- kontext "speicherndlg"
- if ( SpeichernDlg.exists( 1 ) ) then
- Dateiname.SetText ConvertPath (gOfficepath + "user\work\global_test.bas")
- Speichern.click()
+ hFileCloseAll()
else
- warnlog( "File Save dialog is missing" )
- endif
-
- kontext "active"
- if ( Active.Exists( 1 ) ) then
- printlog( "Closing Messagebox with <Yes>")
- Active.Yes()
+ warnlog( "Unable to init BASIC IDE" )
endif
- hDestroyDocument() ' for Basic-IDE
- hDestroyDocument() ' the new writer-doc
-
endcase
'*******************************************************************************
testcase tBasic_IDE_Toolbar_Dialogs
- qaerrorlog( "Replace this test asap, the approach is unusable" )
+ printlog( "BASIC toolbar for Dialogs" )
+
+ const DIALOG_DELAY = 2
+
+ const TABBAR_MENU_NEW = 1
+ const TABBAR_MENU_NEW_DIALOG = 2
dim bIsOpen as boolean
dim brc as boolean
@@ -159,177 +172,140 @@ testcase tBasic_IDE_Toolbar_Dialogs
gApplication = "WRITER"
hCreateDocument()
- printlog "create a new module "
- brc = hOpenBasicOrganizerFromDoc()
- brc = hCreateModuleForDoc()
+ if ( hInitBasicIDE( "tBasic_IDE_Toolbar_Dialogs" ) ) then
- kontext "basicide"
- Tabbar.OpenContextMenu
- hMenuSelectNr ( 1 )
- hMenuSelectNr ( 2 )
- if ( DialogWindow.Exists ( 2 ) ) then
- printlog( "Dialog Editor window is open. Good." )
- else
- warnlog "No dialog window is shown!"
- end if
-
- try
- kontext "MacroBar"
- Compile.Click()
- warnlog( """Compile"" is enabled" )
- catch
- printlog( """Compile"" is disabled" )
- endcatch
-
- try
- kontext "MacroBar"
- BasicRun.Click()
- warnlog( """Run Basic"" is enabled" )
- catch
- printlog( """Run Basic"" is disabled" )
- endcatch
-
- printlog "- Step Procedure (disabled)"
- try
- kontext "MacroBar"
- ProcedureStep.Click()
- warnlog( """Step Procedure"" is enabled" )
- catch
- printlog( """Step Procedure"" is disabled" )
- endcatch
+ kontext "basicide"
+ Tabbar.OpenContextMenu
+ hMenuSelectNr ( TABBAR_MENU_NEW )
+ hMenuSelectNr ( TABBAR_MENU_NEW_DIALOG )
- try
- kontext "MacroBar"
- BasicStop.Click()
- warnlog( """Stop Basic"" is enabled" )
- catch
- printlog( """Stop Basic"" is disabled" )
- endcatch
-
- try
- kontext "MacroBar"
- SingleStep.Click()
- warnlog( """Single Step"" is enabled" )
- catch
- printlog( """Single Step"" is enabled" )
- endcatch
-
- try
- kontext "MacroBar"
- StepBack.Click()
- warnlog( """Single Step Back"" is enabled" )
- catch
- printlog( """Single Step Back"" is enabled" )
- endcatch
-
- try
- kontext "MacroBar"
- Breakpoint.Click()
- warnlog( """Breakpoint"" is enabled" )
- catch
- printlog( """Breakpoint"" is disabled" )
- endcatch
-
-
- try
- kontext "MacroBar"
- AddWatch.Click()
- warnlog( """Add Watch"" is enabled" )
- catch
- printlog( """Add Watch"" is disabled" )
- endcatch
+ if ( DialogWindow.Exists ( DIALOG_DELAY ) ) then
+ printlog( "Dialog Editor window is open. Good." )
+ else
+ warnlog "No dialog window is shown!"
+ end if
+ try
+ kontext "MacroBar"
+ Compile.Click()
+ warnlog( """Compile"" is enabled" )
+ catch
+ printlog( """Compile"" is disabled" )
+ endcatch
- try
- kontext "MacroBar"
- FindParanthese.Click()
- warnlog( """Find Paranthese"" is enabled" )
- catch
- printlog( """Find Paranthese"" is disabled" )
- endcatch
+ try
+ kontext "MacroBar"
+ BasicRun.Click()
+ warnlog( """Run Basic"" is enabled" )
+ catch
+ printlog( """Run Basic"" is disabled" )
+ endcatch
+ printlog "- Step Procedure (disabled)"
+ try
+ kontext "MacroBar"
+ ProcedureStep.Click()
+ warnlog( """Step Procedure"" is enabled" )
+ catch
+ printlog( """Step Procedure"" is disabled" )
+ endcatch
- try
- kontext "macrobar"
- InsertSourceText.Click()
- warnlog( """Insert Source Text"" is enabled" )
+ try
+ kontext "MacroBar"
+ BasicStop.Click()
+ warnlog( """Stop Basic"" is enabled" )
+ catch
+ printlog( """Stop Basic"" is disabled" )
+ endcatch
- kontext "oeffnendlg"
- if ( OeffnenDlg.exists( 2 ) ) then
- Dateiname.SetText( sBasFile1 )
- Oeffnen.Click()
- else
- warnlog( "File Open dialog missing" )
- endif
- catch
- printlog( """Insert Source Text"" is disabled" )
- endcatch
+ try
+ kontext "MacroBar"
+ SingleStep.Click()
+ warnlog( """Single Step"" is enabled" )
+ catch
+ printlog( """Single Step"" is enabled" )
+ endcatch
-
- printlog "- Save Source Test (disabled)"
+ try
+ kontext "MacroBar"
+ StepBack.Click()
+ warnlog( """Single Step Back"" is enabled" )
+ catch
+ printlog( """Single Step Back"" is enabled" )
+ endcatch
- try
- kontext "macrobar"
- SaveSourceTest.Click()
- warnlog( """Save Source Text"" is enabled" )
+ try
+ kontext "MacroBar"
+ Breakpoint.Click()
+ warnlog( """Breakpoint"" is enabled" )
+ catch
+ printlog( """Breakpoint"" is disabled" )
+ endcatch
- kontext "speicherndlg"
- if ( SpeichernDlg.exists( 2 ) ) then
- Dateiname.SetText( sBasFile2 )
- Speichern.Click()
- else
- warnlog( "File Save dialog is missing" )
- endif
- kontext "active"
- if ( Active.Exists( 1 ) ) then
- Active.Yes()
- endif
- catch
- printlog( """Save Source Text"" is disabled" )
- endcatch
+ try
+ kontext "MacroBar"
+ AddWatch.Click()
+ warnlog( """Add Watch"" is enabled" )
+ catch
+ printlog( """Add Watch"" is disabled" )
+ endcatch
-
- bIsOpen = hShowMacroControls()
- if ( bIsOpen ) then
- ToolsCollectionBar.Close()
- end if
- Call hDestroyDocument() ' for Basic-IDE
- Call hDestroyDocument() ' the new writer-doc
+ try
+ kontext "MacroBar"
+ FindParanthese.Click()
+ warnlog( """Find Paranthese"" is enabled" )
+ catch
+ printlog( """Find Paranthese"" is disabled" )
+ endcatch
-endcase
-'******************************************************************************'
+ try
+ kontext "macrobar"
+ InsertSourceText.Click()
+ warnlog( """Insert Source Text"" is enabled" )
+
+ kontext "oeffnendlg"
+ if ( OeffnenDlg.exists( DIALOG_DELAY ) ) then
+ Dateiname.SetText( sBasFile1 )
+ Oeffnen.Click()
+ else
+ warnlog( "File Open dialog missing" )
+ endif
+ catch
+ printlog( """Insert Source Text"" is disabled" )
+ endcatch
-function hClickToolbarButton( oButton as object ) as boolean
- const CFN = "hClickToolbarButton(): "
+ printlog "- Save Source Test (disabled)"
- dim iTry as integer
- dim brc as boolean : brc = false
-
- printlog( CFN & "Clicking button on toolbar: " & oButton.name() )
- for iTry = 1 to 5
-
try
- oButton.click()
- brc = true
- exit for
+ kontext "macrobar"
+ SaveSourceText.Click()
+ warnlog( """Save Source Text"" is enabled" )
+
+ kontext "speicherndlg"
+ if ( SpeichernDlg.exists( DIALOG_DELAY ) ) then
+ Dateiname.SetText( sBasFile2 )
+ Speichern.Click()
+ else
+ warnlog( "File Save dialog is missing" )
+ endif
+
+ kontext "active"
+ if ( Active.Exists( DIALOG_DELAY ) ) then
+ Active.Yes()
+ endif
catch
- printlog( CFN & "Retrying..." )
+ printlog( """Save Source Text"" is disabled" )
endcatch
-
- if ( iTry = 5 ) then
- exit for
- endif
-
- wait( 500 )
-
- next iTry
-
- if ( WaitSlot( 2000 ) <> WSFinished ) then
- warnlog( CFN & "Slot not finished within 1 second" )
+
+ hCloseBasicIDE()
+ hDestroyDocument()
+ else
+ warnlog( "Unable to open BASIC IDE" )
endif
-end function
+endcase
+
diff --git a/testautomation/framework/optional/includes/basic_library_export.inc b/testautomation/framework/optional/includes/basic_library_export.inc
index 18bb4af4441c..6f5acacbdb24 100644..100755
--- a/testautomation/framework/optional/includes/basic_library_export.inc
+++ b/testautomation/framework/optional/includes/basic_library_export.inc
@@ -38,7 +38,9 @@ testcase tBasicLibraryExport
' Assumption: All actions take place in the user/work directory
' macro taken from framework/tools/input/macros.txt::tBasicLibraryExport
- ' For constants (UPPERCASE) see .BAS-file
+ ' For test specific global constants (UPPERCASE) see .BAS-file
+
+ const LIBRARIES_TAB = 3
dim cDocumentName as string
dim cLibraryName as string
@@ -124,7 +126,7 @@ testcase tBasicLibraryExport
Verwalten.click()
printlog( "Go to the libraries-tab" )
- hSelectBasicObjectOrganizerTab( 3 )
+ hSelectBasicObjectOrganizerTab( LIBRARIES_TAB )
kontext "TabBibliotheken"
printlog( "Select the document at pos. " & DOCUMENT_POSITION )
diff --git a/testautomation/framework/optional/includes/basic_library_import.inc b/testautomation/framework/optional/includes/basic_library_import.inc
index ec4cc8fa3b53..9d5dae88ff40 100644..100755
--- a/testautomation/framework/optional/includes/basic_library_import.inc
+++ b/testautomation/framework/optional/includes/basic_library_import.inc
@@ -35,21 +35,29 @@ testcase tBasicLibraryImport
printlog( "Import a BASIC library" )
+ const MY_MACROS = 1
+ const LIBRARIES_TAB = 3
+ const STANDARD_LIBRARY = 1
+
+ const XLB_DIALOG_FILE = "dialog.xlb"
+
dim cMsg as string
dim iCurrentLib as integer
+ dim cPath as string : cPath = hGetWorkPath() & LIBRARY_NAME
+
ToolsMacro_uno
kontext "Makro"
- MakroAus.Select( 1 )
+ MakroAus.Select( MY_MACROS )
Verwalten.click()
- hSelectBasicObjectOrganizerTab( 3 )
+ hSelectBasicObjectOrganizerTab( LIBRARIES_TAB )
printlog( "Select My macros" )
kontext "TabBibliotheken"
- Bibliothek.select( 1 )
+ Bibliothek.select( STANDARD_LIBRARY )
printlog( "Click to add a library" )
Hinzufuegen.click()
@@ -62,20 +70,18 @@ testcase tBasicLibraryImport
OeffnenDlg.typeKeys( "<RETURN>" )
printlog( "Enter &quot;dialog.xlb&quot;" )
- DateiName.setText( "dialog.xlb" )
+ DateiName.setText( XLB_DIALOG_FILE )
- printlog( "Open dialog.xlb" )
+ printlog( "Open " & XLB_DIALOG_FILE )
Oeffnen.click()
kontext "active"
if ( active.exists( 1 ) ) then
if ( active.getRT() <> 373 ) then
- cMSG = Active.getText()
- cMsg = hRemoveLineBreaks( cMsg )
- warnlog( "Autocompletion failed: " & cMsg )
+ warnlog( "Autocompletion failed: " & Active.getText() )
Active.ok()
Kontext "OeffnenDlg"
- DateiName.setText( "dialog.xlb" )
+ DateiName.setText( XLB_DIALOG_FILE )
Oeffnen.click()
endif
endif
@@ -114,10 +120,10 @@ testcase tBasicLibraryImport
hDestroyDocument()
- hDeleteFile( hGetWorkPath() & LIBRARY_NAME & gPathSigne & "dialog.xlb" )
- hDeleteFile( hGetWorkPath() & LIBRARY_NAME & gPathSigne & "Module1.xba" )
- hDeleteFile( hGetWorkPath() & LIBRARY_NAME & gPathSigne & "script.xlb" )
- rmdir( hGetWorkPath() & LIBRARY_NAME ) : printlog( "Remove directory" )
+ hDeleteFile( cPath & GetPathSeparator & XLB_DIALOG_FILE )
+ hDeleteFile( cPath & GetPathSeparator & "Module1.xba" )
+ hDeleteFile( cPath & GetPathSeparator & "script.xlb" )
+ rmdir( cPath ) : printlog( "Remove directory" )
endcase
diff --git a/testautomation/framework/optional/includes/basic_macros.inc b/testautomation/framework/optional/includes/basic_macros.inc
index 0d5e2a451d60..17e1b83d5e18 100644..100755
--- a/testautomation/framework/optional/includes/basic_macros.inc
+++ b/testautomation/framework/optional/includes/basic_macros.inc
@@ -34,51 +34,42 @@
testcase tMakro_In_All_Apps
-
- dim brc as boolean
- dim cApp as string
+ printlog( "Attach a macro to all application types" )
+
dim iApp as Integer
- dim bBug as Boolean
- dim cMsg as string
- bBug = FALSE
const CMACRO = "AppMakro"
-
+ const DIALOG_TIMEOUT = 2
for iApp = 1 to 7
- cApp = hNumericDoctype( iApp )
- printlog( cApp )
+ printlog( hNumericDoctype( iApp ) )
printlog( "Open a new document" )
- brc = hCreateDocument()
+ hCreateDocument()
- brc = hInitBasicIde( CMACRO )
- if ( not brc ) then
+ if ( hInitBasicIde( CMACRO ) ) then
+ printlog "Close the BASIC-IDE"
+ hCloseBasicIde()
+
+ printlog( "Close the navigator (Master-doc)" )
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close,optional" )
+
+ printlog( "Close the document" )
+ hUseAsyncSlot( "FileClose" )
+
+ printlog( "Close the messagebox (document changed)" )
+ kontext "messagebox"
+ if ( MessageBox.Exists( DIALOG_TIMEOUT ) ) then
+ printlog( "MessageBox: " & MessageBox.getText() )
+ hCloseDialog( Messagebox, "no" )
+ else
+ warnlog( "No warning for changed document" )
+ end if
+ else
warnlog( "Could not open the BASIC Macro Organizer, aborting" )
- call hDestroyDocument()
- goto endsub
endif
-
- printlog "Close the BASIC-IDE"
- brc = hCloseBasicIde()
-
- printlog( "Close the navigator (Master-doc)" )
- brc = hCloseNavigator()
-
- printlog( "Close the document" )
- FileClose
-
- printlog( "Close the messagebox (document changed)" )
- kontext "messagebox"
- if ( MessageBox.Exists( 1 ) ) then
- cMsg = MessageBox.getText()
- cMsg = hRemoveLineBreaks( cMsg )
- printlog( "MessageBox: " & cMsg )
- MessageBox.No()
- else
- warnlog( "No warning for changed document" )
- end if
next iApp
@@ -88,32 +79,30 @@ endcase
testcase tMakro_Dialog
- if ( gBuild < 9305 ) then
- warnlog( "#i87457# - Application macros assigned to userlayer" )
- goto endsub
- endif
+ printlog( "Update test for the BASIC organizer - libraries, modules and dialogs" )
+
+ const CFN = "tMakro_Dialog::"
+ const CMACRO = "MacroDlg"
+ const RC_TIMEOUT = -1
+ const DIALOG_TIMEOUT = 2
+ const TAB_MODULES = 1
+ const TAB_DIALOGS = 2
+ const TAB_LIBRARIES = 3
+ const REFERENCE_LIBRARY = "AppLibrary1"
-
- dim brc as boolean
- dim cMsg as string
-
- dim iPos as integer
dim iLibraryItemCount as integer
-
dim iCurrentLibrary as Integer
dim XLBFILE as String
XLBFILE = gTesttoolPath & "framework\optional\input\AppLibrary1\script.xlb"
- const CFN = "tMakro_Dialog::"
- const CMACRO = "MacroDlg"
-
+ XLBFILE = convertpath( XLBFILE )
gApplication = "WRITER"
+
printlog( "Open a new document" )
- brc = hCreateDocument()
+ hCreateDocument()
printlog( "Create a new library, a new module, open Basic-Ide" )
- brc = hInitBasicIde( CMACRO )
- if ( not brc ) then
+ if ( not hInitBasicIde( CMACRO ) ) then
warnlog( CFN & "Could not open BASIC-IDE, aborting" )
goto endsub
endif
@@ -123,284 +112,268 @@ testcase tMakro_Dialog
hCloseBasicIde()
printlog( "Open the Basic Macro Organizer" )
- brc = hOpenBasicOrganizerFromDoc()
+ ToolsMacro_uno
- printlog( "Select the last Module for the current document" )
- iPos = hSelectTheLastNode( MakroAus )
-
- printlog( "Click Organize..." )
- Verwalten.Click()
-
- printlog( "Select Modules-tab" )
- brc = hSelectBasicObjectOrganizerTab( 1 )
+ kontext "Makro"
+ if ( Makro.exists( DIALOG_TIMEOUT ) ) then
-
- printlog( "Press 'new module'" )
- kontext "tabmodule"
- NeuesModul.Click()
+ printlog( "Select the last Module for the current document" )
+ hSelectTheLastNode( MakroAus )
- kontext "neuesmodul"
- printlog( "Cancel the dialog" )
- NeuesModul.Cancel()
+ printlog( "Click Organize..." )
+ Verwalten.Click()
- brc = hSelectBasicObjectOrganizerTab( 2 )
+ printlog( "Select Modules-tab" )
+ hSelectBasicObjectOrganizerTab( TAB_MODULES )
- kontext "tabdialogs"
- printlog( "Press 'new dialog'" )
- NewDialog.Click()
-
- printlog( "Cancel the dialog" )
- kontext "neuerdialog"
- NeuerDialog.Cancel()
+ printlog( "Press 'new module'" )
+ kontext "tabmodule"
+ NeuesModul.Click()
- kontext
- printlog( "Select the libraries Tab" )
- brc = hSelectBasicObjectOrganizerTab( 3 )
+ kontext "neuesmodul"
+ printlog( "Cancel the dialog" )
+ NeuesModul.Cancel()
-
- printlog( "Press 'New' on the libraries tab" )
- kontext "tabbibliotheken"
- Neu.Click()
-
- kontext "neuebibliothek"
- printlog( "Close the dialog with 'OK'" )
- Call DialogTest( NeueBibliothek )
- NeueBibliothek.OK()
-
- printlog( "Delete 'Library1'" )
- kontext "tabbibliotheken"
- Loeschen.Click()
-
- printlog( "Close the warning" )
- kontext "active"
- if ( Active.Exists() ) then
- cMsg = active.getText()
- cMsg = hRemoveLineBreaks( cMsg )
- printlog( "MessageBox: " & cMsg )
- Active.Yes()
- else
- warnlog( "Deletion warning is missing" )
- endif
-
- printlog( "Check the number of libraries in list" )
- kontext "tabbibliotheken"
- iLibraryItemCount = Bibliotheksliste.getItemCount()
- if ( iLibraryItemCount <> 1 ) then
- if ( iLibraryItemCount = 11 ) then
- warnlog( "#i87457# Macros moved from 'OpenOffice.org Macros' to 'My Macros'" )
- else
- warnlog( "Incorrect item count. Should be 1, is: " & iLibraryItemCount )
+ hSelectBasicObjectOrganizerTab( TAB_DIALOGS )
+
+ kontext "tabdialogs"
+ printlog( "Press 'new dialog'" )
+ NewDialog.Click()
+
+ printlog( "Cancel the dialog" )
+ kontext "neuerdialog"
+ NeuerDialog.Cancel()
+
+ kontext
+ printlog( "Select the libraries Tab" )
+ hSelectBasicObjectOrganizerTab( TAB_LIBRARIES )
+
+
+ printlog( "Press 'New' on the libraries tab" )
+ kontext "tabbibliotheken"
+ Neu.Click()
+
+ kontext "neuebibliothek"
+ if ( NeueBibliothek.exists( DIALOG_TIMEOUT ) ) then
+ printlog( "Close the dialog with 'OK'" )
+ Call DialogTest( NeueBibliothek )
+ hCloseDialog( NeueBibliothek, "ok" )
endif
- endif
- printlog( "Append a xlb-file" )
- kontext "tabbibliotheken"
- Hinzufuegen.Click()
+ printlog( "Delete 'Library1'" )
+ kontext "tabbibliotheken"
+ Loeschen.Click()
- printlog( "Select 'AppLibrary1/script.xlb' from the files list"
- kontext "oeffnendlg"
- Dateiname.SetText( ConvertPath ( XLBFILE ) )
- Oeffnen.Click()
-
- ' If the .xlb file cannot be found the test cannot continue. Warn and cleanup.
- kontext "Active"
- if ( Active.exists( 1 ) ) then
-
- try
- Active.getButtonCount()
-
- warnlog( "Script does not exist warning displayed. Aborting test" )
- printlog( Active.getText() )
- active.ok()
-
- kontext "OeffnenDlg"
- if ( OeffnenDlg.exists( 1 ) ) then
- printlog( "Closing File Open dialog" )
- OeffnenDlg.cancel()
- endif
-
- kontext "tabbibliotheken"
- if ( TabBibliotheken.exists( 1 ) ) then
- printlog( "Closing Libaries tab" )
- TabBibliotheken.close()
+ printlog( "Close the warning" )
+ kontext "active"
+ if ( Active.Exists( DIALOG_TIMEOUT ) ) then
+ printlog( "MessageBox: " & active.getText() )
+ Active.Yes()
+ else
+ warnlog( "Deletion warning is missing" )
+ endif
+
+ printlog( "Check the number of libraries in list" )
+ kontext "tabbibliotheken"
+ iLibraryItemCount = Bibliotheksliste.getItemCount()
+ if ( iLibraryItemCount <> 1 ) then
+ if ( iLibraryItemCount = 11 ) then
+ warnlog( "#i87457# Macros moved from 'OpenOffice.org Macros' to 'My Macros'" )
+ else
+ warnlog( "Incorrect item count. Should be 1, is: " & iLibraryItemCount )
endif
-
- kontext "Makro"
- if ( Makro.exists( 1 ) ) then
- printlog( "Closing Macro organizer" )
- Makro.close()
+ endif
+
+ printlog( "Append a xlb-file" )
+ kontext "tabbibliotheken"
+ Hinzufuegen.Click()
+
+ printlog( "Select 'AppLibrary1/script.xlb' from the files list"
+ kontext "oeffnendlg"
+ Dateiname.SetText( XLBFILE )
+ Oeffnen.Click()
+
+ kontext "AppendLibraries"
+ if ( AppendLibraries.exists( DIALOG_TIMEOUT ) ) then
+ printlog( "<Append libraries> dialog is open, good" )
+ else
+
+ ' If the .xlb file cannot be found the test cannot continue. Warn and cleanup.
+ kontext "Active"
+ if ( Active.exists() ) then
+
+ warnlog( "Unexpected messagebox, the script appears to be missing" )
+ printlog( Active.getText() )
+
+ kontext "Active"
+ hCloseDialog( Active, "ok" )
+
+ kontext "OeffnenDlg"
+ hCloseDialog( OeffnenDlg, "cancel,optional" )
+
+ kontext "TabBibliotheken"
+ hCloseDialog( TabBibliotheken, "close,optional" )
+
+ kontext "Makro"
+ hCloseDialog( Makro, "close,optional" )
+
+ printlog( "Exiting test" )
+ goto endsub
+
endif
-
- printlog( "Exiting test" )
- goto endsub
- catch
- printlog( "Script found and loaded. Good." )
- endcatch
-
- endif
+ endif
- printlog( "Ensure 'Insert as Reference' is unchecked" )
- kontext "appendlibraries"
- InsertAsReference.UnCheck()
-
- printlog( "Check 'Replace existing library'" )
- ReplaceExistingLibraries.Check()
-
- printlog( "Press 'OK' to append the library" )
- kontext "appendlibraries"
- try
- AppendLibraries.OK()
- catch
- warnlog( "#i85254# Appending libraries leads to crash" )
- endcatch
-
- printlog( "Check the number of libraries in list (should be two)" )
- kontext "tabbibliotheken"
- iLibraryItemCount = Bibliotheksliste.getItemCount()
- if ( iLibraryItemCount <> 2 ) then
- qaerrorlog( "#i87457# Two entries in list expected, found " & iLibraryItemCount )
- endif
+ printlog( "Ensure 'Insert as Reference' is unchecked" )
+ kontext "appendlibraries"
+ InsertAsReference.UnCheck()
+
+ printlog( "Check 'Replace existing library'" )
+ ReplaceExistingLibraries.Check()
+
+ printlog( "Press 'OK' to append the library" )
+ kontext "appendlibraries"
+
+ hCloseDialog( AppendLibraries, "ok" )
- printlog( "Select the first item" )
- Bibliotheksliste.TypeKeys( "<HOME>" )
- for iCurrentLibrary = 1 to iLibraryItemCount
- if ( Bibliotheksliste.getSelText() = "AppLibrary1" ) then
- printlog( "Found AppLibrary1" )
- exit for
+ printlog( "Check the number of libraries in list (should be two)" )
+ kontext "tabbibliotheken"
+ iLibraryItemCount = Bibliotheksliste.getItemCount()
+ if ( iLibraryItemCount <> 2 ) then
+ qaerrorlog( "#i87457# Two entries in list expected, found " & iLibraryItemCount )
endif
- printlog( "This was not AppLibrary1, trying again" )
- Bibliotheksliste.Typekeys( "<DOWN>" )
- next iCurrentLibrary
-
- printlog( "Set a password for AppLibrary1" )
- kontext "tabbibliotheken"
- if ( Passwort.IsEnabled() ) then
- Passwort.Click()
- kontext "passwddlg"
- PasswdDLG.Cancel()
- else
- warnlog( "Password is disabled for 'AppLibrary1'" )
- endif
- printlog( "Delete 'AppLibrary1'" )
- kontext "tabbibliotheken"
- Loeschen.Click()
-
- printlog( "Close the warning with YES" )
- kontext "active"
- if ( Active.Exists() ) then
- cMsg = active.getText()
- cMsg = hRemoveLineBreaks( cMsg )
- printlog( "MessageBox: " & cMsg )
- Active.Yes()
- else
- warnlog( "Expected confirmation dialog for delete" )
- endif
-
- kontext "tabbibliotheken"
- printlog( "Press 'edit' on 'Libraries'-tab" )
- Bearbeiten.Click()
+ printlog( "Select the first item" )
+ Bibliotheksliste.TypeKeys( "<HOME>" )
+ for iCurrentLibrary = 1 to iLibraryItemCount
+ if ( Bibliotheksliste.getSelText() = REFERENCE_LIBRARY ) then
+ printlog( "Found " & REFERENCE_LIBRARY )
+ exit for
+ endif
+ printlog( "This was not " & REFERENCE_LIBRARY & ", trying again" )
+ Bibliotheksliste.Typekeys( "<DOWN>" )
+ next iCurrentLibrary
+
+ printlog( "Set a password for " & REFERENCE_LIBRARY )
+ kontext "tabbibliotheken"
+ if ( hClickButton( Passwort ) <> RC_TIMEOUT ) then
+ kontext "passwddlg"
+ hCloseDialog( PasswdDLG, "cancel" )
+ else
+ warnlog( "Password is disabled for " & REFERENCE_LIBRARY )
+ endif
- kontext "BasicIDE"
- if ( BasicIDE.Exists( 5 ) ) then
-
- hInsertMacro( 3 )
-
- printlog( "Close the basic-document" )
- brc = hCloseBasicIde()
+ printlog( "Delete " & REFERENCE_LIBRARY )
+ kontext "tabbibliotheken"
+ Loeschen.Click()
+ printlog( "Close the warning with YES" )
kontext "active"
- if ( Active.Exists ( 2 ) ) then
- cMsg = active.getText()
- cMsg = hRemoveLineBreaks( cMsg )
- warnlog( "Unexpected MessageBox: " & cMsg )
- Active.NO()
+ if ( Active.Exists() ) then
+ printlog( "MessageBox: " & active.getText() )
+ Active.Yes()
+ else
+ warnlog( "Expected confirmation dialog for delete" )
endif
- else
- warnlog("#i38978# The Macro-Document is not open, aborting test")
- call hDestroyDocument()
- goto endsub
- endif
+ kontext "tabbibliotheken"
+ printlog( "Press 'edit' on 'Libraries'-tab" )
+ Bearbeiten.Click()
- printlog( "Open the BASIC Macro Organizer" )
- brc = hOpenBasicOrganizerFromDoc()
-
- printlog( "Select the last macro from the list" )
- kontext "makro"
- iPos = hSelectTheLastNode( MakroAus )
-
- try
- printlog( "Assign the macro, Tools/customize dialog should open" )
- Zuordnen.Click ()
- catch
- warnlog( "#i106853# Assign-Button is disabled or macro is missing" )
- endcatch
-
- printlog( "Activate all tapages and cancel the Tools/Customize dialog" )
-
- brc = hToolsCustomizeSelectTab( "menu" )
- brc = hToolsCustomizeSelectTab( "keyboard"
- if ( not brc ) then
- qaerrorlog( "#i61765# Keyboard tab missing when called via Tools/Macros->Assign" )
- endif
- brc = hToolsCustomizeSelectTab( "events" )
- brc = hToolsCustomizeSelectTab( "toolbars" )
+ kontext "BasicIDE"
+ if ( BasicIDE.Exists( DIALOG_TIMEOUT ) ) then
- printlog( "Cancel Tools/Customize dialog -> Macro Organizer should be open" )
- brc = hToolsCustomizeClose( 2 )
-
-
- printlog "Click to run macro"
- kontext "makro"
- try
- Ausfuehren.Click()
- catch
- warnlog( "Unable to run macro" )
+ hInsertMacro( 3 )
+
+ printlog( "Close the basic-document" )
+ hCloseBasicIde()
+
+ kontext "active"
+ if ( Active.Exists ( DIALOG_TIMEOUT ) ) then
+ warnlog( "Unexpected MessageBox: " & active.getText() )
+ Active.NO()
+ endif
+
+ else
+ warnlog("#i38978# The Macro-Document is not open, aborting test")
+ call hDestroyDocument()
+ goto endsub
+ endif
+
+ printlog( "Open the BASIC Macro Organizer" )
+ ToolsMacro_uno
+
+ printlog( "Select the last macro from the list" )
+ kontext "makro"
+ if ( Makro.exists( DIALOG_TIMEOUT ) ) then
+ hSelectTheLastNode( MakroAus )
+
+ printlog( "Assign the macro, Tools/customize dialog should open" )
+ if ( hClickButton( Zuordnen ) = RC_TIMEOUT ) then
+ warnlog( "#i106853# Assign-Button is disabled or macro is missing" )
+ endif
+
+ printlog( "Activate all tapages and cancel the Tools/Customize dialog" )
+ if ( not hToolsCustomizeSelectTab( "keyboard" ) ) then
+ qaerrorlog( "#i61765# Keyboard tab missing when called via Tools/Macros->Assign" )
+ endif
+ hToolsCustomizeSelectTab( "events" )
+ hToolsCustomizeSelectTab( "toolbars" )
+
+ printlog( "Cancel Tools/Customize dialog -> Macro Organizer should be open" )
+ kontext "TabCustomizeToolbars"
+ hCloseDialog( TabCustomizeToolbars, "cancel" )
+
+
+ printlog "Click to run macro"
+ kontext "makro"
+ if ( hClickButton( Ausfuehren ) = RC_TIMEOUT ) then
+ warnlog( "Unable to run macro, button is not enabled" )
+ kontext "Makro"
+ hCloseDialog( Makro, "close" )
+ endif
+
+ kontext "active"
+ if ( active.exists() ) then
+ if ( active.getText() = "TTMacro3" ) then
+ printlog( "The correct macro has been executed" )
+ else
+ warnlog( "Unknown Messagebox: " & active.getText() )
+ endif
+ Active.OK()
+ endif
+ else
+ warnlog( "Macro Organizer did not open" )
+ endif
+
+ printlog( "Open macro organizer from the current document" )
+ ToolsMacro_uno : WaitSlot()
+
+ printlog( "Select the last item in the treelist" )
kontext "Makro"
- Makro.close()
- endcatch
-
- kontext "active"
- if ( active.exists() ) then
- cMsg = active.getText()
- cMsg = hRemoveLineBreaks( cMsg )
- if ( cMsg = "TTMacro3" ) then
- printlog( "The correct macro has been executed" )
+ hSelectTheLastNode( MakroAus )
+
+ printlog( "Delete the new module" )
+ Loeschen.Click()
+
+ printlog( "Close the deletion warning" )
+ kontext "active"
+ if ( active.exists() ) then
+ printlog( "MessageBox: " & active.getText() )
+ Active.Yes()
else
- warnlog( "Unknown Messagebox: " & cMsg )
+ warnlog( "No confirmation dialog for delete" )
endif
- Active.OK()
- endif
-
- printlog( "Open macro organizer from the current document" )
- brc = hOpenBasicOrganizerFromDoc()
-
- printlog( "Select the last item in the treelist" )
- brc = hSelectTheLastNode( MakroAus )
- printlog( "Delete the new module" )
- Loeschen.Click()
-
- printlog( "Close the deletion warning" )
- kontext "active"
- if ( active.exists() ) then
- cMsg = active.getText()
- cMsg = hRemoveLineBreaks( cMsg )
- printlog( "MessageBox: " & cMsg )
- Active.Yes()
+ printlog( "Close the macro organizer" )
+ kontext "makro"
+ Makro.Close()
else
- warnlog( "No confirmation dialog for delete" )
+ warnlog( "Makro Organizer did not open" )
endif
- printlog( "Close the macro organizer" )
- kontext "makro"
- Makro.Close()
-
printlog( "Close the document" )
Call hDestroyDocument()
-
endcase
diff --git a/testautomation/framework/optional/includes/basic_modulehide.inc b/testautomation/framework/optional/includes/basic_modulehide.inc
index 130915ffec46..8423c67e6b67 100644..100755
--- a/testautomation/framework/optional/includes/basic_modulehide.inc
+++ b/testautomation/framework/optional/includes/basic_modulehide.inc
@@ -36,6 +36,14 @@ testcase tBasicIdeModuleHide
const CFN = "tBasicIdeModuleHide::"
+ const TESTMACRO = "TTMacro1"
+ const ERR_NO_LINES_INSERTED = 0
+
+ const RC_SUCCESS = 0
+ const RC_TIMEOUT = -1
+
+ const TAB_MODULES = 1
+
dim rc as integer
dim brc as boolean
dim cDefaultTabName as string
@@ -43,60 +51,48 @@ testcase tBasicIdeModuleHide
gApplication = "WRITER"
call hNewDocument()
- brc = hOpenBasicOrganizerFromDoc()
- brc = hCreateModuleForDoc()
+ ToolsMacro_uno
+ hCreateModuleForDoc()
- brc = hInsertMacro( 1 )
- if ( brc ) then
+ printlog( "Insert macro" )
+ if ( hInsertMacroFromFile( TESTMACRO ) > ERR_NO_LINES_INSERTED ) then
printlog( CFN & "Macro has been written successfully" )
else
warnlog( CFN & "Failed to insert macro" )
endif
- rc = hHideModule()
- if ( rc > 0 ) then
- warnlog( "Some unexpected error occurred while trying to hide the module" )
- endif
+ printlog( "Hide the module" )
+ if ( hHideModule() ) then
- try
' hTestMacro is expected to fail, so we jump to the catch statement
- rc = hTestMacro( 1 )
- if ( rc = 0 ) then
+ if ( hInsertMacroFromFile( TESTMACRO ) <> ERR_NO_LINES_INSERTED ) then
warnlog( "For some reason the original module is still visible" )
else
- warnlog( "There should not be any editingwindow visible" )
+ printlog( "The edit window is not accessible, good" )
endif
- catch
- printlog( " * unable to locate editwindow -> no module visible." )
- endcatch
-
- if ( hOpenBasicObjectOrganizer( 1 ) ) then
-
- modulliste.typekeys( "<END><RIGHT><DOWN><RIGHT><DOWN>" )
- try
- bearbeiten.click()
- catch
- warnlog( "#i35097# Crash when editing last module" )
- endcatch
-
-
- rc = hTestMacro( 1 )
- if ( rc = 1 ) then
- printlog( " * the correct macro-module is open. Good." )
+
+ if ( hOpenBasicObjectOrganizer( TAB_MODULES ) ) then
+
+ modulliste.typekeys( "<END><RIGHT><DOWN><RIGHT><DOWN>" )
+ if ( hClickButton( Bearbeiten ) = RC_TIMEOUT ) then
+ warnlog( "#i35097# Crash when editing last module" )
+ goto endsub
+ endif
+
+ if ( not hBasicIDERunMacro( TESTMACRO ) ) then
+ warnlog( "Incorrect macro executed/macro missing" )
+ endif
+
+ hCloseBasicIDE()
+ hFileCloseAll()
+
else
- warnlog( "The open macro-module is not the one that was expected" )
+ warnlog( "restarting the office to recover from errors" )
+ call exitRestartTheOffice()
endif
-
- hCloseBasicIDE()
-
- call hCloseDocument()
-
+
else
-
- warnlog( "restarting the office to recover from errors" )
- call exitRestartTheOffice()
-
+ warnlog( "Some unexpected error occurred while trying to hide the module" )
endif
-
endcase
diff --git a/testautomation/framework/optional/includes/basic_modulenames.inc b/testautomation/framework/optional/includes/basic_modulenames.inc
index 28c260642482..f874fd93976a 100644..100755
--- a/testautomation/framework/optional/includes/basic_modulenames.inc
+++ b/testautomation/framework/optional/includes/basic_modulenames.inc
@@ -33,68 +33,50 @@
testcase tBasicIdeModuleNames
+ printlog( "Modulenames in BASIC IDE" )
+
+ const CMODULE_VALID1 = "tValidName"
+ const CMODULE_VALID2 = "tValidToo"
+ const TEST_MACRO = "TTMacro1"
+
+ const RC_SUCCESS = 0
+ const RC_FAILURE = 1
+ const ERR_NO_LINES_INSERTED = 0
- dim rc as integer
- dim brc as boolean
- dim i as integer
dim iCurrentName as integer
- const CMODULE = "TModuleNames"
dim cTabName as string
gApplication = "WRITER"
hCreateDocument()
- ' ------ prerequisites ---------
-
- brc = hInitBasicIde( CMODULE )
-
-
- brc = hInsertMacro( 1 )
- if ( rc <> 0 ) then
- warnlog( "Failed to insert macro" )
- endif
+ hInitBasicIde( CMODULE_VALID1 )
+ if ( hInsertMacroFromFile( TEST_MACRO ) > ERR_NO_LINES_INSERTED ) then
- cTabName = hGetTabNameFromOrganizer()
+ cTabName = hGetTabNameFromOrganizer()
+
+ Randomize
+ iCurrentName = Int( 24 * RND ) + 1 ' Range from 1 to 24
+
+ printlog( "Trying with invalid modulename" )
+ cTabName = hCreateInvalidModuleName( iCurrentName )
+ hRenameTab( cTabName )
+ if ( hHandleInvalidNameWarning( cTabname ) ) then
+ printlog( "Warning for invalid modulename displayed" )
+ else
+ warnlog( "Warning for invalid modulename is missing" )
+ endif
- Randomize
- iCurrentName = Int( 24 * RND ) + 1 ' Range from 1 to 24
-
- cTabName = hCreateInvalidModuleName( iCurrentName )
- rc = hRenameTab( cTabName )
- if ( rc = 1 ) then
- hHandleInvalidNameWarning( cTabname )
- else
- warnlog( "Warning missing" )
- endif
-
- cTabname = CMODULE
- rc = hRenameTab( cTabname )
- if ( rc <> 0 ) then
- brc = hHandleInvalidNameWarning( cTabname )
- if ( brc ) then
- warnlog( "Failed to set valid name" )
- endif
- endif
+ printlog( "Trying with valid modulename" )
+ hRenameTab( CMODULE_VALID2 )
+ if ( hHandleInvalidNameWarning( CMODULE_VALID2 ) ) then
+ warnlog( "Failed to set valid modulename" )
+ endif
-
- cTabname = hCreateInvalidModuleName( 0 )
- rc = hRenameTab( cTabName )
- if ( rc <> 0 ) then
- brc = hHandleInvalidNameWarning( cTabname )
- if ( brc ) then
- warnlog( "Failed to set valid name" )
- endif
- endif
-
-
- rc = hTestMacro( 1 )
- if ( rc <> 1 ) then
- warnlog( "The open macro-module is not the one that was expected" )
+ else
+ warnlog( "Failed to insert macro" )
endif
- hCloseBasicIDE()
-
- hDestroyDocument()
+ hFileCloseAll()
endcase
@@ -102,204 +84,124 @@ endcase
testcase tInvalidModuleNames
+ printlog( "Modulenames in BASIC Organizer" )
+
+ const MAX_WAIT = 2
+ const OK_BUTTON_ONLY = 1
- dim brc as boolean
- dim cMsg as string
dim iCurrentName as Integer
-
dim sSeparator as String
dim cModuleName as string
- hBasicModuleCreateNew()
-
-
Randomize
iCurrentName = Int( 24 * RND ) + 1 ' Range from 1 to 24
-
cModuleName = hCreateInvalidModuleName( iCurrentName )
- printlog( "" )
printlog( "Trying module name: " & cModuleName )
- brc = hNameBasicModule( cModuleName )
-
- if ( brc ) then
+ hCreateDocument()
+ ToolsMacro_uno
+
+ ' hCreateModuleForDoc should usually end with the BASIC IDE open
+ ' but we want it to fail by providing an invalid module name
+ if ( hCreateModuleForDoc( cModuleName ) ) then
warnlog( "Basic-Ide should not open for invalid module names" )
-
- ' try to recover and continue for other names
- brc = hCloseBasicIde()
- brc = hDestroyDocument
- brc = hBasicModuleCreateNew()
-
- ' if we cannot recover, exit the test
- if ( not brc ) then
- goto endsub
+ else
+ kontext "Active"
+ if ( Active.exists( MAX_WAIT ) ) then
+ if( Active.getButtonCount() = OK_BUTTON_ONLY ) then
+
+ printlog( "Messagebox <Invalid name> displayed: " & Active.getText() )
+ hCloseDialog( Active, "ok" )
+
+ kontext "NeuesModul"
+ if ( NeuesModul.exists( MAX_WAIT ) ) then
+ hCloseDialog( NeuesModul, "cancel" )
+
+ kontext "Makro"
+ if ( Makro.exists() ) then
+ hCloseDialog( Makro, "close" )
+ else
+ warnlog( "Test should be back on macro dialog" )
+ endif
+ else
+ warnlog( "<NeuesModul> dialog should show after failed naming attempt" )
+ endif
+ else
+ warnlog( "Unexpected messagebox: " & Active.getText() )
+ hCloseDialog( Active, "close" )
+ endif
+ else
+ warnlog( "<Invalid name> Messagebox missing" )
endif
endif
+ hFileCloseAll()
- printlog( "Close the naming dialog (cancel)" )
- kontext "neuesmodul"
- if ( NeuesModul.Exists() ) then
- NeuesModul.Cancel()
- endif
-
- printlog( "Clsoe macro dialog (if it exists)" )
- kontext "makro"
- if ( Makro.Exists() ) then
- Makro.Close()
- endif
-
- printlog( "Close the document" )
- brc = hDestroyDocument()
-
endcase
'*******************************************************************************
testcase tValidModuleNames
+ printlog( "Valid modulenames in BASIC Organizer: Names that are BASIC keywords" )
- dim brc as boolean
- dim cMsg as string
dim iCurrentName as Integer
-
- dim sKeyword as String
-
- hBasicModuleCreateNew()
+ dim sModuleName as String
Randomize
iCurrentName = Int( 8 * RND ) + 1 ' Range from 1 to 8
select case iCurrentName
- case 1 : sKeyword = "option"
- case 2 : sKeyword = "sub"
- case 3 : sKeyword = "function"
- case 4 : sKeyword = "end"
- case 5 : sKeyword = "exit"
- case 6 : sKeyword = "_underscore1"
- case 7 : sKeyword = "underscore_2"
- case 8 : sKeyWord = "ThisIsQuiteALongNameForAModuleDontYouThink"
+ case 1 : sModuleName = "option"
+ case 2 : sModuleName = "sub"
+ case 3 : sModuleName = "function"
+ case 4 : sModuleName = "end"
+ case 5 : sModuleName = "exit"
+ case 6 : sModuleName = "_underscore1"
+ case 7 : sModuleName = "underscore_2"
+ case 8 : sModuleName = "ThisIsQuiteALongNameForAModuleDontYouThink"
end select
- printlog( "" )
- printlog( "Trying module name: " & sKeyword )
-
- brc = hNameBasicModule( sKeyword )
-
- if ( brc ) then
-
- ' try to recover and continue for other names
- brc = hCloseBasicIde()
- brc = hDestroyDocument
- brc = hBasicModuleCreateNew()
-
- ' if we cannot recover, exit the test
- if ( not brc ) then
- goto endsub
- endif
- endif
-
- printlog( "Close the naming dialog (cancel)" )
- kontext "neuesmodul"
- if ( NeuesModul.Exists() ) then
- NeuesModul.Cancel()
- endif
+ hCreateDocument()
+ ToolsMacro_uno
- printlog( "Clsoe macro dialog (if it exists)" )
- kontext "makro"
- if ( Makro.Exists() ) then
- Makro.Close()
+ if ( hCreateModuleForDoc( sModuleName ) ) then
+ printlog( "The module name was accepted: " & sModuleName )
+ hFileCloseAll()
+ else
+ warnlog( "The module name was not accepted: " & sModuleName )
+ goto endsub
endif
- printlog( "Close the document" )
- brc = hDestroyDocument()
-
endcase
'*******************************************************************************
-function hBasicModuleCreateNew() as boolean
+function hHandleInvalidNameWarning( cTabName as string ) as boolean
+ const CFN = "hHandleInvalidNameWarning(): "
+ const MAX_WAIT = 1
- dim brc as boolean
- brc = false
-
- dim iPos as integer
-
- const CFN = "hBasicModuleCreateNew::"
+ kontext "Active"
+ if ( Active.exists( MAX_WAIT ) ) then
- gApplication = "WRITER"
- brc = hCreateDocument()
-
- brc = hOpenBasicOrganizerFromDoc()
- if ( not brc ) then
- warnlog( CFN & "Could not open the BASIC Macro Organizer, aborting" )
- hDestroyDocument()
- endif
-
- if ( brc ) then
- iPos = hSelectTheLastNode( MakroAus )
- if ( not Neu.isEnabled() ) then
- warnlog( CFN & "New button is disabled for the current module, aborting" )
- kontext "Makro"
- Makro.cancel()
- brc = hDestroyDocument()
- endif
- endif
-
- if ( brc ) then
-
- printlog( "Click 'New'" )
- Neu.Click()
+ printlog( "Invalid name message displayed" & Active.getText() )
+ hCloseDialog( Active, "ok" )
+ hHandleInvalidNameWarning() = true
- kontext "NeuesModul"
- if ( Neuesmodul.exists() ) then
- brc = true
- printlog( CFN & "Naming dialog is open"
+ kontext "Active"
+ if ( Active.exists( MAX_WAIT ) ) then
+ printlog( "Unexpected messagebox displayed: " & Active.getText() )
+ hHandleInvalidNameWarning() = false
endif
- endif
-
- hBasicModuleCreateNew() = brc
-
-end function
-
-'*******************************************************************************
-
-function hHandleInvalidNameWarning( cTabName as string ) as boolean
+ kontext "BasicIDE"
+ tabbar.typekeys( "<ESCAPE>" , true )
- dim brc as boolean : brc = false
- dim iTry as integer
-
- const CFN = "hHandleInvalidNameWarning::"
-
- kontext "Active"
- for iTry = 1 to 5
-
- if ( active.exists( 1 ) ) then
-
- if ( brc ) then
- warnlog( CFN & "Too many invalid name warnings" )
- endif
-
- printlog( CFN & "Message: " & active.getText() )
-
- active.ok()
- brc = true
-
- else
-
- if ( not brc ) then
- warnlog( CFN & "Invalid name warning missing" )
- endif
-
- endif
-
- next iTry
-
- kontext "basicide"
- tabbar.typekeys( "<ESCAPE>" , true )
- hHandleInvalidNameWarning() = brc
+ else
+ printlog( "Invalid name warning not displayed" )
+ hHandleInvalidNameWarning() = false
+ endif
end function
diff --git a/testautomation/framework/optional/includes/basic_package_export.inc b/testautomation/framework/optional/includes/basic_package_export.inc
index a8a2ae00459d..28e214102dbb 100644..100755
--- a/testautomation/framework/optional/includes/basic_package_export.inc
+++ b/testautomation/framework/optional/includes/basic_package_export.inc
@@ -40,6 +40,10 @@ testcase tBasicPackageExport
const LIBRARY_NAME = "tBasicExport"
const DOCUMENT_POSITION = 4
const PACKAGE_SIZE = 1325
+
+ const LIBRARIES_TAB = 3
+ const LONG_WAIT = 3
+ const SHORT_WAIT = 1
dim cDocumentName as string
dim cLibraryName as string
@@ -69,7 +73,7 @@ testcase tBasicPackageExport
printlog( "Select the second document" )
kontext "Makro"
- if ( Makro.exists( 1 ) ) then
+ if ( Makro.exists( SHORT_WAIT ) ) then
iNodeCount = hGetNodeCount( MakroAus )
cDocumentName = hSelectNode( MakroAus, iNodeCount )
@@ -77,7 +81,7 @@ testcase tBasicPackageExport
Verwalten.click()
printlog( "Go to the libraries tabpage" )
- hSelectBasicObjectOrganizerTab( 3 )
+ hSelectBasicObjectOrganizerTab( LIBRARIES_TAB )
kontext "TabBibliotheken"
printlog( "Select the document at pos. " & DOCUMENT_POSITION )
@@ -93,7 +97,7 @@ testcase tBasicPackageExport
Neu.click()
kontext "NeueBibliothek"
- if ( NeueBibliothek.exists( 1 ) ) then
+ if ( NeueBibliothek.exists( SHORT_WAIT ) ) then
printlog( "Name the new library: " & LIBRARY_NAME )
BibliotheksName.setText( LIBRARY_NAME )
NeueBibliothek.ok()
@@ -128,7 +132,7 @@ testcase tBasicPackageExport
printlog( "Select the work document" )
kontext "Makro"
- if ( Makro.exists( 1 ) ) then
+ if ( Makro.exists( SHORT_WAIT ) ) then
iNodeCount = hGetNodeCount( MakroAus )
hSelectNode( MakroAus, iNodeCount )
@@ -136,10 +140,10 @@ testcase tBasicPackageExport
Verwalten.click()
printlog( "Libraries tab" )
- hSelectBasicObjectOrganizerTab( 3 )
+ hSelectBasicObjectOrganizerTab( LIBRARIES_TAB )
kontext "TabBibliotheken"
- if ( TabBibliotheken.exists( 1 ) and TabBibliotheken.isVisible() ) then
+ if ( TabBibliotheken.exists( SHORT_WAIT ) and TabBibliotheken.isVisible() ) then
Bibliothek.select( DOCUMENT_POSITION )
printlog( "Select the new library" )
@@ -156,17 +160,17 @@ testcase tBasicPackageExport
Export.click()
kontext "ExportBasicLibraryDlg"
- if ( ExportBasicLibraryDlg.exists( 3 ) ) then
+ if ( ExportBasicLibraryDlg.exists( LONG_WAIT ) ) then
printlog( "Select to export as extension" )
ExportAsPackage.check()
- ExportBasicLibraryDlg.ok()
+ hCloseDialog( ExportBasicLibraryDlg, "ok" )
kontext "SpeichernDlg"
- if ( SpeichernDlg.exists( 3 ) ) then
+ if ( SpeichernDlg.exists( LONG_WAIT ) ) then
printlog( "Save the file, suffix will be added automatically." )
DateiName.setText( hGetWorkPath() & LIBRARY_NAME )
Speichern.click()
- Speichern.notExists( 1 )
+ Speichern.notExists( SHORT_WAIT )
else
warnlog( "Dialog <File Save> did not open" )
endif
@@ -176,16 +180,14 @@ testcase tBasicPackageExport
kontext "TabBibliotheken"
printlog( "Close libraires tabpage" )
- TabBibliotheken.cancel()
- TabBibliotheken.notExists( 1 )
+ hCloseDialog( TabBibliotheken, "cancel" )
else
warnlog( "Dialog <TabBibliotheken> is not available" )
endif
kontext "Makro"
printlog( "Close BASIC organizer" )
- Makro.cancel()
- Makro.notExists( 1 )
+ hCloseDialog( Makro, "cancel" )
else
warnlog( "Dialog <Makro> did not open" )
endif
diff --git a/testautomation/framework/optional/includes/basic_package_import.inc b/testautomation/framework/optional/includes/basic_package_import.inc
index 4ef74de4f112..a16b9e4e50e2 100644..100755
--- a/testautomation/framework/optional/includes/basic_package_import.inc
+++ b/testautomation/framework/optional/includes/basic_package_import.inc
@@ -41,6 +41,9 @@ testcase tBasicPackageImport
dim package_name as string : package_name = "tBasicExport.oxt"
const LIBRARY_NAME = "tBasicExport"
+ const MY_MACROS = 1
+ const LIBRARIES_TAB = 3
+ const SHORT_WAIT = 1
dim cDocumentName as string
dim cLibraryName as string
@@ -49,9 +52,9 @@ testcase tBasicPackageImport
dim iCurrentLib as integer
dim iStatus as integer
- dim cFile as string
- cFile = hGetWorkPath() & package_name
-
+ dim cFile as string : cFile = hGetWorkPath() & package_name
+
+ printlog( "Probe for test extension created by basic_packege_export" )
if ( Not FileExists( cFile ) or ( FileLen( cFile ) = 0 ) ) then
warnlog( "#i105719# - Test extension is missing or has zero size. This is most likely" & _
" a follow-up error from the prior test case. Test stopped." )
@@ -80,14 +83,14 @@ testcase tBasicPackageImport
ToolsMacro_uno
kontext "Makro"
- MakroAus.select( 1 )
+ MakroAus.select( MY_MACROS )
Verwalten.click()
- hSelectBasicObjectOrganizerTab( 3 )
+ hSelectBasicObjectOrganizerTab( LIBRARIES_TAB )
kontext "TabBibliotheken"
- Bibliothek.select( 1 )
+ Bibliothek.select( SHORT_WAIT )
printlog( "Select the new library" )
kontext "TabBibliotheken"
@@ -98,15 +101,13 @@ testcase tBasicPackageImport
endif
next iCurrentLib
cLibraryName = BibliotheksListe.getSelText()
-
- try
- Hinzufuegen.click()
- catch
+
+ if ( not hClickButton( Hinzufuegen ) ) then
warnlog( "#i64007 - Office crashes on clicking import button" )
- endcatch
+ endif
kontext "OeffnenDlg"
- OeffnenDlg.cancel()
+ hCloseDialog( OeffnenDlg, "cancel" )
printlog( "Cleanup: Delete Library, close dialogs and remove package" )
@@ -119,19 +120,18 @@ testcase tBasicPackageImport
Loeschen.click()
kontext "active"
- if ( active.exists( 1 ) ) then
+ if ( active.exists( SHORT_WAIT ) ) then
active.yes()
else
warnlog( "No warning for library deletion" )
endif
- endif
-
+ endif
kontext "TabBibliotheken"
- TabBibliotheken.cancel()
+ hCloseDialog( TabBibliotheken, "cancel" )
kontext "Makro"
- Makro.cancel()
+ hCloseDialog( Makro, "cancel" )
hExtensionRemoveGUI( package_name )
diff --git a/testautomation/framework/optional/includes/basic_protected_libraries.inc b/testautomation/framework/optional/includes/basic_protected_libraries.inc
index 132549c16d8d..03a9aea72834 100644..100755
--- a/testautomation/framework/optional/includes/basic_protected_libraries.inc
+++ b/testautomation/framework/optional/includes/basic_protected_libraries.inc
@@ -47,7 +47,7 @@ testcase tProtectedLibraries
dim iCurrentLib as integer
dim cMsg as string
- hOpenBasicOrganizerFromDoc()
+ ToolsMacro_uno
printlog( "Select My Macros" )
kontext "Makro"
@@ -97,7 +97,7 @@ testcase tProtectedLibraries
printlog( "Restart the application" )
call ExitRestartTheOffice()
- hOpenBasicOrganizerFromDoc()
+ ToolsMacro_uno
printlog( "Select the protected library" )
Kontext "Makro"
diff --git a/testautomation/framework/optional/includes/basic_spectemplate.inc b/testautomation/framework/optional/includes/basic_spectemplate.inc
index 92a792cd5797..35e541a642a2 100644..100755
--- a/testautomation/framework/optional/includes/basic_spectemplate.inc
+++ b/testautomation/framework/optional/includes/basic_spectemplate.inc
@@ -33,30 +33,9 @@
testcase tBasicSpecTemplate
- qaerrorlog( "#i89554# Macro dialog not displayed / document not loaded" )
- goto endsub
-
-
const cFile = "http://specs.openoffice.org/collaterals/template/2.0/OpenOffice-org-Specification-Template.ott"
- dim brc as boolean
- dim cProxy as string
- dim cPort as string
-
- dim cWorkFile as string
-
- cWorkFile = hGetWorkPath() & "SpecTemplate" & hGetSuffix( "current" )
-
-
- hGetPrivateHttpServer( cProxy, cPort )
+ dim cWorkFile as string : cWorkFile = hGetWorkPath() & "SpecTemplate" & hGetSuffix( "current" )
- printlog( "Init: Set proxy (requires private environment to be set)" )
- hSetProxies( cProxy, cPort, "", "", "" )
- if ( WaitSlot() <> WSFinished ) then
- warnlog( "Slot not finished after 1000 msec." )
- else
- printlog( "Slot free in less than 1000 msec." )
- endif
-
printlog( "FileOpen" )
hFileOpen( cFile )
@@ -68,26 +47,26 @@ testcase tBasicSpecTemplate
kontext "OeffnenDlg"
if ( OeffnenDlg.exists( 1 ) ) then
printlog( "Recovering - closing File Open dialog" )
- OeffnenDlg.cancel()
+ hCloseDialog( OeffnenDlg, "cancel" )
endif
goto endsub
endif
printlog( "Accept to execute macros" )
- brc = hAllowMacroExecution()
- if ( not brc ) then
- warnlog( "Missing Macro execution dialog. Please check the file/security settings" )
+ if ( not hAllowMacroExecution() ) then
+ warnlog( "Missing Macro execution dialog. Aborting test" )
+ goto endsub
endif
-
+
kontext "Active"
- if ( Active.exists( 5 ) ) then
+ if ( Active.exists( 10 ) ) then
warnlog( "Fatal: Unexpected active: " & Active.getText() )
active.ok
kontext "OeffnenDlg"
if ( OeffnenDlg.exists( 2 ) ) then
- OeffnenDlg.close()
+ hCloseDialog( OeffnenDlg, "close" )
goto endsub
endif
endif
@@ -101,22 +80,23 @@ testcase tBasicSpecTemplate
hUseMenu()
hMenuSelectNr( 10 )
hMenuSelectNr( 2 )
-
-
+
+ ' This one is required as the document is rendering for a while and we cannot
+ ' tell when it is finished (WaitSlot does not work here)
+ wait( 5000 )
+
+ printlog( "Save the file, overwriting" )
hFileSaveAsKill( cWorkFile )
-
+
+ printlog( "Close the document" )
hDestroyDocument()
-
+
+ printlog( "Load the file again" )
hFileOpen( cWorkFile )
-
hAllowMacroExecution()
- printlog( "Cleanup: Close the document" )
+ printlog( "Cleanup: Close the document and delete the file" )
hDestroyDocument()
-
- printlog( "Cleanup: Delete proxy settings" )
- hSetProxies( "", "", "", "", "" )
-
hDeleteFile( cWorkFile )
endcase
diff --git a/testautomation/framework/optional/includes/basic_usertemplate.inc b/testautomation/framework/optional/includes/basic_usertemplate.inc
index de3b605ed510..03f1602a94b5 100644..100755
--- a/testautomation/framework/optional/includes/basic_usertemplate.inc
+++ b/testautomation/framework/optional/includes/basic_usertemplate.inc
@@ -43,7 +43,6 @@ testcase tMacroUsertemplate
' When creating a document based on a user-created template the macro
' will not execute, instead a com.sun.star... errormessage is displayed
- dim brc as boolean ' returncode
dim irc as integer ' returncode
dim cMacroName as string ' Temp variable to store the name of current macro
@@ -63,62 +62,74 @@ testcase tMacroUsertemplate
kontext "DocumentWriter"
DocumentWriter.typeKeys( DOC_IDENTIFIER )
- brc = hCreateDocument()
-
- brc = hOpenBasicOrganizerFromDoc()
+ printlog( "Create a new document" )
+ hCreateDocument()
+
+ printlog( "Open the macro organizer" )
+ ToolsMacro_uno
+ printlog( "Search for the module" )
+ kontext "Makro"
iCurrentNode = hSelectNodeByName( MakroAus, "Module1" )
if ( iCurrentNode = 0 ) then
warnlog( "#i73521# - The expected node could not be found. Aborting test" )
kontext "Makro"
- Makro.close()
+ hCloseDialog( Makro, "close" )
hDestroyDocument()
goto endsub
endif
- ' verify that we replace the correct macro. if not: Abort
+ printlog( "Find the macro we are going to replace" )
if ( MakroListe.getItemCount() > 0 ) then
cMacroName = MakroListe.getSelText()
if ( lcase( cMacroName ) <> "main" ) then
warnlog( "Test abort: Incorrect macro is selected: " & cMacroName )
printlog( "This should have been the <Main> Macro" )
kontext "Makro"
- Makro.cancel()
+ hCloseDialog( Makro, "cancel" )
hDestroyDocument()
goto endsub
endif
else
warnlog( "There is no macro listed for the current module, the test cannot continue" )
kontext "Makro"
- Makro.close()
+ hCloseDialog( Makro, "close" )
hDestroyDocument()
goto endsub
endif
-
+
+ printlog( "Edit" )
Bearbeiten.click()
+ printlog( "Insert test macro" )
hInsertMacro( 3 )
+ printlog( "Close BASIC IDE" )
hCloseBasicIde()
+ printlog( "Close Document" )
hDestroyDocument()
+ printlog( "Open new document" )
hCreateDocument
+ printlog( "Open Macro Organizer" )
ToolsMacrosRunMacro
-
+
+ printlog( "Find the Macro again" )
cMacroName = hExecScript_tMacroUserTemplate() ' local function, see below
if ( lcase( cMacroName ) <> "main" ) then
warnlog( "Test abort: Incorrect macro is selected: " & cMacroName )
printlog( "This should have been the <Main> Macro" )
ScriptSelector.cancel()
- brc = hDestroyDocument()
+ hDestroyDocument()
goto endsub
endif
- ' run
+ printlog( "Run the macro" )
ScriptSelector.ok()
+ printlog( "Check for macro" )
kontext "Active"
if ( active.exists( 3 ) ) then
printlog( "Messagebox: " & active.getText() )
@@ -126,29 +137,33 @@ testcase tMacroUsertemplate
else
warnlog( "The Macro has not been executed" )
endif
-
- brc = hDestroyDocument()
- brc = hCreateDocument()
+ printlog( "Close the document" )
+ hDestroyDocument()
+
+ printlog( "Open a new document" )
+ hCreateDocument()
printlog( "" )
printlog( "Save as template" )
hFileSaveAsWithFilterKill( sPathOut & FILEOUT, FILTER )
-
+
+ printlog( "Close the document" )
hDestroyDocument()
printlog( "" )
printlog( "File New from Template" )
FileNewFromTemplate
-
+
+ printlog( "Find the template" )
irc = hFindTemplate( FILEOUT )
-
hSelectDocumentObject( irc, 1 )
printlog( "" )
- printlog( "Run Macro..." )
+ printlog( "Open the <Run Macro> dialog" )
ToolsMacrosRunMacro
-
+
+ printlog( "Try to find the macro" )
cMacroName = hExecScript_tMacroUserTemplate() ' local function, see below
if ( lcase( cMacroName ) <> "main" ) then
warnlog( "Test abort: Incorrect macro is selected: " & cMacroName )
@@ -158,10 +173,10 @@ testcase tMacroUsertemplate
goto endsub
endif
- ' run
printlog( "Run" )
ScriptSelector.ok()
-
+
+ printlog( "Verify macro execution" )
kontext "Active"
if ( active.exists( 3 ) ) then
@@ -179,10 +194,11 @@ testcase tMacroUsertemplate
else
warnlog( "Macro not executed / no warning" )
endif
-
- hDestroyDocument()
- hDestroyDocument()
-
+
+ printlog( "Close all open documents" )
+ hFileCloseAll()
+
+ printlog( "Delete test template" )
hDeleteFile( sPathOut & FILEOUT & ".ott" )
diff --git a/testautomation/framework/optional/includes/basic_vba-compat_application-union.inc b/testautomation/framework/optional/includes/basic_vba-compat_application-union.inc
index 222b99215f81..d9f421278514 100755
--- a/testautomation/framework/optional/includes/basic_vba-compat_application-union.inc
+++ b/testautomation/framework/optional/includes/basic_vba-compat_application-union.inc
@@ -46,12 +46,25 @@ testcase tBasicVBACompatApplicationUnion()
const RC_FAILURE = -1
dim macro_identifier( EXPECTED_MACRO_COUNT )
+
+ ' Find out whether we can write to the program directory or not.
+ ' If we can we get different values returned from the test functions
+ ' This is required for userland installations.
+ if( hCheckForAdministratorPermissions() ) then
+ macro_identifier( 1 ) = "1: False"
+ macro_identifier( 2 ) = "2: False"
+ macro_identifier( 3 ) = "3: False"
+ macro_identifier( 4 ) = "4: True"
+ macro_identifier( 5 ) = "5: False"
+ macro_identifier( 6 ) = "6: True"
+ else
macro_identifier( 1 ) = "1: True"
macro_identifier( 2 ) = "2: True"
macro_identifier( 3 ) = "3: True"
macro_identifier( 4 ) = "4: True"
macro_identifier( 5 ) = "5: True"
macro_identifier( 6 ) = "6: True"
+ endif
dim cTestFile as string
cTestFile = gTesttoolPath & "framework/optional/input/vba-compat/" & DOCUMENT_NAME
diff --git a/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc b/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc
index 764ba407236a..1e361b6de0b2 100755
--- a/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc
+++ b/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc
@@ -80,9 +80,10 @@ testcase tBasicVBACompatImportDisabled()
hFileOpen( cTestFile )
printlog( "Open the Basic organizer" )
- hOpenBasicOrganizerFromDoc()
+ ToolsMacro_uno
printlog( "Expand all nodes" )
+ kontext "Makro"
cNodeCount = hExpandAllNodes( MakroAus )
printlog( "Verify that we have the correct node count for the current mode" )
diff --git a/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc b/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc
index 98173ee8ba48..660561322db6 100755
--- a/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc
+++ b/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc
@@ -91,9 +91,10 @@ testcase tBasicVBACompatImportEnabled()
hFileOpen( cTestFile )
printlog( "Open the Basic organizer" )
- hOpenBasicOrganizerFromDoc()
+ ToolsMacro_uno
printlog( "Expand all nodes" )
+ kontext "Makro"
cNodeCount = hExpandAllNodes( MakroAus )
printlog( "Verify that we have the correct node count for the current mode." )
diff --git a/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc b/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc
index 50c59cf88e10..66cc7a77eae5 100755
--- a/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc
+++ b/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc
@@ -67,9 +67,10 @@ testcase tBasicVBACompatImportNothing()
hFileOpen( cTestFile )
printlog( "Open the Basic organizer" )
- hOpenBasicOrganizerFromDoc()
+ ToolsMacro_uno
printlog( "Expand all nodes" )
+ kontext "Makro"
cNodeCount = hExpandAllNodes( MakroAus )
printlog( "Verify that we have the correct node count for the current mode" )
diff --git a/testautomation/framework/optional/includes/extras_file_open.inc b/testautomation/framework/optional/includes/extras_file_open.inc
index 680afdd77197..874012f6bad1 100644..100755
--- a/testautomation/framework/optional/includes/extras_file_open.inc
+++ b/testautomation/framework/optional/includes/extras_file_open.inc
@@ -173,7 +173,8 @@ testcase tOpenObjectsWithFileDialog( cCategory as string )
else
printlog( "Close navigator, if open" )
- hCloseNavigator()
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close,optional" )
sFileOut = cCategory & "_" & iCurrentTemplate
sFileOut = convertpath( sPathOut & sFileOut )
@@ -196,7 +197,8 @@ testcase tOpenObjectsWithFileDialog( cCategory as string )
hHandleActivesOnLoad( 0 , 2 )
printlog( "Close navigator, if open" )
- hCloseNavigator()
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close,optional" )
printlog( "Close document" )
hDestroyDocument()
diff --git a/testautomation/framework/optional/includes/extras_labels.inc b/testautomation/framework/optional/includes/extras_labels.inc
index 11badbd0ba07..27e2ae8dced7 100644..100755
--- a/testautomation/framework/optional/includes/extras_labels.inc
+++ b/testautomation/framework/optional/includes/extras_labels.inc
@@ -33,38 +33,36 @@
testcase tLabelTypes()
+ printlog( "Verify presence of labels and brands" )
+
+ ' If you want to use this test for other languages, remove the following
+ ' if() block and create the reference files by running this test once.
+ ' Follow the instructions emitted by hManagaComparisionList() from the log.
+
if ( gIsoLang <> "en-US" ) then
printlog( "No testing for non-en_US languages" )
goto endsub
endif
+ const NO_DELTA = 0
+ const MAX_LABEL_COUNT = 1600
+ const RELATIVE_PATH = "framework\optional\input\extras_formats\"
dim iBrandCount as integer
dim iCurrentBrand as integer
dim cBrandName as string
-
- dim iTypeCount as integer
- dim iCurrentType as integer
- dim cTypeName as string
-
+ dim iCurrentType as integer
dim cBrandType as string
- dim al_UI_Labels( 1600 ) as string
- al_UI_Labels( 0 ) = "0"
+ dim al_UI_Labels( MAX_LABEL_COUNT ) as string : al_UI_Labels( 0 ) = "0"
dim irc as integer
- dim sFile as string
- sFile = "Labels_" & gISOLang & ".txt"
-
- dim sFileIn as string
- sFileIn = gTesttoolPath & "framework\optional\input\extras_formats\" & sFile
- sFileIn = convertpath( sFileIn )
-
- dim sFileOut as string
- sFileOut = hGetWorkPath() & sFile
+ dim sFile as string : sFile = "Labels_" & gISOLang & ".txt"
+ dim sFileIn as string : sFileIn = convertpath( gTesttoolPath & RELATIVE_PATH & sFile )
+ dim sFileOut as string : sFileOut = hGetWorkPath() & sFile
-
+ printlog( "Open labels dialog, retrieve all label names" )
hCreateLabels()
kontext
@@ -75,33 +73,25 @@ testcase tLabelTypes()
iBrandCount = Marke.getItemCount()
for iCurrentBrand = 1 to iBrandCount
-
+
Marke.select( iCurrentBrand )
-
cBrandName = Marke.getSelText()
-
- iTypeCount = Typ.getItemCount()
-
- for iCurrentType = 1 to iTypeCount
-
+
+ for iCurrentType = 1 to Typ.getItemCount()
+
Typ.select( iCurrentType )
-
- cTypeName = Typ.getSelText()
-
- cBrandType = cBrandName & ":" & cTypeName
+ cBrandType = cBrandName & ":" & Typ.getSelText()
ListAppend( al_UI_Labels() , cBrandType )
-
+
next iCurrentType
-
+
next iCurrentBrand
+ printlog( "Close labels dialog" )
TabEtiketten.Cancel()
+ printlog( "Compare to reference (or create new reference, if none found)" )
irc = hManageComparisionList( sFileIn, sFileOut, al_UI_Labels() )
- if ( irc <> 0 ) then
- warnlog( "The list of labels (Brand/Types) has changed, please review." )
- else
- printlog( "The lists of labels are unchanged. Good." )
- endif
+ hListResultEvaluation( irc , NO_DELTA )
endcase
diff --git a/testautomation/framework/optional/includes/extras_modify_objects.inc b/testautomation/framework/optional/includes/extras_modify_objects.inc
index b8cf23170942..1eb34f786e5f 100644..100755
--- a/testautomation/framework/optional/includes/extras_modify_objects.inc
+++ b/testautomation/framework/optional/includes/extras_modify_objects.inc
@@ -81,12 +81,12 @@ testcase tModifyObjects( iMode as integer, cCategory as string, sVer as string )
next iObject
printlog( "Verify object count (en_US only)" )
- if ( gProductName = "StarOffice" and gISOLang = "en-US" ) then
+ if ( gProductName = "Oracle Open Office" and gISOLang = "en-US" ) then
if ( iObjectSum <> iObjectCountExpected ) then
warnlog( "Number of objects has changed. OLD: " & iObjectCountExpected &_
" NEW: " & iObjectSum )
else
- printlog( "Object count is ok for en-US / StarOffice" )
+ printlog( "Object count is ok for en-US / Oracle Open Office" )
endif
else
printlog( "Template count testing skipped for non-en_US/StarOffice" )
@@ -95,7 +95,7 @@ testcase tModifyObjects( iMode as integer, cCategory as string, sVer as string )
Kontext "TemplateAndDocuments"
printlog( "Switch from preview to document info" )
docinfo.click()
- TemplateAndDocuments.cancel()
+ hCloseDialog( TemplateAndDocuments, "cancel" )
printlog( "" )
printlog( "Starting to load/save/close/reload/close all Objects" )
@@ -111,11 +111,14 @@ testcase tModifyObjects( iMode as integer, cCategory as string, sVer as string )
printlog( "Folder index = " & iObjectFolder & ", Object index = " & iObject )
hFileCloseAll()
-
- if ( iReset = 10 ) then
- call exitRestartTheOffice()
- iReset = 0
- endif
+
+ ' every now and then the office becomes a little unstable.
+ ' Enable the if()-block then, otherwise you might miss some broken
+ ' documents (because the test aborts too early)
+ 'if ( iReset = 10 ) then
+ ' call exitRestartTheOffice()
+ ' iReset = 0
+ 'endif
printlog( "Select the item we want to load" )
FileNewFromTemplate
@@ -138,17 +141,19 @@ testcase tModifyObjects( iMode as integer, cCategory as string, sVer as string )
if ( hFileWait( false ) = -6 ) then
warnlog( "Load failure: ASCII filter dialog displayed, recovering" )
kontext "FilterAuswahl"
- FilterAuswahl.cancel()
+ hCloseDialog( FilterAuswahl, "cancel" )
hDestroyDocument()
else
printlog( "Build filename; save, reload and delete" )
sFile = sPath & cCategory & iObjectFolder & "_" & iObject
- hCloseNavigator()
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close,optional" )
hFileSaveAsKill( sFile )
hDestroyDocument()
hFileOpen( sFile )
hHandleActivesOnLoad( 1 , 2 )
- hCloseNavigator()
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close,optional" )
hDestroyDocument()
hDeleteFile( sFile )
printlog( "Test cycle done, going for next object." )
diff --git a/testautomation/framework/optional/includes/extras_table_autoformat.inc b/testautomation/framework/optional/includes/extras_table_autoformat.inc
index 2de2c491c528..892b33ca27fb 100644..100755
--- a/testautomation/framework/optional/includes/extras_table_autoformat.inc
+++ b/testautomation/framework/optional/includes/extras_table_autoformat.inc
@@ -39,8 +39,7 @@ testcase tAutoformatTable( iApp as integer )
endif
- dim al_UI_formats( 1000 ) as string
- al_UI_formats( 0 ) = "0"
+ dim al_UI_formats( 1000 ) as string : al_UI_formats( 0 ) = "0"
dim iFormatCount as integer
dim iCurrentFormat as integer
@@ -113,11 +112,7 @@ testcase tAutoformatTable( iApp as integer )
hDestroyDocument()
irc = hManageComparisionList( sFileIn, sFileOut, al_UI_formats() )
- if ( irc <> 0 ) then
- warnlog( "The list of table autoformats has changed, please review." )
- else
- printlog( "The list of table autoformats is unchanged. Good." )
- endif
+ hListResultEvaluation( irc , 0 )
endcase
diff --git a/testautomation/framework/optional/includes/filedlg_cjk_files.inc b/testautomation/framework/optional/includes/filedlg_cjk_files.inc
index 19f508193a8d..a2bcc2230ec0 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_cjk_files.inc
+++ b/testautomation/framework/optional/includes/filedlg_cjk_files.inc
@@ -71,7 +71,8 @@ testcase tSaveLoadDelFilesCJK()
hDeleteFile( hGetWorkPath() & cStrangeName )
printlog( "Close navigator, if it exists" )
- hCloseNavigator()
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close,optional" )
next iCounter
diff --git a/testautomation/framework/optional/includes/filedlg_document_properties.inc b/testautomation/framework/optional/includes/filedlg_document_properties.inc
index 089a1d131338..0fd8a0a79f55 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_document_properties.inc
+++ b/testautomation/framework/optional/includes/filedlg_document_properties.inc
@@ -104,3 +104,69 @@ testcase tFiledlgDocumentProperties()
endcase
+'*******************************************************************************
+
+function hDocumentInfoSelectTab( cTabPage as string ) as boolean
+
+
+ '///<h3>Switch between the tabpages in the document info dialog</h3>
+ '///<i>The declaration of the document info dialog is not complete which
+ '///+ enforces special treatment</i><br><br>
+
+ '///<u>Parameter(s):</u><br>
+ '///<ol>
+
+ '///+<li>The name of the tabpage to be activated (String)</li>
+ '///<ul>
+ '///+<li>&quot;General&quot;</li>
+ '///+<li>&quot;Description&quot;</li>
+ '///+<li>&quot;User&quot;</li>
+ '///+<li>&quot;Internet&quot;</li>
+ '///+<li>&quot;Statistics&quot;</li>
+ '///+<li>The string is case insensitive</li>
+
+ '///</ul>
+
+ '///</ol>
+
+
+ '///<u>Returns:</u><br>
+ '///<ol>
+ '///+<li>Errorcondition (Boolean)</li>
+ '///<ul>
+ '///+<li>TRUE if tabpage is known and switching worked</li>
+ '///+<li>FALSE on icorrect input parameter</li>
+ '///+<li>FALSE on any other error</li>
+ '///</ul>
+ '///</ol>
+
+ const CFN = "hDocumentInfoSelectTab::"
+ printlog( CFN & "Enter with option (tabpage): " & cTabPage )
+ dim brc as boolean 'a multi purpose boolean returnvalue
+ brc = true
+
+ '///<u>Description:</u>
+ '///<ul>
+ '///+<li>Kontext to the dialog</li>
+ Kontext
+
+ '///+<li>Select the page to switch to, context to the new page</li>
+ select case ( ucase( cTabPage ) )
+ case "GENERAL" : active.setPage TabDokument : kontext "TabDokument"
+ case "DESCRIPTION" : active.setPage TabBeschreibung : kontext "TabBeschreibung"
+ case "USER" : warnlog( "#i95523# - Cannot access controls on Custom page" )
+ brc = false
+ 'active.setPage TabBenutzer : kontext "TabBenutzer"
+ case "INTERNET" : active.setPage TabInternet : kontext "TabInternet"
+ case "STATISTICS" : active.setPage TabStatistik : kontext "TabStatistik"
+ case default : brc = false
+ end select
+
+ '///</ul>
+
+ printlog( CFN & "Exit with result: " & brc )
+ hDocumentInfoSelectTab() = brc
+
+end function
+
+
diff --git a/testautomation/framework/optional/includes/filedlg_filternames.inc b/testautomation/framework/optional/includes/filedlg_filternames.inc
index 6c41ef444b61..083fdac2793e 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_filternames.inc
+++ b/testautomation/framework/optional/includes/filedlg_filternames.inc
@@ -46,12 +46,14 @@ testcase tVerifyFilterNames
dim iCurrentItem as integer
dim cFile as string
- dim iErr as integer
+ dim irc as integer
' For Windows and Solaris Sparc there exists additional commercial filters
' that are available for StarOffice only.
cFile = gProductName & "_Filternames_"
+ cFile = hStringReplaceChar( cFile, " ", "_" )
+
if ( not gOOo ) then
select case gtSysName
case "Windows" : cFile = cFile & "add_" & gIsoLang & ".txt"
@@ -71,7 +73,7 @@ testcase tVerifyFilterNames
dim cFileOut as string
cFileOut = hGetWorkPath() & cFile
-
+
printlog( "Create a new document" )
hCreateDocument()
@@ -105,7 +107,8 @@ testcase tVerifyFilterNames
OeffnenDlg.cancel()
- iErr = hManageComparisionList( cFileIn, cFileOut, asFilterNames() )
+ irc = hManageComparisionList( cFileIn, cFileOut, asFilterNames() )
+ hListResultEvaluation( irc , 0 )
else
warnlog( "File Open dialog not present." )
@@ -113,11 +116,6 @@ testcase tVerifyFilterNames
printlog( "Close the document" )
hDestroyDocument()
-
- if ( iErr <> 0 ) then
- warnlog( "Filterlist differs from reference, please review" )
- endif
-
-
+
endcase
diff --git a/testautomation/framework/optional/includes/filedlg_passwords.inc b/testautomation/framework/optional/includes/filedlg_passwords.inc
index c8dd68effe83..b921b1a831e0 100644..100755
--- a/testautomation/framework/optional/includes/filedlg_passwords.inc
+++ b/testautomation/framework/optional/includes/filedlg_passwords.inc
@@ -58,7 +58,8 @@ testcase tFiledlgPasswords()
hCreateDocument()
- hCloseNavigator()
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close,optional" )
call hChangeDoc()
@@ -164,13 +165,15 @@ testcase tFiledlgPasswords()
warnlog( "File Open dislog did not come up" )
endif
- hCloseNavigator()
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close,optional" )
hDestroyDocument()
hDeleteFile( workpath & workfile )
- hCloseNavigator()
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close,optional" )
next iCurrentFileFormat
diff --git a/testautomation/framework/optional/includes/help_compare_applications.inc b/testautomation/framework/optional/includes/help_compare_applications.inc
index 240535bed85b..b7edb50dbc8b 100644..100755
--- a/testautomation/framework/optional/includes/help_compare_applications.inc
+++ b/testautomation/framework/optional/includes/help_compare_applications.inc
@@ -43,6 +43,7 @@ testcase tCompareHelpApps()
dim sFileOut as string
dim sFilein as string
dim sFileName as string
+ dim sProductName as string : sProductName = hStringReplaceChar( gProductName, " ", "_" )
' the array that holds the names of the applications
dim aTopicsFromUI( 10 ) as string ' max index = 7 expected
@@ -55,7 +56,8 @@ testcase tCompareHelpApps()
dim brc as boolean
' define input and output paths, presetting variables
- sFileName = gProductName & "_help_applications_" & gIsoLang & ".txt"
+
+ sFileName = sProductName & "_help_applications_" & gIsoLang & ".txt"
sFileOut = hGetWorkFile( sFilename )
sFileIn = gTesttoolPath & "framework\optional\input\help_browser\"
sFileIn = sFileIn & sFileName
@@ -90,9 +92,7 @@ testcase tCompareHelpApps()
printlog( "Beginning comparision" )
irc = hManageComparisionList( sFileIn, sFileOut, aTopicsFromUI() )
- if ( irc <> 0 ) then
- warnlog( "Something went wrong, please review the log" )
- endif
+ hListResultEvaluation( irc , 0 )
endcase
diff --git a/testautomation/framework/optional/includes/help_compare_content.inc b/testautomation/framework/optional/includes/help_compare_content.inc
index 15874b0bd758..fc9f9a7de4d9 100644..100755
--- a/testautomation/framework/optional/includes/help_compare_content.inc
+++ b/testautomation/framework/optional/includes/help_compare_content.inc
@@ -43,6 +43,7 @@ testcase tCompareHelpContent()
dim sFileOut as string
dim sFilein as string
dim sFileName as string
+ dim sProductName as string : sProductName = hStringReplaceChar( gProductName, " ", "_" )
' the array that holds the names of the applications
dim aTopicsFromUI( 1200 ) as string
@@ -55,7 +56,8 @@ testcase tCompareHelpContent()
dim brc as boolean
' define input and output paths, presetting variables
- sFileName = gProductName & "_help_content_" & gIsoLang & ".txt"
+
+ sFileName = sProductName & "_help_content_" & gIsoLang & ".txt"
sFileOut = hGetWorkFile( sFilename )
sFileIn = gTesttoolPath & "framework\optional\input\help_browser\"
sFileIn = convertpath( sFileIn & sFileName )
@@ -85,9 +87,7 @@ testcase tCompareHelpContent()
printlog( "" )
printlog( "Beginning comparision" )
irc = hManageComparisionList( sFileIn, sFileOut, aTopicsFromUI() )
- if ( irc <> 0 ) then
- warnlog( "Something went wrong, please review the log." )
- endif
+ hListResultEvaluation( irc , 0 )
endcase
diff --git a/testautomation/framework/optional/includes/help_compare_topics.inc b/testautomation/framework/optional/includes/help_compare_topics.inc
index 75dd76625b88..feef650c64e9 100644..100755
--- a/testautomation/framework/optional/includes/help_compare_topics.inc
+++ b/testautomation/framework/optional/includes/help_compare_topics.inc
@@ -46,7 +46,7 @@ testcase tCompareHelpTopics()
' handle this. If problems occur, this shuld be the first place to
' look.
- const MAX_ENTRIES = 30000
+ const MAX_ENTRIES = 25000
' variables related to filenames
dim sFileOut as string
@@ -59,23 +59,23 @@ testcase tCompareHelpTopics()
' some increment operators and temporary variables
dim iCurrentItem as integer
dim sCurrentItem as string
+ dim sProductName as string
dim iCurrentApp as integer
dim iAboutItems as integer
dim cAboutItem as string
dim irc as integer
- dim brc as boolean
dim bNextItem as boolean
' define input and output paths, presetting variables
- sFileName = gProductName & "_help_topics_" & gIsoLang & ".txt"
+ sProductName = hStringReplaceChar( gProductName, " ", "_" )
+ sFileName = sProductName & "_help_topics_" & gIsoLang & ".txt"
sFileOut = hGetWorkFile( sFilename )
sFileIn = gTesttoolPath & "framework\optional\input\help_browser\"
sFileIn = convertpath( sFileIn & sFileName )
aTopicsFromUI( 0 ) = "0"
- brc = hOpenHelp()
- if ( not brc ) then
+ if ( not hOpenHelp() ) then
warnlog( "Help not open, aborting test" )
goto endsub
endif
@@ -120,9 +120,7 @@ testcase tCompareHelpTopics()
printlog( "Beginning comparision. This will take a while ..." )
irc = hManageComparisionList( sFileIn, sFileOut, aTopicsFromUI() )
- if ( irc <> 0 ) then
- warnlog( "The list has changed, please review" )
- endif
+ hListResultEvaluation( irc , 0 )
endcase
diff --git a/testautomation/framework/optional/includes/help_search.inc b/testautomation/framework/optional/includes/help_search.inc
index 2e37fe58562e..dddf9cbda60d 100644..100755
--- a/testautomation/framework/optional/includes/help_search.inc
+++ b/testautomation/framework/optional/includes/help_search.inc
@@ -38,6 +38,8 @@ testcase tHelpSearch
goto endsub
endif
+ const RC_LISTS_IDENTICAL = 0
+
dim brc as boolean
dim irc as integer
@@ -48,16 +50,16 @@ testcase tHelpSearch
dim cBasePath as string
cBasePath = gTesttoolPath & "framework\optional\input\help_browser\"
dim cDataFile as string
-
- brc = hOpenHelp()
- if ( not brc ) then
+ dim sProductName as string : sProductName = hStringReplaceChar( gProductName, " ", "_" )
+
+ printlog( "Open Help Browser" )
+ if ( not hOpenHelp() ) then
warnlog( "Help not open, aborting test" )
goto endsub
endif
-
- brc = hSelectHelpTab( "find" )
- if ( not brc ) then
+ printlog( "Go to the Find-Tabpage" )
+ if ( not hSelectHelpTab( "find" ) ) then
warnlog( "Could not access requested TabPage, aborting test" )
call hClosehelp()
goto endsub
@@ -75,15 +77,14 @@ testcase tHelpSearch
ListAllDelete( aUIList() )
hGetListItems( Result, aUIList() )
-
- cDataFile = gProductName & "_search_without_filter_" & gIsoLang & ".txt"
+
+
+ cDataFile = sProductName & "_search_without_filter_" & gIsoLang & ".txt"
sFileOut = hGetWorkFile( cDataFile )
sFileIn = convertpath( cBasePath & cDataFile )
- irc = hManageComparisionList( sFileIn, sFileOut, aUIList() )
- if ( irc <> 0 ) then
- warnlog( "Lists are not identical, please review the log" )
- endif
+ irc = hManageComparisionList( sFileIn, sFileOut, aUIList() )
+ hListResultEvaluation( irc , RC_LISTS_IDENTICAL )
' ------------ Search whole words only -------------------------------------
printlog( "" )
@@ -98,14 +99,12 @@ testcase tHelpSearch
ListAllDelete( aUIList() )
hGetListItems( Result, aUIList() )
- cDataFile = gProductName & "_search_whole_words_only_" & gIsoLang & ".txt"
+ cDataFile = sProductName & "_search_whole_words_only_" & gIsoLang & ".txt"
sFileOut = hGetWorkFile( cDataFile )
sFileIn = convertpath( cBasePath & cDataFile )
- irc = hManageComparisionList( sFileIn, sFileOut, aUIList() )
- if ( irc <> 0 ) then
- warnlog( "Lists are not identical, please review the log" )
- endif
+ irc = hManageComparisionList( sFileIn, sFileOut, aUIList() )
+ hListResultEvaluation( irc , RC_LISTS_IDENTICAL )
' ------------ Search headings only ----------------------------------------
printlog( "" )
@@ -120,14 +119,12 @@ testcase tHelpSearch
ListAllDelete( aUIList() )
hGetListItems( Result, aUIList() )
- cDataFile = gProductName & "_search_headings_only_" & gIsoLang & ".txt"
+ cDataFile = sProductName & "_search_headings_only_" & gIsoLang & ".txt"
sFileOut = hGetWorkFile( cDataFile )
sFileIn = convertpath( cBasePath & cDataFile )
- irc = hManageComparisionList( sFileIn, sFileOut, aUIList() )
- if ( irc <> 0 ) then
- warnlog( "Lists are not identical, please review the log" )
- endif
+ irc = hManageComparisionList( sFileIn, sFileOut, aUIList() )
+ hListResultEvaluation( irc , RC_LISTS_IDENTICAL )
' ------------ Search headings and whole words -----------------------------
printlog( "" )
@@ -142,15 +139,12 @@ testcase tHelpSearch
ListAllDelete( aUIList() )
hGetListItems( Result, aUIList() )
- cDataFile = gProductName & "_search_headings_and_whole_words_" & gIsoLang & ".txt"
+ cDataFile = sProductName & "_search_headings_and_whole_words_" & gIsoLang & ".txt"
sFileOut = hGetWorkFile( cDataFile )
sFileIn = convertpath( cBasePath & cDataFile )
- irc = hManageComparisionList( sFileIn, sFileOut, aUIList() )
- if ( irc <> 0 ) then
- warnlog( "Lists are not identical, please review the log" )
- endif
-
+ irc = hManageComparisionList( sFileIn, sFileOut, aUIList() )
+ hListResultEvaluation( irc , RC_LISTS_IDENTICAL )
hCloseHelp()
diff --git a/testautomation/framework/optional/includes/ole_3.inc b/testautomation/framework/optional/includes/ole_3.inc
index 22cab57056f6..9f1d0ac28d6b 100644..100755
--- a/testautomation/framework/optional/includes/ole_3.inc
+++ b/testautomation/framework/optional/includes/ole_3.inc
@@ -81,15 +81,11 @@ endcase
'*******************************************************************************
-sub hInsertOLEObject( bRemoveFocus as boolean, cOLEObject as string, cOleType as string )
+function hInsertOLEObject( bRemoveFocus as boolean, cOLEObject as string, cOleType as string ) as beoolean
dim sFile as String
dim bOleAvailable as boolean
-
-
-
-
printlog( "" )
printlog( "Beginning testcase with options: " )
printlog( "* Remove focus...: " & bRemoveFocus )
@@ -102,12 +98,14 @@ sub hInsertOLEObject( bRemoveFocus as boolean, cOLEObject as string, cOleType as
' So writer/writer, calc/calc, masterdoc/writer is skipped ...
if ( gApplication = cOleType ) then
printlog( "Skipping " & cOleType & " as OLE object" )
- goto testend
+ hInsertOLEObject() = false
+ exit function
endif
if ( gApplication = "MASTERDOCUMENT" and cOleType = "WRITER" ) then
printlog( "Skipping " & cOleType & " as OLE object" )
- goto testend
+ hInsertOLEObject() = false
+ exit function
endif
hCreateDocument()
@@ -125,12 +123,12 @@ sub hInsertOLEObject( bRemoveFocus as boolean, cOLEObject as string, cOleType as
ObjektTyp.Select( cOLEObject )
printlog( "Click OK" )
- OLEObjektEinfuegen.OK()
- WaitSlot( 3000 )
+ hCloseDialog( OLEObjektEinfuegen, "ok" )
else
warnlog( "Insert OLE object dialog is missing, test ends" )
hDestroyDocument()
- goto testend
+ hInsertOLEObject() = false
+ exit function
endif
if ( bRemoveFocus ) then
@@ -149,14 +147,8 @@ sub hInsertOLEObject( bRemoveFocus as boolean, cOLEObject as string, cOleType as
sFile = ConvertPath ( gOfficePath + "user\work\ole_" & cOleType )
printlog( "Save the file; File to be written (w/o extension): " & sFile )
- if fileexists(sFile) then
- kill(sFile)
- qaerrorlog("killed file from former test run")
- endif
-
- hFileSaveAsKill( sFile )
-
- printlog( "Close the document" )
+ hDeleteFile( sFile )
+ hFileSaveAs( sFile )
hDestroyDocument()
printlog( "Reopen the file: " & sFile )
@@ -165,7 +157,8 @@ sub hInsertOLEObject( bRemoveFocus as boolean, cOLEObject as string, cOleType as
bOleAvailable = isOleAvailable()
if ( bOleAvailable ) then
- call DisableNavigator()
+ kontext "Navigator"
+ if ( Navigator.exists() ) then hCloseDialog( Navigator, "close,optional" )
call OLESetFocus()
@@ -174,14 +167,10 @@ sub hInsertOLEObject( bRemoveFocus as boolean, cOLEObject as string, cOleType as
qaErrorLog( "#i44725# OLE Object not saved in Master Document" )
endif
- printlog( "Cleanup: Close the document" )
+ printlog( "Cleanup: Close the document, delete workfile" )
hDestroyDocument()
-
- printlog( "Cleanup: Delete the workfile" )
hDeleteFile( sFile )
-
- ' We end up here when the test has been skipped or aborted
- testend:
+ hInsertOLEObject() = true
end sub
diff --git a/testautomation/framework/optional/includes/ole_tools.inc b/testautomation/framework/optional/includes/ole_tools.inc
index 0428f758cb3d..03b921fc95d3 100644..100755
--- a/testautomation/framework/optional/includes/ole_tools.inc
+++ b/testautomation/framework/optional/includes/ole_tools.inc
@@ -74,22 +74,38 @@ end sub
'*******************************************************************************
-sub hSetToStandardView ( DieApp$ )
- select case DieApp$
+function hSetToStandardView ( cApplication as string ) as boolean
+
+ const MAX_WAIT_FOR_DIALOG = 2
+
+ select case ( cApplication )
case "WRITER"
- gApplication = "WRITER"
+ gApplication = cApplication
Call hNewDocument
Kontext "DocumentWriter"
case "MASTERDOCUMENT"
- gApplication = "MASTERDOCUMENT"
+ gApplication = cApplication
Call hNewDocument
Kontext "DocumentMasterDoc"
+ case else
+ printlog( "Application not supported by this function: " & cApplication )
+ hSetToStandardView() = false
+ exit function
end select
- ViewZoom
+
+ hUseAsyncSlot( "ViewZoom" )
+
Kontext "Massstab"
- Optimal.Check
- Massstab.ok()
+ if ( Massstab.exists( MAX_WAIT_FOR_DIALOG ) ) then
+ Optimal.Check()
+ hCloseDialog( Massstab, "ok" )
+ else
+ warnlog( "Zoom-Dialog did not open" )
+ endif
+
Call hCloseDocument
+ hSetToStandardView() = true
+
end sub
'*******************************************************************************
@@ -140,23 +156,6 @@ end sub
'*******************************************************************************
-sub DisableNavigator()
- printlog( " - disable the navigator in globaldoc/writer" )
- select case gApplication
- case "MASTERDOCUMENT" : Kontext "NavigatorGlobalDoc"
- if NavigatorGlobalDoc.Exists() then
- ViewNavigator
- endif
- case "WRITER" : Kontext "NavigatorWriter"
- if NavigatorWriter.Exists() then
- ViewNavigator
- endif
- end select
- sleep( 1)
-end sub
-
-'*******************************************************************************
-
sub UncheckAutoFileExtension()
Kontext "SpeichernDlg"
if SpeichernDlg.exists(5) then
diff --git a/testautomation/framework/optional/includes/options_ls_2.inc b/testautomation/framework/optional/includes/options_ls_2.inc
deleted file mode 100644
index f3e9cee13250..000000000000
--- a/testautomation/framework/optional/includes/options_ls_2.inc
+++ /dev/null
@@ -1,307 +0,0 @@
-'encoding UTF-8 Do not remove or change this line!
-'**************************************************************************
-' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-'
-' Copyright 2000, 2010 Oracle and/or its affiliates.
-'
-' OpenOffice.org - a multi-platform office productivity suite
-'
-' This file is part of OpenOffice.org.
-'
-' OpenOffice.org is free software: you can redistribute it and/or modify
-' it under the terms of the GNU Lesser General Public License version 3
-' only, as published by the Free Software Foundation.
-'
-' OpenOffice.org is distributed in the hope that it will be useful,
-' but WITHOUT ANY WARRANTY; without even the implied warranty of
-' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-' GNU Lesser General Public License version 3 for more details
-' (a copy is included in the LICENSE file that accompanied this code).
-'
-' You should have received a copy of the GNU Lesser General Public License
-' version 3 along with OpenOffice.org. If not, see
-' <http://www.openoffice.org/license.html>
-' for a copy of the LGPLv3 License.
-'
-'/************************************************************************
-'*
-'* owner : thorsten.bosbach@sun.com
-'*
-'* short description : (functionality test for load/save group)
-'*
-'\******************************************************************************
-
-testcase func_LoadSaveGeneral_1
-
- warnlog( "#i95523# - cannot access custom tabpage on document info dialog" )
- goto endsub
-
- Dim bSave as boolean, bPromptSave as boolean
- Dim sSaveTime as String
- Dim sFilename, sFilebak as String
- Dim i as Integer
-
- gApplication = "WRITER"
-
-
- sFilename = ConvertPath ( gOfficePath + "user\work\o_save.sxw" )
- sFilebak = ConvertPath ( gOfficePath + "user\backup\o_save.bak" )
-
- if app.Dir ( sFilename ) <> "" then app.kill ( sFilename )
- if app.Dir ( sFilebak ) <> "" then app.kill ( sFilebak )
-
- printlog " - save"
- printlog " - document properties before saving"
- printlog " open a new document"
- hNewDocument
-
- Kontext "DocumentWriter"
- DocumentWriter.TypeKeys "tools/options/load-save/general: save-> edit document properties before saving<Return>"
- printlog " open tools / options / load & save / general"
- ToolsOptions
- hToolsOptions ( "LoadSave", "General" )
-
- printlog " check 'document properties before saving'"
- bSave = DokumenteigenschaftenBearbeiten.IsChecked
- DokumenteigenschaftenBearbeiten.Check
-
- Kontext "ExtrasOptionenDlg"
- ExtrasOptionenDlg.OK
- Sleep (2)
- printlog " save the document"
-
- FileSaveAs
- Kontext "SpeichernDlg"
- Dateiname.SetText sFilename
- Sleep (1)
- Speichern.Click
- Sleep (1)
- kontext
- 'overwrite warning on rerun
- if active.exists(3) then
- active.yes
- endif
-
- printlog " activate all tabpages on properties dialog and cancel it"
- try
- Kontext
- active.SetPage( TabDokument)
- active.SetPage TabDokumentinfo
- active.SetPage TabBenutzer
- active.SetPage TabInternet
- active.SetPage TabStatistik
- Kontext "TabStatistik"
- TabStatistik.Cancel
- catch
- Warnlog "Perhaps the document properties aren't active after saving => the dialog come not up after file save!"
- endcatch
-
- printlog " - always create backup copy"
- Kontext "DocumentWriter"
- DocumentWriter.TypeKeys "tools/options/load-save/general: save-> always create backup copy<Return>"
- printlog " open tools / options / load & save / general"
- ToolsOptions
- hToolsOptions ( "LoadSave", "General" )
-
- if bSave = TRUE then DokumenteigenschaftenBearbeiten.Check else DokumenteigenschaftenBearbeiten.UnCheck
- bSave = Sicherungskopie.IsChecked
- Sicherungskopie.Check
- Kontext "ExtrasOptionenDlg"
- ExtrasOptionenDlg.OK
- Sleep (3)
-
- if app.Dir ( sFilebak ) <> "" then Warnlog "Before saving the document the backup-file exists!"
- hFileSave
- if app.Dir ( sFilebak ) = "" then Warnlog "After saving the document the backup-file doesn't exists => BUG!"
-
- printlog " - autosave : after 1 min, with prompt"
- Kontext "DocumentWriter"
- DocumentWriter.TypeKeys "tools/options/load-save/general: save-> autosave after 1 min with prompt<Return>"
- ToolsOptions
- hToolsOptions ( "LoadSave", "General" )
-
- if bSave = TRUE then Sicherungskopie.Check else Sicherungskopie.UnCheck
- bSave = AutomatischSpeichern.IsChecked
- AutomatischSpeichern.Check
- sSaveTime = 15 'debug
-
- Minuten.SetText "2"
-
- Kontext "ExtrasOptionenDlg"
- ExtrasOptionenDlg.OK
- Sleep (130)
-
- for i=1 to 2
- Kontext "Active"
- if Active.Exists (3) then
- Active.Yes
- Kontext "SpeichernDlg"
- if SpeichernDlg.Exists then SpeichernDlg.Cancel
- Sleep (2)
- printlog "Active came up :-) " + i
- else
- printlog "Active didn't come up :-( " + i
- end if
- next i
-
- printlog " - close the document and check the saved data"
- hCloseDocument ' closes the document with 'discard'
- hFileOpen ( sFilename )
-kontext
-if active.exists(5) then
-warnlog active.gettext
-goto endsub
-endif
- ' This part compares the content of the file after reload with text entered
- ' during the entire test. It should contain three lines of text.
- printlog( " - Compare the content of the file with the text entered during the test." )
- printlog( " First line..." )
- Kontext "DocumentWriter"
- DocumentWriter.TypeKeys "<Up>", 5
- DocumentWriter.TypeKeys "<Home>"
- DocumentWriter.TypeKeys "<Shift End>"
- EditCopy
- WaitSlot()
- if lcase ( GetClipboardText ) <> "tools/options/load-save/general: save-> edit document properties before saving" then Warnlog "The first sentence is wrong!"
-
- printlog( " Second line..." )
- DocumentWriter.TypeKeys "<Down>"
- DocumentWriter.TypeKeys "<Home>"
- DocumentWriter.TypeKeys "<Shift End>"
- EditCopy
- WaitSlot()
- if lcase ( GetClipboardText ) <> "tools/options/load-save/general: save-> always create backup copy" then Warnlog "The second sentence is wrong!"
-
- printlog( " Third line..." )
- DocumentWriter.TypeKeys "<Down>"
- DocumentWriter.TypeKeys "<Home>"
- DocumentWriter.TypeKeys "<Shift End>"
- EditCopy
- WaitSlot()
- if lcase ( GetClipboardText ) <> "tools/options/load-save/general: save-> autosave after 1 min with prompt" then Warnlog "The third sentence is wrong!"
-
- hCloseDocument
-
- printlog " - load the backup-file"
- hOpenFile ( sFilebak )
-
- Kontext "Filterauswahl"
- if Filterauswahl.Exists(2) then
- warnlog "Is bugId 107399 present? => Detection of our own fileformar fails when the extension is not the standard extension!"
- Filterauswahl.Close
- else
- Kontext "DocumentWriter"
- DocumentWriter.TypeKeys "<Up>", 5
- DocumentWriter.TypeKeys "<Home>"
- DocumentWriter.TypeKeys "<Shift End>"
- EditCopy
-
- WaitSlot()
-
- if GetClipboardText <> "" then
- call hCloseDocument
- else
- warnlog "Perhaps the bak-file was not loaded. => Verify BugID 86607!"
- end if
- end if
-
- printlog " - reset options"
- ToolsOptions
- hToolsOptions ( "LoadSave", "General" )
- AutomatischSpeichern.Check
- Minuten.SetText sSaveTime
- if bSave = TRUE then AutomatischSpeichern.Check else AutomatischSpeichern.UnCheck
- Kontext "ExtrasOptionenDlg"
- ExtrasOptionenDlg.OK
-
-endcase
-
-' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
-' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
-testcase func_LoadSaveGeneral_2
- Dim bSave as Boolean
- Dim sFilename, sFilename2, sCharSet as String
-
- const ICWAIT as integer = 1
-
-
- sFilename = ConvertPath ( gOfficePath + "user\work\o_save_1.html" )
- sFilename2 = ConvertPath ( gOfficePath + "user\work\o_save_2.html" )
-
- if app.dir ( sFilename ) <> "" then app.kill ( sFilename )
- if app.dir ( sFilename2 ) <> "" then app.kill ( sFilename2 )
-
- printlog " - save"
- printlog " - save URL relative to"
-
- if bAsianLan = TRUE then
- sCharSet = GetHTMLCharSet
- if SetHTMLCharSetToUTF8 = FALSE then
- Warnlog "The test cannot find the UTF8 Character Set for HTML-Export. The test can have many errors at saving HTML-Files!"
- else
- printlog "The Character Set for HTML-Export is now Unicode UTF8!"
- end if
- end if
-
- gApplication = "HTML"
- hNewDocument
-
- if gNetzInst = TRUE then
- hGrafikEinfuegen ( ConvertPath ( gNetzOfficePath + "share\gallery\photos\desert1.jpg" ) )
- else
- hGrafikEinfuegen ( ConvertPath ( gOfficePath + "share\gallery\photos\desert1.jpg" ) )
- end if
-
- printlog " - relative to filesystem"
- ToolsOptions
- hToolsOptions ( "LoadSave", "General" )
-
- bSave = URLimDateisystem.IsChecked
- URLimDateisystem.Check
- Kontext "ExtrasOptionenDlg"
- ExtrasOptionenDlg.OK
- Sleep (2)
-
- printlog " save the HTML file"
- hFileSaveAs ( sFilename )
-
- printlog " check the relativ path in source code of HTML file"
- Call URLGraphicCheck ( TRUE, sFilename )
-
- printlog " - relative to filesystem ( unchecked )"
- ToolsOptions
- hToolsOptions ( "LoadSave", "General" )
-
- URLimDateisystem.UnCheck
- Kontext "ExtrasOptionenDlg"
- ExtrasOptionenDlg.OK
- Sleep (2)
-
- printlog " save the HTML file"
- hFileSaveAs ( sFilename2 )
-
- printlog " check the hard coded path in source code of HTML file"
- Call URLGraphicCheck ( FALSE, sFilename2 )
-
- hCloseDocument
-
- printlog " - reset the options"
- ToolsOptions
- hToolsOptions ( "LoadSave", "General" )
-
- if bSave = TRUE then URLimDateisystem.Check else URLimDateisystem.UnCheck
- Kontext "ExtrasOptionenDlg"
- ExtrasOptionenDlg.OK
- Sleep (2)
-
- printlog "No test for 'relative to internet'"
-
- if bAsianLan = TRUE then
- printlog Chr(13 ) + "Reset the Character Set back to default : " + sCharSet
- SetHTMLCharSet ( sCharSet )
- end if
-
- gApplication = "WRITER"
-endcase
-
-
diff --git a/testautomation/framework/optional/includes/options_ooo_general.inc b/testautomation/framework/optional/includes/options_ooo_general.inc
index 8197a4fe54d9..0b218bff8493 100644..100755
--- a/testautomation/framework/optional/includes/options_ooo_general.inc
+++ b/testautomation/framework/optional/includes/options_ooo_general.inc
@@ -1,5 +1,5 @@
'encoding UTF-8 Do not remove or change this line!
-'**************************************************************************
+'*******************************************************************************
' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
'
' Copyright 2000, 2010 Oracle and/or its affiliates.
@@ -23,41 +23,21 @@
' <http://www.openoffice.org/license.html>
' for a copy of the LGPLv3 License.
'
-'/************************************************************************
+'/******************************************************************************
'*
-'* owner : thorsten.bosbach@sun.com
+'* owner : joerg.skottke@sun.com
'*
-'* short description : Grid Layout for CJK test in Writer
+'* short description : 1. test for general group userdata
'*
-'\***********************************************************************
+'\******************************************************************************
-private const SOURCE_PATH = "framework\optional\input\CJK\"
+testcase tOOoGeneral
-testcase tTextGridDialog_1
+ dim lsSave (4) as String
+ dim lbSave (3) as Boolean
- '/// Check if tabpage 'Text Grid' disappears when "Asian Language support" is NOT checked
- if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
- Call CheckAsianLanguageSupport("Off")
- hNewDocument()
- FormatPageWriter
- try
- Kontext
- Active.SetPage TabGrid
- Kontext "TabGrid"
- TabGrid.Cancel
- warnlog "Shouldn't get Tabpage: Grid Text"
- catch
- Kontext
- Active.SetPage TabSeite
- Kontext "TabSeite"
- TabSeite.Cancel
- endcatch
- endif
+ hNewDocument
- '/// Check if tabpage 'Text Grid' appears when "Asian Language support" is checked
- Call CheckAsianLanguageSupport("On")
-
- hNewDocument
ToolsOptions
hToolsOptions ( "StarOffice", "General" )
@@ -81,503 +61,71 @@ testcase tTextGridDialog_1
StyleSheet.Select 3
Kontext "ExtrasOptionenDlg"
- ExtrasOptionenDlg.OK
- if ( ExtrasOptionenDlg.notExists( 3 ) ) then
- printlog( "Options closed" )
- endif
- hCloseDocument()
-endcase
-
-'-------------------------------------------------------------------------
-
-testcase tTextGridDialog_2
- '/// No grid is active, no changes to existing version
- Dim testFile , sCorrectResult as String
-
- testFile = "gridtest.sxw"
- sCorrectResult = "1"
-
- Call hNewDocument
-
- '/// open a test file , and check No Grid checkbox
- Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
- sMakeReadOnlyDocumentEditable
-
- FormatPageWriter
- Kontext
- if active.exists(5) then
- Active.SetPage TabGrid
- endif
- Kontext "TabGrid"
- NoGrid.Check
- Sleep 1
- TabGrid.OK
- Sleep 1
-
- '/// Active navigator dialogue , set page to '2' and wait for a while
- Kontext
- ViewNavigator
- Kontext "NavigatorWriter"
-
- Seitennummer.SetText "2"
- Sleep 5
- hCloseNavigator
-
- '/// In No Grid mode, there should be only 1 page, the focus is before the first line
- Kontext "DocumentWriter"
- Call DocumentWriter.TypeKeys "<End>"
- Sleep 1
- Call DocumentWriter.TypeKeys "<Shift Left>"
- hUseAsyncSlot( "EditCopy" )
-
- if GetClipboardText <> sCorrectResult then Warnlog "Something wrong when choosing NoGrid option!"
-
- Call hCloseDocument
-endcase
-
-'-------------------------------------------------------------------------
-
-testcase tTextGridDialog_3
- '/// Grid (lines only): The page is set up with a defined number of lines
- Dim testFile , sCorrectResult , sLinesPerPage as String
-
- testFile = "gridtest.sxw"
- sCorrectResult = "G"
- sLinesPerPage = "10"
-
- Call hNewDocument
-
- '/// open a test file and check Grid(lines onle) checkbox ,
- '/// + set 10 line/page
- Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
- sMakeReadOnlyDocumentEditable
- FormatPageWriter
- Kontext
- if active.exists(5) then
- Active.SetPage TabGrid
- endif
- Kontext "TabGrid"
- LinesGrid.Check
- LinesPerPage.SetText sLinesPerPage
- Sleep 1
- TabGrid.OK
- Sleep 1
-
- '/// Active navigator dialogue , set page to '2' and wait for a while
- Kontext
- ViewNavigator
- Kontext "NavigatorWriter"
-
- Seitennummer.SetText "2"
- Sleep 5
- hCloseNavigator
-
- Kontext "DocumentWriter"
- Call DocumentWriter.TypeKeys "<End>"
- Sleep 1
- Call DocumentWriter.TypeKeys "<Shift Left>"
- hUseAsyncSlot( "EditCopy" )
-
- if GetClipboardText <> sCorrectResult then Warnlog "Something wrong when choosing Grid(lines only) option!"
-
- Call hCloseDocument
-endcase
-
-'-------------------------------------------------------------------------
-
-testcase tTextGridDialog_4
- '/// Grid (lines and characters): The page is set up with a defined number of lines and a defined number of characters in each line
- Dim testFile , sCorrectResult as String
- Dim sLinesPerPage , sCharsPerLine as String
- testFile = "gridtest.sxw"
- sCorrectResult = "E"
- sLinesPerPage = "10"
- sCharsPerLine = "9"
+ hCloseDialog( ExtrasOptionenDlg, "ok" )
+ hCloseDocument
- Call hNewDocument
-
- '/// open a test file and check Grid(lines and characters) checkbox
- '/// + set 10 line/page and 9 characters/line
- Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
- sMakeReadOnlyDocumentEditable
- FormatPageWriter
- Kontext
- if active.exists(5) then
- Active.SetPage TabGrid
- endif
- Kontext "TabGrid"
- CharsGrid.Check
- LinesPerPage.SetText sLinesPerPage
- CharsPerLine.SetText sCharsPerLine
- Sleep 1
- TabGrid.OK
- Sleep 1
-
- '/// Active navigator dialogue , set page to '2' and wait for a while
- Kontext
- ViewNavigator
- Kontext "NavigatorWriter"
-
- Seitennummer.SetText "2"
- Sleep 5
- hCloseNavigator
-
- Kontext "DocumentWriter"
- Call DocumentWriter.TypeKeys "<End>"
- Sleep 1
- Call DocumentWriter.TypeKeys "<Shift Left>"
- hUseAsyncSlot( "EditCopy" )
-
- if GetClipboardText <> sCorrectResult then Warnlog "Something wrong when choosing Grid(lines and characters) option!"
-
- Call hCloseDocument
-endcase
-
-'-------------------------------------------------------------------------
-
-testcase tGridDisplay_1
- '/// Print grid: The grid lines will be printed. Inactive if "Display grid" is inactive.
- Call hNewDocument
-
- '/// format / page / tabpage Text grid
- '/// + check "display grid" and check "print grid"
- FormatPageWriter
- Kontext
- if active.exists(5) then
- Active.SetPage TabGrid
- endif
- Kontext "TabGrid"
- CharsGrid.Check
- Display.Check
- Sleep 1
- PrintGrid.Check
- Sleep 1
- TabGrid.OK
- Sleep 1
-
- '/// Print to printer
- FilePrint
- Kontext "Active"
- if ( Active.Exists( 5 ) ) then
- if Active.GetRT() = 304 then
- Active.Ok()
- QAErrorLog "No Default-Printer!"
- Kontext "Printing"
- if ( Printing.exists( 1 )) then
- Printing.Cancel
- endif
- endif
- else
- Kontext "Printing"
- if ( Printing.exists( 2 )) then
- Printing.OK()
- Printing.notExists( 5 )
- endif
-
- kontext "Active"
- if active.exists(5) then
- qaErrorLog active.getText()
- active.ok()
- endif
- endif
-
- '/// format / page / tabpage Text grid
- '/// + check "display grid" and uncheck "print grid"
- FormatPageWriter
- Kontext
- if active.exists(5) then
- Active.SetPage TabGrid
- endif
- Kontext "TabGrid"
- CharsGrid.Check
- Display.Check
- Sleep 1
- PrintGrid.UnCheck
- Sleep 1
- TabGrid.OK
- Sleep 1
-
- '/// Print to printer
- FilePrint
- Kontext "Active"
- if ( Active.Exists( 5 ) )then
- if Active.GetRT() = 304 then
- Active.Ok()
- QAErrorLog "No Default-Printer!"
- Kontext "Printing"
- if ( Printing.exists( 1 )) then
- Printing.Cancel()
- endif
- endif
- else
- Kontext "Printing"
- if( Printing.exists( 1 )) then
- Printing.OK
- Printing.notExists( 5 )
- endif
- kontext
- if ( active.exists( 2 ) ) then
- qaErrorLog active.getText
- active.ok
- endif
- endif
-
- Call hCloseDocument
-endcase
-
-'-------------------------------------------------------------------------
-
-testcase tUserDefineLayout_1
- '/// Decrease characters per line will cause lines per page decrease accordingly
- Dim sLinesPerPage , sCharsPerLine as String
- Dim sExpectLinesPerPage , sExpectLinesPerPage1 as String
-
- sLinesPerPage = "20"
- sCharsPerLine = "2"
- sExpectLinesPerPage = "2"
- sExpectLinesPerPage1 = "3"
-
- Call hNewDocument
-
- '/// Format/page , set lines per page to 20, and set charsets per line to 2
- '/// + wait for a moment , then check the the number of lines per page.
- FormatPageWriter
- Kontext
- if active.exists(5) then
- Active.SetPage TabGrid
- endif
- Kontext "TabGrid"
- CharsGrid.Check
-
- LinesPerPage.SetText sLinesPerPage
- Sleep 2
- CharsPerLine.SetText sCharsPerLine
- Sleep 2
-
- 'This step is no use, just let the LinesPerPage change the number
- CharsGrid.Check
-
- if LinesPerPage.GetText <> sExpectLinesPerPage AND LinesPerPage.GetText <> sExpectLinesPerPage1 then
- Warnlog "The lines per page should be" + sExpectLinesPerPage + " OR " + sExpectLinesPerPage1 +" but get " +LinesPerPage.GetText
- endif
-
- TabGrid.Cancel
-
- Call hCloseDocument
-endcase
+ printlog " - exit/restart StarOffice"
+ ExitRestartTheOffice
-'-------------------------------------------------------------------------
-
-testcase tFontSizeChanges_1
- '/// Change the font size to bigger enough will change the layout
- Dim testFile , sCorrectResult as String
- Dim sLinesPerPage , sCharsPerLine as String
- dim sTemp as string
-
- testFile = "FontSizeChanges_1.sxw"
- sCorrectResult = "1"
- sLinesPerPage = "2"
- sCharsPerLine = "9"
-
- Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
- sMakeReadOnlyDocumentEditable
- Kontext "DocumentWriter"
- Call DocumentWriter.TypeKeys "<Shift Right>"
-
- Kontext "FormatObjectbar"
- Schriftgroesse.Select "60"
- Schriftgroesse.TypeKeys "<Return>"
- Sleep 1
-
- Kontext "DocumentWriter"
- FormatPageWriter
- Kontext
- if active.exists(5) then
- Active.SetPage TabGrid
- endif
- Kontext "TabGrid"
- if TabGrid.exists(5) then
- sTemp = LinesPerPage.GetText
- if sTemp <> sLinesPerPage then
- Warnlog "The lines per page should be: '" + sLinesPerPage + "'; but get: '" + sTemp + "'"
- endif
- sTemp = CharsPerLine.GetText
- if sTemp <> sCharsPerLine then
- Warnlog "The chars per line should be: '" + sCharsPerLine + "'; but get: '" +sTemp + "'"
- endif
- TabGrid.Cancel
- else
- warnlog "TabGrid is not available."
- endif
-
- Kontext
- ViewNavigator
- Kontext "NavigatorWriter"
- if NavigatorWriter.exists(5) then
- Seitennummer.SetText "2"
- Sleep 5
- else
- warnlog "Navigator not available"
- endif
- hCloseNavigator
-
- Kontext "DocumentWriter"
- sleep 3
- Call DocumentWriter.TypeKeys "<Shift Right>"
-
- hUseAsyncSlot( "EditCopy" )
- sTemp = GetClipboardText
- if sTemp <> sCorrectResult then
- Warnlog "Don't get the expected result , hope to be: '" + sCorrectResult + "'; but get: '" + sTemp + "'"
- endif
-
- Call hCloseDocument
-endcase
-
-'-------------------------------------------------------------------------
-
-testcase tRubyText_1
- '/// If Ruby Text is applied and longer than its Base Text it will stretch over more grid cells than the base text itself.
- Dim testFile , sRubyText as String
-
- testFile = "rubytest.sxw"
- sRubyText = "Ruby Test Text ....................."
-
- Call hNewDocument
-
- '/// open a test file , and insert long ruby test text
- Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
- sMakeReadOnlyDocumentEditable
- Kontext "DocumentWriter"
- Call DocumentWriter.TypeKeys "<Shift Right>"
- Sleep 1
-
- FormatRuby
- Kontext "RubyDialog"
- Sleep 3
- RubyText1.setText sRubyText
- Sleep 2
- RubyDialog.OK
- Sleep 2
- DialogClose.Click
- Sleep 1
-
- Kontext "DocumentWriter"
- FormatAutoformatApply
- Sleep 2
- Call DocumentWriter.TypeKeys "<End>"
- Sleep 2
- Call DocumentWriter.TypeKeys "<Shift Left>"
- hUseAsyncSlot( "EditCopy" )
-
- if NOT(GetClipboardText = "5" OR GetClipboardText = "6") then
- Warnlog "Don't get the correct result after inserting ruby text! Get " + GetClipboardText
- endif
-
- Call hCloseDocument
-endcase
-
-'-------------------------------------------------------------------------
-
-testcase tIndentsTest_1
- '/// Indents should work and always indenting as close as possible to their measurements by snapping to the appropriate grid cell. Tabs therefore will be ignored.
- Dim testFile , sCorrectPage1 , sCorrectPage2 as String
-
- testFile = "IndentsTest.sxw"
- sCorrectPage1 = "1"
- sCorrectPage2 = "2"
-
- Call hNewDocument
-
- '/// open a test file , and press TAB in second line
- Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
- sMakeReadOnlyDocumentEditable
- Kontext "DocumentWriter"
- Call DocumentWriter.TypeKeys "<Down>"
- Sleep 1
- Call DocumentWriter.TypeKeys "<Tab>"
- Sleep 1
- Call DocumentWriter.TypeKeys "<End>"
- Sleep 1
-
- '/// Active navigator dialogue , check if the page number is 1
- Kontext
- ViewNavigator
- Kontext "NavigatorWriter"
- if Seitennummer.GetText <> sCorrectPage1 then Warnlog "First test :Something wrong in indents test!"
- hCloseNavigator
-
- '/// press TAB in second line again
- Kontext "DocumentWriter"
- Call DocumentWriter.TypeKeys "<Home>"
- Sleep 1
- Call DocumentWriter.TypeKeys "<Tab>"
- Sleep 1
- Call DocumentWriter.TypeKeys "<End>"
- Sleep 1
-
- '/// Active navigator dialogue , check if the page number is 2
- Kontext
- ViewNavigator
- Kontext "NavigatorWriter"
- if Seitennummer.GetText <> sCorrectPage2 then Warnlog "Second test :Something wrong in indents test!"
- hCloseNavigator
-
- Call hCloseDocument
-endcase
-
-'-------------------------------------------------------------------------
-
-testcase tObjectsTest_1
- '/// If objects are anchored to text they will "wander" with its surrounding text.
- '/// If they are anchored as character they will snap to the appropriate grid cell (since they are a character).
- Dim testFile , sCorrectPage1 , sCorrectPage2 as String
+ printlog " - check data"
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "General" )
- testFile = "objectsTest.sxw"
- sCorrectPage1 = "1"
- sCorrectPage2 = "2"
+ if Zweistellig.GetText <> "1950" then Warnlog "Year ( 2 digits ) => changes not saved: '" + Zweistellig.GetText +"' #i29810"
+ if Aktivieren.IsChecked <> TRUE then Warnlog "Enable HelpAgent => changes not saved"
+ Zuruecksetzen.Click
+ if gPlatgroup = "w95" then
+ if StarOfficeDialogeBenutzen.IsChecked = lbSave (2) then Warnlog "Use StarOffice dialogs => changes not saved!"
+ end if
+ If DruckenStatus.IsChecked = lbSave ( 3 ) then Warnlog "Printing sets 'Document modified' status => changes not saved!"
- Call hNewDocument
+ printlog " - 2. change data"
+ Zweistellig.SetText "1800"
+ DruckenStatus.UnCheck
- '/// open a test file , and press TAB in second line
- Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
+ Kontext "ExtrasOptionenDlg"
+ hCloseDialog( ExtrasOptionenDlg, "ok" )
- '/// If object is anchored as Character , check if it will snap to the appropriate grid cell
- fStartupNavigator( "OLEObject" , 1 )
- Sleep 1
- Auswahlliste.TypeKeys "<Return>"
- Sleep 1
- hCloseNavigator
+ printlog " - check data"
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "General" )
- Kontext
- FormatAnchorAsCharacter
- WaitSlot()
+ if Zweistellig.GetText <> "1800" then Warnlog "Year ( 2 digits ) => changes not saved : '" + Zweistellig.GetText +"'"
+ If DruckenStatus.IsChecked <> FALSE then Warnlog "Printing sets 'Document modified' status => changes not saved!"
+ if StyleSheet.GetSelIndex <> 3 then Warnlog "Style sheet for StarOffice Help => changes not saved!"
+ printlog " - reset to saved data"
+ Zweistellig.SetText lsSave ( 1 )
+ Aktivieren.Check
+ Zuruecksetzen.Click
+ if lbSave (1) = TRUE then Aktivieren.Check else Aktivieren.Uncheck
+ if gPlatgroup = "w95" then
+ if lbSave (2) = TRUE then StarOfficeDialogeBenutzen.Check else StarOfficeDialogeBenutzen.UnCheck
+ end if
+ If lbSave(3)= TRUE then DruckenStatus.Check else DruckenStatus.UnCheck
+ StyleSheet.Select lsSave(3)
- ViewNavigator
- Kontext "NavigatorWriter"
- Seitennummer.SetText sCorrectPage2
- Sleep 5
- if Seitennummer.GetText <> sCorrectPage2 then Warnlog "Something wrong when object is anchored as Character!"
- hCloseNavigator
+ Kontext "ExtrasOptionenDlg"
+ hCloseDialog( ExtrasOptionenDlg, "ok" )
- '/// If object is anchored to Character , check if it will NOT snap to the appropriate grid cell
- fStartupNavigator( "OLEObject" , 1 )
- Auswahlliste.TypeKeys "<Return>"
- hCloseNavigator
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "General" )
- Kontext
- FormatAnchorToCharacter
+ printlog " - check the reset data"
+ if Zweistellig.GetText <> lsSave ( 1 ) then Warnlog "Year ( 2 digits ) => changes not saved"
+ if Aktivieren.IsChecked <> lbSave (1) then Warnlog "Enable HelpAgent => changes not saved"
+ Aktivieren.Check
+ Zuruecksetzen.Click
+ if lbSave (1) = TRUE then Aktivieren.Check else Aktivieren.Uncheck
+ if gPlatgroup = "w95" then
+ if StarOfficeDialogeBenutzen.IsChecked <> lbSave (2) then Warnlog "Use StarOffice dialogs => changes not saved!"
+ end if
+ If DruckenStatus.IsChecked <> lbSave(3) then Warnlog "Printing sets 'Document modified' status => changes not saved!"
+ if StyleSheet.GetSelText <> lsSave (3) then Warnlog "Style sheet for StarOffice Help => changes not saved!"
- ViewNavigator
- Kontext "NavigatorWriter"
- Seitennummer.SetText sCorrectPage2
- Sleep 5
- if Seitennummer.GetText <> sCorrectPage1 then Warnlog "Something wrong when object is anchored to Character!"
- hCloseNavigator
- Kontext
+ Kontext "ExtrasOptionenDlg"
+ hCloseDialog( ExtrasOptionenDlg, "ok" )
- Call hCloseDocument
endcase
diff --git a/testautomation/framework/optional/includes/options_ooo_security.inc b/testautomation/framework/optional/includes/options_ooo_security.inc
index c3dece4de849..be542fc71689 100644..100755
--- a/testautomation/framework/optional/includes/options_ooo_security.inc
+++ b/testautomation/framework/optional/includes/options_ooo_security.inc
@@ -91,13 +91,6 @@ sub checkSecurityPage( _file as string )
warnlog( "Failed to open Security options" )
endif
- Kontext "TabSecurity"
- if ( TabSecurity.exists() ) then
- checkCheckBox( _file , "*" , RecommendToOpenDocumentReadOnly )
- checkCheckBox( _file , "*" , RecordChanges )
- else
- warnlog( "Could not return to Security Tabpage" )
- endif
else
warnlog( "Security Tabpage not available" )
endif
@@ -110,6 +103,9 @@ sub changeSecurityPage( _file as string )
printlog( " * Changing current settings according to the reference list." )
printlog( " * Using settings from file: " & _file )
+
+ kontext "TabSecurity"
+ if ( TabSecurity.exists() ) then
Options.click
Kontext "TabSecurityOptionsAndWarnings"
@@ -120,12 +116,12 @@ sub changeSecurityPage( _file as string )
setCheckBox( _file , "*" , RemovePersonalInformationOnSaving )
setCheckBox( _file , "*" , RecommendPasswordProtectionOnSaving )
TabSecurityOptionsAndWarnings.cancel
- Kontext "TabSecurity"
- setCheckBox( _file , "*" , RecommendToOpenDocumentReadOnly )
- setCheckBox( _file , "*" , RecordChanges )
Kontext "OptionenDLG"
OptionenDLG.OK
+ else
+ warnlog( "Security Tabpage not available" )
+ endif
sleep(2)
call exitRestartTheOffice()
diff --git a/testautomation/framework/optional/includes/scripting_basics.inc b/testautomation/framework/optional/includes/scripting_basics.inc
deleted file mode 100644
index 36f5ce44feec..000000000000
--- a/testautomation/framework/optional/includes/scripting_basics.inc
+++ /dev/null
@@ -1,73 +0,0 @@
-'encoding UTF-8 Do not remove or change this line!
-'**************************************************************************
-' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-'
-' Copyright 2000, 2010 Oracle and/or its affiliates.
-'
-' OpenOffice.org - a multi-platform office productivity suite
-'
-' This file is part of OpenOffice.org.
-'
-' OpenOffice.org is free software: you can redistribute it and/or modify
-' it under the terms of the GNU Lesser General Public License version 3
-' only, as published by the Free Software Foundation.
-'
-' OpenOffice.org is distributed in the hope that it will be useful,
-' but WITHOUT ANY WARRANTY; without even the implied warranty of
-' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-' GNU Lesser General Public License version 3 for more details
-' (a copy is included in the LICENSE file that accompanied this code).
-'
-' You should have received a copy of the GNU Lesser General Public License
-' version 3 along with OpenOffice.org. If not, see
-' <http://www.openoffice.org/license.html>
-' for a copy of the LGPLv3 License.
-'
-'/************************************************************************
-'*
-'* owner : joerg.skottke@sun.com
-'*
-'* short description : Quick short test for the scripting framework
-'*
-'\******************************************************************************
-
-testcase tScripting
-
-
- const ORGANIZER_ITEMS = 2
-
- hInitBackingMode()
-
- ToolsMacrosOrganizeMacrosBeanShell
-
- Kontext "ScriptOrganizer"
- if ( ScriptOrganizer.exists( 5 ) ) then
- printlog( "Beanshell Script Organizer is present. Good" )
- if ( ScriptTreeList.getItemCount() <> ORGANIZER_ITEMS ) then
- warnlog( "The Treelist does not contain the expected number " & _
- "of items. Please verify that exactly three top-nodes exist" )
- endif
- ScriptOrganizer.cancel()
- else
- warnlog( "Script Organizer for Beanshell is missing" )
- endif
-
- ToolsMacrosOrganizeMacrosJavaScript
-
- Kontext "ScriptOrganizer"
- if ( ScriptOrganizer.exists( 5 ) ) then
- printlog( "JavaScript Script Organizer is present. Good" )
- if ( ScriptTreeList.getItemCount() <> ORGANIZER_ITEMS ) then
- warnlog( "The Treelist does not contain the expected number " & _
- "of items. Please verify that exactly three top-nodes exist" )
- endif
- ScriptOrganizer.cancel()
- else
- warnlog( "Script Organizer for JavaScript is missing" )
- endif
-
-
-endcase
-
-
-
diff --git a/testautomation/framework/optional/includes/scripting_organizers.inc b/testautomation/framework/optional/includes/scripting_organizers.inc
index b9b7dcebde7a..d5159cd383ee 100644..100755
--- a/testautomation/framework/optional/includes/scripting_organizers.inc
+++ b/testautomation/framework/optional/includes/scripting_organizers.inc
@@ -178,7 +178,7 @@ testcase tScriptingOrganizers( iDialog as integer )
endif
kontext "ScriptOrganizer"
- brc = hCloseScriptOrganizer()
+ hCloseDialog( ScriptOrganizer, "close" )
printlog( "" )
printlog( "Test 3: Script storage in documents (save/load)" )
@@ -225,7 +225,7 @@ testcase tScriptingOrganizers( iDialog as integer )
endif
kontext "ScriptOrganizer"
- brc = hCloseScriptOrganizer()
+ hCloseDialog( ScriptOrganizer, "close" )
try
hFileSave
@@ -250,7 +250,8 @@ testcase tScriptingOrganizers( iDialog as integer )
iItemCount = hGetNodeCount( ScriptTreeList )
if ( iItemCount <> IDOCPOS ) then
warnlog( "Treelist not populated, the test cannot continue" )
- brc = hCloseScriptOrganizer()
+ kontext "ScriptOrganizer"
+ hCloseDialog( ScriptOrganizer, "close" )
brc = hDestroyDocument()
goto endsub
endif
@@ -260,9 +261,11 @@ testcase tScriptingOrganizers( iDialog as integer )
warnlog( "Not all libraries/scripts have been deleted" )
endif
- brc = hCloseScriptOrganizer()
+ kontext "ScriptOrganizer"
+ hCloseDialog( ScriptOrganizer, "close" )
- brc = hCloseNavigator()
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close,optional" )
brc = hDestroyDocument()
diff --git a/testautomation/framework/optional/includes/security_certification_dialogs.inc b/testautomation/framework/optional/includes/security_certification_dialogs.inc
index 2b645712cc02..18c47c36d5fa 100644..100755
--- a/testautomation/framework/optional/includes/security_certification_dialogs.inc
+++ b/testautomation/framework/optional/includes/security_certification_dialogs.inc
@@ -32,8 +32,6 @@
'\******************************************************************************
testcase tCertificationDialogs
-
-
dim brc as boolean
const CFN = "tCertificationDialogs::"
const SVERSION = "680"
@@ -44,16 +42,23 @@ testcase tCertificationDialogs
hDeleteFile( sFile )
- call hNewDocument()
+ hNewDocument()
- call hChangeDoc()
+ hChangeDoc()
- brc = hOpenDigitalSignaturesDialog()
+ hOpenDigitalSignaturesDialog()
kontext "active"
if ( active.exists( 1 ) ) then
printlog( "MSGBOX: " & active.getText() )
- active.yes()
+ try
+ active.yes()
+ catch
+ warnlog( CFN & "This is not the expected messagebox, aborting test" )
+ active.ok()
+ hCloseDocument()
+ goto endsub
+ endcatch
printlog( CFN & "Allow to save the document" )
else
if ( gApplication <> "MASTERDOCUMENT" ) then
@@ -91,8 +96,5 @@ testcase tCertificationDialogs
endif
call hCloseDocument()
-
-
-
endcase
diff --git a/testautomation/framework/optional/includes/security_certified_docs.inc b/testautomation/framework/optional/includes/security_certified_docs.inc
index 59f74e809c6f..b00e5460e3fb 100644..100755
--- a/testautomation/framework/optional/includes/security_certified_docs.inc
+++ b/testautomation/framework/optional/includes/security_certified_docs.inc
@@ -52,14 +52,14 @@ testcase tLoadCertifiedFile( cBuildID as string )
sFileOut = hGetWorkPath() & "certificate_data.txt"
' Variable to store boolean returncodes from functions
- dim brc as boolean
- brc = true
+ dim brc as boolean : brc = true
+ dim irc as boolean : irc = 0
' the number of certificates attached to the current document
dim iCertCount as integer
printlog( "Load the file" )
- brc = hFileOpen( cFile )
+ hFileOpen( cFile )
brc = hHandleActivesOnLoad( 0 , 2 )
' in case the file did not get loaded, handle the problem by aborting the test
@@ -122,12 +122,8 @@ testcase tLoadCertifiedFile( cBuildID as string )
kontext "TabXMLSecDetails"
hGetListItems( XMLSecDetailsListBox, sCertData() )
- brc = hManageComparisionList( sFileIn, sFileOut, sCertData() )
- if ( not brc ) then
- warnlog( "The data of the certificate appears to be incorrect" )
- else
- printlog( "Verification of the certificate succeeded" )
- endif
+ irc = hManageComparisionList( sFileIn, sFileOut, sCertData() )
+ hListResultEvaluation( irc , 0 )
SkipEditBrowseBox:
diff --git a/testautomation/framework/optional/includes/security_incorrect_password.inc b/testautomation/framework/optional/includes/security_incorrect_password.inc
index eedbc8c67896..2478a59d6294 100644..100755
--- a/testautomation/framework/optional/includes/security_incorrect_password.inc
+++ b/testautomation/framework/optional/includes/security_incorrect_password.inc
@@ -32,37 +32,31 @@
'\******************************************************************************
testcase tIncorrectPassword( filetypeID as string )
-
- const WORKFILE = "password"
- dim suffix as string
- dim workpath as string
-
- dim rc as integer
- dim brc as boolean
dim iCurrentFilter as integer
dim cCurrentFilter as string
+ dim filepath as string
const PASSWORD_VALID = "MyPasswd09#+1"
const PASSWORD_FALSE = "MyPasswd00#+1"
const DOC_ID = "f_sec_incorrect_password.bas testdocument"
-
- workpath = hGetWorkPath()
-
- suffix = hGetSuffix( filetypeID )
+
+ printlog( "Build a valid filename with full path and suffix" )
+ filepath = hGetWorkPath() & "password" & hGetSuffix( filetypeID )
+ printlog( "The workfile is: " & filepath )
printlog( "Delete the workfile - if it was left over by a former testrun" )
- hDeleteFile( workpath & WORKFILE & suffix )
+ hDeleteFile( filepath )
printlog( "Make sure we have exactly one single document open" )
hFileCloseAll()
- hCreateDocument()
+ hCreateDocument() ' Do not use hInitSingleDoc() here as it creates a Writer document
printlog( "Change the document" )
hChangeDoc()
printlog( "Click on FileSave" )
- FileSave
+ hUseAsyncSlot( "FileSave" )
Kontext "SpeichernDlg"
if ( SpeichernDlg.exists( 1 ) ) then
@@ -92,9 +86,7 @@ testcase tIncorrectPassword( filetypeID as string )
printlog( "Click on the Save-Button" )
Speichern.click()
- brc = hSecurityEnterPasswordOnSave( PASSWORD_VALID )
-
- if ( brc ) then
+ if ( hSecurityEnterPasswordOnSave( PASSWORD_VALID ) ) then
kontext "AlienWarning"
if ( AlienWarning.exists( 3 ) ) then
@@ -107,8 +99,7 @@ testcase tIncorrectPassword( filetypeID as string )
endif
printlog( "Close the document" )
- brc = hDestroyDocument()
- if ( not brc ) then
+ if ( not hDestroyDocument() ) then
warnlog( "Something went wrong while closing the document. please check" )
endif
@@ -118,8 +109,7 @@ testcase tIncorrectPassword( filetypeID as string )
printlog( "Load the file again" )
hFileOpen( workpath & WORKFILE & suffix )
- brc = hSecurityEnterPasswordOnLoad( PASSWORD_FALSE , false )
- if ( not brc ) then
+ if ( not hSecurityEnterPasswordOnLoad( PASSWORD_FALSE , false ) ) then
warnlog( "Something went wrong while using the password dialog" )
endif
diff --git a/testautomation/framework/optional/includes/security_macrosecurity.inc b/testautomation/framework/optional/includes/security_macrosecurity.inc
index b996ff4a2cf8..1c9d360da9e6 100644..100755
--- a/testautomation/framework/optional/includes/security_macrosecurity.inc
+++ b/testautomation/framework/optional/includes/security_macrosecurity.inc
@@ -59,7 +59,10 @@ testcase tMacroSecurityLevels( cFileFormat )
cWorkFile = convertToURL( cWorkFile )
dim iSecLevel as integer
- dim brc as boolean
+
+ const EXPECTED_MESSAGECOUNT = 1
+ const ALLOW_ONE_EXTRA_MESSAGEBOX = 1
+ const ALLOW_NO_EXTRA_MESSAGEBOXES = 0
' We have quite a bunch of possible combinations here. Some trigger a security warning
' others do not. Depending on the security level we either get no warning at all, the
@@ -76,7 +79,7 @@ testcase tMacroSecurityLevels( cFileFormat )
' *) Covered by test "f_sec_trusted_path.bas"
printlog( "Load a document with macro for each of the four security levels" )
- for iSecLevel = 0 to 3
+ for iSecLevel = GC_MACRO_SECURITY_LEVEL_LOW to GC_MACRO_SECURITY_LEVEL_VERYHIGH
printlog( "Set macro security level to " & iSecLevel )
hSetMacroSecurityAPI( iSecLevel )
@@ -86,46 +89,46 @@ testcase tMacroSecurityLevels( cFileFormat )
printlog( "Check security level dependent behavior" )
select case iSecLevel
- case 0 : brc = hIdentifyExecutedMacro()
- if ( not brc ) then
- if ( gApplication = "MATH" ) then
- qaerrorlog( "#i68291# Math document forgets eventbinding" )
- else
- warnlog( "#i53711# Macro was not found/executed" )
- endif
- endif
-
- case 1 : brc = hAllowMacroExecution()
- if ( not brc ) then
- warnlog( "Macro execution warning missing, chek the file/security settings" )
- endif
- brc = hIdentifyExecutedMacro()
- if ( not brc ) then
- if ( gApplication = "MATH" ) then
- qaerrorlog( "#i68291# Math document forgets eventbinding" )
- else
- warnlog( "#i53711# Macro was not found/executed" )
- endif
- endif
-
- case 2 : brc = hHandleActivesOnLoad( 1 , 1 )
- if ( not brc ) then
- qaerrorlog( "#i53710# unexpected second messagebox" )
- endif
- brc = hIdentifyExecutedMacro()
- if ( brc ) then
- warnlog( "Macro was executed" )
- endif
-
- case 3 : brc = hHandleActivesOnLoad( 1 , 0 )
- brc = hIdentifyExecutedMacro()
- if ( brc ) then
- warnlog( "Macro was executed" )
- endif
+ case GC_MACRO_SECURITY_LEVEL_LOW :
+
+ if ( not hIdentifyExecutedMacro() ) then
+ warnlog( "#i110184# - Macro was not executed" )
+ endif
+
+ case GC_MACRO_SECURITY_LEVEL_MEDIUM :
+
+ if ( not hAllowMacroExecution() ) then
+ warnlog( "#i110184# - Macro execution warning missing, check the file/security settings" )
+ endif
+
+ if ( not hIdentifyExecutedMacro() ) then
+ warnlog( "#i110184# - Macro was not executed" )
+ endif
+
+ case GC_MACRO_SECURITY_LEVEL_HIGH :
+
+ if ( not hHandleActivesOnLoad( EXPECTED_MESSAGECOUNT , ALLOW_ONE_EXTRA_MESSAGEBOX ) ) then
+ warnlog( "#i53710# unexpected second messagebox" )
+ endif
+
+ if ( hIdentifyExecutedMacro() ) then
+ warnlog( "Macro was executed" )
+ endif
+
+ case GC_MACRO_SECURITY_LEVEL_VERYHIGH :
+
+ if ( not hHandleActivesOnLoad( EXPECTED_MESSAGECOUNT , ALLOW_NO_EXTRA_MESSAGEBOXES ) ) then
+ warnlog( "#i53710# unexpected second messagebox" )
+ endif
+
+ if ( hIdentifyExecutedMacro() ) then
+ warnlog( "Macro was executed" )
+ endif
+
end select
printlog( "Close document" )
- brc = hDestroyDocument()
+ hDestroyDocument()
next iSecLevel
diff --git a/testautomation/framework/optional/includes/security_recommend_password.inc b/testautomation/framework/optional/includes/security_recommend_password.inc
index eaceab3691b9..628fdecd7ae5 100644..100755
--- a/testautomation/framework/optional/includes/security_recommend_password.inc
+++ b/testautomation/framework/optional/includes/security_recommend_password.inc
@@ -80,11 +80,8 @@ testcase tRecommendPassword( filetypeID as string )
if ( rc = 0 ) then
- if AutomatischeDateinamenserweiterung.Exists then
- AutomatischeDateinamenserweiterung.Uncheck
- endif
-
-
+ AutomatischeDateinamenserweiterung.Uncheck
+
printlog( "Name the file" )
Dateiname.settext( workpath & workfile )
@@ -117,6 +114,5 @@ testcase tRecommendPassword( filetypeID as string )
printlog( "Close the current document" )
call hCloseDocument()
-
endcase
diff --git a/testautomation/framework/optional/includes/standardbar2.inc b/testautomation/framework/optional/includes/standardbar2.inc
index a4252179b198..3d2b87f33b7b 100644..100755
--- a/testautomation/framework/optional/includes/standardbar2.inc
+++ b/testautomation/framework/optional/includes/standardbar2.inc
@@ -90,9 +90,10 @@ testcase tStandardBar_2
sleep( 1 )
hMenuselectNr ( iNewButtonItem )
- sleep( 3 )
+ hFileWait() ' was sleep( 3 )
- hCloseNavigator()
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close,optional" )
select case iNewButtonItem
case 1 : Kontext "DocumentWriter"
diff --git a/testautomation/framework/optional/includes/w_grid_layout1.inc b/testautomation/framework/optional/includes/w_grid_layout1.inc
index 737cf850ad65..772ebc6d9d00 100644
--- a/testautomation/framework/optional/includes/w_grid_layout1.inc
+++ b/testautomation/framework/optional/includes/w_grid_layout1.inc
@@ -35,11 +35,17 @@ private const SOURCE_PATH = "framework\optional\input\CJK\"
testcase tTextGridDialog_1
+ dim lsSave( 3 ) as string
+ dim lbSave( 3 ) as boolean
+
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close,optional" )
+
'/// Check if tabpage 'Text Grid' disappears when "Asian Language support" is NOT checked
if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
Call CheckAsianLanguageSupport("Off")
hNewDocument()
- FormatPageWriter
+ hUseAsyncSlot( "FormatPageWriter" )
try
Kontext
Active.SetPage TabGrid
@@ -57,26 +63,33 @@ testcase tTextGridDialog_1
'/// Check if tabpage 'Text Grid' appears when "Asian Language support" is checked
Call CheckAsianLanguageSupport("On")
- sleep 5
- FormatPageWriter
- Kontext
- if Active.exists (10) then
- try
- Kontext
- Active.SetPage TabGrid
- Kontext "TabGrid"
- TabGrid.Cancel
- catch
- Kontext
- Active.SetPage TabSeite
- Kontext "TabSeite"
- TabSeite.Cancel
- warnlog "Couldn't get Tabpage: Grid Text"
- endcatch
- else
- warnlog "FormatPageWriter didn't bring up ndialog"
- endif
- hCloseDocument()
+ hNewDocument
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "General" )
+
+ printlog " - save old data"
+ lsSave ( 1 ) = Zweistellig.GetText
+ lbSave ( 1 ) = Aktivieren.IsChecked
+ Aktivieren.Check
+ if gPlatgroup = "w95" then
+ lbSave (2) = StarOfficeDialogeBenutzen.IsChecked
+ end if
+ lbSave ( 3 ) = DruckenStatus.IsChecked
+ lsSave ( 3 ) = StyleSheet.GetSelText
+
+ printlog " - invert/change data"
+ Zweistellig.SetText "1950"
+ Zuruecksetzen.Click
+ if gPlatgroup = "w95" then
+ if lbSave (2) = TRUE then StarOfficeDialogeBenutzen.Uncheck else StarOfficeDialogeBenutzen.Check
+ end if
+ If lbSave ( 3 ) = TRUE then DruckenStatus.Uncheck else DruckenStatus.Check
+ StyleSheet.Select 3
+
+ Kontext "ExtrasOptionenDlg"
+ hCloseDialog( ExtrasOptionenDlg, "ok" )
+ hFileCloseAll()
+
endcase
'-------------------------------------------------------------------------
@@ -94,30 +107,28 @@ testcase tTextGridDialog_2
Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
sMakeReadOnlyDocumentEditable
- FormatPageWriter
+ hUseAsyncSlot( "FormatPageWriter" )
Kontext
if active.exists(5) then
Active.SetPage TabGrid
endif
Kontext "TabGrid"
NoGrid.Check
- Sleep 1
- TabGrid.OK
- Sleep 1
+ hCloseDialog( TabGrid, "ok" )
+
'/// Active navigator dialogue , set page to '2' and wait for a while
Kontext
ViewNavigator
Kontext "NavigatorWriter"
-
- Seitennummer.SetText "2"
- Sleep 5
- hCloseNavigator
+ Seitennummer.SetText "2" : Wait( 2000 )
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close" )
'/// In No Grid mode, there should be only 1 page, the focus is before the first line
Kontext "DocumentWriter"
Call DocumentWriter.TypeKeys "<End>"
- Sleep 1
+ wait( 200 ) ' sleep 1
Call DocumentWriter.TypeKeys "<Shift Left>"
hUseAsyncSlot( "EditCopy" )
@@ -142,7 +153,7 @@ testcase tTextGridDialog_3
'/// + set 10 line/page
Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
sMakeReadOnlyDocumentEditable
- FormatPageWriter
+ hUseAsyncSlot( "FormatPageWriter" )
Kontext
if active.exists(5) then
Active.SetPage TabGrid
@@ -150,22 +161,19 @@ testcase tTextGridDialog_3
Kontext "TabGrid"
LinesGrid.Check
LinesPerPage.SetText sLinesPerPage
- Sleep 1
- TabGrid.OK
- Sleep 1
+ hCloseDialog( TabGrid, "ok" )
'/// Active navigator dialogue , set page to '2' and wait for a while
Kontext
ViewNavigator
Kontext "NavigatorWriter"
-
- Seitennummer.SetText "2"
- Sleep 5
- hCloseNavigator
+ Seitennummer.SetText "2" : Wait( 2000 )
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close" )
Kontext "DocumentWriter"
Call DocumentWriter.TypeKeys "<End>"
- Sleep 1
+ wait( 200 ) ' sleep 1
Call DocumentWriter.TypeKeys "<Shift Left>"
hUseAsyncSlot( "EditCopy" )
@@ -192,7 +200,7 @@ testcase tTextGridDialog_4
'/// + set 10 line/page and 9 characters/line
Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
sMakeReadOnlyDocumentEditable
- FormatPageWriter
+ hUseAsyncSlot( "FormatPageWriter" )
Kontext
if active.exists(5) then
Active.SetPage TabGrid
@@ -201,22 +209,19 @@ testcase tTextGridDialog_4
CharsGrid.Check
LinesPerPage.SetText sLinesPerPage
CharsPerLine.SetText sCharsPerLine
- Sleep 1
- TabGrid.OK
- Sleep 1
+ hCloseDialog( TabGrid, "ok" )
'/// Active navigator dialogue , set page to '2' and wait for a while
Kontext
ViewNavigator
Kontext "NavigatorWriter"
-
- Seitennummer.SetText "2"
- Sleep 5
- hCloseNavigator
+ Seitennummer.SetText "2" : Wait( 2000 )
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close" )
Kontext "DocumentWriter"
Call DocumentWriter.TypeKeys "<End>"
- Sleep 1
+ wait( 200 ) ' sleep 1
Call DocumentWriter.TypeKeys "<Shift Left>"
hUseAsyncSlot( "EditCopy" )
@@ -233,7 +238,7 @@ testcase tGridDisplay_1
'/// format / page / tabpage Text grid
'/// + check "display grid" and check "print grid"
- FormatPageWriter
+ hUseAsyncSlot( "FormatPageWriter" )
Kontext
if active.exists(5) then
Active.SetPage TabGrid
@@ -241,14 +246,12 @@ testcase tGridDisplay_1
Kontext "TabGrid"
CharsGrid.Check
Display.Check
- Sleep 1
PrintGrid.Check
- Sleep 1
- TabGrid.OK
- Sleep 1
+ hCloseDialog( TabGrid, "ok" )
+
'/// Print to printer
- FilePrint
+ hUseAsyncSlot( "FilePrint" )
Kontext "Active"
if ( Active.Exists( 5 ) ) then
if Active.GetRT() = 304 then
@@ -262,7 +265,7 @@ testcase tGridDisplay_1
else
Kontext "Printing"
if ( Printing.exists( 2 )) then
- printing.cancel()
+ Printing.OK()
Printing.notExists( 5 )
endif
@@ -283,11 +286,8 @@ testcase tGridDisplay_1
Kontext "TabGrid"
CharsGrid.Check
Display.Check
- Sleep 1
PrintGrid.UnCheck
- Sleep 1
- TabGrid.OK
- Sleep 1
+ hCloseDialog( TabGrid, "ok" )
'/// Print to printer
FilePrint
@@ -303,10 +303,8 @@ testcase tGridDisplay_1
endif
else
Kontext "Printing"
- if( Printing.exists( 1 )) then
- printing.cancel()
- Printing.notExists( 5 )
- endif
+ hCloseDialog( Printing, "ok" )
+
kontext
if ( active.exists( 2 ) ) then
qaErrorLog active.getText
@@ -333,7 +331,7 @@ testcase tUserDefineLayout_1
'/// Format/page , set lines per page to 20, and set charsets per line to 2
'/// + wait for a moment , then check the the number of lines per page.
- FormatPageWriter
+ hUseAsyncSlot( "FormatPageWriter" )
Kontext
if active.exists(5) then
Active.SetPage TabGrid
@@ -342,16 +340,13 @@ testcase tUserDefineLayout_1
CharsGrid.Check
LinesPerPage.SetText sLinesPerPage
- Sleep 2
CharsPerLine.SetText sCharsPerLine
- Sleep 2
'This step is no use, just let the LinesPerPage change the number
CharsGrid.Check
if LinesPerPage.GetText <> sExpectLinesPerPage AND LinesPerPage.GetText <> sExpectLinesPerPage1 then
- Warnlog( "#i106381# - LInes per page changed" )
- printlog( "The lines per page should be" + sExpectLinesPerPage & " OR " & sExpectLinesPerPage1 & " but get " &LinesPerPage.GetText )
+ Warnlog "The lines per page should be" + sExpectLinesPerPage + " OR " + sExpectLinesPerPage1 +" but get " +LinesPerPage.GetText
endif
TabGrid.Cancel
@@ -362,7 +357,6 @@ endcase
'-------------------------------------------------------------------------
testcase tFontSizeChanges_1
-
'/// Change the font size to bigger enough will change the layout
Dim testFile , sCorrectResult as String
Dim sLinesPerPage , sCharsPerLine as String
@@ -381,10 +375,9 @@ testcase tFontSizeChanges_1
Kontext "FormatObjectbar"
Schriftgroesse.Select "60"
Schriftgroesse.TypeKeys "<Return>"
- Sleep 1
Kontext "DocumentWriter"
- FormatPageWriter
+ hUseAsyncSlot( "FormatPageWriter" )
Kontext
if active.exists(5) then
Active.SetPage TabGrid
@@ -393,11 +386,11 @@ testcase tFontSizeChanges_1
if TabGrid.exists(5) then
sTemp = LinesPerPage.GetText
if sTemp <> sLinesPerPage then
- Warnlog "The lines per page should be: '" & sLinesPerPage & "'; but get: '" & sTemp & "'"
+ Warnlog "The lines per page should be: '" + sLinesPerPage + "'; but get: '" + sTemp + "'"
endif
sTemp = CharsPerLine.GetText
if sTemp <> sCharsPerLine then
- Warnlog "The chars per line should be: '" & sCharsPerLine & "'; but get: '" &sTemp & "'"
+ Warnlog "The chars per line should be: '" + sCharsPerLine + "'; but get: '" +sTemp + "'"
endif
TabGrid.Cancel
else
@@ -408,21 +401,21 @@ testcase tFontSizeChanges_1
ViewNavigator
Kontext "NavigatorWriter"
if NavigatorWriter.exists(5) then
- Seitennummer.SetText "2"
- Sleep 5
+ Seitennummer.SetText "2" : Wait( 2000 )
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close" )
else
- warnlog "Navigator not available"
+ warnlog( "Navigator not open" )
endif
- hCloseNavigator
Kontext "DocumentWriter"
- sleep 3
+ wait( 200 ) ' sleep 3
Call DocumentWriter.TypeKeys "<Shift Right>"
hUseAsyncSlot( "EditCopy" )
sTemp = GetClipboardText
if sTemp <> sCorrectResult then
- Warnlog "Don't get the expected result , hope to be: '" & sCorrectResult & "'; but get: '" & sTemp & "'"
+ Warnlog "Don't get the expected result , hope to be: '" + sCorrectResult + "'; but get: '" + sTemp + "'"
endif
Call hCloseDocument
@@ -431,41 +424,51 @@ endcase
'-------------------------------------------------------------------------
testcase tRubyText_1
- '/// If Ruby Text is applied and longer than its Base Text it will stretch over more grid cells than the base text itself.
- Dim testFile , sRubyText as String
- testFile = "rubytest.sxw"
- sRubyText = "Ruby Test Text ....................."
+ '/// If Ruby Text is applied and longer than its Base Text it will stretch over more grid cells than the base text itself.
+ const TEST_FILE = "rubytest.sxw"
+ const RUBY_TEXT = "Ruby Test Text ....................."
+ printlog( "Create a new document" )
Call hNewDocument
- '/// open a test file , and insert long ruby test text
- Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
- sMakeReadOnlyDocumentEditable
+ printlog( "Open test file" )
+ Call hFileOpen ( gTesttoolPath + SOURCE_PATH + TEST_FILE )
+
+ printlog( "Remove write protection of document (if set)" )
+ Call sMakeReadOnlyDocumentEditable()
+
Kontext "DocumentWriter"
+ printlog( "Mark character to the right of current cursor position" )
Call DocumentWriter.TypeKeys "<Shift Right>"
- Sleep 1
- FormatRuby
+ printlog( "Open <Format Ruby> dialog" )
+ hUseAsyncSlot( "FormatRuby" )
+
Kontext "RubyDialog"
- Sleep 3
- RubyText1.setText sRubyText
- Sleep 2
- RubyDialog.OK
- Sleep 2
- DialogClose.Click
- Sleep 1
+ if ( RubyDialog.exists( 3 ) ) then
+ RubyText1.setText( RUBY_TEXT )
+ RubyDialog.OK
+ DialogClose.Click
+ else
+ warnlog( "Ruby dialog not open" )
+ endif
Kontext "DocumentWriter"
- FormatAutoformatApply
- Sleep 2
+ printlog( "Apply Autoformat" )
+ hUseAsyncSlot( "FormatAutoformatApply" )
+
+ printlog( "Select last character in current line" )
Call DocumentWriter.TypeKeys "<End>"
- Sleep 2
+ Wait( 200 )
Call DocumentWriter.TypeKeys "<Shift Left>"
+ Wait( 200 )
+
+ printlog( "<EditCopy>" )
hUseAsyncSlot( "EditCopy" )
if NOT(GetClipboardText = "5" OR GetClipboardText = "6") then
- Warnlog "Don't get the correct result after inserting ruby text! Get " & GetClipboardText
+ Warnlog "Don't get the correct result after inserting ruby text! Get " + GetClipboardText
endif
Call hCloseDocument
@@ -475,47 +478,54 @@ endcase
testcase tIndentsTest_1
'/// Indents should work and always indenting as close as possible to their measurements by snapping to the appropriate grid cell. Tabs therefore will be ignored.
- Dim testFile , sCorrectPage1 , sCorrectPage2 as String
- testFile = "IndentsTest.sxw"
- sCorrectPage1 = "1"
- sCorrectPage2 = "2"
+ const TEST_FILE = "IndentsTest.sxw"
+ const CORRECT_PAGE_1 = "1"
+ const CORRECT_PAGE_2 = "2"
Call hNewDocument
'/// open a test file , and press TAB in second line
- Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
+ Call hFileOpen ( gTesttoolPath + SOURCE_PATH + TEST_FILE )
+
sMakeReadOnlyDocumentEditable
+
Kontext "DocumentWriter"
Call DocumentWriter.TypeKeys "<Down>"
- Sleep 1
+ wait( 200 ) ' sleep 1
Call DocumentWriter.TypeKeys "<Tab>"
- Sleep 1
+ wait( 200 ) ' sleep 1
Call DocumentWriter.TypeKeys "<End>"
- Sleep 1
+ wait( 200 ) ' sleep 1
'/// Active navigator dialogue , check if the page number is 1
Kontext
ViewNavigator
Kontext "NavigatorWriter"
- if Seitennummer.GetText <> sCorrectPage1 then Warnlog "First test :Something wrong in indents test!"
- hCloseNavigator
+ if ( Seitennummer.GetText <> CORRECT_PAGE_1 ) then
+ Warnlog "First test :Something wrong in indents test!"
+ endif
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close" )
'/// press TAB in second line again
Kontext "DocumentWriter"
Call DocumentWriter.TypeKeys "<Home>"
- Sleep 1
+ wait( 200 ) ' sleep 1
Call DocumentWriter.TypeKeys "<Tab>"
- Sleep 1
+ wait( 200 ) ' sleep 1
Call DocumentWriter.TypeKeys "<End>"
- Sleep 1
+ wait( 200 ) ' sleep 1
'/// Active navigator dialogue , check if the page number is 2
Kontext
ViewNavigator
Kontext "NavigatorWriter"
- if Seitennummer.GetText <> sCorrectPage2 then Warnlog "Second test :Something wrong in indents test!"
- hCloseNavigator
+ if ( Seitennummer.GetText <> CORRECT_PAGE_2 ) then
+ Warnlog "Second test :Something wrong in indents test!"
+ endif
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close" )
Call hCloseDocument
endcase
@@ -525,23 +535,23 @@ endcase
testcase tObjectsTest_1
'/// If objects are anchored to text they will "wander" with its surrounding text.
'/// If they are anchored as character they will snap to the appropriate grid cell (since they are a character).
- Dim testFile , sCorrectPage1 , sCorrectPage2 as String
- testFile = "objectsTest.sxw"
- sCorrectPage1 = "1"
- sCorrectPage2 = "2"
+ const TEST_FILE = "objectsTest.sxw"
+ const CORRECT_PAGE_1 = "1"
+ const CORRECT_PAGE_2 = "2"
Call hNewDocument
'/// open a test file , and press TAB in second line
- Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
+ Call hFileOpen ( gTesttoolPath + SOURCE_PATH + TEST_FILE )
'/// If object is anchored as Character , check if it will snap to the appropriate grid cell
fStartupNavigator( "OLEObject" , 1 )
- Sleep 1
+ wait( 200 ) ' sleep 1
Auswahlliste.TypeKeys "<Return>"
- Sleep 1
- hCloseNavigator
+ wait( 200 ) ' sleep 1
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close" )
Kontext
FormatAnchorAsCharacter
@@ -550,26 +560,32 @@ testcase tObjectsTest_1
ViewNavigator
Kontext "NavigatorWriter"
- Seitennummer.SetText sCorrectPage2
- Sleep 5
- if Seitennummer.GetText <> sCorrectPage2 then Warnlog "Something wrong when object is anchored as Character!"
- hCloseNavigator
+ Seitennummer.SetText( CORRECT_PAGE_1 )
+ WaitSlot( 5000 ) ' wait( 200 ) ' sleep 5
+ if ( Seitennummer.GetText <> CORRECT_PAGE_1 ) then
+ Warnlog "Something wrong when object is anchored as Character!"
+ endif
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close" )
'/// If object is anchored to Character , check if it will NOT snap to the appropriate grid cell
fStartupNavigator( "OLEObject" , 1 )
Auswahlliste.TypeKeys "<Return>"
- hCloseNavigator
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close" )
Kontext
FormatAnchorToCharacter
ViewNavigator
Kontext "NavigatorWriter"
- Seitennummer.SetText sCorrectPage2
- Sleep 5
- if Seitennummer.GetText <> sCorrectPage1 then Warnlog "Something wrong when object is anchored to Character!"
- hCloseNavigator
- Kontext
+ Seitennummer.SetText( CORRECT_PAGE_2 )
+ WaitSlot( 5000 ) ' wait( 200 ) ' sleep 5
+ if ( Seitennummer.GetText <> CORRECT_PAGE_1 ) then
+ Warnlog "Something wrong when object is anchored to Character!"
+ endif
+ kontext "Navigator"
+ hCloseDialog( Navigator, "close" )
Call hCloseDocument
endcase