summaryrefslogtreecommitdiff
path: root/testautomation/chart2
diff options
context:
space:
mode:
Diffstat (limited to 'testautomation/chart2')
-rw-r--r--testautomation/chart2/optional/includes/ch2_datadialogue.inc12
-rw-r--r--[-rwxr-xr-x]testautomation/chart2/optional/includes/ch2_lvl1a.inc234
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/optional/includes/loadsave/ch2_losa.inc315
-rw-r--r--testautomation/chart2/optional/includes/loadsave/ch2_xml_format.inc74
-rwxr-xr-x[-rw-r--r--]testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard.inc2
-rw-r--r--testautomation/chart2/tools/ch_tools_common.inc179
6 files changed, 411 insertions, 405 deletions
diff --git a/testautomation/chart2/optional/includes/ch2_datadialogue.inc b/testautomation/chart2/optional/includes/ch2_datadialogue.inc
index e0db844353c1..fd7876057db5 100644
--- a/testautomation/chart2/optional/includes/ch2_datadialogue.inc
+++ b/testautomation/chart2/optional/includes/ch2_datadialogue.inc
@@ -45,12 +45,6 @@ testcase tChartDataDialogueButtons
Printlog " Insert a new Chart-object, via the Menu: 'Insert - Chart'."
InsertChart
WaitSlot()
- '/// Press 'TAB' once to select the object
- printlog " Press 'TAB' once to select the object."
- DocumentImpress.TypeKeys "<TAB>"
- '/// Click the button 'RETURN' / 'ENTER' to enter the Chart-Data-dialogue
- printlog " Click the button 'Return', to enter the Chart-Data-dialogue."
- DocumentImpress.TypeKeys "<RETURN>"
Kontext "DocumentChart"
'/// Open context menu
printlog "Open context menu"
@@ -230,12 +224,6 @@ testcase tChartDataDialogueFieldsUndo
printlog " Insert a new Chart-object, via the Menu: 'Insert - Chart'."
InsertChart
WaitSlot()
- '/// Press 'TAB' once to select the object
- printlog " Press 'TAB' once to select the object."
- DocumentImpress.TypeKeys "<TAB>"
- '/// Click the button 'RETURN' / 'ENTER' to enter the Chart-Data-dialogue
- printlog " Click the button 'Return', to enter the Chart-Data-dialogue."
- DocumentImpress.TypeKeys "<RETURN>"
Kontext "DocumentChart"
'/// Open context menu
printlog "Open context menu"
diff --git a/testautomation/chart2/optional/includes/ch2_lvl1a.inc b/testautomation/chart2/optional/includes/ch2_lvl1a.inc
index 5f72fd7e32f9..99ca5a985bc4 100755..100644
--- a/testautomation/chart2/optional/includes/ch2_lvl1a.inc
+++ b/testautomation/chart2/optional/includes/ch2_lvl1a.inc
@@ -40,109 +40,111 @@ end sub
testcase tPlotOptions
-
- Dim sOutputFile as string
- sOutputFile = convertpath(gOfficepath & "user\work\hiddenCells.ods")
- printlog "Load simple chart document"
- if fLoadVerySimpleChartAndSaveLocal() > 0 then
- warnlog "Loading test document seems to have failed -> Check this out!"
- goto endsub
- endif
- printlog "Select chart using navigator"
- if fSelectFirstOLE = -1 then
- warnlog "It was not possible to select the chart object!"
- Call hCloseDocument
- goto endsub
- endif
+ Dim sOutputFile as string
+ sOutputFile = convertpath(gOfficepath & "user\work\hiddenCells.ods")
- printlog "Edit / Object / Edit"
- EditObjectEdit
+ gApplication = "CALC"
- printlog "Select DataSeries A by toolbar selectorbox"
- Kontext "DocumentChart"
- call fChartSelectElement (8)
+ printlog "Load simple chart document"
+ if fLoadVerySimpleChartAndSaveLocal() > 0 then
+ warnlog "Loading test document seems to have failed -> Check this out!"
+ goto endsub
+ endif
+ printlog "Select chart using navigator"
+ if fSelectFirstOLE = -1 then
+ warnlog "It was not possible to select the chart object!"
+ Call hCloseDocument
+ goto endsub
+ endif
+
+ printlog "Edit / Object / Edit"
+ EditObjectEdit
+ waitslot()
+ printlog "Select DataSeries A by toolbar selectorbox"
+ Kontext "DocumentChart"
+ call fChartSelectElement (8)
+
+ printlog "Invoke Format::ObjectProperties"
+ Kontext "Toolbar"
+ FormatSelection.Click
- printlog "Invoke Format::ObjectProperties"
- Kontext "Toolbar"
- FormatSelection.Click
+ printlog "Select tab page Options"
+ Kontext
+ Active.SetPage TabDataSeriesOptions
+ Kontext "TabDataSeriesOptions"
+ printlog "activate checkbox 'Include values from hidden cells'"
+ try
+ IncludeHiddenCells.Check
+ catch
+ Warnlog "checkbox hidden or disabled"
+ Call hCloseDocument
+ goto endsub
+ endcatch
- printlog "Select tab page Options"
- Kontext
- Active.SetPage TabDataSeriesOptions
- Kontext "TabDataSeriesOptions"
- printlog "activate checkbox 'Include values from hidden cells'"
- try
- IncludeHiddenCells.Check
- catch
- Warnlog "checkbox hidden or disabled"
- Call hCloseDocument
- goto endsub
- endcatch
-
- printlog "Close and reopen data series dialog - checkbox should be still activated"
- TabDataSeriesOptions.Ok
- Kontext "DocumentChart"
- FormatSelection
- printlog "Select tab page Options"
- Kontext
- Active.SetPage TabDataSeriesOptions
- Kontext "TabDataSeriesOptions"
- if Not IncludeHiddenCells.IsChecked then
- Warnlog "After closing and reopening of Data-Series dialog the checkbox isn't checked anymore"
- TabDataSeriesOptions.Cancel
- Kontext "DocumentCalc"
- DocumentCalc.TypeKeys "<Escape>"
- call hCloseDocument
- goto endsub
- endif
+ printlog "Close and reopen data series dialog - checkbox should be still activated"
+ TabDataSeriesOptions.Ok
+ Kontext "DocumentChart"
+ FormatSelection
+ printlog "Select tab page Options"
+ Kontext
+ Active.SetPage TabDataSeriesOptions
+ Kontext "TabDataSeriesOptions"
+ if Not IncludeHiddenCells.IsChecked then
+ Warnlog "After closing and reopening of Data-Series dialog the checkbox isn't checked anymore"
+ TabDataSeriesOptions.Cancel
+ Kontext "DocumentCalc"
+ DocumentCalc.TypeKeys "<Escape>"
+ call hCloseDocument
+ goto endsub
+ endif
+
+ TabDataSeriesOptions.Ok
+
+ printlog "save and reopen file - checkbox still must be checked"
+ if NOT hFileSaveAsKill (sOutputFile) then
+ warnlog "Saving test document failed -> Aborting"
+ Kontext "DocumentCalc"
+ DocumentCalc.TypeKeys "<Escape>"
+ call hCloseDocument
+ goto endsub
+ endif
+ Call hCloseDocument
- TabDataSeriesOptions.Ok
-
- printlog "save and reopen file - checkbox still must be checked"
- if NOT hFileSaveAsKill (sOutputFile) then
- warnlog "Saving test document failed -> Aborting"
- Kontext "DocumentCalc"
- DocumentCalc.TypeKeys "<Escape>"
- call hCloseDocument
- goto endsub
- endif
- Call hCloseDocument
-
Call hFileOpen(sOutputFile)
- if fSelectFirstOLE = -1 then
- warnlog "It was not possible to select the chart object!"
- Call hCloseDocument
- goto endsub
- endif
+ if fSelectFirstOLE = -1 then
+ warnlog "It was not possible to select the chart object!"
+ Call hCloseDocument
+ goto endsub
+ endif
- EditObjectEdit
+ EditObjectEdit
+ waitslot()
+ printlog "Select DataSeries A by toolbar selectorbox"
+ call fChartSelectElement (8)
- printlog "Select DataSeries A by toolbar selectorbox"
- call fChartSelectElement (8)
+ printlog "Invoke Format::ObjectProperties"
+ Kontext "Toolbar"
+ FormatSelection.Click
+ Kontext
+ Active.SetPage TabDataSeriesOptions
+ Kontext "TabDataSeriesOptions"
+ if Not IncludeHiddenCells.IsChecked then
+ Warnlog "After closing and reopening of Data-Series dialog the checkbox isn't checked anymore"
+ TabDataSeriesOptions.Cancel
+ Kontext "DocumentCalc"
+ DocumentCalc.TypeKeys "<Escape>"
+ call hCloseDocument
+ goto endsub
+ endif
- printlog "Invoke Format::ObjectProperties"
- Kontext "Toolbar"
- FormatSelection.Click
- Kontext
- Active.SetPage TabDataSeriesOptions
- Kontext "TabDataSeriesOptions"
- if Not IncludeHiddenCells.IsChecked then
- Warnlog "After closing and reopening of Data-Series dialog the checkbox isn't checked anymore"
- TabDataSeriesOptions.Cancel
- Kontext "DocumentCalc"
- DocumentCalc.TypeKeys "<Escape>"
- call hCloseDocument
- goto endsub
- endif
-
- '/// Close dialog with Cancel-button
- TabDataSeriesOptions.Cancel
- '/// Close document
- Kontext "DocumentCalc"
- DocumentCalc.TypeKeys "<Escape>"
+ '/// Close dialog with Cancel-button
+ TabDataSeriesOptions.Cancel
+ '/// Close document
+ Kontext "DocumentCalc"
+ DocumentCalc.TypeKeys "<Escape>"
- Call hCloseDocument
+ Call hCloseDocument
endcase
'
@@ -150,14 +152,16 @@ endcase
'
testcase tChartShapes
- Dim sLocalFile as string
- Dim sLocalFileXLS as string
- Dim sFormatXLS as string
- sLocalFile = convertpath(gOfficepath & "user\work\chartshapes.ods")
- sLocalFileXLS = convertpath(gOfficepath & "user\work\chartshapes.xls")
- sFormatXLS = "MS Excel 97"
-
- printlog " Load simple chart document"
+ Dim sLocalFile as string
+ Dim sLocalFileXLS as string
+ Dim sFormatXLS as string
+ sLocalFile = convertpath(gOfficepath & "user\work\chartshapes.ods")
+ sLocalFileXLS = convertpath(gOfficepath & "user\work\chartshapes.xls")
+ sFormatXLS = "MS Excel 97"
+
+ gApplication = "CALC"
+
+ printlog " Load simple chart document"
if fLoadVerySimpleChartAndSaveLocal() > 0 then
warnlog "Loading test document seems to have failed -> Check this out!"
goto endsub
@@ -168,11 +172,11 @@ testcase tChartShapes
EditObjectEdit
printlog " Verify that the drawbar is visible"
Kontext "DrawBar"
-
+
qaerrorlog "#i107003# disabled because of bug in toolbars"
-' if Not DrawBar.Exists then
-' Call hToolbarSelect("Drawing", true)
-' endif
+ ' if Not DrawBar.Exists then
+ ' Call hToolbarSelect("Drawing", true)
+ ' endif
printlog " Insert a shape to the chart by <STRG-RETURN>"
Kontext "DocumentChart"
@@ -197,7 +201,7 @@ testcase tChartShapes
Kontext "DocumentCalc"
DocumentCalc.TypeKeys "<Escape>"
printlog "Select chart using navigator"
- call fSelectFirstOLE
+ call fSelectFirstOLE
printlog "Invoke Edit::Object::Edit to enter Inplace Mode"
EditObjectEdit
printlog " Check if shape is still there"
@@ -206,7 +210,7 @@ testcase tChartShapes
Sleep (1)
Kontext "Toolbar"
if ChartElementSelector.GetSelText <> "ChartShape1" then
- warnlog "Something is wrong with the shape"
+ warnlog "Something is wrong with the shape"
endif
printlog " Leave Chart"
Kontext "DocumentCalc"
@@ -219,12 +223,12 @@ testcase tChartShapes
call hCloseDocument
goto endsub
end if
- printlog " Close document"
+ printlog " Close document"
call hCloseDocument
printlog " Open document"
call hFileOpen ( sLocalFile )
- printlog "Select chart using navigator"
- call fSelectFirstOLE
+ printlog "Select chart using navigator"
+ call fSelectFirstOLE
printlog "Invoke Edit::Object::Edit to enter Inplace Mode"
EditObjectEdit
printlog " Check if shape is still there"
@@ -233,16 +237,16 @@ testcase tChartShapes
Sleep (1)
Kontext "Toolbar"
if ChartElementSelector.GetSelText <> "ChartShape1" then
- warnlog "Something is wrong with the shape"
+ warnlog "Something is wrong with the shape"
endif
printlog " Leave Chart"
Kontext "DocumentCalc"
DocumentCalc.TypeKeys "<Escape>"
printlog " Close document"
Call hCloseDocument
- call hFileOpen ( sLocalFileXLS )
- printlog "Select chart using navigator"
- call fSelectFirstOLE
+ call hFileOpen ( sLocalFileXLS )
+ printlog "Select chart using navigator"
+ call fSelectFirstOLE
printlog "Invoke Edit::Object::Edit to enter Inplace Mode"
EditObjectEdit
printlog " Check if shape is still there"
@@ -251,12 +255,12 @@ testcase tChartShapes
Sleep (1)
Kontext "Toolbar"
if ChartElementSelector.GetSelText <> "ChartShape1" then
- warnlog "Something is wrong with the shape"
+ warnlog "Something is wrong with the shape"
endif
printlog " Leave Chart"
Kontext "DocumentCalc"
DocumentCalc.TypeKeys "<Escape>"
printlog " Close document"
Call hCloseDocument
-
+
endcase
diff --git a/testautomation/chart2/optional/includes/loadsave/ch2_losa.inc b/testautomation/chart2/optional/includes/loadsave/ch2_losa.inc
index c2cb96636557..34b84e85250e 100644..100755
--- a/testautomation/chart2/optional/includes/loadsave/ch2_losa.inc
+++ b/testautomation/chart2/optional/includes/loadsave/ch2_losa.inc
@@ -23,192 +23,197 @@
' <http://www.openoffice.org/license.html>
' for a copy of the LGPLv3 License.
'
-'/************************************************************************
+'/******************************************************************************
'*
'* owner : oliver.craemer@sun.com
'*
'* short description : Load file of one Spreadsheet format and save to another
'*
-'************************************************************************
-'*
-' #1 subLoSaFromTo ' Initial routine
-' #1 tLoadSaveFromTo
-'*
-'\************************************************************************
+'\******************************************************************************
sub subLoSaFromTo
- Dim sSourcePath as STRING
- Dim lsInputFileList ( 500 ) as STRING
- Dim iFilesInList as INTEGER
- Dim sCurrentFileInList as STRING
- Dim iMainIndex as INTEGER
-
+
+ dim sSourcePath as string
+ dim lsInputFileList ( 500 ) as string
+ dim iFilesInList as integer
+ dim sCurrentFileInList as string
+ dim iMainIndex as integer
+
+ dim cRelativePath as string
+ cRelativePath = "chart2\optional\input\" & gsDirectoryInSourcePath &"\"
+
'///<u><b>Load/Save files with charts</b></u>
printLog Chr(13) + "--------- Save with filter: " & gsFileFormat & " ----------"
- sSourcePath = convertPath ( gtesttoolpath & "chart2\optional\input\" & gsDirectoryInSourcePath &"\" )
+ sSourcePath = convertPath ( gtesttoolpath & cRelativePath )
+
'///+<ul><li>Determine list of files to test (All files in 'chart2\loadsave\input\<gsDirectoryInSourcePath>\')</li>
- Call GetAllFileList( sSourcePath , "*." & gsDirectoryInSourcePath , lsInputFileList() )
- '///+<li>Determine number of files found</li>
- iFilesInList = cInt( lsInputFileList(0) )
+ GetAllFileList( sSourcePath , "*." & gsDirectoryInSourcePath , lsInputFileList() )
+ iFilesInList = ListCount( lsInputFileList() )
'///+<li>Run testcase 'tLoadSaveFromTo' for each file in list</li></ul>
for iMainIndex = 2 to iFilesInList
+
sCurrentFileInList = lsInputFileList( iMainIndex )
printlog "* * * * * * *"
printlog "Loop " & ( iMainIndex - 1 ) & " of " & ( iFilesInList - 1 )
printlog "Test document: " & sCurrentFileInList
call tLoadSaveFromTo ( sCurrentFileInList )
+
next iMainIndex
-End Sub
-
-'*******************************************************************
-
-testcase tLoadSaveFromTo ( sCurrentFile as STRING )
- Dim sCurrentFileLength as INTEGER
- Dim iCurrentPostionInFileName as INTEGER
- Dim iLastPathSignePositon as INTEGER
- Dim sExtractedFileName as STRING
- Dim sExtractedExtension as STRING
- Dim sTemporaryFile as STRING
- Dim sOutputFile as STRING
- Dim iIndex as INTEGER
-
- '///<u><b>Load file - SaveAs... - Close - Relaod</b></u>
+
+end sub
+
+'*******************************************************************************
+
+function hLoSaEscape() as boolean
+
+ ' Fine grained function to send Escape-keystroke to a spreadsheet document
+
+ const MAX_TRIES = 12
+ dim iTry as integer
+
+ for iTry = 1 to MAX_TRIES
+
+ wait( 250 )
+
+ Kontext "DocumentCalc"
+ try
+ DocumentCalc.TypeKeys( "<ESCAPE>" )
+ hLoSaEscape() = true
+ exit for
+ catch
+ if ( iTry = MAX_TRIES ) then
+ warnlog( "hLoSaEscape(): Sending <ESCAPE> to document failed." )
+ hLoSaEscape() = false
+ endif
+ endcatch
+
+ next iTry
+
+end function
+
+'*******************************************************************************
+
+function hLoSaInplaceEditing() as boolean
+
+ ' Enter in-place editing mode
+
+ const RC_TIMEOUT = -1
+
+ Kontext "DocumentCalc"
+ printlog( "Enable in-place editing by slot <EditObjectEdit>" )
+ if ( hUseAsyncSlot( "EditObjectEdit" ) <> RC_TIMEOUT ) then
+
+ printlog( "Clicked menuitem: Format->Charttype" )
+ if ( hUseAsyncSlot( "FormatChartType" ) <> RC_TIMEOUT ) then
+
+ Kontext "ChartType"
+ if ChartType.exists(2) then
+
+ printlog( "Chart type dialog open, Chart object was found." )
+ Kontext "ChartType"
+ if ( hCloseDialog( ChartType, "cancel" ) ) then
+ printlog( "Chart type dialog closed successfully" )
+ hLoSaInplaceEditing() = true
+ else
+ warnlog( "hLoSaInplaceEditing(): Failed to close dialog <ChartType>" )
+ hLoSaInplaceEditing() = false
+ endif
+ else
+ warnlog( "hLoSaInplaceEditing(): Chart type dialog not open, please check the Chart object" )
+ hLoSaInplaceEditing() = false
+ endif
+
+ else
+ warnlog( "hLoSaInplaceEditing(): Failed to execute slot <FormatChartType>" )
+ hLoSaInplaceEditing() = false
+ endif
+ else
+ warnlog( "hLoSaInplaceEditing(): Failed to execute slot <EditObjectEdit>" )
+ hLoSaInplaceEditing() = false
+ endif
+
+end function
+
+'*******************************************************************************
+
+testcase tLoadSaveFromTo ( sCurrentFile as string )
+
+ printlog( "Load/Save files containing Chart OLE objects in multiple file-formats" )
+
+ dim sCurrentFileLength as integer
+ dim iCurrentPostionInFileName as integer
+ dim iLastPathSignePositon as integer : iLastPathSignePositon = 0
+ dim sExtractedFileName as string
+ dim sExtractedExtension as string
+ dim sTemporaryFile as string
+ dim sOutputFile as string
+ dim iIndex as integer
+
sCurrentFileLength = len ( sCurrentFile )
- iCurrentPostionInFileName = 0
- iLastPathSignePositon = 0
+
'Remove path and extension from file name
- DO
+ do
iCurrentPostionInFileName = instr ( iCurrentPostionInFileName + 1 , sCurrentFile , gPathSigne )
if iCurrentPostionInFileName = 0 then
- Exit DO
+ exit do
endif
iLastPathSignePositon = iCurrentPostionInFileName
- LOOP
+ loop
+
sExtractedFileName = right ( sCurrentFile , sCurrentFileLength - iLastPathSignePositon )
sCurrentFileLength = len ( sExtractedFileName )
- sExtractedExtension = right ( sExtractedFileName , 4 )
+ sExtractedExtension = right ( sExtractedFileName , 4 )
sExtractedFileName = left ( sExtractedFileName , sCurrentFileLength - 4 )
sTemporaryFile = ( gOfficePath & ConvertPath("user\work\TemporaryFileToAvoidLocking" ) )
- sOutputFile = ( gOfficePath & ConvertPath("user\work\") & sExtractedFileName & "_" & gsDirectoryInSourcePath & "_to" & gsOutputFileCustomExtension )
- '///+<ul><li>Open test document</li>
- try
- call hFileOpen(sCurrentFile)
- catch
- warnlog "Serious Problem occured while loading the input file -> Quit"
+ sOutputFile = ( gOfficePath & ConvertPath("user\work\" & sExtractedFileName & "_" & gsDirectoryInSourcePath & "_to" & gsOutputFileCustomExtension ) )
+
+ printlog( "Open file: " & sCurrentFile )
+ if ( not hFileOpen( sCurrentFile ) ) then
+ warnlog( "Unable to read file" )
goto endsub
- endcatch
-
- '///+<li>Save file localy to avoid locking issues</li>
- if hFileSaveAsKill ( sTemporaryFile & sExtractedExtension ) then
- printlog ">> OK, successfully saved the test document localy!"
- else
- warnlog "Saving the testdocument localy in source format failed!"
- endif
- sleep (2)
-
- '///+<li>Check existence of chart in file using following steps</li>
- '///+<li>1. Select Chart</li>
- printlog ">> Check if chart exist after loading file"
- call fSelectFirstOLE
-
- Kontext "DocumentCalc"
- try
- '///+<li>2. Invoke 'Edit::Object::Edit' to enter inplace mode</li>
- EditObjectEdit
- sleep(2)
- '///+<li>3. Invoke Chart Type</li>
- FormatChartType
- '///+<li>4. Check if Chart Type came up</li>
- Kontext "ChartType"
- if ChartType.exists(2) then
- printlog ">> OK, found a Chart object after loading the file."
- else
- warnlog "Chart Type did not appear -> Check this out!"
- endif
- '///+<li>5. Close Chart Type</li>
- Kontext "ChartType"
- ChartType.Cancel
- catch
- warnlog "Chart does not exist in file or a serious problem occured -> Check this out!"
- endcatch
- sleep(3)
-
- '///+<li>Hit 'ESCAPE' key to leave inplace mode</li>
- Kontext "DocumentCalc"
- try
- DocumentCalc.TypeKeys "<ESCAPE>"
- catch
- warnlog "CRASH???"
- goto endsub
- endcatch
-
- '///+<li>Save file using ODS format</li>
- printlog "Save file as " & sOutputFile
- try
- if hFileSaveAsWithFilter ( sOutputFile , gsFileFormat ) then
- printlog ">> OK, successfully saved the test document!"
- else
- warnlog "Saving the testdocument failed!"
- endif
- catch
- warnlog "A serious problem occured while saving file to target format -> Check this out!"
- goto endsub
- endcatch
- sleep(2)
-
- '///+<li>Close document</li>
- printlog "Closing test document"
- call hCloseDocument
- sleep(5)
-
- '///+<li>Open document again</li>
- printlog "Reloading saved document"
- try
- call hFileOpen(sOutputFile)
- catch
- warnlog "Serious Problem occured while reloading the output file -> Quit"
+ endif
+
+ printlog( "Save file locally, overwriting existing" )
+ if ( not hFileSaveAsKill( sTemporaryFile & sExtractedExtension ) ) then
+ warnlog( "Unable to save file locally" )
goto endsub
- endcatch
- sleep(2)
-
- '///+<li>Check existence of chart after saving to target format in file using following steps</li>
- '///+<li>1. Select Chart</li>
- printlog ">> Check if chart exist after saving file to target format"
- call fSelectFirstOLE
-
- Kontext "DocumentCalc"
- try
- '///+<li>2. Invoke 'Edit::Object::Edit' to enter inplace mode</li>
- EditObjectEdit
- '///+<li>3. Invoke Chart Type</li>
- FormatChartType
- '///+<li>4. Check if Chart Type came up</li>
- Kontext "ChartType"
- if ChartType.exists(2) then
- printlog ">> OK, found a Chart object after saving the file to target format."
- else
- warnlog "Chart Type did not appear after saving the file to target format -> Check this out!"
- endif
- '///+<li>5. Close Chart Type</li>
- Kontext "ChartType"
- ChartType.Cancel
- catch
- warnlog "Chart does not exist in file or a serious problem occured after saving the file to target format -> Check this out!"
- endcatch
- sleep(3)
+ endif
- '///+<li>Hit 'ESCAPE' key to leave inplace mode</li>
- Kontext "DocumentCalc"
- try
- DocumentCalc.TypeKeys "<ESCAPE>"
- catch
- warnlog "CRASH???"
- goto endsub
- endcatch
+ printlog( "Select the first OLE object via Navigator" )
+ call fSelectFirstOLE
+
+ printlog( "Enter in-place editing mode" )
+ hLoSaInplaceEditing()
+
+ printlog( "Type <Escape> to exit in-place editing mode" )
+ hLoSaEscape()
+
+ printlog( "Save file as " & sOutputFile & " using filter: " & gsFileFormat )
+ if ( not hFileSaveAsWithFilterKill ( sOutputFile , gsFileFormat ) ) then
+ warnlog( "Saving the document failed using filter: " & gsFileFormat )
+ goto endsub
+ endif
+
+ printlog( "Close the document" )
+ hCloseDocument()
- '///+<li>Close document</li>
- printlog "Closing test document"
- call hCloseDocument
- '///+<li>END</li></ul>
+ printlog( "Reload document" )
+ if ( not hFileOpen(sOutputFile) ) then
+ warnlog( "Failed to reload document" )
+ goto endsub
+ endif
+
+ printlog( "Select the first (and only) OLE object" )
+ call fSelectFirstOLE
+
+ printlog( "Enter in-place editing mode" )
+ hLoSaInplaceEditing()
+
+ printlog( "Type <Escape> to exit in-place editing mode" )
+ hLoSaEscape()
+
+ printlog( "Close the document" )
+ call hCloseDocument()
+
endcase
diff --git a/testautomation/chart2/optional/includes/loadsave/ch2_xml_format.inc b/testautomation/chart2/optional/includes/loadsave/ch2_xml_format.inc
index 515d9fe55ca6..0cf868bacaaf 100644
--- a/testautomation/chart2/optional/includes/loadsave/ch2_xml_format.inc
+++ b/testautomation/chart2/optional/includes/loadsave/ch2_xml_format.inc
@@ -37,17 +37,17 @@
'\***********************************************************************
testcase tCompareXMLFormatCreate
-'///+ Test purpose: Verify within three characteristics that there is really a chart
+ '///+ Test purpose: Verify within three characteristics that there is really a chart
dim sOutputFile as string
dim sUnpackedStorageDir as string
dim sChartContentXML as string
-
+
gApplication = "WRITER"
sOutputFile = convertpath(gOfficepath & "user\work\Chart2_XML.odt")
sUnpackedStorageDir = (gOfficePath & ConvertPath("user\work\chart2_XML2"))
sChartContentXML = (gOfficePath & ConvertPath("user\work\chart2_XML2") & ConvertPath("\Object 1\content.xml"))
-
+
'/// File / New / Text
printlog " Open new Writer document"
call hNewDocument
@@ -62,25 +62,25 @@ testcase tCompareXMLFormatCreate
goto endsub
else
printlog "File saved successfully."
- endif
+ endif
'/// File / Close
call hCloseDocument
sleep(3)
- printlog "File closed"
- '/// Uncompress with <i>unzip</i> or <i>jar</i> the
+ printlog "File closed"
+ '/// Uncompress with <i>unzip</i> or <i>jar</i> the
'///+ <i>gOfficepath</i>/user/work/verySimpleChart.ods document
'///+ into <i>gOfficePath</i>/user/work/chart2_XML-directory
printlog "Unpack storage of test document."
UnpackStorage(sOutputFile, sUnpackedStorageDir)
- printlog "Read the test documents DOM."
+ printlog "Read the test documents DOM."
'/// Load the XML file <i>gOfficePath</i>/user/work/chart2_XML/Object 1/content.xml
'///+ in an XML editor
- SAXReadFile(sChartContentXML)
+ SAXReadFile(sChartContentXML)
printlog "Set the DOM pointer to document root"
printlog "|-/"
SAXSeekElement("/")
printlog " |-office:document-content"
- '/// Open the element 'office:document-content'
+ '/// Open the element 'office:document-content'
SAXSeekElement("office:document-content")
printlog " |-office:body"
'/// Open the element 'office:body'
@@ -96,9 +96,9 @@ testcase tCompareXMLFormatCreate
'///+ passed.
if SAXGetAttributeValue("chart:class") = "chart:bar" then
printlog "This is a bar chart as expected"
- else
+ else
warnlog "This is no bar chart, it is a " & SaxGetAttributeValue("chart:class")
- endif
+ endif
printlog "Seek for chart:plot-area"
printlog " |-chart:plot-area"
'/// Open the element 'chart:plot-area'
@@ -107,9 +107,9 @@ testcase tCompareXMLFormatCreate
'///+ the second characteristics validation has been passed.
if SAXGetAttributeValue("chart:data-source-has-labels") = "both" then
printlog "The label attribute for chart:plot-area is correct"
- else
+ else
warnlog "The lable attribute is not both, it is " & SaxGetAttributeValue("chart:data-source-has-labels")
- endif
+ endif
printlog "Seek for chart:series"
printlog " |-chart:series"
'/// Open the element 'chart:series'
@@ -118,51 +118,51 @@ testcase tCompareXMLFormatCreate
'///+ the hird characteristics validation has been passed.
if SAXGetAttributeValue("chart:values-cell-range-address") = "local-table.$B$2:.$B$5" then
printlog "The cell range for chart:series is correct"
- else
+ else
warnlog "The cell range is not local-table.$B$2:.$B$5, it is " & SaxGetAttributeValue("chart:values-cell-range-address")
endif
- ' DEBUG: printlog "I'm here: " & SAXGetElementName
+ ' DEBUG: printlog "I'm here: " & SAXGetElementName
'/// Close the XML editor.
- SAXRelease
+ SAXRelease
endcase
'
'--------------------------------------------------------------------
'
testcase tCompareXMLFormatLoad
-'///+ Test purpose: Verify within three characteristics that there is really a chart
+ '///+ Test purpose: Verify within three characteristics that there is really a chart
dim sOutputFile as string
dim sUnpackedStorageDir as string
dim sChartContentXML as string
-
+
gApplication = "CALC"
sOutputFile = convertpath(gOfficepath & "user\work\verySimpleChart.ods")
sUnpackedStorageDir = (gOfficePath & ConvertPath("user\work\chart2_XML"))
sChartContentXML = (gOfficePath & ConvertPath("user\work\chart2_XML") & ConvertPath("\Object 1\content.xml"))
-
+
'/// File / Open / <i>gTestToolPath</i>/chart2/update/input/verySimpleChart.ods
- '/// File / Save As / <i>gOfficepath</i>/user/work/verySimpleChart.ods
+ '/// File / Save As / <i>gOfficepath</i>/user/work/verySimpleChart.ods
if fLoadVerySimpleChartAndSaveLocal() > 0 then
warnlog "Loading test document failed!"
goto endsub
else
printlog "Test document has successfully been loaded."
endif
-
+
'/// Select the chart object using the navigator
printlog "Select chart using navigator"
if fSelectFirstOLE = 0 then
printlog "Chart is selected"
- else
+ else
warnlog "Chart could not be selected"
call hCloseDocument
goto endsub
endif
-
+
'/// Activate chart with Edit / Object / Edit
printlog "Activate chart by Edit / Object / Edit"
EditObjectEdit
-
+
'Save document localy
Kontext "DocumentCalc"
'/// Press twice <ESCAPE> to leave the chart object
@@ -178,25 +178,25 @@ testcase tCompareXMLFormatLoad
goto endsub
else
printlog "File with very simple chart saved successfully."
- endif
+ endif
'/// File / Close
call hCloseDocument
sleep(3)
- printlog "File with very simple chart closed"
- '/// Uncompress with <i>unzip</i> or <i>jar</i> the
+ printlog "File with very simple chart closed"
+ '/// Uncompress with <i>unzip</i> or <i>jar</i> the
'///+ <i>gOfficepath</i>/user/work/verySimpleChart.ods document
'///+ into <i>gOfficePath</i>/user/work/chart2_XML-directory
printlog "Unpack storage of test document."
UnpackStorage(sOutputFile, sUnpackedStorageDir)
- printlog "Read the test documents DOM."
+ printlog "Read the test documents DOM."
'/// Load the XML file <i>gOfficePath</i>/user/work/chart2_XML/Object 1/content.xml
'///+ in an XML editor
- SAXReadFile(sChartContentXML)
+ SAXReadFile(sChartContentXML)
printlog "Set the DOM pointer to document root"
printlog "|-/"
SAXSeekElement("/")
printlog " |-office:document-content"
- '/// Open the element 'office:document-content'
+ '/// Open the element 'office:document-content'
SAXSeekElement("office:document-content")
printlog " |-office:body"
'/// Open the element 'office:body'
@@ -212,9 +212,9 @@ testcase tCompareXMLFormatLoad
'///+ passed.
if SAXGetAttributeValue("chart:class") = "chart:bar" then
printlog "This is a bar chart as expected"
- else
+ else
warnlog "This is no bar chart, it is a " & SaxGetAttributeValue("chart:class")
- endif
+ endif
printlog "Seek for chart:plot-area"
printlog " |-chart:plot-area"
'/// Open the element 'chart:plot-area'
@@ -223,9 +223,9 @@ testcase tCompareXMLFormatLoad
'///+ the second characteristics validation has been passed.
if SAXGetAttributeValue("table:cell-range-address") = "Sheet1.A1:B2" then
printlog "The cell range for chart:plot-area is correct"
- else
+ else
warnlog "#i100780#: The cell range is not Sheet1.A1:B2, it is " & SaxGetAttributeValue("table:cell-range-address")
- endif
+ endif
printlog "Seek for chart:series"
printlog " |-chart:series"
'/// Open the element 'chart:series'
@@ -234,10 +234,10 @@ testcase tCompareXMLFormatLoad
'///+ the hird characteristics validation has been passed.
if SAXGetAttributeValue("chart:values-cell-range-address") = "Sheet1.A1:A2" then
printlog "The cell range for chart:series is correct"
- else
+ else
warnlog "#i100780#: The cell range is not Sheet1.A1:A2, it is " & SaxGetAttributeValue("chart:values-cell-range-address")
endif
- ' DEBUG: printlog "I'm here: " & SAXGetElementName
+ ' DEBUG: printlog "I'm here: " & SAXGetElementName
'/// Close the XML editor.
- SAXRelease
+ SAXRelease
endcase
diff --git a/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard.inc b/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard.inc
index 10ba7eb017e1..6bcf3399796d 100644..100755
--- a/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard.inc
+++ b/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard.inc
@@ -199,7 +199,7 @@ testcase tCreateNew3DChart
endif
printlog "Check that 3D look is 'simple' (=default)"
if Scheme3D.GetSelIndex <> 1 then
- warnlog "Default 3D Look ('simple') has not been preserved after save and reload."
+ warnlog "#i112522# - Default 3D Look ('simple') has not been preserved after save and reload."
endif
printlog "Check that 3D shape 'cone' is selected"
if BarColumnShape.GetSelIndex <> 3 Then
diff --git a/testautomation/chart2/tools/ch_tools_common.inc b/testautomation/chart2/tools/ch_tools_common.inc
index 311e8c354f74..2a8664109e19 100644
--- a/testautomation/chart2/tools/ch_tools_common.inc
+++ b/testautomation/chart2/tools/ch_tools_common.inc
@@ -29,83 +29,92 @@
'*
'* short description : Chart2 Tool library
'*
-'**************************************************************************************************
-'*
-' #1 fInsertOLE ' User Insert / Object / OLE to insert a chart
-' #1 fLoadVerySimpleChart ' Load file with a very simple chart
-' #1 fLoadVerySimpleChartAndSaveLocal ' Load file with a very simple chart and save it loacally
-' #1 fConvertChartTo3D ' Function to invoke the 'Insert::Titles...' dialog
-' #1 fOpenTestDocumentAndSelectDataRange ' Opens a test document and executes FormatDataRange
-' #1 fOpenTestDocumentAndInsertChart ' Opens a test document and selects a data range at a specific position
-'*
'\************************************************************************************************
-sub fInsertOLE as BOOLEAN
-'Insert Chart OLE in Document
- 'Get localised OLE names
- call GetOleDefaultNames()
- fInsertOLE = FALSE
+sub fInsertOLE() as boolean
+
+ ' Insert an OLE object (the name is localized)
+ call GetOleDefaultNames()
+
'/// Insert / Object / OLE
InsertObjectOLEObject
- sleep(1)
+
Kontext "OLEObjektEinfuegen"
- '/// Check if list box is not empty
- if Objekttyp.getItemcount < 1 then
- warnlog "There are no OLE-Objects in the listbox"
+ if ( OLEObjektEinfuegen.exists( 1 ) ) then
+
+ if ( Objekttyp.getItemcount() = 0 ) then
+
+ warnlog( "fInsertOLE(): There are no OLE-Objects in the <Objekttyp> listbox" )
+ OLEObjektEinfuegen.cancel()
+ fInsertOLE() = false
+
+ else
+
+ try
+ Objekttyp.Select gOLEChart
+ OLEObjektEinfuegen.ok()
+ sleep( 2 )
+ fInsertOLE() = true
+ catch
+ warnlog( "fInsertOLE(): Invalid OLE Object selected: " & gOLEChart )
+ OLEObjektEinfuegen.cancel()
+ fInsertOLE() = false
+ endcatch
+
+ endif
+
+ else
+ warnlog( "fInsertOLE(): Failed to open <Insert OLE object> dialog" )
+ fInsertOLE() = false
endif
- '/// Select chart in listbox
- Objekttyp.Select gOLEChart
- '/// Quit dialog using OK
- OLEObjektEinfuegen.OK
- sleep(2)
- fInsertOLE = TRUE
+
end sub
'
'--------------------------------------------------------------------
'
function fLoadVerySimpleChart() as INTEGER
- fLoadVerySimpleChart = 99
-'Load file with a very simple chart
-'No Input
-'Returns error-code:
-'+ 0 := Sucess
-'+ 1 := Serious problem trying to load the document
-'+99 := Unexpected error
+ fLoadVerySimpleChart = 99
+ 'Load file with a very simple chart
+ 'No Input
+ 'Returns error-code:
+ '+ 0 := Sucess
+ '+ 1 := Serious problem trying to load the document
+ '+99 := Unexpected error
- dim sInputFile as string
- sInputFile = convertpath( gtesttoolpath & "chart2/required/input/verySimpleChart.ods" )
- '/// Load file <i>gTesttoolpath</i>/chart2/required/input/verySimpleChart.ods
- try
- call hFileOpen ( sInputFile )
- printlog "File with very simple chart loaded"
- fLoadVerySimpleChart = 0
- catch
- qaErrorLog "Loading file with very simple chart seems to fail"
- fLoadVerySimpleChart = 1
- endcatch
+ dim sInputFile as string
+ sInputFile = convertpath( gtesttoolpath & "chart2/required/input/verySimpleChart.ods" )
+ '/// Load file <i>gTesttoolpath</i>/chart2/required/input/verySimpleChart.ods
+ try
+ call hFileOpen ( sInputFile )
+ printlog "File with very simple chart loaded"
+ fLoadVerySimpleChart = 0
+ catch
+ qaErrorLog "Loading file with very simple chart seems to fail"
+ fLoadVerySimpleChart = 1
+ endcatch
end function
'
'--------------------------------------------------------------------
'
function fLoadVerySimpleChartAndSaveLocal() as INTEGER
- fLoadVerySimpleChartAndSaveLocal = 99
-'Load file with a very simple chart and save it loacally
-'No Input
-'Returns error-code:
-'+ 0 := Sucess
-'+ 1 := Serious problem trying to load the document
-'+ 2 := Serious problem trying to save the document
+ fLoadVerySimpleChartAndSaveLocal = 99
+ 'Load file with a very simple chart and save it loacally
+ 'No Input
+ 'Returns error-code:
+ '+ 0 := Sucess
+ '+ 1 := Serious problem trying to load the document
+ '+ 2 := Serious problem trying to save the document
dim iCheckIsFileLoaded as INTEGER
dim sOutputFile as STRING
- sOutputFile = convertpath( gOfficepath & "user/work/verySimpleChart.ods" )
+ sOutputFile = convertpath( gOfficepath & "user/work/verySimpleChart.ods" )
iCheckIsFileLoaded = fLoadVerySimpleChart()
if iCheckIsFileLoaded > 0 then
'When loading fails pass error code to current function
fLoadVerySimpleChartAndSaveLocal = iCheckIsFileLoaded
exit function
else
- printlog "File with very simple chart loaded successfully."
+ printlog "File with very simple chart loaded successfully."
endif
'/// Save document local
Kontext "DocumentCalc"
@@ -125,28 +134,28 @@ end function
'--------------------------------------------------------------------
'
function fConvertChartTo3D() as BOOLEAN
- fConvertChartTo3D = FALSE
-'Function to invoke the 'Insert::Titles...' dialog
-'No Input
-'Returns TRUE on success
+ fConvertChartTo3D = FALSE
+ 'Function to invoke the 'Insert::Titles...' dialog
+ 'No Input
+ 'Returns TRUE on success
- '/// Invoke Format::Chart Type...
- if fInvokeChartTypeDialog() > 0 then
- warnlog "Invoking 'Format::Chart Type...' seems to cause an Error"
- exit function
- endif
- '/// Check 3D box
- if fSetChartType3D ( TRUE ) = 0 then
- fConvertChartTo3D = TRUE
- else
- warnlog "Converting chart to 3D seems to cause an Error"
- exit function
- endif
- '/// Close Chart Type dialog with OK
- if fCloseChartTypeDialogOK() > 0 then
- warnlog "Closing Chart Type dialog seems to cause an Error"
- fConvertChartTo3D = FALSE
- endif
+ '/// Invoke Format::Chart Type...
+ if fInvokeChartTypeDialog() > 0 then
+ warnlog "Invoking 'Format::Chart Type...' seems to cause an Error"
+ exit function
+ endif
+ '/// Check 3D box
+ if fSetChartType3D ( TRUE ) = 0 then
+ fConvertChartTo3D = TRUE
+ else
+ warnlog "Converting chart to 3D seems to cause an Error"
+ exit function
+ endif
+ '/// Close Chart Type dialog with OK
+ if fCloseChartTypeDialogOK() > 0 then
+ warnlog "Closing Chart Type dialog seems to cause an Error"
+ fConvertChartTo3D = FALSE
+ endif
end function
'
'-------------------------------------------------------------------------
@@ -155,13 +164,13 @@ function fOpenTestDocumentAndSelectDataRange(sInputFile as string) as BOOLEAN
fOpenTestDocumentAndSelectDataRange = FALSE
call hFileOpen(sInputFile)
sleep(2)
- Call sMakeReadOnlyDocumentEditable()
+ Call sMakeReadOnlyDocumentEditable()
'/// Select chart using navigator
printlog "Select chart using navigator"
- call fSelectFirstOLE
+ call fSelectFirstOLE
'/// Edit / Object / Edit
printlog "Edit / Object / Edit"
- EditObjectEdit
+ EditObjectEdit
'///Open FORMAT / DATA RANGES
printlog "Open FORMAT / DATA RANGES"
FormatDataRanges
@@ -172,9 +181,9 @@ function fOpenTestDocumentAndSelectDataRange(sInputFile as string) as BOOLEAN
'Switching tabpages as workaround for #i77237#
Active.SetPage TabChartTypeDataSeries
QAErrorLog "#i77237#-Testtool can't access OK after switching tabpage"
- Active.SetPage TabChartTypeDataRange
+ Active.SetPage TabChartTypeDataRange
Kontext "TabChartTypeDataRange"
- call DialogTest ( TabChartTypeDataRange )
+ call DialogTest ( TabChartTypeDataRange )
fOpenTestDocumentAndSelectDataRange = TRUE
end function
'
@@ -184,20 +193,20 @@ function fOpenTestDocumentAndInsertChart(sInputFile as string) as BOOLEAN
fOpenTestDocumentAndInsertChart = FALSE
call hFileOpen(sInputFile)
sleep(2)
- Call sMakeReadOnlyDocumentEditable()
- Kontext "DocumentCalc"
- printlog "Type <STRG+HOME>"
- DocumentCalc.TypeKeys "<MOD1 HOME>"
+ Call sMakeReadOnlyDocumentEditable()
+ Kontext "DocumentCalc"
+ printlog "Type <STRG+HOME>"
+ DocumentCalc.TypeKeys "<MOD1 HOME>"
printlog "Type twice <RIGHT> cursor key"
- DocumentCalc.TypeKeys "<RIGHT>" , 2
+ DocumentCalc.TypeKeys "<RIGHT>" , 2
printlog "Type thrice <DOWN> cursor key"
- DocumentCalc.TypeKeys "<DOWN>" , 3
- printlog "Menu Insert chart to open chart wizard"
+ DocumentCalc.TypeKeys "<DOWN>" , 3
+ printlog "Menu Insert chart to open chart wizard"
InsertChart
try
WaitSlot()
fOpenTestDocumentAndInsertChart = TRUE
- catch
+ catch
fOpenTestDocumentAndInsertChart = FALSE
endcatch
end function