summaryrefslogtreecommitdiff
path: root/testautomation/extensions/optional/includes
diff options
context:
space:
mode:
Diffstat (limited to 'testautomation/extensions/optional/includes')
-rwxr-xr-xtestautomation/extensions/optional/includes/display_name.inc113
-rw-r--r--testautomation/extensions/optional/includes/e_taskpane.inc74
-rwxr-xr-xtestautomation/extensions/optional/includes/extensions.inc684
-rwxr-xr-xtestautomation/extensions/optional/includes/fileopen.inc103
-rwxr-xr-xtestautomation/extensions/optional/includes/help.inc213
-rwxr-xr-xtestautomation/extensions/optional/includes/identifiers.inc120
-rwxr-xr-xtestautomation/extensions/optional/includes/issue110083.inc79
-rwxr-xr-xtestautomation/extensions/optional/includes/location.inc133
-rwxr-xr-xtestautomation/extensions/optional/includes/meta-inf.inc83
-rwxr-xr-xtestautomation/extensions/optional/includes/online_update.inc114
-rwxr-xr-xtestautomation/extensions/optional/includes/options.inc172
-rw-r--r--testautomation/extensions/optional/includes/platforms.inc126
-rwxr-xr-xtestautomation/extensions/optional/includes/publisher.inc286
13 files changed, 2300 insertions, 0 deletions
diff --git a/testautomation/extensions/optional/includes/display_name.inc b/testautomation/extensions/optional/includes/display_name.inc
new file mode 100755
index 000000000000..080c22fa3a98
--- /dev/null
+++ b/testautomation/extensions/optional/includes/display_name.inc
@@ -0,0 +1,113 @@
+'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@oracle.com
+'*
+'* short description : Extension display names
+'*
+'\******************************************************************************
+
+testcase tExtensionDisplayName
+
+ if ( gISOLang <> "en-US" ) then
+ qaerrorlog( "Test is not locale-safe, en-US only" )
+ goto endsub
+ endif
+
+ '///<h1>Extension display names</h1>
+ '///<u><pre>Synopsis</pre></u>Since CWS jl76 a possibility exists to give an extension a name which
+ '///+ differs from the filename to be displayed in the extension manager.<br>
+ '///<u><pre>Specification</pre></u>http://specs.openoffice.org/appwide/packagemanager/packagemanager_gui_spec.sxw<br>
+ '///<u><pre>Files used</pre></u>gTesttoolPath/extensions/features/input/display_name/*.oxt
+
+ const EXTENSION_COUNT = 5
+
+ dim cExtensionPath as string
+ cExtensionPath = gTesttoolPath & "extensions\optional\input\display_name\"
+ cExtensionPath = convertpath( cExtensionPath )
+
+ dim cExtensionFileName( EXTENSION_COUNT ) as string
+ cExtensionFileName( 1 ) = "name1.oxt"
+ cExtensionFileName( 2 ) = "name2.oxt"
+ cExtensionFileName( 3 ) = "name3.oxt"
+ cExtensionFileName( 4 ) = "name4.oxt"
+ cExtensionFileName( 5 ) = "name5.oxt"
+
+ dim cExtensionDisplayName( EXTENSION_COUNT ) as string
+ cExtensionDisplayName( 1 ) = "name1 en-US"
+ cExtensionDisplayName( 2 ) = "name2 en-US-region1"
+ cExtensionDisplayName( 3 ) = "name3 en"
+ cExtensionDisplayName( 4 ) = "name4 en-GB"
+ cExtensionDisplayName( 5 ) = "name5 de"
+
+ dim iCurrentExtension as integer
+ dim cCurrentExtension as string
+ dim iStatus as integer
+ dim bStatus as boolean
+
+ '///<u><pre>Test case specification</u></pre>
+ '///<ul>
+ '///+<li>Install test extensions via GUI</li>
+ for iCurrentExtension = 1 to EXTENSION_COUNT
+
+ cCurrentExtension = cExtensionPath & cExtensionFileName( iCurrentExtension )
+
+ printlog( "" )
+ printlog( "Adding extension by filename: " & cCurrentExtension )
+
+ iStatus = hExtensionAddGUI( cCurrentExtension , "NoLicense, InstallForUser, NoUpdate, Verbose" )
+ if ( iStatus < 1 ) then
+ warnlog( "Failed to install extension: " & cCurrentExtension )
+ endif
+
+ next iCurrentExtension
+
+ '///+<li>Remove all extensions by display name (which also verifies the display name)</li>
+ bStatus = true
+ for iCurrentExtension = 1 to EXTENSION_COUNT
+
+ cCurrentExtension = cExtensionDisplayName( iCurrentExtension )
+
+ printlog( "" )
+ printlog( "Removing extension by display name: " & cCurrentExtension )
+
+ iStatus = hExtensionRemoveGUI( cCurrentExtension )
+ if ( iStatus <> 0 ) then
+ warnlog( "Failed to remove extension: " & cCurrentExtension )
+ bStatus = false
+ endif
+
+ next iCurrentExtension
+
+ '///+<li>If anything went wrong, reset the office/userlayer</li>
+ if ( not bStatus ) then
+ call sResetTheOffice
+ endif
+ '///</ul>
+
+endcase
+
diff --git a/testautomation/extensions/optional/includes/e_taskpane.inc b/testautomation/extensions/optional/includes/e_taskpane.inc
new file mode 100644
index 000000000000..6d1794e68456
--- /dev/null
+++ b/testautomation/extensions/optional/includes/e_taskpane.inc
@@ -0,0 +1,74 @@
+'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 :
+'*
+'* short description :
+'*
+'\***********************************************************************
+testcase tTaskPane
+
+ Dim sExtensionPath as String
+ Dim iStatus as integer
+
+ sExtensionPath = gTesttoolPath + "extensions/optional/input/extensions/TaskPaneComponent/TaskPaneComponent.oxt"
+
+ iStatus = hExtensionAddGUI( sExtensionPath, "InstallForUser, NoLicense" )
+ if(iStatus <= 0 ) then
+ warnlog "extension could not installed. ErrorCode is " + iStatus
+ goto endsub
+ endif
+
+ call hNewDocument
+
+ kontext "DocumentCalc"
+
+ DocumentCalc.useMenu
+
+ hMenuSelectNr(3)
+ if(hMenuItemIsChecked(11)) then
+ ' do nothing. The pane is displayed
+ else
+ hMenuSelectNr(11)
+ endif
+
+ kontext "MSC_Special_Dialog"
+ if ( MSC_Special_Dialog.exists(1) ) then
+ printlog "task pane exists"
+ else
+ warnlog "task pane does not exists"
+ endif
+
+ call hCloseDocument
+
+ iStatus = hExtensionRemoveGUI("TaskPaneComponent.oxt")
+ if(iStatus <> 0 ) then
+ warnlog "extension could not deinstalled. ErrorCode is " + iStatus
+ goto endsub
+ endif
+
+endcase
diff --git a/testautomation/extensions/optional/includes/extensions.inc b/testautomation/extensions/optional/includes/extensions.inc
new file mode 100755
index 000000000000..db115274e19d
--- /dev/null
+++ b/testautomation/extensions/optional/includes/extensions.inc
@@ -0,0 +1,684 @@
+'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@oracle.com
+'*
+'* short description : Function test of extension manager
+'*
+'\************************************************************************
+
+testcase tExtensionsFunction
+
+ ' written for CWS jsc7, in master since SRC680m176
+ ' additions for CWS sb63 - Dependency checking with versioning - documents 24-30
+ ' features: - http://specs.openoffice.org/appwide/packagemanager/simple_extension_license.odt
+ ' - http://specs.openoffice.org/appwide/packagemanager/extensiondependencies1.odt
+ '/// The test documents are available at http://qa.openoffice.org/source/browse/qa/qatesttool/framework/basic/input/extensions/ ///'
+ '/// Textdocuments used in this test and expected messages: ///'
+ '/// (1/31): simpleLicense\BadDesc.oxt ///'
+ '/// - BadDesc.oxt/description.xml contains data which cannot be parsed. ///'
+ '/// - will not install ///'
+ '/// (2/31): simpleLicense\BadNamespace.oxt ///'
+ '/// - BadNamespace.oxt/description.xml contains a root element with an unsupported namespace. ///'
+ '/// - will not install ///'
+ '/// (3/31): simpleLicense\BadRoot.oxt ///'
+ '/// - BadRoot.oxt/description.xml does not contain the root element <description>. ///'
+ '/// - will not install ///'
+ '/// (4/31): simpleLicense\IncompAttr1.oxt ///'
+ '/// - ExtensionSoftwareLicenseAgreement dialog exists ///'
+ '/// - installs and is enabled ///'
+ '/// (5/31): simpleLicense\IncompAttr2.oxt ///'
+ '/// - Cannot find a localized license text or a default license text. ///'
+ '/// - will not install ///'
+ '/// (6/31): simpleLicense\LongLic.oxt ///'
+ '/// - ExtensionSoftwareLicenseAgreement dialog exists ///'
+ '/// - It is a Long License ///'
+ '/// - installs and is enabled ///'
+ '/// (7/31): simpleLicense\MissingLic.oxt ///'
+ '/// - MissingLic.oxt\registration\license_en_US.txt does not exist. ///'
+ '/// - will not install ///'
+ '/// (8/31): simpleLicense\MissingLicRef.oxt ///'
+ '/// - Cannot find a localized license text or a default license text. ///'
+ '/// - will not install ///'
+ '/// (9/31): simpleLicense\NoDesc.oxt ///'
+ '/// - installs and is enabled ///'
+ '/// (10/31): simpleLicense\NoLangNoDefault.oxt ///'
+ '/// - Cannot find a localized license text or a default license text. ///'
+ '/// - will not install ///'
+ '/// (11/31): simpleLicense\OnlyDefault.oxt ///'
+ '/// - Cannot find a localized license text or a default license text. ///'
+ '/// - will not install ///'
+ '/// (12/31): simpleLicense\ShortLicense.oxt ///'
+ '/// - ExtensionSoftwareLicenseAgreement dialog exists ///'
+ '/// - installs and is enabled ///'
+ '/// (13/31): ///'
+ '/// - will not install ///'
+ '/// (14/31): simpleLicense\ShortLicenseShared.oxt ///'
+ '/// - ExtensionSoftwareLicenseAgreement dialog exists ///'
+ '/// - installs and is enabled ///'
+ '/// (15/31): dependencies\broken-dependency.oxt ///'
+ '/// - broken-dependency.oxt/description.xml contains data which cannot be parsed. ///'
+ '/// - will not install ///'
+ '/// (16/31): dependencies\double-dependencies.oxt ///'
+ '/// - UnsatisfiedDependencies dialog exists ///'
+ '/// (1/2): Dependency 1 ///'
+ '/// (2/2): Dependency 2 ///'
+ '/// - will not install ///'
+ '/// (17/31): dependencies\empty-dependencies.oxt ///'
+ '/// - installs and is enabled ///'
+ '/// (18/31): dependencies\funny-dependency.oxt ///'
+ '/// - UnsatisfiedDependencies dialog exists ///'
+ '/// (1/1): & < > ' " > ' tab . crlf ///'
+ '/// . em-dash�;. line-separator?. paragraph-separator?. xxxxxxxxxxx... ///'
+ '/// - will not install ///'
+ '/// (19/31): dependencies\license-dependency.oxt ///'
+ '/// - UnsatisfiedDependencies dialog exists ///'
+ '/// (1/1): Dependency ///'
+ '/// - will not install ///'
+ '/// (20/31): dependencies\many-dependencies.oxt ///'
+ '/// - UnsatisfiedDependencies dialog exists ///'
+ '/// (1/20): Dependency 1 ///'
+ '/// (2/20): Dependency 2 ///'
+ '/// (3/20): Dependency 3 ///'
+ '/// (4/20): Dependency 4 ///'
+ '/// (5/20): Dependency 5 ///'
+ '/// (6/20): Dependency 6 ///'
+ '/// (7/20): Dependency 7 ///'
+ '/// (8/20): Dependency 8 ///'
+ '/// (9/20): Dependency 9 ///'
+ '/// (10/20): Dependency 10 ///'
+ '/// (11/20): Dependency 11 ///'
+ '/// (12/20): Dependency 12 ///'
+ '/// (13/20): Dependency 13 ///'
+ '/// (14/20): Dependency 14 ///'
+ '/// (15/20): Dependency 15 ///'
+ '/// (16/20): Dependency 16 ///'
+ '/// (17/20): Dependency 17 ///'
+ '/// (18/20): Dependency 18 ///'
+ '/// (19/20): Dependency 19 ///'
+ '/// (20/20): Dependency 20 ///'
+ '/// - will not install ///'
+ '/// (21/31): dependencies\no-dependencies.oxt ///'
+ '/// - installs and is enabled ///'
+ '/// (22/31): dependencies\no-description.oxt ///'
+ '/// - installs and is enabled ///'
+ '/// (23/31): dependencies\unknown-dependency.oxt ///'
+ '/// - UnsatisfiedDependencies dialog exists ///'
+ '/// (1/1): Unknown ///'
+ '/// - will not install ///'
+ '/// (24/31): dependencies\version21.oxt ///'
+ '/// - installs and is enabled ///'
+ '/// (25/31): dependencies\version10000.oxt ///'
+ '/// - UnsatisfiedDependencies dialog exists ///'
+ '/// (1/1): Unknown ///'
+ '/// - will not install ///'
+ '/// (26/31): dependencies\version21ns.oxt ///'
+ '/// - installs and is enabled ///'
+ '/// (27/31): dependencies\version21other.oxt ///'
+ '/// - UnsatisfiedDependencies dialog exists ///'
+ '/// (1/1): Unknown ///'
+ '/// - will not install ///'
+ '/// (25/31): dependencies\version25.oxt ///'
+ '/// - installs and is enabled ///'
+ '/// (25/31): dependencies\version30.oxt ///'
+ '/// - installs and is enabled ///'
+ '/// (25/31): dependencies\version31.oxt ///'
+ '/// - UnsatisfiedDependencies dialog exists ///'
+ '/// (1/1): Unknown ///'
+ '/// - will not install ///'
+ '/// (27/31): dependencies\version21other.oxt ///'
+ '/// - UnsatisfiedDependencies dialog exists ///'
+ '/// (1/1): Unknown ///'
+ '/// (30/31): dependencies\versionempty.oxt ///'
+ '/// - installs and is enabled ///'
+ '/// (31/31): dependencies\versionnone.oxt ///'
+ '/// - installs and is enabled ///'
+ '/// (32/41): versions/plain.oxt
+ '/// - installs and is enabled ///'
+ '/// (33/41): versions/plain.oxt
+ '/// - You are about to install version 1.02.4.7.0 of the extension org.openoffice.legacy.plain.oxt. That version is already installed.
+ '/// - installs and is enabled ///'
+ '/// (34/41): versions/version_none/plain.oxt
+ '/// - You are about to install version 0 of the extension org.openoffice.legacy.plain.oxt. The newer version 1.02.4.7.0 is already installed.
+ '/// - installs and is enabled ///'
+ '/// (35/41): versions/version_1.2.3/plain.oxt
+ '/// - You are about to install version 1.2.3 of the extension org.openoffice.legacy.plain.oxt. The older version 0 is already installed.
+ '/// - installs and is enabled ///'
+ '/// (36/41): versions/version_1.2.3/plain.oxt
+ '/// - You are about to install version 1.2.3 of the extension org.openoffice.legacy.plain.oxt. That version is already installed.
+ '/// - installs and is enabled ///'
+ '/// (37/41): versions/version_0.0/plain.oxt
+ '/// - You are about to install version 0.0 of the extension org.openoffice.legacy.plain.oxt. The newer version 1.2.3 is already installed.
+ '/// - installs and is enabled ///'
+ '/// (38/41): versions/version_1.2.4.7/plain.oxt
+ '/// - You are about to install version 1.2.4.7 of the extension org.openoffice.legacy.plain.oxt. The older version 0.0 is already installed.
+ '/// - installs and is enabled ///'
+ '/// (39/41): versions/version_1.02.4.7.0/plain.oxt
+ '/// - You are about to install version 1.02.4.7.0 of the extension org.openoffice.legacy.plain.oxt. That version is already installed.
+ '/// - installs and is enabled ///'
+ '/// (40/41): versions/version_1.2.3/plain.oxt
+ '/// - You are about to install version 1.2.3 of the extension org.openoffice.legacy.plain.oxt. The newer version 1.02.4.7.0 is already installed.
+ '/// - installs and is enabled ///'
+ '/// (41/41): versions/version_1.2.15.3/plain.oxt
+ '/// - You are about to install version 1.2.15.3 of the extension org.openoffice.legacy.plain.oxt. The older version 1.2.3 is already installed.
+
+ dim j,b,i,a,x,y as integer
+ dim sPath as string
+ dim aFiles(50) as string
+ dim aFeatures(50) as string
+ dim aFileList(50) as string
+ dim sTemp as string
+ dim sTemp2 as string
+ dim sTemp3 as string
+ dim sTemp4 as string
+ dim aTemp
+ dim aTemp2
+ dim sFirstStatus as string
+ dim bFound as boolean
+ dim aRemovePackages(50) as string
+ dim bFoundNumber as boolean
+ dim sLastVersion as string
+
+ sLastVersion = ""
+ ' want to start and work with just one document window
+ b = getDocumentCount
+ hFileCloseAll()
+ hNewDocument()
+
+ ' load about twenty one extension files, to test the features
+ ' the list tells the filename and in encoded numbers the features
+ ' a line looks like:
+ ' simpleLicense\LongLic.oxt;0,2,1,0
+ ' - the filename and the features are seperated by a semicolon
+ ' - the numbes for the features are seperated by colons
+ ' 1st number: Unsatisfied dependencies; if there are any, the number counts them; if there are none it is zero and the dialog won't come up
+ ' 2nd number: License; if there is one the value is 1; it it a long one, where the scroll button needs to be used it is 2; 3 if the license should not be accepted for testing purposes, if there is no license the value is zero
+ ' 3rd number: If the extension should successfully install the value is one, else zero.
+ ' 4th number: If an active is expected after selecting a file for installation the value is one, else zero.
+ ' 5th number: If active is expected the expected version information after selecting a file for installation the value is one, else zero and if an upgrade/downgrade is expected, the number is 2.
+
+ ' Base path for test files
+ sPath = convertPath(gTestToolPath+"extensions/optional/input/")
+ ' read filelist and expected features
+ ListRead(aFileList(), sPath+"files.txt")
+ a = listCount(aFileList())
+ printlog a
+ for i = 1 to a
+ aTemp = split (aFileList(i),";")
+ if uBound(aTemp()) >0 then
+ listAppend(aFiles(),aTemp(0))
+ listAppend(aFeatures(),aTemp(1))
+ endif
+ next i
+
+ ' there are some dependencys to languages...
+ if iSprache = 49 then
+ sTemp = aFeatures(4)
+ aFeatures(4) = aFeatures(5)
+ aFeatures(5) = sTemp
+ else
+ if iSprache <> 01 then
+ aFeatures(4) = aFeatures(5)
+ aFeatures(6) = aFeatures(5)
+ aFeatures(12) = aFeatures(5)
+ aFeatures(13) = aFeatures(5)
+ aFeatures(14) = aFeatures(5)
+ endif
+ endif
+ ' cleanup before starting; check that no extension from the list is installed right now; if remove it.
+ '/// Before starting, look into extension manager, if already a file is installed, that will be used in this test ///'
+ '/// Remove it. ///'
+ a = listCount(aFiles())
+ dim ii as integer
+ ToolsPackageManager
+ kontext "PackageManager"
+ If PackageManager.exists(10) then
+ BrowsePackages.typeKeys("<home>")
+ ii = 1
+ while (ii < BrowsePackages.getItemCount+1 )
+ kontext "PackageManager"
+ 'BrowsePackages.typeKeys("+")
+ 'BrowsePackages.typeKeys("<down>")
+ BrowsePackages.select ii
+ sTemp = BrowsePackages.getItemText (ii,1)
+ if right(sTemp,3) = "oxt" then
+ for x = 1 to a
+ sTemp3 = aFiles(x)
+ aTemp = split(sTemp3,"\")
+ if uBound(aTemp) < 1 then
+ aTemp = split(sTemp3,"/")
+ endif
+ sTemp3 = aTemp(uBound(aTemp))
+ if sTemp = sTemp3 then
+ qaErrorLog "Package is already installed, trying to remove it: '" + sTemp + "'"
+ if remove.isEnabled then
+ remove.click
+
+ kontext "Active"
+ if ( Active.exists( 2 ) ) then
+ Active.ok()
+ else
+ warnlog( "No confirmation dialog for Extension removal" )
+ endif
+
+ Kontext "AddingPackages"
+ y=0
+ while AddingPackages.exists(1) AND (y<30)
+ printlog "RemovingPackages..."
+ sleep 1
+ y=y+1
+ wend
+ kontext "PackageManager"
+ BrowsePackages.typeKeys("<up>")
+ x = 100
+ else
+ warnlog "Package is already installed and can't get removed: '" + sTemp + "'"
+ ii=ii+1
+ x = 101
+ endif
+ endif
+ next x
+ if x < 100 then
+ ii=ii+1
+ endif
+ else
+ ii=ii+1
+ endif
+ wend
+ kontext "PackageManager"
+ PackageManager.close
+ WaitSlot( 5000 )
+ endif
+
+ ' for every test file do...
+ a = listCount(aFiles())
+ for i = 1 to a
+ printlog "********** Test file ("+i+"/"+a+"): "+aFiles(i)
+ aTemp = split (aFeatures(i),",")
+ '/// call Tools - Package/Extension manager ///'
+ ToolsPackageManager
+ kontext "PackageManager"
+ If PackageManager.exists(10) then
+ '/// going to top of package list and explode every line, until the button 'Add' is enabled ///'
+ '/// should be 'My Packages' ///'
+ 'BrowsePackages.typeKeys("<home>")
+ 'sTemp = BrowsePackages.getSelText
+ 'sTemp2 = ""
+ 'while (Not Add.isEnabled AND (sTemp <> sTemp2))
+ ' BrowsePackages.typeKeys("+")
+ ' BrowsePackages.typeKeys("<down>")
+ ' sTemp2 = sTemp
+ ' sTemp = BrowsePackages.getSelText
+ 'wend
+ 'if sTemp = sTemp2 then
+ ' warnlog "Couldn't find a way to enable the Add button - aborting"
+ ' goto endsub
+ 'endif
+ 'printlog BrowsePackages.getSelText
+ '/// click button 'Add' ///'
+ try
+ Add.click
+ catch
+ warnlog "#i90870# extension manager deadlock/C++ runtimes"
+ exitrestarttheoffice
+ ToolsPackageManager
+ kontext "PackageManager"
+ Add.click
+ endcatch
+ '/// Add Package(s)... dialg comes up ///'
+ Kontext "OeffnenDlg"
+ if OeffnenDlg.exists(5) then
+ '/// put filename into field ///'
+ Dateiname.setText convertPath(sPath + aFiles(i))
+ printlog DateiTyp.getSelText
+ '/// press button 'Open' ///'
+ Oeffnen.click
+ else
+ warnlog "Add Package(s)... dialog didn't came up"
+ endif
+
+ 'Asking for whom to install; All: YES, Me: NO, nobody: Cancel
+ kontext
+ if active.exists(5) then
+ sTemp = active.getText
+ printlog "Messagebox: " + sTemp
+ ' We only want to handle the installation target here which only
+ ' pops up if we have the choice (rights to write to shared layer)
+ if active.getButtonCount = 3 then
+ try
+ active.yes
+ catch
+ warnlog( "Try...catch: Failed to click Yes-button" )
+ endcatch
+ else
+ printlog "No installation target message (this is probably a root-installation)"
+ endif
+ endif
+
+ '/// Progress dialog comes up ///'
+ Kontext "AddingPackages"
+ if AddingPackages.exists(1) then
+ printlog " - AddingPackages dialog exists"
+ 'DialogTest(AddingPackages)
+ endif
+
+ '/// If any error happens, an active comes up, telling what is wrong ///'
+ ' error is just a dialog with one button
+ ' version infos have two buttons
+ Kontext
+ if active.exists(5) then
+ sTemp = active.getText
+ select case active.getbuttoncount
+ case 1:
+ y = instr(sTemp, " ")
+ if cBool(aTemp(3)) then
+ printlog sTemp
+ else
+ warnlog sTemp
+ endif
+ case 2:
+ x = 0
+ if cBool(aTemp(4)) then
+ printlog "Version info message available."
+ else
+ warnlog "Version info message available, but not expected"
+ endif
+ printlog sTemp
+ bFoundNumber = false
+ aTemp2 = split(sTemp," ")
+ y = uBound(aTemp2)
+ while ((NOT bFoundNumber) AND (x < y))
+ stemp2 = left(aTemp2(x),1)
+ if isNumeric(stemp2) then
+ bFoundNumber = TRUE
+ printlog "Try to install version: " + aTemp2(x)
+ endif
+ x=x+1
+ wend
+ if NOT bFoundNumber then
+ warnlog "No version was mentioned in the version message!"
+ endif
+ bFoundNumber = false
+ while (NOT bFoundNumber AND x < y)
+ stemp2 = left(aTemp2(x),1)
+ if isNumeric(stemp2) then
+ bFoundNumber = TRUE
+ endif
+ x=x+1
+ wend
+ if aTemp(4) = "2" AND bFoundNumber then
+ printlog "Old version is: " + aTemp2(x-1)
+ elseif bFoundNumber then
+ warnlog "No old version expected: " + aTemp2(x-1)
+ elseif aTemp(4) = "2" then
+ warnlog "Old version expected, but not mentioned."
+ endif
+ end select
+ active.ok
+ else
+ if cBool(aTemp(3)) then
+ if i = 3 then
+ qaErrorLog "#i73367# "
+ else
+ warnlog "errormessage expected, but none came up."
+ endif
+ endif
+ endif
+
+ '/// If there are any unsatisfied dependencies, they are shown now ///'
+ Kontext "UnsatisfiedDependencies"
+ if UnsatisfiedDependencies.exists(10) then
+ if cBool(aTemp(0)) then
+ printlog " - UnsatisfiedDependencies dialog exists"
+ else
+ warnLog "UnsatisfiedDependencies are not expected but available"
+ endif
+ DialogTest(UnsatisfiedDependencies)
+ y = UnsatisfiedDependencyList.getItemCount
+ if cInt(aTemp(0)) <> y then
+ warnlog "Difference in dependencies; expected: " + aTemp(0) + "; found: " +y
+ endif
+ for x = 1 to y
+ printlog " ("+x+"/"+y+"): "+UnsatisfiedDependencyList.getItemText(x)
+ next x
+ '/// close dialog if available, extension will not be installed ///'
+ UnsatisfiedDependencies.close
+ else
+ if cBool(aTemp(0)) then
+ warnLog "UnsatisfiedDependencies expected but none shown."
+ endif
+ endif
+
+ '/// If there is a license, it is shown now ///'
+ Kontext "ExtensionSoftwareLicenseAgreement"
+ if ExtensionSoftwareLicenseAgreement.exists(10) then
+ if cBool(aTemp(1)) then
+ printlog " - ExtensionSoftwareLicenseAgreement dialog exists"
+ else
+ warnlog "ExtensionSoftwareLicenseAgreement are not expected but shown"
+ endif
+ if NOT Accept.isEnabled then
+ if cInt(aTemp(1)) = 2 then
+ printlog " Long License"
+ else
+ errorlog "Long License"
+ endif
+ else
+ if NOT cInt(aTemp(1)) = 2 then
+ printlog "Long License"
+ else
+ errorlog "Long License"
+ endif
+ endif
+ '/// scroll down until accept button is enabled, click accept button ///'
+ LicenseText.typeKeys ("<mod1 a>",true)
+ if Accept.isEnabled then
+ '/// for testing purposes click cancel one time - the extension should not get installed ///'
+ if cInt(aTemp(1)) = 3 then
+ ExtensionSoftwareLicenseAgreement.CANCEL
+ else
+ Accept.click
+ endif
+ else
+ qaErrorLog "Accept not enabled.yet"
+ while NOT Accept.isEnabled
+ ScrollDown.click
+ printlog "Scrolling..."
+ sleep 1
+ wend
+ '/// for testing purposes click cancel one time - the extension should not get installed ///'
+ if cInt(aTemp(1)) = 3 then
+ ExtensionSoftwareLicenseAgreement.CANCEL
+ else
+ Accept.click
+ endif
+ endif
+ else
+ if cBool(aTemp(1)) then
+ errorlog "ExtensionSoftwareLicenseAgreement dialog expected but not shown."
+ endif
+ endif
+
+ '/// There may come up another active right now, which would be an error ///'
+ Kontext
+ if active.exists(5) then
+ sTemp = active.getText
+ if i = 7 then
+ qaerrorlog "#i67452# " + sTemp
+ else
+ if i = 13 then
+ qaerrorlog "#i73307#" + stemp
+ else
+ warnlog sTemp
+ endif
+ endif
+ active.ok
+ endif
+
+ '/// the progress dialog is now available again ///'
+ Kontext "AddingPackages"
+ x=0
+ while AddingPackages.exists(1) AND (x<30)
+ printlog "AddingPackages..."
+ sleep 1
+ x=x+1
+ wend
+
+ '/// There may come up another active right now, which would be an error ///'
+ Kontext
+ if active.exists(5) then
+ sTemp = active.getText
+ warnlog sTemp
+ active.ok
+ endif
+
+ ' find out, if the extension got installed
+ kontext "PackageManager"
+ BrowsePackages.typeKeys("<home>")
+ BrowsePackages.typeKeys("+")
+ y = BrowsePackages.getItemCount
+ sTemp = aFiles(i)
+ aTemp2 = split(sTemp,"\")
+ if uBound(aTemp2) < 1 then
+ aTemp2 = split(sTemp,"/")
+ endif
+ sTemp = aTemp2(uBound(aTemp2))
+ printlog stemp
+ bFound = FALSE
+ for x = 1 to y
+ sTemp2 = BrowsePackages.getItemText(x,1)
+ printlog "("+x+"/"+y+"): "+sTemp2
+ ' Mechanism to detect a status change; report it only one time
+ sTemp3 = BrowsePackages.getItemText(x,3) ' enabled?
+ sTemp4 = BrowsePackages.getItemText(x,2) ' version
+ if sTemp3 <> "" AND sFirstStatus = "" then
+ sFirstStatus = sTemp3
+ else
+ if (sFirstStatus <> sTemp3) AND (sTemp3 <> "") AND (sFirstStatus <> "alreadyshown") then
+ qaErrorlog "#i67450# " + sFirstStatus + " <> " + sTemp3
+ sFirstStatus= "alreadyshown"
+ endif
+ endif
+ if sTemp3 <> "" then
+ printlog " +++ " + sTemp3
+ endif
+ if sTemp4 <> "" then
+ sLastVersion = sTemp4
+ printlog " Version:" + sTemp4
+ endif
+ if sTemp = sTemp2 then
+ listAppend(aRemovePackages(), sTemp)
+ if cBool(aTemp(2)) then
+ printlog "-------------------------------- Extension got installed"
+ bFound = TRUE
+ else
+ if i = 3 then
+ qaerrorLog "#i73367# "
+ else
+ warnLog "-------------------------------- Extension got installed, but shouldn't do that"
+ endif
+ endif
+ endif
+ next x
+ if NOT cBool(aTemp(2)) and bFound then
+ warnlog "not found"
+ endif
+ '/// Close extension manager ///'
+ PackageManager.OK
+ 'OK / Close
+ else
+ warnlog "Couldn't call Tools -> Package manager - aborting test at " + i
+ goto endsub
+ endif
+ next i
+
+ '/// after installing all extensions, remove them ///'
+ ' uninstall all components, that were installed
+ a = listCount(aRemovePackages())
+ ToolsPackageManager
+
+ kontext "PackageManager"
+ If PackageManager.exists(10) then
+
+ BrowsePackages.typeKeys("<home>")
+ waitslot()
+
+ ii = 1
+ while (ii < BrowsePackages.getItemCount +1)
+
+ wait( 2000 ) ' Required, Extension Manager needs time to populate
+ kontext "PackageManager"
+ 'BrowsePackages.typeKeys("+")
+ 'BrowsePackages.typeKeys("<down>")
+ sTemp2 = sTemp
+ BrowsePackages.select ii
+ waitslot()
+
+ sTemp = BrowsePackages.getItemText (ii,1)
+ if right(sTemp,3) = "oxt" then
+ for x = 1 to a
+ if sTemp = aRemovePackages(x) then
+ printlog "Package is installed, trying to remove it: '" + sTemp + "'"
+ if remove.isEnabled then
+ remove.click
+
+ kontext "Active"
+ if ( Active.exists( 2 ) ) then
+ Active.ok()
+ else
+ warnlog( "No confirmation for extension removal" )
+ endif
+
+ Kontext "AddingPackages"
+ y=0
+ while AddingPackages.exists(1) AND (y<30)
+ printlog "RemovingPackages..."
+ sleep 1
+ y=y+1
+ wend
+ kontext "PackageManager"
+ BrowsePackages.typeKeys("<up>")
+ x = 100
+ else
+ warnlog "Package can't get removed: '" + sTemp + "'"
+ ii=ii+1
+ endif
+ endif
+ next x
+ endif
+ ii = ii+1
+ wend
+ kontext "PackageManager"
+ hCloseDialog( PackageManager, "close" )
+ else
+ qaErrorLog "disabling installed extensions failed;"
+ endif
+ WaitSlot()
+ hFileCloseAll()
+endcase
+
+
diff --git a/testautomation/extensions/optional/includes/fileopen.inc b/testautomation/extensions/optional/includes/fileopen.inc
new file mode 100755
index 000000000000..922e5ece9adc
--- /dev/null
+++ b/testautomation/extensions/optional/includes/fileopen.inc
@@ -0,0 +1,103 @@
+'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@oracle.com
+'*
+'* short description : CWS oxtsysint01 enables installing extensions via file open dialog
+'*
+'\******************************************************************************
+
+testcase tExtensionFileOpen
+
+ printlog( "Install an extension via File Open - new with CWS oxtsysint01" )
+
+ dim cString as string
+
+ if ( gBuild < 9305 ) then
+ printlog( "No testing for builds prior to 9305"
+ goto endsub
+ endif
+
+ const EXTENSION_NAME = "locationtest.oxt"
+ dim cPath as string
+ cPath = gTesttoolPath & "extensions/optional/input/path_to_extension/" & EXTENSION_NAME
+
+ hFileOpen( cPath )
+
+ kontext "Active"
+ if ( Active.exists() ) then
+ printlog( "Extension installation message found, accepting" )
+ printlog( Active.getText() )
+ Active.ok()
+ else
+ warnlog( "Extension installation message missing" )
+ endif
+
+ hExtensionRemoveGUI( EXTENSION_NAME )
+
+ printlog( "Verify that the Add Extension Dialog remembers the last used path..." )
+ hExtensionAddGUI( cPath, "" )
+
+ printlog( "Reopen Extension Manager UI, click Add.. and check the directory" )
+ ToolsPackageManager
+
+ kontext "PackageManager"
+ if ( PackageManager.exists( 3 ) ) then
+ Add.click()
+
+ Kontext "OeffnenDlg"
+ if ( OeffnenDlg.exists( 2 ) ) then
+
+ printlog( "Select the last item in the list which should be the extension" )
+ DateiAuswahl.select( Dateiauswahl.getItemCount() )
+ cString = DateiAuswahl.getSelText()
+ if ( cString <> EXTENSION_NAME ) then
+ warnlog( "Incorrect extension listed. Please check path and filename" )
+ printlog( "Expected: " & EXTENSION_NAME )
+ printlog( "Found...: " & cString )
+ printlog( "Issues: #i67122, #i92234" )
+ else
+ printlog( "Found correct extension, the dialog remembers the path" )
+ endif
+
+ kontext "OeffnenDlg"
+ OeffnenDlg.cancel()
+ else
+ warnlog( "Could not access Add Extensions Dialog" )
+ endif
+
+ kontext "PackageManager"
+ PackageManager.close()
+ else
+ warnlog( "Could not open Extension Manager GUI" )
+ endif
+
+ hExtensionRemoveGUI( EXTENSION_NAME )
+
+endcase
+
+
diff --git a/testautomation/extensions/optional/includes/help.inc b/testautomation/extensions/optional/includes/help.inc
new file mode 100755
index 000000000000..004fd70ac429
--- /dev/null
+++ b/testautomation/extensions/optional/includes/help.inc
@@ -0,0 +1,213 @@
+'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@oracle.com
+'*
+'* short description : Extensible help
+'*
+'\******************************************************************************
+
+testcase tExtensibleHelp
+
+ '///<h1>Extensible help</h1>
+
+ '///<u><pre>Synopsis</pre></u>Beginning with CWS ab38 extensions can extend the help application with index entries and content<br>
+ '///<u><pre>Specification document</pre></u><a href=http://specs.openoffice.org/appwide/help/ExtensibleHelp.odt>
+ '///+http://specs.openoffice.org/appwide/help/ExtensibleHelp.odt</a><br>
+ '///<u><pre>Files used:</pre></u>.../extensions/features/input/extensible_help/*.info, *.oxt<br>
+ '///<u><pre>Test case specification</pre></u>
+
+ ' This is the base path to the input directory where all workfiles are located
+ dim cExtName as string
+ dim cExtPath as string
+ cExtPath = gTesttoolPath & "extensions\optional\input\extensible_help\"
+ cExtPath = convertpath( cExtPath )
+
+ ' This is the configuration file for the test extensions. This approach was chosen
+ ' because the extensions have a lot in common but not enough to make a general
+ ' routine without any special cases. It is possible to add more extensions easily
+ ' by just configuring them in the config file. Ideally no canges to the test case
+ ' itself are required.
+ const CONFIG_FILE = "extension.info"
+ dim cCfgPath as string
+ cCfgPath = cExtPath
+ cCfgPath = convertpath( cCfgPath & CONFIG_FILE )
+
+ ' In this array we store the config file. Always make sure it is large enough
+ ' to hold the entire file
+ dim cCfgArray( 60 ) as string
+
+ ' Some returnvalues/status variables, general purpose
+ dim iStatus as integer
+ dim bStatus as boolean
+
+ ' Control variables for the outer loop (actions for each extension)
+ dim iCurrentExtension as integer
+ dim iExtensionCount as integer
+
+ ' Control variables for the inner loop (items to test for an extension)
+ dim cCurrentHelpItem as string
+ dim iCurrentHelpItem as integer
+ dim iHelpItemCount as integer
+
+ ' Values retrieved from the config file or the help content
+ dim cItem as string
+ dim cHead as string
+ dim cLine as string
+
+ ' Correct the position within the index list. If we have a main item with
+ ' sub-items we might need to move a few entries down in the list to get the
+ ' sub-items.
+ dim cMove as string
+ dim iMove as integer
+ dim iMoveDown as integer
+
+ do while ( getDocumentCount > 0 )
+ call hCloseDocument()
+ loop
+
+ '///<ul>
+ '///+<li>Open a writer document (so the help comes up for writer)</li>
+ gApplication = "WRITER"
+ call hNewDocument()
+ if ( getDocumentCount <> 1 ) then
+ warnlog( "Fatal: Unable to open new writer document" )
+ sResetTheOffice
+ goto endsub
+ endif
+
+ '///+<li>Read the config file - determine the number of test-extensions</li>
+ iStatus = hGetDataFileSection( cCfgPath, cCfgArray(), "files", "", "" )
+ iExtensionCount = int( hGetValueForKeyAsString( cCfgArray(), "count" ) )
+ printlog( "Read configuration for " & iExtensionCount & " files." )
+
+ '///+<li>Cycle through the configured test-extensions</li>
+ '///<ul>
+ for iCurrentExtension = 1 to iExtensionCount
+
+ '///+<li>Read the config file - get settings for current extension</li>
+ hGetDataFileSection( cCfgPath, cCfgArray(), iCurrentExtension, "", "" )
+ cExtPath = cExtPath & hGetValueForKeyAsString( cCfgArray(), "file" )
+ cExtName = hGetValueForKeyAsString( cCfgArray(), "name" )
+
+
+ '///+<li>Install the test-extension, cleanup and quit on failure</li>
+ iStatus = hExtensionAddGUI( cExtPath , "NoUpdate,NoLicense,InstallForUser,Verbose" )
+ if ( iStatus < 1 ) then
+ warnlog( "Fatal: Adding extension failed with rc = " & iStatus )
+ sResetTheOffice
+ goto endsub
+ endif
+
+ '///+<li>Open the help browser</li>
+ HelpContents
+ kontext "StarOfficeHelp"
+ if ( StarOfficeHelp.exists( 2 ) ) then
+
+ '///+<li>Switch to the index tabpage</li>
+ TabControl.setPage( IndexPage )
+ else
+ warnlog( "Unable to open help browser" )
+ hCloseDocument()
+ sResetTheOffice()
+ goto endsub
+ endif
+
+ '///+<li>Search the help index for the items described in the config file</li>
+ iHelpItemCount = int( hGetValueForKeyAsString( cCfgArray(), "items" ) )
+ printlog( "Testing " & iHelpItemCount & " items" )
+ '///<ul>
+ for iCurrentHelpItem = 1 to iHelpItemCount
+
+ printlog( "" )
+ printlog( "Testing item " & iCurrentHelpItem )
+
+ '///+<li>Get the test strings from the config file</li>
+ cItem = "hindex_" & iCurrentHelpItem
+ cMove = "h_move_" & iCurrentHelpItem
+ cHead = "header_" & iCurrentHelpItem
+ cItem = hGetValueForKeyAsString( cCfgArray(), cItem )
+ cHead = hGetValueForKeyAsString( cCfgArray(), cHead )
+ iMove = int( hGetValueForKeyAsString( cCfgArray(), cMove )
+
+ '///+<li>Enter the search term into the search field of the index page</li>
+ kontext "StarOfficeHelp"
+ SearchIndex.setText( cItem ) : WaitSlot()
+
+ for iMoveDown = 1 to iMove
+ SearchIndex.typeKeys( "<DOWN>" )
+ next iMoveDown
+
+ '///+<li>Display the associated help page (content) by clicking on &quot;Display&quot;</li>
+ DisplayIndex.click() : WaitSlot()
+
+ '///+<li>Get the header from the content</li>
+ kontext "HelpContent"
+ HelpContent.typeKeys( "<MOD1 HOME>" )
+ HelpContent.typeKeys( "<SHIFT RIGHT>" , len( cHead ) )
+ hUseAsyncSlot( "EditCopy" )
+ cLine = GetClipBoardText
+
+ '///+<li>Compare the config string with the header</li>
+ if ( cLine <> cHead ) then
+ if ( iCurrentHelpItem = 1 and gPlatGroup <> "Win95" ) then
+ qaerrorlog( "Header is incorrect, slower navigation on Unix(like)" )
+ else
+ warnlog( "Header is incorrect. Please check." )
+ endif
+ printlog( "Found...: " & cLine )
+ printlog( "Expected: " & cHead )
+ else
+ printlog( "The header is correct: " & cLine )
+ endif
+
+ next iCurrentHelpItem
+ '///</ul>
+
+ '///+<li>Close the help browser</li>
+ kontext "StarOfficeHelp"
+ StarOfficeHelp.typeKeys( "<MOD1 F4>" )
+
+ '///+<li>Remove the extension</li>
+ hExtensionRemoveGUI( cExtName )
+
+
+ next iCurrentExtension
+ '///</ul>
+
+ '///+<li>Close the writer document</li>
+ call hCloseDocument()
+ if ( getDocumentCount <> 0 ) then
+ warnlog( "Fatal: Failed to close writer document" )
+ sResetTheOffice
+ goto endsub
+ endif
+
+ '///</ul>
+
+endcase
+
diff --git a/testautomation/extensions/optional/includes/identifiers.inc b/testautomation/extensions/optional/includes/identifiers.inc
new file mode 100755
index 000000000000..1a183f6c8025
--- /dev/null
+++ b/testautomation/extensions/optional/includes/identifiers.inc
@@ -0,0 +1,120 @@
+'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@oracle.com
+'*
+'* short description : Use unique identifiers instead of filenames for extensions
+'*
+'\******************************************************************************
+
+testcase tExtensionIdentifiers()
+
+ printlog( "Extension identifiers / reinstallation of extensions" )
+
+ if ( gBuild <= 9183 ) then
+ printlog( "Build does not support extension identifiers" )
+ goto endsub
+ endif
+
+
+ dim cExtensionPath( 2 ) as string
+ dim cCommonPath as string
+ dim cExtensionCount( 3 ) as integer
+ const EXTENSION_NAME = "identifier.oxt"
+ dim cExtensionFlags as string
+
+
+ ' paths to the extensions - the have identical names but different identifiers
+ cCommonPath = gTesttoolPath & "extensions\optional\input\identifier\"
+ cExtensionPath( 1 ) = convertpath( cCommonPath & "legacy\" & EXTENSION_NAME )
+ cExtensionPath( 2 ) = convertpath( cCommonPath & "explicit\" & EXTENSION_NAME )
+ cExtensionCount( 0 ) = hGetExtensionCount()
+
+ ' Install first extension
+ cExtensionFlags = "InstallForUser"
+ cExtensionCount( 1 ) = hExtensionAddGUI( cExtensionPath( 1 ), cExtensionFlags )
+ if ( cExtensionCount( 1 ) = cExtensionCount( 0 ) + 1 ) then
+ printlog( "Extension 1 was installed" )
+ else
+ warnlog( "Incorrect extension count: " & cExtensionCount( 1 ) )
+ endif
+
+ ' Install second extension
+ cExtensionFlags = "InstallForUser"
+ cExtensionCount( 2 ) = hExtensionAddGUI( cExtensionPath( 2 ), cExtensionFlags )
+ if ( cExtensionCount( 2 ) = cExtensionCount( 1 ) + 1 ) then
+ printlog( "Extension 2 was installed" )
+ else
+ warnlog( "Incorrect extension count: " & cExtensionCount( 2 ) )
+ endif
+
+ ' Install first extension again
+ cExtensionFlags = "InstallForUser,AllowUpdate"
+ cExtensionCount( 3 ) = hExtensionAddGUI( cExtensionPath( 1 ), cExtensionFlags )
+ if ( cExtensionCount( 3 ) = cExtensionCount( 2 ) ) then
+ printlog( "Extension 1 was installed, overwriting existing" )
+ endif
+
+
+ ' Install second extension again
+ cExtensionFlags = "InstallForUser,AllowUpdate"
+ cExtensionCount( 3 ) = hExtensionAddGUI( cExtensionPath( 2 ), cExtensionFlags )
+ if ( cExtensionCount( 3 ) = cExtensionCount( 2 ) ) then
+ printlog( "Extension 2 was installed, overwriting existing" )
+ endif
+
+ hExtensionRemoveGUI( EXTENSION_NAME )
+ hExtensionRemoveGUI( EXTENSION_NAME )
+
+ ' Install first extension
+ cExtensionFlags = "InstallForUser"
+ cExtensionCount( 1 ) = hExtensionAddGUI( cExtensionPath( 1 ), cExtensionFlags )
+ if ( cExtensionCount( 1 ) = cExtensionCount( 0 ) + 1 ) then
+ printlog( "Extension 1 was installed again" )
+ else
+ warnlog( "Extension 1 was not installed" )
+ endif
+
+ ' Install second extension
+ cExtensionFlags = "InstallForUser"
+ cExtensionCount( 2 ) = hExtensionAddGUI( cExtensionPath( 2 ), cExtensionFlags )
+ if ( cExtensionCount( 2 ) = cExtensionCount( 1 ) + 1 ) then
+ printlog( "Extension 2 was installed again" )
+ else
+ warnlog( "Extension 2 was not installed" )
+ endif
+
+ hExtensionRemoveGUI( EXTENSION_NAME )
+ hExtensionRemoveGUI( EXTENSION_NAME )
+
+ if ( hGetExtensionCount() <> cExtensionCount( 0 ) ) then
+ warnlog( "For some reason we have an unexpected number of extensions listed" )
+ else
+ printlog( "Extensions were handled correctly" )
+ endif
+
+endcase
diff --git a/testautomation/extensions/optional/includes/issue110083.inc b/testautomation/extensions/optional/includes/issue110083.inc
new file mode 100755
index 000000000000..73f7ad108322
--- /dev/null
+++ b/testautomation/extensions/optional/includes/issue110083.inc
@@ -0,0 +1,79 @@
+'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@oracle.com
+'*
+'* short description : CWS sb112 fixes a problem with configuration schemas
+'*
+'\******************************************************************************
+
+testcase tExtensionIssue110083()
+
+ printlog( "Configuration/-schema .xcu/.xcs-files which might trigger exceptions from unopkg/Extension Manager" )
+
+ const NUMBER_OF_TEST_EXTENSIONS = 2
+
+ dim cExtensionNames( NUMBER_OF_TEST_EXTENSIONS ) as string
+ cExtensionNames( 1 ) = "LoggingOptions.xcs"
+ cExtensionNames( 2 ) = "Logging.xcu"
+
+ dim cErrorIdentifier( NUMBER_OF_TEST_EXTENSIONS ) as string
+ cErrorIdentifier( 1 ) = "no component element"
+ cErrorIdentifier( 2 ) = "no component element"
+
+ dim cExtensionPath as string
+ cExtensionPath = gTesttoolPath & "extensions/optional/input/issues/"
+
+ dim cExtension as string
+
+ dim iCurrentExtension as integer
+
+
+ for iCurrentExtension = 1 to NUMBER_OF_TEST_EXTENSIONS
+
+ cExtension = convertpath( cExtensionPath & cExtensionNames( iCurrentExtension ) )
+ hExtensionAddGUI( cExtension, "" )
+
+ kontext "Active"
+ if ( Active.exists() ) then
+ if ( instr( Active.getText, cErrorIdentifier( iCurrentExtension ) ) > 0 ) then
+ warnlog( "#i110083# - Error installing .xcs/.xcu-file: " & cExtensionNames( iCurrentExtension ) )
+ Active.ok()
+
+ kontext "PackageManager"
+ PackageManager.close()
+ else
+ warnlog( "Unexpected messagebox displayed. It cannot be handled" )
+ endif
+ else
+ hExtensionRemoveGUI( cExtensionNames( iCurrentExtension ) )
+ endif
+
+ next iCurrentExtension
+
+endcase
+
diff --git a/testautomation/extensions/optional/includes/location.inc b/testautomation/extensions/optional/includes/location.inc
new file mode 100755
index 000000000000..262495666cbb
--- /dev/null
+++ b/testautomation/extensions/optional/includes/location.inc
@@ -0,0 +1,133 @@
+'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@oracle.com
+'*
+'* short description : Test the extension locator service
+'*
+'\******************************************************************************
+
+testcase tExtensionLocation
+
+ printlog( "Test the extension locator service" )
+
+ ' The location of the sample extension and helper document
+ dim cWorkPath as string
+ cWorkPath = gTesttoolPath & "extensions\optional\input\path_to_extension\"
+ cWorkPath = convertpath( cWorkPath )
+
+ const EXTENSION_NAME = "locationtest.oxt"
+ const DOCUMENT_NAME = "LocationTest.odt"
+ const MACRO_NAME = "tExtensionLocation"
+
+ dim brc as boolean
+ dim irc as integer
+ dim cMsg as string
+
+ printlog( "Using extension: " & cWorkPath & EXTENSION_NAME )
+ printlog( "Using document.: " & cWorkPath & DOCUMENT_NAME )
+
+ brc = hFileOpen( cWorkPath & DOCUMENT_NAME )
+ if ( not brc ) then
+ brc = hAllowMacroExecution()
+ if ( not brc ) then
+ warnlog( "This is not the macro execution warning" )
+ endif
+ else
+ warnlog( "Macro execution warning is missing" )
+ endif
+
+ hMacroOrganizerRunMacro( MACRO_NAME )
+
+ kontext "Makro"
+ if ( Makro.exists( 1 ) ) then
+ warnlog( "Macro was not executed")
+ Makro.close()
+ goto endsub
+ else
+ printlog( "Macro was executed")
+ endif
+
+ kontext "active"
+ if ( active.exists( 2 ) ) then
+ cMsg = active.getText()
+ if ( cMsg <> "" ) then
+ warnlog( "The messagebox is not empty: " & cMsg )
+ else
+ printlog( "Messagebox is empty, good." )
+ endif
+ active.ok()
+ else
+ warnlog( "No messagebox displayed, please check that the macro is executed" )
+ endif
+
+ hExtensionAddGUI( cWorkPath & EXTENSION_NAME , "verbose,InstallForUser" )
+ hMacroOrganizerRunMacro( MACRO_NAME )
+
+ kontext "active"
+ if ( active.exists( 2 ) ) then
+ cMsg = active.getText()
+
+ if ( cMsg = "" ) then
+ warnlog( "The messagebox is empty, please check." )
+ else
+
+ printlog( "Content of messagebox: " & cMsg )
+
+ if ( instr( cMsg , "file:///" ) > 0 ) then
+ printlog( "Found File-URL" )
+ else
+ warnlog( "This does not appear to be a File-URL, please check!" )
+ endif
+
+ if ( instr( cMsg , EXTENSION_NAME ) > 0 ) then
+ printlog( "Extension string is present" )
+ else
+ warnlog( "Extension name seems to be missing" )
+ endif
+
+ if ( dir( cMsg ) = "" ) then
+ warnlog( "The extension could not be found at the expected location" )
+ else
+ printlog( "Extension found. Good." )
+ endif
+
+ endif
+ active.ok()
+ else
+ warnlog( "No messagebox displayed, please check that the macro is executed" )
+ endif
+
+ irc = hExtensionRemoveGUI( EXTENSION_NAME )
+ if ( irc <> 0 ) then
+ warnlog( "the extension was NOT cleanly removed" )
+ endif
+
+ hDestroyDocument()
+
+endcase
+
diff --git a/testautomation/extensions/optional/includes/meta-inf.inc b/testautomation/extensions/optional/includes/meta-inf.inc
new file mode 100755
index 000000000000..4d36586dd908
--- /dev/null
+++ b/testautomation/extensions/optional/includes/meta-inf.inc
@@ -0,0 +1,83 @@
+'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@oracle.com
+'*
+'* short description : Case sensitive META-INF in packages
+'*
+'\******************************************************************************
+
+testcase tLowerCaseMetaInf
+
+ printlog( "The filename <META-INF> in lowercase letters may prevent installation" )
+
+ dim cExtensionName as string
+ cExtensionName = "lowercasemetainf.oxt"
+
+ dim cExtensionPath as string
+ cExtensionPath = gTesttoolPath & "extensions\optional\input\errors\"
+ cExtensionPath = cExtensionPath & cExtensionName
+
+ dim irc as integer
+
+ printlog( "Install extension: " & cExtensionPath )
+ irc = hExtensionAddGUI( cExtensionPath, "AcceptLicense,InstallForUser" )
+
+ if ( irc > 0 ) then
+
+ printlog( "Check for unexpected messagebox" )
+ kontext "Active"
+ if ( Active.exists( 3 ) ) then
+ warnlog( "Extension should install after license has been displayed" )
+ printlog( Active.getText() )
+
+ printlog( "Trying to end test gracefully" )
+ Active.ok()
+
+ printlog( "Close Extension Manager" )
+ kontext "PackageManager"
+ if ( PackageManager.exists( 3 ) ) then
+ PackageManager.close()
+ else
+ warnlog( "Cannot access Extension Manager" )
+ endif
+
+ else
+ printlog( "No messagebox, good." )
+ endif
+
+ printlog( "Remove extension" )
+ hExtensionRemoveGUI( cExtensionName )
+
+ else
+
+ warnlog( "The extension was not installed" )
+
+ endif
+
+endcase
+
diff --git a/testautomation/extensions/optional/includes/online_update.inc b/testautomation/extensions/optional/includes/online_update.inc
new file mode 100755
index 000000000000..24739132beaa
--- /dev/null
+++ b/testautomation/extensions/optional/includes/online_update.inc
@@ -0,0 +1,114 @@
+'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@oracle.com
+'*
+'* short description : Hit update button for an extension
+'*
+'\******************************************************************************
+
+testcase tExtensionUpdate
+
+ 'warnlog( "#i81543# Office crashes when Testtool executes .exists() method on some objects" )
+ 'goto endsub
+
+ '///<h3>Hit update button for an extension</h3>
+ '///<ul>
+
+ const EXTENSION_NAME = "ShortLicense.oxt"
+
+ dim cSampleExtension as string
+ cSampleExtension = gTesttoolPath & "extensions\optional\input\simpleLicense\"
+ cSampleExtension = cSampleExtension & EXTENSION_NAME
+ cSampleExtension = convertpath( cSampleExtension )
+
+ dim iDocumentsBefore as integer
+ dim iDocumentsAfter as integer
+
+ printlog( "" )
+
+ if ( dir( cSampleExtension ) <> "" ) then
+ printlog( "Using extension: " & cSampleExtension )
+ else
+ warnlog( "Fatal: Sample extension could not be found: " & cSampleExtension )
+ goto endsub
+ endif
+ printlog( "" )
+
+
+ '///+<li>Create a new writer document</li>
+ hNewDocument()
+
+ '///+<li>get the number of open documents (should be 2)</li>
+ iDocumentsBefore = getDocumentCount()
+
+ '///+<li>Add sample extension &quot;ShortLicense&quot;</li>
+ hExtensionAddGUI( cSampleExtension , "InstallForUser,AcceptLicense,Verbose" )
+
+ '///+<li>Reopen the Extension Manager</li>
+ printlog( "Reopen Extension Manager" )
+ ToolsPackageManager
+
+ '///+<li>Click the &quot;Update&quot;-button</li>
+ printlog( "Click the update-button" )
+ kontext "PackageManager"
+ updates.click()
+
+ '///+<li>verif y that the update-Dialog is present</li>
+ kontext "ExtensionUpdate"
+ if ( ExtensionUpdate.exists() ) then
+ printlog( "Close update-dialog. Good." )
+ ExtensionUpdate.cancel()
+ else
+ warnlog( "Extension update dialog is missing" )
+ endif
+
+ '///+<li>Close the Extension Manager"
+ kontext "PackageManager"
+ if ( PackageManager.exists() ) then
+ printlog( "Close Extension Manager" )
+ PackageManager.close()
+ endif
+
+ '///+<li>verify that we still have the correct number of documents open</li>
+ iDocumentsAfter = getDocumentCount()
+ if ( iDocumentsAfter <> iDocumentsBefore ) then
+ warnlog( "Incorrect number of documents open. Please verify" )
+ else
+ printlog( "Correct number of documents are open. Good" )
+ endif
+
+ '///+<li>Close the second document</li>
+ hCloseDocument()
+
+ '///+<li>Remove the extension</li>
+ hExtensionRemoveGUI( EXTENSION_NAME )
+
+ '///</ul>
+
+endcase
+
diff --git a/testautomation/extensions/optional/includes/options.inc b/testautomation/extensions/optional/includes/options.inc
new file mode 100755
index 000000000000..ff30ba00847b
--- /dev/null
+++ b/testautomation/extensions/optional/includes/options.inc
@@ -0,0 +1,172 @@
+'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@oracle.com
+'*
+'* short description : Options for extensions
+'*
+'\******************************************************************************
+
+testcase tExtensionOptions1
+
+ '///<h3>Options for extensions</h3>
+ '///<ul>
+
+ const EXTENSION_NAME = "leaf1.oxt"
+ const OPTIONS_ITEM = "Writer leaf1 en-US"
+ const ITEM_POS_1 = 2
+ const ITEM_POS_2 = 35
+ const ITEM_POS_2_ASIAN = 38
+
+ dim cExtensionName as string
+
+ dim cExtensionPath as string
+ cExtensionPath = gTesttoolPath & "extensions\optional\input\options\"
+
+ dim cExtensionFile as string
+ cExtensionFile = convertpath( cExtensionPath & EXTENSION_NAME )
+
+ dim irc as integer
+ dim brc as boolean
+
+ '///+<li>Create one single writer document, the node will be merged into it</li>
+ do while ( getDocumentCount > 0 )
+ hCloseDocument()
+ loop
+ gApplication = "WRITER"
+ hNewDocument()
+ kontext "DocumentWriter"
+ DocumentWriter.typeKeys( "tExtensionOptions1" )
+
+
+ '///+<li>Open the Extension Manager, click Add</li>
+ '///+<li>Load the sample extension &quot;leaf1.oxt&quot;</li>
+ '///+<li>Close the Extension Manager</li>
+ printlog( "Add sample extension" )
+ hExtensionAddGUI( cExtensionFile, "verbose,InstallForUser" )
+
+ '///+<li>Reopen the Extension Manager</li>
+ printlog( "Reopen the Extension Manager" )
+ ToolsPackageManager
+ kontext "PackageManager"
+
+ '///+<li>Select the extension by name</li>
+ printlog( "Move from the top node to the sample extension" )
+ BrowsePackages.select( EXTENSION_NAME )
+
+ '///+<li>Test some control states for leaf1.oxt node</li>
+ printlog( "Verify control states" )
+ '///<ul>
+ '///+<li>Add... (enabled)</li>
+ if ( not Add.isEnabled() ) then
+ warnlog( "Add button should be enabled" )
+ endif
+
+ '///+<li>Remove (enabled)</li>
+ if ( not Remove.isEnabled() ) then
+ warnlog( "Remove button should be enabled" )
+ endif
+
+ '///+<li>Enable (hidden)</li>
+ if ( Enable.exists() ) then
+ warnlog( "Enable button should be hidden" )
+ endif
+
+ '///+<li>Disable (enabled)</li>
+ if ( not Disable.isEnabled() ) then
+ warnlog( "Disable button should be enabled" )
+ endif
+
+ '///+<li>Updates... (enabled)</li>
+ if ( not Updates.isEnabled() ) then
+ warnlog( "Updates button should be enabled" )
+ endif
+
+ '///+<li>Options... (enabled)</li>
+ if ( not Options.isEnabled() ) then
+ warnlog( "Options button should be enabled" )
+ endif
+ '///</ul>
+
+ '///+<li>Click on the Options... button</li>
+ printlog( "Open Options dialog from Extension Manager" )
+ kontext "PackageManager"
+ if ( options.exists() ) then
+ options.click()
+
+ '///+<li>Verify that the node &quot;leaf1&quot; is at pos 2 (absolute)</li>
+ printlog( "Verify presence and position of the leaf node" )
+ irc = hSelectOptionsItem( OPTIONS_ITEM , ITEM_POS_1 )
+ if ( irc > 0 ) then
+ warnlog( "Test failed" )
+ endif
+
+ '///+<li>Close Options dialog (cancel)
+ printlog( "Cancel Options dialog to get back to the Extension Manager" )
+ OptionenDlg.cancel()
+
+ else
+ warnlog( "Options button does not exist/implemented in CWS jl61" )
+ endif
+
+ '///+<li>Close the Extension Manager</li>
+ kontext "PackageManager"
+ printlog( "Close the Extension Manager" )
+ PackageManager.close()
+
+ '///+<li>Open Tools/Options</li>
+ printlog( "From the document open Tools/Options" )
+ ToolsOptions
+
+ printlog( "Verify presence and position of the leaf node" )
+ if ( bAsianLan ) then
+ irc = hSelectOptionsItem( OPTIONS_ITEM , ITEM_POS_2_ASIAN )
+ else
+ irc = hSelectOptionsItem( OPTIONS_ITEM , ITEM_POS_2 )
+ endif
+ if ( irc > 1 ) then
+ warnlog( "Node <" & OPTIONS_ITEM & "> was not found in Tools/Options" )
+ else
+ printlog( "Node is present. Good." )
+ endif
+
+ Kontext "OptionenDlg"
+ printlog( "Cancel Tools/Options to get back to the document" )
+ OptionenDlg.cancel()
+
+ '///+<li>Cleanup: Remove the sample extension</li>
+ printlog( "Remove sample extension" )
+ hExtensionRemoveGUI( EXTENSION_NAME )
+
+ '///+<li>Cleanup: Close document</li>
+ do while ( getDocumentCount > 0 )
+ hCloseDocument()
+ loop
+
+ '///<ul>
+endcase
+
diff --git a/testautomation/extensions/optional/includes/platforms.inc b/testautomation/extensions/optional/includes/platforms.inc
new file mode 100644
index 000000000000..eaac40b777cb
--- /dev/null
+++ b/testautomation/extensions/optional/includes/platforms.inc
@@ -0,0 +1,126 @@
+'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@oracle.com
+'*
+'* short description : Supported extension platforms
+'*
+'\******************************************************************************
+
+testcase tExtensionPlatforms
+
+ printlog( "Verify that only extensions designed for this platform are installed" )
+
+ dim cBasePath as string
+ cBasePath = gTesttoolPath & "extensions\optional\input\platform\"
+ cBasePath = convertpath( cBasePath )
+
+ dim cConfigFile as string
+ cConfigFile = cBasePath & "extensions.info"
+
+ dim iExtensionCount as integer
+ dim iCurrentExtension as integer
+
+ dim cCurrentExtensionName as string
+ dim cCurrentExtensionPath as string
+ dim cCurrentExtensionFile as string
+ dim cCurrentExtensionPlatform as string
+ dim cInfoArray( 200 ) as string
+
+ dim iStatus as integer
+ dim bShouldInstall as boolean
+
+ hGetDataFileSection( cConfigFile, cInfoArray(), "general", "", "" )
+ iExtensionCount = hGetValueForKeyAsInt( cInfoArray(), "ExtensionCount" )
+
+ for iCurrentExtension = 1 to iExtensionCount
+
+ hGetDataFileSection( cConfigFile, cInfoArray(), iCurrentExtension, "" , "" )
+ cCurrentExtensionFile = hGetValueForKeyAsString( cInfoArray(), "File" )
+ cCurrentExtensionName = hGetValueForKeyAsString( cInfoArray(), "Name" )
+ cCurrentExtensionPath = cBasePath & cCurrentExtensionFile
+ cCurrentExtensionPlatform = hGetValueForKeyAsString( cInfoArray(), "Platform" )
+
+ ' Find out whether the extension should install or not
+ select case ( cCurrentExtensionPlatform )
+ case "all" : bShouldInstall = TRUE
+ case gtSysName : bShouldInstall = TRUE
+ case gPlatGroup : bShouldInstall = TRUE
+ case gPlatform : bShouldInstall = TRUE
+ case else : bShouldInstall = FALSE
+ end select
+
+ printlog( "" )
+ printlog( "("+iCurrentExtension+"/"+iExtensionCount+") Current extension: " & cCurrentExtensionFile )
+ iStatus = hExtensionAddGUI( cCurrentExtensionPath, "InstallForUser, NoLicense, NoUpdate, Verbose" )
+
+ if ( iStatus = -7 or iStatus >= 0 ) then
+
+ kontext "Active"
+ if ( Active.exists( 2 ) ) then
+ select case ( bShouldInstall )
+ case TRUE : warnlog( "Extension should install but a warning is displayed" )
+ case FALSE : printlog( "Extension is for another platform, it is not installed" )
+ end select
+ Active.ok()
+ else
+ select case ( bShouldInstall )
+ case TRUE : printlog( "No platform mismatch warning. Good." )
+ case FALSE : warnlog( "Platform mismatch warning is missing!" )
+ end select
+ endif
+
+ kontext "PackageManager"
+ if ( PackageManager.exists( 1 ) ) then PackageManager.close()
+
+ iStatus = hExtensionRemoveGUI( cCurrentExtensionName )
+
+ select case ( iStatus )
+ case 0: ' Extension was removed successfully
+ select case ( bShouldInstall )
+ case TRUE : printlog( "Extension was installed and removed, good" )
+ case FALSE : warnlog( "The extension was removed but should not be installed" )
+ end select
+ case 3: ' Extension was not found at removal
+ select case ( bShouldInstall )
+ case TRUE : warnlog( "The extension should have been installed but is missing" )
+ case FALSE : printlog( "The extension was not installed. Good" )
+ end select
+ case else : ' Any other returnvalue is bad
+ warnlog( "Unexpected returnvalue from function: " & iStatus )
+ end select
+
+ else
+ warnlog( "Bad status returned, installation of extension failed" )
+ goto endsub
+ endif
+
+ next iCurrentExtension
+
+endcase
+
+
diff --git a/testautomation/extensions/optional/includes/publisher.inc b/testautomation/extensions/optional/includes/publisher.inc
new file mode 100755
index 000000000000..739b28edaef8
--- /dev/null
+++ b/testautomation/extensions/optional/includes/publisher.inc
@@ -0,0 +1,286 @@
+'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@oracle.com
+'*
+'* short description : Extension publisher and release notes
+'*
+'\******************************************************************************
+
+testcase tExtensionPublisher
+
+ printlog( "Extension Manager and Release Notes" )
+
+ if ( gISOLang <> "en-US" ) then
+ qaerrorlog( "Test does not handle translated strings, aborting" )
+ goto endsub
+ endif
+
+ ' Specification document
+ ' http://specs.openoffice.org/appwide/packagemanager/online_update_for_extensions.odt
+ ' http://specs.openoffice.org/appwide/packagemanager/online_update_for_extensions.odt
+
+ ' This is the path where the test-extensions and the info file are located
+ dim cBasePath as string
+ cBasePath = gTesttoolPath & "extensions/optional/input/publisher/"
+ cBasePath = convertpath( cBasePath )
+
+ ' Modify this file to add test cases or attributes
+ dim cInfoFile as string : cinfoFile = cBasePath & "extension.info"
+
+ ' The number of files to test. Information about this is stored in the file
+ ' specified by cInfoFile
+ dim iFileCount as integer
+ dim iCurrentFile as integer
+ dim iExtensionCount as integer
+ dim iExitCounter as integer
+ dim iCurrentExtensionCount as integer : iCurrentExtensionCount = 0
+ dim iTry as integer
+
+ ' This is the data we get from the configuration file
+ dim cCurrentFileName as string
+ dim cHasReleaseNotes as string
+ dim cReleaseNotes as string
+ dim cHasPublisher as string
+ dim cPublisher as string
+
+ ' This is where we store the configuration data. This array must have more
+ ' lines than cInfoFile contains.
+ dim cConfigArray( 60 ) as string
+
+ dim cTestString as string
+ dim bInstallationComplete as boolean : bInstallationComplete = false
+
+ iExtensionCount = hGetExtensionCount()
+
+
+ hGetDataFileSection( cInfoFile, cConfigArray(), "info", "", "" )
+ iFileCount = int( hGetValueForKeyAsString( cConfigArray() , "filecount" ) )
+ printlog( cInfoFile & " specifies " & iFileCount & " documents to load" )
+
+ iExtensionCount = iExtensionCount + iFileCount
+ printlog( "Expected number of extensions after installation: " & iExtensionCount )
+
+ printlog( "Installing extensions" )
+ for iCurrentFile = 1 to iFileCount
+
+ hGetDataFileSection( cInfoFile, cConfigArray(), iCurrentFile, "", "" )
+ cCurrentFileName = hGetValueForKeyAsString( cConfigArray() , "file" )
+ cCurrentFileName = cBasePath & cCurrentFileName
+ sExtensionCLI( "add" , cCurrentFileName )
+ wait 1000 ' This is required, sExtensionCLI is asynchronous.
+
+ next iCurrentFile
+ printlog( "Finished installing extensions, now verifying..." )
+
+ hNewDocument()
+ ToolsPackageManager
+
+ kontext "PackageManager"
+ if ( PackageManager.exists( 3 ) ) then
+
+ for iTry = 1 to 30
+
+ iCurrentExtensionCount = BrowsePackages.getItemCount()
+
+ if ( iCurrentExtensionCount = iExtensionCount ) then
+ printlog( "All extensions have been installed, good." )
+ bInstallationComplete = true
+ exit for
+ endif
+
+ printlog( "Waiting for listbox: Number of extensions: " & iCurrentExtensionCount )
+ wait( 1000 ) ' Required, the list takes considerable time to fill.
+
+ next iTry
+
+ ' If one or more extensions have not been added to the list we better abort the
+ ' test as the remaining parts need all extensions to be installed causing
+ ' lots of cryptig errors to appear in the log.
+ if ( not bInstallationComplete ) then
+ warnlog( "Not all extensions have been installed. Aborting test." )
+ kontext "PackageManager"
+ if ( PackageManager.exists() ) then
+ PackageManager.cancel()
+ PackageManager.notExists( 2 )
+ endif
+ goto endsub
+ endif
+ else
+ warnlog( "The Extension Manager did not open, Aborting test" )
+ goto endsub
+ endif
+
+
+ kontext "PackageManager"
+ printlog( "Going for the update-dialog" )
+ if ( Updates.isEnabled() ) then
+
+ printlog( "Updates-button is enabled" )
+ Updates.click()
+
+ kontext "ExtensionUpdate"
+ if ( ExtensionUpdate.exists( 2 ) ) then
+
+ iExitCounter = 0
+ do while ( AvailableUpdatesList.getItemCount() < iFileCount )
+ printlog( "Waiting for Updates List to populate..." )
+ wait( 1000 )
+ iExitCounter = iExitCounter + 1
+ if ( iExitCounter = 200 ) then
+ warnlog( "Update list for extensions is stalled (expected: 7), " & _
+ "found: " & AvailableUpdatesList.getItemCount() )
+ kontext "ExtensionUpdate"
+ ExtensionUpdate.cancel()
+ ExtensionUpdate.notExists( 2 )
+ kontext "PackageManager"
+ PackageManager.cancel()
+ PackageManager.notExists( 2 )
+ goto endsub
+ endif
+ loop
+
+ if ( ShowAllUpdates.exists() ) then
+ if ( ShowAllUpdates.isEnabled() ) then
+ warnlog( """Show all updates"" should be disabled" )
+ else
+ printlog( """Show all updates"" is disabled, good" )
+ endif
+ else
+ qaerrorlog( """Show all updates"" checkbox could not be accessed" )
+ endif
+
+ if ( AvailableUpdatesList.isEnabled() ) then
+
+ printlog( "Available updates list populated in " & iExitCounter & " seconds" )
+
+ if ( iExitCounter < 20 ) then
+
+ for iCurrentFile = 1 to iFileCount
+
+ hGetDataFileSection( cInfoFile, cConfigArray(), iCurrentFile, "", "" )
+ cCurrentFileName = hGetValueForKeyAsString( cConfigArray() , "display_name" )
+
+ cHasReleaseNotes = hGetValueForKeyAsString( cConfigArray() , "has_release_notes" )
+ cReleaseNotes = hGetValueForKeyAsString( cConfigArray() , "release_notes" )
+
+ cHasPublisher = hGetValueForKeyAsString( cConfigArray() , "has_publisher" )
+ cPublisher = hGetValueForKeyAsString( cConfigArray() , "publisher" )
+
+ AvailableUpdatesList.select( iCurrentFile )
+
+ if ( AvailableUpdatesList.getText() = cCurrentFileName ) then
+ printlog( "Testing extension: " & cCurrentFileName )
+
+ if ( lcase( cHasReleaseNotes ) = "yes" ) then
+ if ( ReleaseNotesText.isVisible() ) then
+ printlog( " - Release notes text is visible. Good." )
+ qaerrorlog( "#i84700# cannot read static text on extension update dialog" )
+ 'cTestString = ReleaseNotesText.getSelText()
+ 'if ( cTestString = cReleaseNotes ) then
+ ' printlog( " - Release notes text is ok." )
+ 'else
+ ' warnlog( "Incorrect release notes text" )
+ ' printlog( "Expected: " & cReleaseNotes )
+ ' printlog( "Found...: " & ctestString )
+ 'endif
+ else
+ warnlog( "Release notes text is not visible" )
+ endif
+ else
+ if ( ReleaseNotesText.isVisible() ) then
+ warnlog( "Release notes should not be visible" )
+ else
+ printlog( " - No release notes for this extension." )
+ endif
+ endif
+
+ if ( lcase( cHasPublisher ) = "yes" ) then
+ if ( UpdatePublisherText.isVisible() ) then
+ printlog( " - Publisher text is visible. Good." )
+ qaerrorlog( "#i84700# cannot read static text" )
+ 'cTestString = UpdatePublisherText.getText()
+ 'if ( cTestString = cPublisher ) then
+ ' printlog( " - Release notes text is ok." )
+ 'else
+ ' warnlog( "Incorrect release notes text" )
+ ' printlog( "Expected: " & cPublisher )
+ ' printlog( "Found...: " & ctestString )
+ 'endif
+ else
+ warnlog( "Publisher text is not visible." )
+ endif
+ else
+ if ( UpdatePublisherText.isVisible() ) then
+ warnlog( "Publisher should not be visible." )
+ else
+ printlog( " - No Publisher for this extension." )
+ endif
+ endif
+
+ else
+ printlog( "The extension is not at the expected position" )
+ printlog( "Expected: " & cCurrentFileName )
+ printlog( "Found...: " & AvailableUpdatesList.getText() )
+ exit for
+ endif
+
+ next iCurrentFile
+ else
+ warnlog( "Updates list not fully populated in 15 seconds -> fail" )
+ endif
+ else
+ warnlog( "No extensions available for update. Installation failed?" )
+ endif
+
+ kontext "ExtensionUpdate"
+ ExtensionUpdate.cancel()
+ ExtensionUpdate.notExists( 2 )
+ else
+ warnlog( "Extension Update dialog is not open" )
+ endif
+
+ else
+ warnlog( "Update-button on extension manager ui is disabled" )
+ endif
+
+ kontext "PackageManager"
+ PackageManager.close()
+ PackageManager.notExists( 2 )
+
+ printlog( "Removing extensions" )
+ for iCurrentFile = 1 to iFileCount
+ hGetDataFileSection( cInfoFile, cConfigArray(), iCurrentFile, "", "" )
+ cCurrentFileName = hGetValueForKeyAsString( cConfigArray() , "file" )
+ sExtensionCLI( "remove" , cCurrentFileName )
+ next iCurrentFile
+ printlog( "Finished removing extensions" )
+
+ hFileCloseAll()
+
+endcase
+