diff options
author | Joerg Sievers <jsi@openoffice.org> | 2008-06-16 06:43:46 +0000 |
---|---|---|
committer | Joerg Sievers <jsi@openoffice.org> | 2008-06-16 06:43:46 +0000 |
commit | 8811ad3b73d19555db0dbb7fe71d87ebd4762f28 (patch) | |
tree | d7cd8ff36d718479cc063cfdd3cb95b523977250 /testautomation/dbaccess/required/includes | |
parent | 0726d12d9b6161a9711cb6fd9749bf36c662889f (diff) |
changed structure which will be included into the CWS process.
Diffstat (limited to 'testautomation/dbaccess/required/includes')
-rwxr-xr-x | testautomation/dbaccess/required/includes/DatabaseTypes.inc | 742 | ||||
-rwxr-xr-x | testautomation/dbaccess/required/includes/Forms.inc | 97 | ||||
-rwxr-xr-x | testautomation/dbaccess/required/includes/MainApp.inc | 612 | ||||
-rwxr-xr-x | testautomation/dbaccess/required/includes/Query.inc | 982 | ||||
-rwxr-xr-x | testautomation/dbaccess/required/includes/ReportBuilder01.inc | 831 | ||||
-rwxr-xr-x | testautomation/dbaccess/required/includes/Table.inc | 649 | ||||
-rwxr-xr-x | testautomation/dbaccess/required/includes/TableDesign.inc | 526 | ||||
-rwxr-xr-x | testautomation/dbaccess/required/includes/Wizards.inc | 241 | ||||
-rwxr-xr-x | testautomation/dbaccess/required/includes/Xforms01.inc | 491 |
9 files changed, 5171 insertions, 0 deletions
diff --git a/testautomation/dbaccess/required/includes/DatabaseTypes.inc b/testautomation/dbaccess/required/includes/DatabaseTypes.inc new file mode 100755 index 000000000000..6d57ad4e4cc7 --- /dev/null +++ b/testautomation/dbaccess/required/includes/DatabaseTypes.inc @@ -0,0 +1,742 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: DatabaseTypes.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 07:43:45 $ +'* +'* 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 : marc.neumann@sun.com +'* +'* short description : test the database types +'* +'************************************************************************ +'* +' #1 tMySQLODBCProperties +' #1 tMySQLJDBCProperties +' #1 tAdabasProperties +' #1 tOracleJDBCProperties +' #1 tJDBCProperties +' #1 tODBCProperties +' #1 tdBaseProperties +' #1 tTextProperties +' #1 tSpreadsheetProperties +' #1 tMozillaProperties +' #1 tLDAPProperties +' #1 tEvolutionProperties +' #1 tCheckHSQLDB +'* +'\*********************************************************************************** +sub DatabaseTypes + + printlog "------------------ DatabaseTypes.inc ---------------------" + + call tMySQLODBCProperties + call tMySQLJDBCProperties + call tAdabasProperties + call tOracleJDBCProperties + call tJDBCProperties + call tODBCProperties + call tdBaseProperties + call tTextProperties + call tSpreadsheetProperties + call tMozillaProperties + call tLDAPProperties + call tEvolutionProperties + call tCheckHSQLDB + +end sub +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +testcase tMySQLODBCProperties + + call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) + + ViewForms + + Kontext "Insight" + Insight.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + DataBaseType.select(getIdForDatabaseType("MySQLODBC")) + + Kontext "ConnectionType" + NextBtn.Click + sleep(1) + call fCheckConnectionTabPage("MySQLODBC") + + Kontext "ConnectionType" + NextBtn.Click + sleep(1) + + Kontext "TabMySQLODBC" + '/// check the MySQLODBC page + call fCheckTabPage(TabMySQLODBC) + + Kontext "ConnectionType" + ConnectionType.OK + + call fCheckAdvancedDialog("MySQLODBC") + + call fCloseDatabase() + +endcase +'------------------------------------------------------------------------- +testcase tMySQLJDBCProperties + + call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) + + ViewForms + + Kontext "Insight" + Insight.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + DataBaseType.select(getIdForDatabaseType("MySQLJDBC")) + + Kontext "ConnectionType" + NextBtn.Click + sleep(1) + call fCheckConnectionTabPage("MySQLJDBC") + + Kontext "ConnectionType" + NextBtn.Click + sleep(1) + + Kontext "TabMySQLJDBC" + '/// check the MySQLJDBC page + call fCheckTabPage(TabMySQLJDBC) + + Kontext "ConnectionType" + ConnectionType.OK + + call fCheckAdvancedDialog("MySQLJDBC") + + call fCloseDatabase() + +endcase +'------------------------------------------------------------------------- +testcase tAdabasProperties + + if gPlatform = "x86" then + printlog "Adabas is not available under x86." + goto endsub + end if + + if gPlatform = "osx" then + printlog "Adabas doesn't exists under mac osx." + goto endsub + end if + + call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) + + ViewForms + + Kontext "Insight" + Insight.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + sleep(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + DataBaseType.select(getIdForDatabaseType("AdabasD")) + + Kontext "ConnectionType" + NextBtn.Click + sleep(1) + call fCheckConnectionTabPage("Adabas") + + Kontext "ConnectionType" + NextBtn.Click + sleep(1) + + Kontext "TabAdabas" + '/// check the Adabas page + call fCheckTabPage(TabAdabas) + + Kontext "ConnectionType" + ConnectionType.OK + + call fCheckAdvancedDialog("Adabas") + + call fCloseDatabase() + +endcase +'------------------------------------------------------------------------- +testcase tOracleJDBCProperties + + call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) + + ViewForms + + Kontext "Insight" + Insight.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + DataBaseType.select(getIdForDatabaseType("OracleJDBC") + + Kontext "ConnectionType" + NextBtn.Click + sleep(1) + call fCheckConnectionTabPage("OracleJDBC") + + Kontext "ConnectionType" + NextBtn.Click + sleep(1) + + Kontext "TabOracleJDBC" + '/// check the TabOracleJDBC page + call fCheckTabPage(TabOracleJDBC) + + Kontext "ConnectionType" + ConnectionType.Cancel + + call fCloseDatabase() + +endcase +'------------------------------------------------------------------------- +testcase tJDBCProperties + + call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) + + ViewForms + + Kontext "Insight" + Insight.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + DataBaseType.select(getIdForDatabaseType("JDBC") + + Kontext "ConnectionType" + NextBtn.Click + sleep(1) + call fCheckConnectionTabPage("JDBC") + + Kontext "ConnectionType" + ConnectionType.Cancel + + call fCloseDatabase() + +endcase +'------------------------------------------------------------------------- +testcase tLDAPProperties + + if gPlatform = "osx" then + printlog "LDAP doesn't exists under mac osx." + goto endsub + end if + + call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) + + ViewForms + + Kontext "Insight" + Insight.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + DataBaseType.select(getIdForDatabaseType("LDAP") + 1 ) ' +1 because for mysql there are 2 entries + + Kontext "ConnectionType" + NextBtn.Click + sleep(1) + call fCheckConnectionTabPage("LDAP") + + Kontext "ConnectionType" + NextBtn.Click + sleep(1) + + Kontext "TabLDAP" + '/// check the LDAP page + call fChecktabPage(TabLDAP) + + Kontext "ConnectionType" + ConnectionType.Cancel + + call fCloseDatabase() + +endcase +'------------------------------------------------------------------------- +testcase tEvolutionProperties + + if gPlatform <> "lin" then + printlog "Evolution does only exists under linux." + goto endsub + end if + + call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) + + ViewForms + + Kontext "Insight" + Insight.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + try + DataBaseType.select(getIdForDatabaseType("Evolution")) + catch + warnlog "failed to select DataBaseType Evolution - maybe not installed or activated in this build" + TabGeneral.Cancel + call fCloseDatabase + goto endsub + endcatch + + Kontext "ConnectionType" + ConnectionType.OK + + 'call fCheckAdvancedDialog("Evolution") + + call fCloseDatabase() + +endcase +'------------------------------------------------------------------------- +testcase tMozillaProperties + + if gPlatform = "osx" then + printlog "LDAP doesn't exists under mac osx." + goto endsub + end if + + call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) + + ViewForms + + Kontext "Insight" + Insight.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + DataBaseType.select(getIdForDatabaseType("Mozilla")) + + 'add sleep to give OOo time to react + sleep(2) + + Kontext "ConnectionType" + ConnectionType.OK + + 'call fCheckAdvancedDialog("Mozilla") + + 'add sleep to give OOo time to react + sleep(2) + + call fCloseDatabase() + +endcase +'------------------------------------------------------------------------- +testcase tSpreadsheetProperties + + call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) + + ViewForms + + Kontext "Insight" + Insight.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + DataBaseType.select(getIdForDatabaseType("Spreadsheet")) + + Kontext "ConnectionType" + NextBtn.Click + sleep(1) + call fCheckConnectionTabPage("Spreadsheet") + + Kontext "ConnectionType" + ConnectionType.Cancel + + 'call fCheckAdvancedDialog("Spreadsheet") + + call fCloseDatabase() + +endcase +'------------------------------------------------------------------------- +testcase tTextProperties + + call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) + + ViewForms + + Kontext "Insight" + Insight.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + DataBaseType.select(getIdForDatabaseType("Text")) + + Kontext "ConnectionType" + NextBtn.Click + sleep(1) + call fCheckConnectionTabPage("Text") + + Kontext "ConnectionType" + NextBtn.Click + sleep(1) + + Kontext "TabTextBase" + '/// check the Text page + call fCheckTabPage(TabTextBase) + + Kontext "ConnectionType" + ConnectionType.ok + + call fCheckAdvancedDialog("Text") + + call fCloseDatabase() + +endcase +'------------------------------------------------------------------------- +testcase tdBaseProperties + + call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) + + ViewForms + + Kontext "Insight" + Insight.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + DataBaseType.select(getIdForDatabaseType("dBase")) + + Kontext "ConnectionType" + NextBtn.Click + sleep(1) + call fCheckConnectionTabPage("dBase") + + Kontext "ConnectionType" + NextBtn.Click + sleep(1) + + Kontext "TabdBase" + '/// check the dBase page + call fCheckTabPage(TabdBase) + + Kontext "ConnectionType" + ConnectionType.OK + + call fCheckAdvancedDialog("dBase") + + call fCloseDatabase() + +endcase +'------------------------------------------------------------------------- +testcase tODBCProperties + + call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) + + ViewForms + + Kontext "Insight" + Insight.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + DataBaseType.select(getIdForDatabaseType("ODBC")) + + Kontext "ConnectionType" + NextBtn.Click + sleep(1) + call fCheckConnectionTabPage("ODBC") + + Kontext "ConnectionType" + NextBtn.Click + sleep(1) + + Kontext "TabODBC" + '/// check the ODBC page + call fCheckTabPage(TabODBC) + + Kontext "ConnectionType" + ConnectionType.OK + + call fCheckAdvancedDialog("ODBC") + + call fCloseDatabase() + +endcase +'------------------------------------------------------------------------- +testcase tCheckHSQLDB + + Dim sDatasourceFileName as String + sDatasourceFileName = ConvertPath(gOfficePath + "user/work/hsqldb.odb") + call fCreateHSQLDatasource(sDatasourceFileName) + + call fOpenDatabase(sDatasourceFileName) + + Kontext "ContainerView" + ViewTables + + call fCloseDatabase() + +endcase +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +function fCheckAdvancedDialog(sType as string) + + printlog "+Check the Advanced Settings for the datasource type " + sType + + Kontext "Insight" + Insight.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(3) + + Kontext "Advanced" + + if sType = "OracleJDBC" OR sType = "JDBC" OR sType = "ODBC" then + TabControl.setPage AdvancedSettingsSpecial + call fcheckControl(SQL92Check) + call fcheckControl(AppendAlias) + call fcheckControl(Ignoreprivileges) + call fcheckControl(ParameterSubstiti) + call fcheckControl(DisplayVersionColumns) + call fcheckControl(BooleanComparison) + call fcheckControl(EnableOuterJoin) + call fcheckControl(CheckRequiredFields) + + TabControl.setPage TabGeneratedValues + call fcheckControl(RetrieveGeneratedValues) + call fcheckControl(AutoIncrementStatement) + call fcheckControl(QueryGeneratedValues) + + elseif sType = "MySQLODBC" OR sType = "MySQLJDBC" then + + 'call fcheckControl(SQL92Check) + call fcheckControl(AppendAlias) + call fcheckControl(Ignoreprivileges) + call fcheckControl(ParameterSubstiti) + call fcheckControl(DisplayVersionColumns) + call fcheckControl(BooleanComparison) + call fcheckControl(EnableOuterJoin) + call fcheckControl(CheckRequiredFields) + + + elseif sType = "dBase" OR sType = "Text" then + call fcheckControl(SQL92Check) + 'call fcheckControl(BooleanComparison) + 'call fcheckControl(AppendAlias) + + elseif sType = "Spreadsheet" OR sType = "Mozilla" OR sType = "Evolution" OR sType = "LDAP" then + ' call fcheckControl(BooleanComparison) + ' call fcheckControl(AppendAlias) + + elseif sType = "Adabas" then + call fcheckControl(AppendAlias) + call fcheckControl(BooleanComparison) + call fcheckControl(SQL92Check) + call fcheckControl(DisplayVersionColumns) + call fcheckControl(CheckRequiredFields) + else + qaerrorlog "unknown database type" + end if + + Kontext "Advanced" + Advanced.Cancel + +end function +'------------------------------------------------------------------------- +function fcheckControl(oControl as object) + + if oControl.exists() then + printlog "|The control " + oControl.Name + " exists." + else + warnlog "|The control " + oControl.Name + " doesn't exists." + end if + +end function +'------------------------------------------------------------------------- +function fCheckConnectionTabPage(sType as string) + + printlog "+check the connection page for the datasource type " + sType + + Kontext "TabConnection" + + call DialogTest(TabConnection) + + if sType = "MySQLODBC" then + call fcheckControl(MySQLODBCDatasource) + call fcheckControl(SelectPath) + call fcheckControl(Username) + call fcheckControl(PasswordRequired) + call fcheckControl(TestConnection) + + elseif sType = "MySQLJDBC" then + call fcheckControl(MySQLJDBCDatasource) + call fcheckControl(Username) + call fcheckControl(PasswordRequired) + call fcheckControl(TestConnection) + + elseif sType = "Adabas" then + call fcheckControl(AdabasDatasource) + call fcheckControl(SelectPath) + call fcheckControl(Username) + call fcheckControl(PasswordRequired) + call fcheckControl(TestConnection) + + elseif sType = "OracleJDBC" then + call fcheckControl(OracleJDBCDatasource) + call fcheckControl(Username) + call fcheckControl(PasswordRequired) + call fcheckControl(TestConnection) + + elseif sType = "JDBC" then + call fcheckControl(ConnectUrl) + call fcheckControl(Username) + call fcheckControl(PasswordRequired) + call fcheckControl(TestConnection) + call fcheckControl(TestDriver) + call fcheckControl(JDBCDriverClass) + + elseif sType = "ODBC" then + call fcheckControl(OdbcDatasourceName) + call fcheckControl(Username) + call fcheckControl(PasswordRequired) + call fcheckControl(TestConnection) + + elseif sType = "dBase" then + call fcheckControl(dBasePath) + call fcheckControl(SelectPath) + call fcheckControl(TestConnection) + + elseif sType = "Spreadsheet" then + call fcheckControl(SpreadsheetPath) + call fcheckControl(SelectPath) + call fcheckControl(TestConnection) + + elseif sType = "Text" then + call fcheckControl(TextPath) + call fcheckControl(SelectPath) + call fcheckControl(TestConnection) + + elseif sType = "LDAP" then + call fcheckControl(HostName) + call fcheckControl(TestConnection) + + elseif sType = "Mozilla" OR sType = "Evolution" then + call fcheckControl(TestConnection) + end if + +end function +'------------------------------------------------------------------------- +function fCheckTabPage(oType as object) + + printlog "+check the " + oType.Name + " page." + Kontext oType.Name + + call DialogTest(oType) + + if oType.Name = "TabMySQLJDBC" OR oType.Name = "TabOracleJDBC" then + call fcheckControl(CharSet) + call fcheckControl(HostName) + call fcheckControl(PortNumber) + call fcheckControl(DriverClass) + call fcheckControl(TestClass) + + elseif oType.Name = "TabAdabas" then + call fcheckControl(CharSet) + call fcheckControl(HostName) + call fcheckControl(CacheSize) + call fcheckControl(DataIncrement) + call fcheckControl(CotrolUser) + call fcheckControl(ControlPassword) + call fcheckControl(ShutdownService) + call fcheckControl(Extended) + + elseif oType.Name = "TabODBC" then + call fcheckControl(UseCatalogs) + call fcheckControl(Options) + call fcheckControl(CharSet) + + elseif oType.Name = "TabdBase" then + call fcheckControl(CharSet) + call fcheckControl(DisplayInactiveRecords) + call fcheckControl(Indexes) + + elseif ( oType.Name = "TabLDAP" ) then + call fcheckControl(BaseDN) + call fcheckControl(PortNumber) + call fcheckControl(Records) + + elseif ( oType.Name = "TabTextBase" ) then + call fcheckControl(TextContainsHeaders) + call fcheckControl(FieldSeparator) + call fcheckControl(TextSeparator) + call fcheckControl(DecimalSeparator) + call fcheckControl(ThousandsSeparator) + call fcheckControl(PlainTextFiles) + call fcheckControl(CVSFiles) + call fcheckControl(Custom) + call fcheckControl(CustomTxt) + call fcheckControl(CharSet) + end if + +end function diff --git a/testautomation/dbaccess/required/includes/Forms.inc b/testautomation/dbaccess/required/includes/Forms.inc new file mode 100755 index 000000000000..005ae4758e86 --- /dev/null +++ b/testautomation/dbaccess/required/includes/Forms.inc @@ -0,0 +1,97 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: Forms.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 07:43:45 $ +'* +'* 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 : marc.neumann@sun.com +'* +'* short description : test forms +'* +'************************************************************************ +'* +' #1 tNewFormDesign +'* +'\*********************************************************************************** +sub Forms + + printlog "------------------ Forms.inc ---------------------" + + call tNewFormDesign + +end sub +'------------------------------------------------------------------------- +testcase tNewFormDesign + + '/// open biblio database + printlog "open biblio database" + call fDateiOeffnen(gOfficePath + ConvertPath("user/database/biblio.odb")) + + Kontext "Insight" + + Insight.MouseDown(50,50) + Insight.MouseUp(50,50) + sleep(1) + + '/// view forms + printlog "view forms" + + ViewForms + + sleep(1) + + '/// open a new form design + printlog "open a new form design" + + NewFormDesign + + sleep(5) + + '/// close the form design + printlog "close the form design" + + Kontext "DocumentWriter" + DocumentWriter.UseMenu + hMenuSelectNr(8) ' the window menu + hMenuSelectNr(2) ' the Close Window + ' if messages box appear because of unsaved record click no in the dialog + Kontext "Messagebox" + if Messagebox.Exists(3) then + Messagebox.No + end if + + sleep(1) + + '/// close the database + printlog "close the database" + + call fCloseDatabase + +endcase diff --git a/testautomation/dbaccess/required/includes/MainApp.inc b/testautomation/dbaccess/required/includes/MainApp.inc new file mode 100755 index 000000000000..cc58ceecad35 --- /dev/null +++ b/testautomation/dbaccess/required/includes/MainApp.inc @@ -0,0 +1,612 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: MainApp.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 07:43:45 $ +'* +'* 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 : marc.neumann@sun.com +'* +'* short description : test the Main Application Window +'* +'************************************************************************ +'* +' #1 tMainApp +' #1 tMainMenuBar +' #1 tDatabaseProperties +' #1 tTableView +' #1 tPreview +' #1 tTableFilters +' #1 tRegisterDatabaseDialog +'* +'\*********************************************************************************** +sub MainApp + + printlog "------------------ MainApp.inc ---------------------" + + call tMainApp + call tMainMenuBar + call tDatabaseProperties + call tTableView + call tPreview + call tTableFilters + + call tRegisterDatabaseDialog + +end sub +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +testcase tTableFilters + + call fDateiOeffnen(gOfficePath + ConvertPath("user/database/biblio.odb")) + + Kontext "Insight" + + Insight.MouseDown(50,50) + Insight.MouseUp(50,50) + sleep(1) + TableFilters + sleep(1) + Kontext "TablesFilter" + + TablesFilter.Cancel + sleep 1 + + call hCloseDocument + + +endcase +'------------------------------------------------------------------------- +testcase tTableView + + call fDateiOeffnen(gOfficePath + ConvertPath("user/database/biblio.odb")) + + Kontext "Insight" + + Insight.MouseDown(50,50) + Insight.MouseUp(50,50) + + if not InsightSwapIconView.exists(1) then + warnlog "InsightSwapIconView doesn't exists" + goto endsub + end if + + '/// display Tables View + printlog "display Tables View" + ViewTables + Kontext "ContainerView" + if not TableTree.exists(1) then + warnlog "TableTree doesn't appear" + goto endsub + end if + + TableTree.TypeKeys("<HOME>") + TableTree.TypeKeys("<UP>") + + sleep(5) + + call hCloseDocument + +endcase +'------------------------------------------------------------------------- +testcase tMainApp + + dim iCount as integer ' the numbers of the items in the creation list. + + call fDateiOeffnen(gOfficePath + ConvertPath("user/database/biblio.odb")) + + Kontext "Insight" + + Insight.MouseDown(50,50) + Insight.MouseUp(50,50) + + Kontext "Insight" + if Insight.exists() then + printlog "Insight appear" + else + warnlog "Insight doesn't appear" + goto endsub + end if + + if InsightSwapView.exists() then + printlog "InsightSwapView appear" + else + warnlog "InsightSwapView doesn't appear" + goto endsub + end if + + '/// display Tables View + printlog "display Tables View" + ViewTables + if InsightTablesView.exists(1) then + printlog "InsightTablesView appear" + else + warnlog "InsightTablesView doesn't appear" + goto endsub + end if + + '/// count the items in the CreationList + printlog "count the items in the CreationList" + iCount = CreationList.getItemCount() + if ( iCount <> 2) then + warnlog "There are not 2 items in the CreationList. There are " + iCount + " items." + end if + + '/// display Queries View + printlog "display Queries View" + ViewQueries + if InsightQueriesView.exists(1) then + printlog "InsightQueriesView appear" + else + warnlog "InsightQueriesView doesn't appear" + goto endsub + end if + + '/// count the items in the CreationList + printlog "count the items in the CreationList" + iCount = CreationList.getItemCount() + if ( iCount <> 3) then + warnlog "There are not 3 items in the CreationList. There are " + iCount + " items." + end if + + '/// display Forms View + printlog "display Forms View" + ViewForms + Kontext "ContainerView" + if FormTree.exists(1) then + printlog "InsightFormsView appear" + else + warnlog "InsightFormsView doesn't appear" + goto endsub + end if + Kontext "Insight" + '/// count the items in the CreationList + printlog "count the items in the CreationList" + iCount = CreationList.getItemCount() + if ( iCount <> 2) then + warnlog "There are not 2 items in the CreationList. There are " + iCount + " items." + end if + + '/// display Reports View + printlog "display Reports View" + ViewReports + if InsightReportsView.exists(1) then + printlog "InsightReportsView appear" + else + warnlog "InsightReportsView doesn't appear" + goto endsub + end if + + '/// count the items in the CreationList + printlog "count the items in the CreationList" + Dim iCheckCount as Integer + iCount = CreationList.getItemCount() + if ( hIsExtensionAlreadyInstalled("sun-report-builder.oxt")) then + iCheckCount = 2 + else + iCheckCount = 1 + endif + if ( iCount <> iCheckCount ) then + warnlog "There are not " + iCheckCount + " items in the CreationList. There are " + iCount + " items." + end if + + call hCloseDocument + +endcase +'------------------------------------------------------------------------- +testcase tPreview + + call fDateiOeffnen(gOfficePath + ConvertPath("user/database/biblio.odb")) + + Kontext "Insight" + + Insight.MouseDown(50,50) + Insight.MouseUp(50,50) + + ViewTables + + sleep(1) + + Kontext "ContainerView" + TableTree.select 1 + + Kontext "Insight" + Insight.UseMenu + hMenuSelectNr(3) + hMenuSelectNr(4) + hMenuSelectNr(3) + + sleep(5) + + + Kontext "DatabaseBeamer" + if ( not DatabaseBeamer.exists(1) ) then + warnlog "the preview doesn't display the table" + else + printlog "preview displayed" + endif + + Kontext "Insight" + Insight.UseMenu + hMenuSelectNr(3) + hMenuSelectNr(4) + hMenuSelectNr(1) + + sleep(5) + + Kontext "DatabaseBeamer" + if ( DatabaseBeamer.exists(1) ) then + warnlog "the preview is still there" + else + printlog "preview turn off" + endif + + sleep(1) + + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tMainMenuBar + + dim iCount as integer ' the numbers of the items in the menu. + + call fDateiOeffnen(gOfficePath + ConvertPath("user/database/biblio.odb")) + + Kontext "Insight" + Insight.UseMenu + '/// check if there are 11 items in the file menu. + printlog "check if there are 11 items in the file menu." + '/// + there different count related to the file pick list. + printlog "+ there different count related to the file pick list." + hMenuSelectNr(1) ' the file menu + iCount = getMenuItemCount() + if (iCount <> 11 ) then + warnlog "There should be 11 items in the file menu but there are " + iCount + " items." + end if + + + '/// check if there are 12 items in the FILE/NEW menu. + printlog "check if there are 12 items in the FILE/NEW menu." + hMenuSelectNr(1) ' FILE/NEW menu + iCount = hMenuItemGetCount() + if (iCount <> 12) then + warnlog "There should 12 items in the FILE/NEW menu but there are " + iCount + " items." + end if + call hMenuClose() ' close the FILE menu + + '/// check the FILE/AUTOPILOTS + printlog "check the FILE/AUTOPILOTS" + Insight.UseMenu + hMenuSelectNr(1) ' the file menu + hMenuSelectNr(4) ' the autopilots menu + iCount = hMenuItemGetCount() + if (gOOO) then + if (iCount <> 10) then + warnlog "There should 10 items in the FILE/AUTOPILOTS menu but there are " + iCount + " items." + end if + else + if (iCount <> 8) then + warnlog "There should 8 items in the FILE/AUTOPILOTS menu but there are " + iCount + " items." + end if + endif + call hMenuClose() + + '/// check if there are 15 items in the edit menu. + printlog "check if there are 15 items in the edit menu." + Insight.UseMenu + hMenuSelectNr(2) + iCount = hMenuItemGetCount() + if (iCount <> 15) then + warnlog "There should 15 items in the edit menu but there are " + iCount + " items." + end if + call hMenuClose() + + '/// check if there are 6 items in the view menu. + printlog "check if there are 6 items in the view menu." + Insight.UseMenu + hMenuSelectNr(3) + iCount = hMenuItemGetCount() + if (iCount <> 6) then + warnlog "There should 6 items in the view menu but there are " + iCount + " items." + end if + call hMenuClose() + + '/// check the VIEW/DATABASE OBJECTS + printlog "check the VIEW/DATABASE OBJECTS" + Insight.UseMenu + hMenuSelectNr(3) + hMenuSelectNr(1) + iCount = hMenuItemGetCount() + if (iCount <> 4) then + warnlog "There should 4 items in the VIEW/DATABASE menu but there are " + iCount + " items." + end if + call hMenuClose() + + '/// check the VIEW/SORT OBJECTS + printlog "check the VIEW/SORT OBJECTS" + Insight.UseMenu + hMenuSelectNr(3) + hMenuSelectNr(5) + iCount = hMenuItemGetCount() + if (iCount <> 2) then + warnlog "There should 2 items in the VIEW/SORT menu but there are " + iCount + " items." + end if + call hMenuClose() + + '/// check the VIEW/PREVIEW + printlog "check the VIEW/PREVIEW" + Insight.UseMenu + hMenuSelectNr(3) + hMenuSelectNr(4 ) + iCount = hMenuItemGetCount() + if (iCount <> 3) then + warnlog "There should 3 items in the VIEW/PREVIEW menu but there are " + iCount + " items." + end if + call hMenuClose() + + '/// check if there are 8 items in the insert menu. + printlog "check if there are 8 items in the insert menu." + Insight.UseMenu + hMenuSelectNr(4) + iCount = hMenuItemGetCount() + if (iCount <> 8) then + warnlog "There should 8 items in the insert menu but there are " + iCount + " items." + end if + call hMenuClose() + + '/// check if there are 9 items in the tools menu. + printlog "check if there are 9 items in the tools menu." + Insight.UseMenu + hMenuSelectNr(5) + iCount = hMenuItemGetCount() + if (iCount <> 9) then + warnlog "There should 9 items in the tools menu but there are " + iCount + " items." + end if + call hMenuClose() + + '/// check if there are 4 items in the TOOLS/MACRO menu. + printlog "check if there are 4 items in the TOOLS/MACRO menu." + Insight.UseMenu + hMenuSelectNr(5) + hMenuSelectNr(5) + iCount = hMenuItemGetCount() + if (iCount <> 4) then + warnlog "There should 4 items in the TOOLS/MACRO menu but there are " + iCount + " items." + end if + call hMenuClose() + + call hCloseDocument + +endcase +'------------------------------------------------------------------------- +testcase tDatabaseProperties + + dim sValue as string + + call fDateiOeffnen(gOfficePath + ConvertPath("user/database/biblio.odb")) + + Kontext "Insight" + Insight.MouseDown(50,50) + Insight.MouseUp(50,50) + + Kontext "Insight" + Insight.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(1) + sleep(1) + Kontext "DatabaseProperties" + call DialogTest(DatabaseProperties) + ' TabControl.SetPage TabGeneral + ' + ' '/// check the general tabpage + ' printlog "check the general tabpage" + ' Kontext "TabGeneral" + ' 'TODO: check real names. + ' sValue = SourceName.getText() + ' if ( strComp(sValue,"TT_Biblio") <> 0 ) then + ' warnlog "The datasource name is not right. it should be 'TT_Biblio' but it is " + sValue + ' end if + ' sValue = DataBaseType.getSelText() + ' if ( strComp(sValue,"dBASE") <> 0 ) then + ' warnlog "The datasource type is not right. it should be 'dBase' but it is " + sValue + ' end if + ' + ' Advanced.Click + ' Kontext "Advanced" + ' Advanced.Close + +' tabconnection in this script == tabgeneral in the office ( historic reasons ) + '/// check the connection tabpage + printlog "check the connection tabpage" + Kontext "DatabaseProperties" + TabControl.SetPage TabConnection + + Kontext "TabConnection" + if NOT TabConnection.exists(1) then + warnlog "Tabpage doesn't exists." + end if + '/// check if the text in the path is correct + 'printlog "check if the text in the path is correct" + sValue = dBasePath.getText() + 'if ( strComp(sValue,"sdbc:dbase:$(userurl)/database/biblio") <> 0 ) then + ' warnlog "the path is not correct. It is " + sValue + 'end if + '/// click the select path button + printlog "click the select path button" + SelectPath.Click + + Kontext "GeneralFileDialog" + '/// cancel the open dialog + printlog "cancel the open dialog" + GeneralFileDialog.Cancel + + Kontext "TabConnection" + '/// click the test connection button + printlog "click the test connection button" + TestConnection.Click + + Kontext "Active" + '/// close the messagesdialog + printlog "close the messagesdialog" + Active.OK + + Kontext "DatabaseProperties" + '/// switch to the additional Settings + printlog "switch to the additional Settings" + TabControl.SetPage TabdBase + + Kontext "TabdBase" + '/// open the index dialog + printlog "open the index dialog" + Indexes.Click + + Kontext "Indexes" + '/// close the index dialog with cancel + Indexes.Cancel + + Kontext "DatabaseProperties" + '/// Cancel the datasource admin dialog + printlog "Cancel the datasource admin dialog" + DatabaseProperties.Cancel + + call hCloseDocument() + +endcase +'-------------------------------------------------------------------- +testcase tRegisterDatabaseDialog + + dim i as integer + '/// open new document + printlog "open new document" + call hNewDocument + '/// open TOOLS / OPTIONS + printlog "open TOOLS / OPTIONS" + ToolsOptions + '/// open Data Source / DATABASES + printlog "open Data Source / DATABASES" + call hToolsOptions ( "Datasources", "Databases" ) + + Kontext "TabRegisteredDatabase" + call DialogTest( TabRegisteredDatabase ) + if (RegisteredDatabases.getItemCount() = 0 ) then + warnlog "there are no registered databases. There should be at least a registered 'Bibliography' database." + Kontext "OptionenDlg" + OptionenDlg.Cancel + call hCloseDocument + goto endsub + endif + RegisteredDatabases.select 1 + '/// check if the Bibliography is registered + printlog "check if the Bibliography is registered" + if RegisteredDatabases.getSeltext() <> "Bibliography" then + warnlog "the bibliography database is not registered" + else + printlog "database bibliography is registered" + endif + '/// click in the delete button but don't delete the database + printlog "click in the delete button but don't delete the database" + DeleteBtn.Click + Kontext "Active" + Active.no + '/// click on the new button + printlog "click on the new button" + Kontext "TabRegisteredDatabase" + NewBtn.Click + sleep(1) + '/// cancel the new dialog + printlog "cancel the new dialog" + Kontext "CreateDatabaseLink" + call DialogTest( CreateDatabaseLink ) + CreateDatabaseLink.Cancel + + '/// click on the edit button + printlog "click on the edit button" + Kontext "TabRegisteredDatabase" + EditBtn.Click + sleep(1) + '/// cancel the edit dialog + Kontext "CreateDatabaseLink" + call DialogTest( CreateDatabaseLink ) + CreateDatabaseLink.Cancel + + sleep(1) + '/// close TOOLS / OPTIONS with cancel + printlog "close TOOLS / OPTIONS with cancel" + Kontext "OptionenDlg" + OptionenDlg.Cancel + + '/// close document + printlog "close document" + + call hCloseDocument + +endcase +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +function fDateiOeffnen ( DocName$ ) + + Dim DieDatei as String + + DieDatei = ConvertPath ( DocName$ ) + + FileOpen + sleep (1) + Kontext "OeffnenDlg" + Dateiname.SetText DieDatei + sleep (3) + Oeffnen.Click + sleep (3) + + fDateiOeffnen = true + +end function +'------------------------------------------------------------------------- +function getMenuItemCount as Integer +'use this function becasue this doesn't count the pick list + Dim i, j, Ende, nID as Integer + Sleep 2 + j=0 + for i=1 to MenuGetItemCount + if NOT MenuIsSeperator ( i ) then + dim s as String + s = Mid(MenuGetItemText( MenuGetItemID(i)),3,1) + 'printlog "s = " + s + 'printlog "MenuGetItemText( MenuGetItemID(i)) = " + MenuGetItemText( MenuGetItemID(i)) + if s <> ":" then + j=j+1 + endif + endif + next i + getMenuItemCount = j +end function + diff --git a/testautomation/dbaccess/required/includes/Query.inc b/testautomation/dbaccess/required/includes/Query.inc new file mode 100755 index 000000000000..29a9929e6422 --- /dev/null +++ b/testautomation/dbaccess/required/includes/Query.inc @@ -0,0 +1,982 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: Query.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 07:43:45 $ +'* +'* 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 : marc.neumann@sun.com +'* +'* short description : test the Main Query Application Window +'* +'************************************************************************ +'* +' #1 tMainMenuBar +' #1 tExecute +' #1 tClearQuery +' #1 tAddTable +' #1 tSwitchDesign +' #1 tNativeSQL +' #1 tFunctions +' #1 tTableName +' #1 tAliasName +' #1 tDistinctvalues +' #1 tEdit +' #1 tCut +' #1 tCopy +' #1 tPaste +' #1 tUndo +'* +'\*********************************************************************************** +sub Query + + printlog "------------------ Query.inc ---------------------" + + printlog "-------------------- main menu -------------------------" + call tMainMenuBar + + printlog "--------------------- toolbar --------------------------" + call tExecute + call tClearQuery + call tAddTable + call tSwitchDesign + call tNativeSQL + call tFunctions + call tTableName + call tAliasName + call tDistinctvalues + call tEdit + call tCut + call tCopy + call tPaste + call tUndo + +end sub +'------------------------------------------------------------------------- +testcase tClearQuery + + dim sTableName as String + + initQueryDesign + + Kontext "AddTables" + if not AddTables.Exists(5) then + warnlog "The Add Table dialog doesn't appear." + goto endsub + end if + sTableName = TableName.GetSelText + printlog "- Add 'biblio' table to query design" + if sTableName <> "biblio" then + warnlog "It should be the 'biblio'-database table but it is the '" + sTableName + "' database table?!" + goto endsub + else + AddTable.Click + sleep(2) + end if + Kontext "Toolbar" + printlog "- Deleting query" + ClearQuery.Click + sleep(5) + Kontext "Toolbar" + if ClearQuery.IsEnabled = TRUE then + warnlog "'Delete Query' button should be disabled after using it!" + end if + + call fCloseQueryDesign + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tNativeSQL + + dim sTableName as String + + initQueryDesign + + Kontext "AddTables" + '/// close the add table dialog + printlog "close the add table dialog" + if AddTables.Exists(5) then + CloseDlg.Click + end if + '/// switch to the SQL View and turn on the native SQL mode + printlog "switch to the SQL View and turn on the native SQL mode" + Kontext "Toolbar" + sleep(1) + DesignView.Click + sleep(1) + Kontext "Sqlobjectbar" + NativeSQL.Click + '/// check if the design view icon is disabled + Kontext "Toolbar" + if DesignView.isEnabled then + warnlog "The designview icon is enabled, but in Native SQL it mustn't" + end if + sleep(2) + + Kontext "Sqlobjectbar" + NativeSQL.Click + + Kontext "Toolbar" + DesignView.Click + + call fCloseQueryDesign + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tSwitchDesign + + dim sTableName as String + + call initQueryDesign + + Kontext "AddTables" + if AddTables.Exists(5) then + sTableName = TableName.GetSelText + printlog "- Add 'biblio' table to query design" + if sTableName <> "biblio" then + warnlog "It should be the 'biblio'-database table but it is the '" & SelEntry & "' database table?!" + goto endsub + else + AddTable.Click + sleep(2) + end if + Kontext "Toolbar" + printlog "- Design view clicked" + DesignView.Click + sleep(5) + Kontext "QueryEditWindow" + if QueryEditWindow.IsVisible = FALSE then + warnlog "The design window has not been disabled by clicking 'Design view' button!" + else + Kontext "Toolbar" + printlog "- Design view cliecked to switch back" + DesignView.Click + Kontext "QueryDesignTable" + if QueryDesignTable.IsVisible = FALSE then + warnlog "Switching back to 'design view' failed!" + end if + end if + end if + + call fCloseQueryDesign + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tTableName + + call initQueryDesign + + Kontext "AddTables" + if AddTables.Exists(5) then + TableName.Select 1 + AddTable.Click + else + warnlog "AddTables doesn't exists" + end if + sleep(1) + Kontext "QueryDesignCriterion" + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "Type" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<DOWN>" , 6 , true + sleep(1) + QueryDesignCriterion.TypeKeys "test" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<DOWN>" , true + sleep(1) + '/// turn off the table name field + printlog "turn off the table name field" + Kontext "Designobjectbar" + if Designobjectbar.exists(1) then + DBViewTableNames.Click + sleep(1) + else + warnlog "The Designobjectbar toolbar isn't visible." + end if + '/// check if the table field still there + printlog "check if the table field still there" + sleep(1) + Kontext "QueryDesignCriterion" + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<DOWN>" , 6 , true + sleep(1) + QueryDesignCriterion.TypeKeys "<HOME>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<SHIFT END>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<MOD1 C>" , true + sleep(1) + if getClipboard = "'test'" then + warnlog "TableName still there but I have switch them off" + end if + + call fCloseQueryDesign + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +testcase tExecute + + dim sTableName as String + + call initQueryDesign + + Kontext "AddTables" + if AddTables.Exists(5) then + '/// Adding biblio table to query design. + printlog "Adding biblio table to query design." + sTableName = TableName.GetSelText + printlog "- Add 'biblio' table to query design" + if sTableName <> "biblio" then + warnlog "It should be the 'biblio'-database table but it is the '" + sTableName + "' database table?!" + goto endsub + else + AddTable.Click + sleep(2) + end if + end if + Kontext "QueryDesignTable" + printlog "- Changing window" + '/// Switching with <b><F6></b> to <i>criterion</i> window (<a href="http://so-web4.germany.sun.com/eis/servlet/qa.FeatureEditServlet?Id=1168">feature 1168</a>) . + QueryDesignTable.TypeKeys "<F6>" , TRUE + Kontext "QueryDesignCriterion" + printlog "- Selecting 'field' as criteria" + '/// Selecting field as criteria. + Field.Select(2) + sleep(1) + '/// Typing <b><TAB></b> to switch to the <i>tool bar</i>. + QueryDesignCriterion.TypeKeys "<TAB>" , TRUE + sleep(1) + Kontext "Toolbar" + printlog "- Executing query" + '/// Ececuting query. + ExecuteBtn.Click + sleep(5) + Kontext "TableView" + '/// Verifying that <i>database beamer</i> (=result) is available. + if NOT TableView.Exists(3) then + warnlog "Execution of a query failed!" + end if + + call fCloseQueryDesign + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tAddTable + + dim sTableName as String + + call initQueryDesign + + '/// close the add table dialog + printlog "close the add table dialog" + Kontext "AddTables" + if AddTables.Exists(5) then + CloseDlg.Click + end if + '/// click on the add table icon in the toolbar of the query design + printlog "click on the add table icon in the toolbar of the query design" + Kontext "Designobjectbar" + sleep(1) + if Designobjectbar.exists(1) then + AddTables.Click + sleep(1) + else + warnlog "The Designobjectbar toolbar isn't visible." + end if + '/// check if the dialog opens + printlog "check if the dialog opens" + Kontext "AddTables" + if AddTables.Exists(5) then + CloseDlg.Click + else + warnlog "The AddTable dialog doesn't open" + end if + + call fCloseQueryDesign + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tFunctions + + initQueryDesign + + Kontext "AddTables" + if AddTables.Exists(5) then + TableName.Select 1 + AddTable.Click + end if + sleep(1) + Kontext "QueryDesignCriterion" + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "Type" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<DOWN>" , 6 , true + sleep(1) + QueryDesignCriterion.TypeKeys "test" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<DOWN>" , true + sleep(1) + '/// turn off the function field + printlog "turn off the function field" + Kontext "Designobjectbar" + if Designobjectbar.exists(1) then + DBViewFunctions.Click + sleep(1) + else + warnlog "The Designobjectbar toolbar isn't visible." + end if + + sleep(1) + '/// check if the function field still there + printlog "check if the function field still there" + sleep(1) + Kontext "QueryDesignCriterion" + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<DOWN>" , 6 , true + sleep(1) + QueryDesignCriterion.TypeKeys "<HOME>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<SHIFT END>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<MOD1 C>" , true + sleep(1) + if getClipboard = "'test'" then + warnlog "Functions still there but I have switch them off" + end if + + call fCloseQueryDesign + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tAliasName + + initQueryDesign + + Kontext "AddTables" + if AddTables.Exists(5) then + CloseDlg.Click + end if + '/// insert any aliasname into the alias field + printlog "insert any aliasname into the alias field" + sleep(1) + Kontext "QueryDesignCriterion" + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<DOWN>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "test" , true + sleep(1) + '/// turn off the alias field + printlog "turn off the alias field" + Kontext "Designobjectbar" + if Designobjectbar.exists(1) then + DBViewAliases.Click + sleep(1) + else + warnlog "The Designobjectbar toolbar isn't visible." + end if + sleep(1) + '/// check if the alias field still there + printlog "check if the alias field still there" + sleep(1) + Kontext "QueryDesignCriterion" + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<DOWN>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<HOME>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<SHIFT END>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<MOD1 C>" , true + sleep(1) + if getClipboard = "test" then + warnlog "Alias still there but I have switch them off" + end if + + call fCloseQueryDesign + call fCloseDatabase +endcase +'------------------------------------------------------------------------- +testcase tDistinctValues + + initQueryDesign + + Kontext "AddTables" + if AddTables.Exists(5) then + CloseDlg.Click + end if + '/// turn on the distinct vales + printlog "turn on the distinct vales" + Kontext "Designobjectbar" + sleep(1) + if Designobjectbar.exists(1) then + DBDistinctValues.Click + sleep(1) + DBDistinctValues.Click + sleep(1) + else + warnlog "The Designobjectbar toolbar isn't visible." + end if + call fCloseQueryDesign + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tEdit + + initQueryDesign + + Kontext "AddTables" + if AddTables.Exists(5) then + CloseDlg.Click + end if + '/// turn off the edit mode + printlog "turn off the edit mode" + Kontext "Toolbar" + sleep(1) + Edit.Click + sleep(1) + Kontext "Designobjectbar" + if Designobjectbar.exists(1) then + if DBDistinctValues.isEnabled then warnlog "DistincValues icon is enable, but when Edit is turn off, it mustn't." + if AddTables.isEnabled then warnlog "AddTables icon is enable, but when Edit is turn off, it mustn't." + else + warnlog "The Designobjectbar toolbar isn't visible." + end if + + Kontext "Toolbar" + if ClearQuery.isEnabled then warnlog "ClearQuery icon is enable, but when Edit is turn off, it mustn't." + + call fCloseQueryDesign + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tCut + + initQueryDesign + + '/// add any table ans select any field + printlog "add any table ans select any field" + Kontext "AddTables" + if AddTables.Exists(5) then + TableName.Select 1 + AddTable.Click + end if + Kontext "Toolbar" + sleep(1) + if Cut.isenabled then warnlog "The cut icon is enabled but it is nothing selected." + '/// select the fieldname and check if the cut button works + printlog "select the fieldname and check if the cut button works" + sleep(1) + Kontext "QueryDesignCriterion" + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "Type" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<DOWN>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<UP>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<SHIFT END>" , true + sleep(1) + + Kontext "Toolbar" + if Cut.isenabled then + Cut.Click + else + warnlog "The Cut icon is not enabled but I have select something" + DatabaseClose + Kontext "Messagebox" + if Messagebox.Exists(3) then + Messagebox.No + else + warnlog "There should be a message box because the query has been changed!" + end if + sleep(1) + call hCloseDocument + goto endsub + endif + + sleep(1) + '/// check if the text is in the clipboard + printlog "check if the text is in the clipboard" + if getClipboard <> "Type" then + warnlog "The Cut button doesn't work" + end if + + call fCloseQueryDesign + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tCopy + + initQueryDesign + + '/// add any table ans select any field + printlog "add any table ans select any field" + Kontext "AddTables" + if AddTables.Exists(5) then + TableName.Select 1 + AddTable.Click + end if + Kontext "Toolbar" + sleep(1) + if Copy.isenabled then warnlog "The copy icon is enabled but it is nothing selected.Bug 107845" + '/// select the fieldname and check if the copy button works + printlog "select the fieldname and check if the copy button works" + sleep(1) + Kontext "QueryDesignCriterion" + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "Type" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<DOWN>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<UP>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<SHIFT END>" , true + sleep(1) + + Kontext "Toolbar" + if Copy.isenabled then + Copy.Click + else + warnlog "The Copy icon is not enabled but I have select something" + DatabaseClose + Kontext "Messagebox" + if Messagebox.Exists(3) then + Messagebox.No + else + warnlog "There should be a message box because the query has been changed!" + end if + sleep(1) + call hCloseDocument + goto endsub + endif + + sleep(1) + '/// check if the text is in the clipboard + printlog "check if the text is in the clipboard" + if getClipboard <> "Type" then + warnlog "The Cut button doesn't work" + end if + + call fCloseQueryDesign + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tPaste + + initQueryDesign + + '/// add any table and select any field + printlog "add any table and select any field" + Kontext "AddTables" + if AddTables.Exists(5) then + TableName.Select 1 + AddTable.Click + else + warnlog "The AddTable dialog doesn't appear." + printlog "TEST STOPPED" + call fCloseQueryDesign + call fCloseDatabase + goto endsub + end if + '/// select the fieldname and check if the paste button works + printlog "select the fieldname and check if the paste button works" + sleep(1) + Kontext "QueryDesignCriterion" + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "Type" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<DOWN>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<UP>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<SHIFT END>" , true + sleep(1) + + Kontext "Toolbar" + if Copy.isenabled then + Copy.Click + else + warnlog "The Copy icon is not enabled but I have select something" + printlog "TEST STOPPED" + call fCloseQueryDesign + call fCloseDatabase + goto endsub + endif + + sleep(1) + '/// check if the text is in the clipboard + printlog "check if the text is in the clipboard" + if getClipboard <> "Type" then + warnlog "The Copy button doesn't work" + printlog "TEST STOPPED" + call fCloseQueryDesign + call fCloseDatabase + goto endsub + end if + + Kontext "QueryDesignCriterion" + QueryDesignCriterion.TypeKeys "<RIGHT>" , 2 , true + sleep(1) + + Kontext "Toolbar" + if Paste.isenabled then + Paste.Click + else + warnlog "The Paste icon is not enabled but I have copy something" + printlog "TEST STOPPED" + call fCloseQueryDesign + call fCloseDatabase + goto endsub + endif + sleep(1) + Kontext "QueryDesignCriterion" + QueryDesignCriterion.TypeKeys "1" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<HOME>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<SHIFT END>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<MOD1 C>" , true + sleep(1) + + if getClipboard <> "Type1" then + warnlog "The Paste button doesn't work" + end if + + call fCloseQueryDesign + call fCloseDatabase + + +endcase +'------------------------------------------------------------------------- +testcase tUndo + + initQueryDesign + + '/// close the add table dialog + printlog "close the add table dialog" + Kontext "AddTables" + if AddTables.Exists(5) then + CloseDlg.Click + end if + '/// click on the add table icon in the toolbar of the query design + printlog "click on the add table icon in the toolbar of the query design" + Kontext "Toolbar" + sleep(1) + if Undo.isenabled then warnlog "The undo icon is enabled but I have nothing done" + sleep(1) + '/// check if the dialog opens + printlog "check if the dialog opens" + Kontext "Designobjectbar" + if Designobjectbar.exists(1) then + AddTables.Click + sleep(1) + else + warnlog "The Designobjectbar toolbar isn't visible." + end if + Kontext "AddTables" + if AddTables.Exists(5) then + TableName.Select 1 + AddTable.Click + else + warnlog "The AddTable dialog doesn't open" + end if + Kontext "Toolbar" + if Undo.isenabled then + Undo.Click + Kontext "Designobjectbar" + if Designobjectbar.exists(1) then + if not AddTables.isenabled then warnlog "The undo button doesn't work" + sleep(1) + else + warnlog "The Designobjectbar toolbar isn't visible." + end if + else + warnlog "The undo icon is disabled but I have insert a table" + endif + + call fCloseQueryDesign + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tRedo + + initQueryDesign + + '/// close the add table dialog + printlog "close the add table dialog" + Kontext "AddTables" + if AddTables.Exists(5) then + CloseDlg.Click + printlog "The AddTables dialog exists, I close it." + else + printlog "The AddTables dialog doesn't exists, thats OK." + end if + '/// click on the add table icon in the toolbar of the query design + printlog "click on the add table icon in the toolbar of the query design" + Kontext "Toolbar" + sleep(1) + if Redo.isenabled then warnlog "The redo icon is enabled but I have nothing done" + '/// check if the dialog opens + printlog "check if the dialog opens" + Kontext "Toolbar" + sleep(1) + AddTables.Click + Kontext "AddTables" + if AddTables.Exists(5) then + TableName.Select 1 + AddTable.Click + else + warnlog "The AddTable dialog doesn't open" + end if + Kontext "Toolbar" + if Undo.isenabled then + Undo.Click + sleep(1) + Redo.Click + sleep(1) + if AddTables.isenabled then warnlog "The redo button doesn't work" + else + warnlog "The undo icon is disabled but I have insert a table" + endif + + sleep(1) + + call fCloseQueryDesign + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +testcase tMainMenuBar + + dim iCount as integer ' the numbers of the items in the menu. + + initQueryDesign + '/// close the add table dialog + printlog "close the add table dialog" + Kontext "AddTables" + if AddTables.Exists(5) then + CloseDlg.Click + printlog "The AddTables dialog exists, I close it." + end if + + Kontext "QueryDesignTable" + QueryDesignTable.UseMenu + + '/// check if there are between 8 and 12 items in the file menu. + printlog "check if there are between 8 and 12 items in the file menu." + '/// + there different count related to the file pick list. + printlog "+ there different count related to the file pick list." + hMenuSelectNr(1) ' the file menu + iCount = getMenuItemCount() + if (iCount <> 8 ) then + warnlog "There should between 8 and 12 items in the file menu but there are " + iCount + " items." + end if + + '/// check if there are 12 items in the FILE/NEW menu. + printlog "check if there are 12 items in the FILE/NEW menu." + hMenuSelectNr(1) ' FILE/NEW menu + iCount = hMenuItemGetCount() + if (iCount <> 12) then + warnlog "There should 12 items in the FILE/NEW menu but there are " + iCount + " items." + end if + call hMenuClose() ' close the FILE menu + + '/// check the FILE/AUTOPILOTS + printlog "check the FILE/AUTOPILOTS" + QueryDesignTable.UseMenu + hMenuSelectNr(1) ' the file menu + hMenuSelectNr(3) ' the autopilots menu + iCount = hMenuItemGetCount() + if (gOOO) then + if (iCount <> 10) then + warnlog "There should 10 items in the FILE/AUTOPILOTS menu but there are " + iCount + " items." + end if + else + if (iCount <> 8) then + warnlog "There should 8 items in the FILE/AUTOPILOTS menu but there are " + iCount + " items." + end if + endif + call hMenuClose() + + '/// check if there are 9 items in the edit menu. + printlog "check if there are 9 items in the edit menu." + QueryDesignTable.UseMenu + hMenuSelectNr(2) + iCount = hMenuItemGetCount() + if (iCount <> 9) then + warnlog "There should 9 items in the edit menu but there are " + iCount + " items." + end if + call hMenuClose() + + '/// check if there are 7 items in the view menu. + printlog "check if there are 7 items in the view menu." + QueryDesignTable.UseMenu + hMenuSelectNr(3) + iCount = hMenuItemGetCount() + if (iCount <> 7) then + warnlog "There should 7 items in the view menu but there are " + iCount + " items." + end if + call hMenuClose() + + '/// check if there are 2 items in the insert menu. + printlog "check if there are 2 items in the insert menu." + QueryDesignTable.UseMenu + hMenuSelectNr(4) + iCount = hMenuItemGetCount() + if (iCount <> 2) then + warnlog "There should 2 items in the insert menu but there are " + iCount + " items." + end if + call hMenuClose() + + '/// check if there are 4 items in the tools menu. + printlog "check if there are 4 items in the tools menu." + QueryDesignTable.UseMenu + hMenuSelectNr(5) + iCount = hMenuItemGetCount() + if (iCount <> 4) then + warnlog "There should 4 items in the tools menu but there are " + iCount + " items." + end if + call hMenuClose() + + '/// check if there are 4 items in the TOOLS/MACRO menu. + printlog "check if there are 4 items in the TOOLS/MACRO menu." + QueryDesignTable.UseMenu + hMenuSelectNr(5) + hMenuSelectNr(1) + iCount = hMenuItemGetCount() + if (iCount <> 4) then + warnlog "There should 4 items in the TOOLS/MACRO menu but there are " + iCount + " items." + end if + call hMenuClose() + + call fCloseQueryDesign + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +function fDateiOeffnen ( DocName$ ) + + Dim DieDatei as String + + DieDatei = ConvertPath ( DocName$ ) + + FileOpen + sleep (1) + Kontext "OeffnenDlg" + Dateiname.SetText DieDatei + sleep (3) + Oeffnen.Click + sleep (3) + + Kontext "Insight" + + fDateiOeffnen = true + +end function +'------------------------------------------------------------------------- +function getMenuItemCount as Integer +'use this function becasue this doesn't count the pick list + Dim i, j, Ende, nID as Integer + Sleep 2 + j=0 + for i=1 to MenuGetItemCount + if NOT MenuIsSeperator ( i ) then + dim s as String + s = Mid(MenuGetItemText( MenuGetItemID(i)),3,1) + 'printlog "s = " + s + 'printlog "MenuGetItemText( MenuGetItemID(i)) = " + MenuGetItemText( MenuGetItemID(i)) + if s <> ":" then + j=j+1 + endif + endif + next i + getMenuItemCount = j +end function +'------------------------------------------------------------------------- +sub initQueryDesign + + call fDateiOeffnen(gOfficePath + ConvertPath("user/database/biblio.odb")) + + Kontext "Insight" + + Insight.MouseDown(50,50) + Insight.MouseUp(50,50) + + sleep(1) + + NewQueryDesign + + ' if not InsightSwapIconView.exists(1) then + ' warnlog "InsightSwapIconView doesn't exists" + ' exit sub + ' end if + ' + ' '/// display Queries View + ' printlog "display Queries View" + ' ViewQueries + ' if InsightQueriesView.exists(1) then + ' printlog "InsightQueriesView appear" + ' else + ' warnlog "InsightQueriesView doesn't appear" + ' exit sub + ' end if + ' + ' Kontext "Insight" + ' CreationList.select(1) + ' sleep(1) + ' Insight.TypeKeys "<TAB>" , true + ' Insight.TypeKeys "<RETURN>" , true + ' sleep(1) +end sub diff --git a/testautomation/dbaccess/required/includes/ReportBuilder01.inc b/testautomation/dbaccess/required/includes/ReportBuilder01.inc new file mode 100755 index 000000000000..4ce19157a6a2 --- /dev/null +++ b/testautomation/dbaccess/required/includes/ReportBuilder01.inc @@ -0,0 +1,831 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: ReportBuilder01.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 07:43:45 $ +'* +'* 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 : marc.neumann@sun.com +'* +'* short description : report builder include file +'* +'\*********************************************************************************** +sub rpt_Main + + printlog "------------------ ReportBuilder01.inc ---------------------" + + if ( tools_reporttools_InstallExtension() = 0 ) then + call tMainMenuBar + call tExecuteReport + call tEditReport + call tConditionalFormatingDialog + call tPageNumber + call tDateTime + call tGroupingSorting + call tReportNavigator + call tReportHeaderFooter + call tPageHeaderFooter + else + warnlog "report extension could not installed" + endif + +end sub +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +testcase tMainMenuBar + + if(gPlatform = "x86" or gPlatform = "sol") then + warnlog "#88579# crash on closing report design" + goto endsub + endif + + dim iCount as Integer + + '/// open Bibliography database + + call hFileOpen(gOfficePath + ConvertPath("user/database/biblio.odb")) + + Kontext "Insight" + + Insight.MouseDown(50,50) + Insight.MouseUp(50,50) + sleep(1) + + '/// open the report designer + call fOpenNewReportDesign + + sleep(10) + + '/// check the menu for the right entries + + 'file menu + Kontext "ReportDesign" + ReportDesign.UseMenu + '/// check if there are 10 items in the file menu. + printlog "check if there are 10 items in the file menu." + hMenuSelectNr(1) ' the file menu + iCount = hMenuItemGetCount() + if (iCount <> 10 ) then + warnlog "There should be 10 items in the file menu but there are " + iCount + " items." + end if + + '/// check if there are 12 items in the FILE/NEW menu. + printlog "check if there are 12 items in the FILE/NEW menu." + hMenuSelectNr(1) ' FILE/NEW menu + iCount = hMenuItemGetCount() + if (iCount <> 12) then + warnlog "There should 12 items in the FILE/NEW menu but there are " + iCount + " items." + end if + call hMenuClose() ' close the FILE menu + + '/// check the FILE/AUTOPILOTS + printlog "check the FILE/AUTOPILOTS" + ReportDesign.UseMenu + hMenuSelectNr(1) ' the file menu + hMenuSelectNr(4) ' the autopilots menu + iCount = hMenuItemGetCount() + if (gOOO) then + if (iCount <> 10) then + warnlog "There should 10 items in the FILE/AUTOPILOTS menu but there are " + iCount + " items." + end if + else + if (iCount <> 8) then + warnlog "There should 8 items in the FILE/AUTOPILOTS menu but there are " + iCount + " items." + end if + endif + call hMenuClose() + + 'edit menu + + '/// check if there are 12 items in the edit menu. + printlog "check if there are 12 items in the edit menu." + ReportDesign.UseMenu + hMenuSelectNr(2) + iCount = hMenuItemGetCount() + if (iCount <> 12) then + warnlog "There should 12 items in the edit menu but there are " + iCount + " items." + end if + call hMenuClose() + + 'view menu + + '/// check if there are 11 items in the view menu. + printlog "check if there are 11 items in the view menu." + ReportDesign.UseMenu + hMenuSelectNr(3) + iCount = hMenuItemGetCount() + if (iCount <> 11) then + warnlog "There should 11 items in the view menu but there are " + iCount + " items." + end if + call hMenuClose() + + 'insert menu + + '/// check if there are 3 items in the insert menu. + printlog "check if there are 3 items in the insert menu." + ReportDesign.UseMenu + hMenuSelectNr(4) + iCount = hMenuItemGetCount() + if (iCount <> 3) then + warnlog "There should 3 items in the insert menu but there are " + iCount + " items." + end if + call hMenuClose() + + 'format menu + + '/// check if there are 7 items in the format menu. + printlog "check if there are 7 items in the format menu." + ReportDesign.UseMenu + hMenuSelectNr(5) + iCount = hMenuItemGetCount() + if (iCount <> 7) then + warnlog "There should 7 items in the format menu but there are " + iCount + " items." + end if + call hMenuClose() + + '/// check if there are 6 items in the format/arange menu. + printlog "check if there are 6 items in the format/arange menu." + ReportDesign.UseMenu + hMenuSelectNr(5) + hMenuSelectNr(4) + iCount = hMenuItemGetCount() + if (iCount <> 6) then + warnlog "There should 6 items in the format/arrange menu but there are " + iCount + " items." + end if + call hMenuClose() + + '/// check if there are 6 items in the format/alignment menu. + printlog "check if there are 6 items in the format/alignment menu." + ReportDesign.UseMenu + hMenuSelectNr(5) + hMenuSelectNr(5) + iCount = hMenuItemGetCount() + if (iCount <> 6) then + warnlog "There should 6 items in the format/alignment menu but there are " + iCount + " items." + end if + call hMenuClose() + + '/// check if there are 4 items in the format/object resiing menu. + printlog "check if there are 4 items in the format/object resiing menu." + ReportDesign.UseMenu + hMenuSelectNr(5) + hMenuSelectNr(6) + iCount = hMenuItemGetCount() + if (iCount <> 4) then + warnlog "There should 4 items in the format/alignment menu but there are " + iCount + " items." + end if + call hMenuClose() + + + 'tools menu + + '/// check if there are 4 items in the tools menu. + printlog "check if there are 4 items in the tools menu." + ReportDesign.UseMenu + hMenuSelectNr(6) + iCount = hMenuItemGetCount() + if (iCount <> 4) then + warnlog "There should 4 items in the tools menu but there are " + iCount + " items." + end if + call hMenuClose() + + 'help menu + + '/// check if there are 9 items in the help menu. + printlog "check if there are 9 items in the help menu." + ReportDesign.UseMenu + hMenuSelectNr(8) + iCount = hMenuItemGetCount() + if (gOOO) then + if (iCount <> 9) then + warnlog "There should 9 items in the help menu but there are " + iCount + " items." + end if + else + if (iCount <> 9 AND iCount <> 8 ) then + warnlog "There should 8 or 9 items in the help menu but there are " + iCount + " items." + end if + endif + call hMenuClose() + + + '/// close the report designer + call fCloseReportDesign + '/// close the database + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tConditionalFormatingDialog + + if(gPlatform = "x86" or gPlatform = "sol") then + warnlog "#88579# crash on closing report design" + goto endsub + endif + + '/// open Bibliography database + printlog "open Bibliography database" + call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + '/// open the report designer + printlog "open the report designer" + call fOpenNewReportDesign + + Kontext "ReportDesign" + ReportDesign.Maximize() + + '/// insert a data control + printlog "insert a data control" + Kontext "FormControls" + Edit.Click + sleep(1) + + Kontext "ReportDesign" + ReportDesign.MouseDown ( 30, 10 ) + ReportDesign.MouseMove ( 40, 20 ) + ReportDesign.MouseUp ( 40, 20 ) + sleep(1) + + '/// open the conditional formating dialog via the menu + printlog "open the conditional formating dialog via the menu" + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(5) + hMenuSelectNr(1) + + '/// check if the conditional formating dialog appear + printlog "check if the conditional formating dialog appear" + sleep(10) + Kontext "ConditionalFormating" + if ( not ConditionalFormating.exists(3)) then + warnlog "Condditional Formating Dialog doesn't appear" + call fCloseReportDesign + call fCloseDatabase + goto endsub + else + printlog "Conditional Formating Dialog appear" + call DialogTest(ConditionalFormating) + ConditionalFormating.Cancel + endif + + '/// check if there is one condition + '/// add 2 more conditions and check if the dialog grows + '/// add one more condition and check if the scrollbar gets enabled + '/// check if the right condition is displayed + '/// remove the second condition and check if the scrollbar gets disabled + '/// remove 2 conditions and check if the dialog skrink + + '/// close the report designer + call fCloseReportDesign + '/// close the database + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tExecuteReport + + if(gPlatform = "x86" or gPlatform = "sol") then + warnlog "#88579# crash on closing report design" + goto endsub + endif + + '/// open Bibliography database + call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + '/// open the report designer + call fOpenNewReportDesign + + '/// select the first table in the content list box + printlog "select the first table in the content list box" + Kontext "ReportDataProperties" + Content.select 1 + Content.typeKeys("<RETURN>",true) ' important to leave the listbox + + Kontext "ReportDesign" + ReportDesign.TypeKeys("<MOD1 TAB>",true) + ReportDesign.TypeKeys("<MOD1 TAB>",true) + + Kontext "ReportAddField" + ReportAddFieldList.select 1 + ReportAddField.TypeKeys("<RETURN>",true) + + 'close the Add Field dialog to get the focus back to the design + call fCloseAddFieldDialog() + + '/// execute the report + printlog "execute the report" + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(12) + + sleep(10) + + '/// ckeck if the report is created + printlog "ckeck if the report is created" + Kontext "DocumentWriter" + if (DocumentWriter.exists(10)) then + call fCloseReportView + else + warnlog "No report is created." + endif + + sleep(1) + '/// close the report design + printlog "close the report design" + call fCloseReportDesign + + '/// close the database + printlog "close the database" + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tPageNumber + + if(gPlatform = "x86" or gPlatform = "sol") then + warnlog "#88579# crash on closing report design" + goto endsub + endif + + '/// open Bibliography database + printlog "open Bibliography database" + call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + '/// open the report designer + printlog "open the report designer" + call fOpenNewReportDesign + + '/// insert a data control + printlog "insert a data control" + Kontext "FormControls" + Edit.Click + sleep(1) + + Kontext "ReportDesign" + ReportDesign.MouseDown ( 30, 20 ) + ReportDesign.MouseMove ( 40, 30 ) + ReportDesign.MouseUp ( 40, 30 ) + sleep(1) + + '/// open page number dialog via the menu + printlog "open page number dialog via the menu" + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(4) + hMenuSelectNr(1) + + '/// check if the page number dialog appear + printlog "check if the page number dialog appear" + Kontext "ReportPageNumber" + if ( not ReportPageNumber.exists(3)) then + warnlog "Page Number Dialog doesn't appear" + call fCloseReportDesign + call fCloseDatabase + goto endsub + else + printlog "Page Number Dialog appear" + call DialogTest(ReportPageNumber) + ReportPageNumber.Cancel + endif + + '/// close the report designer + call fCloseReportDesign + '/// close the database + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tDateTime + + if(gPlatform = "x86" or gPlatform = "sol") then + warnlog "#88579# crash on closing report design" + goto endsub + endif + + '/// open Bibliography database + printlog "open Bibliography database" + call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + '/// open the report designer + printlog "open the report designer" + call fOpenNewReportDesign + + '/// insert a data control + printlog "insert a data control" + Kontext "FormControls" + Edit.Click + sleep(1) + + Kontext "ReportDesign" + ReportDesign.MouseDown ( 30, 20 ) + ReportDesign.MouseMove ( 40, 30 ) + ReportDesign.MouseUp ( 40, 30 ) + sleep(1) + + '/// open date time dialog via the menu + printlog "open date time dialog via the menu" + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(4) + hMenuSelectNr(2) + + '/// check if the date time dialog appear + printlog "check if the date time dialog appear" + Kontext "ReportDateTime" + if ( not ReportDateTime.exists(3)) then + warnlog "Date Time Dialog doesn't appear" + call fCloseReportDesign + call fCloseDatabase + goto endsub + else + printlog "Date Time Dialog appear" + call DialogTest(ReportDateTime) + ReportDateTime.Cancel + endif + + + '/// close the report designer + call fCloseReportDesign + '/// close the database + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tGroupingSorting + + if(gPlatform = "x86" or gPlatform = "sol") then + warnlog "#88579# crash on closing report design" + goto endsub + endif + + '/// open Bibliography database + printlog "open Bibliography database" + call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + '/// open the report designer + printlog "open the report designer" + call fOpenNewReportDesign + + '/// insert a data control + printlog "insert a data control" + Kontext "FormControls" + Edit.Click + sleep(1) + + Kontext "ReportDesign" + ReportDesign.MouseDown ( 30, 50 ) + ReportDesign.MouseMove ( 40, 60 ) + ReportDesign.MouseUp ( 40, 60 ) + sleep(1) + + '/// open date time dialog via the menu + printlog "open date time dialog via the menu" + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(3) + hMenuSelectNr(5) + + '/// check if the sorting and grouping dialog appear + printlog "check if the sorting and grouping dialog appear" + Kontext "ReportSortingGrouping" + if ( not ReportSortingGrouping.exists(3)) then + warnlog "Sorting and Grouping Dialog doesn't appear" + call fCloseReportDesign + call fCloseDatabase + goto endsub + else + printlog "Sorting and Grouping Dialog appear" + call DialogTest(ReportSortingGrouping) + ReportSortingGrouping.Close + endif + + + '/// close the report designer + call fCloseReportDesign + '/// close the database + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tReportNavigator + + if(gPlatform = "x86" or gPlatform = "sol") then + warnlog "#88579# crash on closing report design" + goto endsub + endif + + '/// open Bibliography database + printlog "open Bibliography database" + call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + '/// open the report designer + printlog "open the report designer" + call fOpenNewReportDesign + + '/// insert a data control + printlog "insert a data control" + Kontext "FormControls" + Edit.Click + sleep(1) + + Kontext "ReportDesign" + ReportDesign.MouseDown ( 30, 50 ) + ReportDesign.MouseMove ( 40, 60 ) + ReportDesign.MouseUp ( 40, 60 ) + sleep(1) + + '/// open report navigator via the menu + printlog "open report navigator via the menu" + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(3) + hMenuSelectNr(6) + + '/// check if the report navigator appear + printlog "check if the report navigator appear" + Kontext "ReportNavigator" + if ( not ReportNavigator.exists(3)) then + warnlog "report navigator doesn't appear" + call fCloseReportDesign + call fCloseDatabase + goto endsub + else + printlog "report navigator appear" + call DialogTest(ReportNavigator) + ReportNavigator.Close + endif + + + '/// close the report designer + call fCloseReportDesign + '/// close the database + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tReportHeaderFooter + + if(gPlatform = "x86" or gPlatform = "sol") then + warnlog "#88579# crash on closing report design" + goto endsub + endif + + '/// open Bibliography database + printlog "open Bibliography database" + call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + '/// open the report designer + printlog "open the report designer" + call fOpenNewReportDesign + + '/// open report navigator + printlog "open report navigator" + call fOpenReportNavigator + + '/// check if the report navigator appear + printlog "check if the report navigator appear" + Kontext "ReportNavigator" + if ( not ReportNavigator.exists(3)) then + warnlog "report navigator doesn't appear" + call fCloseReportDesign + call fCloseDatabase + goto endsub + endif + '/// check if there are 6 entries in the report navigator + printlog "check if there are 6 entries in the report navigator" + if (NavigatorTree.getItemCount <> 6) then + warnlog "the count of items in the report navigator is not correct." + _ + "it should 6 but it is " + NavigatorTree.getItemCount + endif + + 'close the report navigator to get the focus back into the document + call fCloseReportNavigator + + '/// turn on the report header via the edit menu + printlog "turn on the report header via the edit menu" + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(9) + + 'open the navigator again + call fOpenReportNavigator + + '/// check if report header appear in the report navigator (8 entries) + printlog "check if report header appear in the report navigator (8 entries)" + Kontext "ReportNavigator" + if (NavigatorTree.getItemCount <> 8) then + warnlog "the report header is not diaplyed in the report navigator." + endif + + 'close the report navigator to get the focus back into the document + call fCloseReportNavigator + + '/// turn off the report header via the edit menu + printlog "turn off the report header via the edit menu" + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(9) + + 'open the navigator again + call fOpenReportNavigator + + '/// check if report header disappear in the report navigator (6 entries) + printlog "check if report header disappear in the report navigator (6 entries)" + Kontext "ReportNavigator" + if (NavigatorTree.getItemCount <> 6) then + warnlog "the report header is not diaplyed in the report navigator." + endif + + 'close the report navigator + call fCloseReportNavigator + + '/// close the report designer + printlog "close the report designer" + call fCloseReportDesign + '/// close the database + printlog "close the database" + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tPageHeaderFooter + + if(gPlatform = "x86" or gPlatform = "sol") then + warnlog "#88579# crash on closing report design" + goto endsub + endif + + '/// open Bibliography database + printlog "open Bibliography database" + call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + '/// open the report designer + printlog "open the report designer" + call fOpenNewReportDesign + + '/// open report navigator + call fOpenReportNavigator + + '/// check if the report navigator appear + printlog "check if the report navigator appear" + Kontext "ReportNavigator" + if ( not ReportNavigator.exists(3)) then + warnlog "report navigator doesn't appear" + call fCloseReportDesign + call fCloseDatabase + goto endsub + endif + '/// check if there are 6 entries in the report navigator + printlog "check if there are 6 entries in the report navigator" + if (NavigatorTree.getItemCount <> 6) then + warnlog "the count of items in the report navigator is not correct." + _ + "it should 6 but it is " + NavigatorTree.getItemCount + endif + + 'close the report navigator to get the focus back into the document + call fCloseReportNavigator + + '/// turn off the page header via the edit menu + printlog "turn off the page header via the edit menu" + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(8) + + 'open the report navigator + call fOpenReportNavigator + + '/// check if page header disappear in the report navigator (4 entries) + printlog "check if page header disappear in the report navigator (4 entries)" + Kontext "ReportNavigator" + if (NavigatorTree.getItemCount <> 4) then + warnlog "the page header is not displayed in the report navigator." + endif + + 'close the report navigator to get the focus back into the document + call fCloseReportNavigator + + '/// turn on the page header via the edit menu + printlog "turn on the page header via the edit menu" + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(8) + + 'open the report navigator + call fOpenReportNavigator + + '/// check if page header appear in the report navigator (6 entries) + printlog "check if page header appear in the report navigator (6 entries)" + Kontext "ReportNavigator" + if (NavigatorTree.getItemCount <> 6) then + warnlog "the page header is displayed in the report navigator." + endif + + 'close the report navigator + call fCloseReportNavigator + + '/// close the report designer + printlog "close the report designer" + call fCloseReportDesign + '/// close the database + printlog "close the database" + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tEditReport + + if(gPlatform = "x86" or gPlatform = "sol") then + warnlog "#88579# crash on closing report design" + goto endsub + endif + + '/// open Bibliography database + call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + '/// open the report designer + call fOpenNewReportDesign + + '/// select the first table in the content list box + printlog "select the first table in the content list box" + Kontext "ReportDataProperties" + Content.select 1 + Content.typeKeys("<RETURN>",true) ' important to leave the listbox + + Kontext "ReportDesign" + ReportDesign.TypeKeys("<MOD1 TAB>",true) + ReportDesign.TypeKeys("<MOD1 TAB>",true) + + Kontext "ReportAddField" + ReportAddFieldList.select 1 + ReportAddField.TypeKeys("<RETURN>",true) + + 'close the Add Field dialog to get the focus back to the design + call fCloseAddFieldDialog() + + '/// save the report + printlog "save the report" + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(1) + hMenuSelectNr(6) + + sleep(10) + + '/// insert a name into the save dialog + printlog "insert a name into the save dialog" + + Kontext "FormSaveDialog" ' report and forms use the same dialog + FormName.setText("Report1") + SaveBtn.Click + + '/// close the report design + printlog "close the report design" + call fCloseReportDesign + + '/// open the report again in the edit mode + printlog "open the report again in the edit mode" + call fOpenReportInDesign("Report1") + + Kontext "ReportDesign" + if (ReportDesign.exists(10)) then + call fCloseReportDesign + else + warnlog "ReportDesign not open" + endif + + '/// close the database + printlog "close the database" + call fCloseDatabase + +endcase diff --git a/testautomation/dbaccess/required/includes/Table.inc b/testautomation/dbaccess/required/includes/Table.inc new file mode 100755 index 000000000000..1683d97bea3f --- /dev/null +++ b/testautomation/dbaccess/required/includes/Table.inc @@ -0,0 +1,649 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: Table.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 07:43:45 $ +'* +'* 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 : marc.neumann@sun.com +'* +'* short description : test the Main Table Application Window +'* +'************************************************************************ +'* +' #1 tMainMenuBar +' #1 tSearch +' #1 tSortAscending +' #1 tSortDescending +' #1 tAutoFilter +' #1 tDefaultFilter +' #1 tSortOrder +' #1 tRemoveFilter +' #1 tApplyFilter +' #1 tRefresh +' #1 tEdit +' #1 tCut +' #1 tCopy +' #1 tPaste +' #1 tUndo +' #1 tSave +'* +'\*********************************************************************************** +sub Table + + printlog "------------------ Table.inc ---------------------" + + printlog "-------------------- main menu -------------------------" + call tMainMenuBar + + printlog "--------------------- toolbar --------------------------" + call tSearch + call tSortAscending + call tSortDescending + call tAutoFilter + call tDefaultFilter + call tSortOrder + call tRemoveFilter + call tApplyFilter + call tRefresh + call tEdit + call tCut + call tCopy + call tPaste + call tUndo + call tSave + +end sub +'------------------------------------------------------------------------- +testcase tSearch + + '/// open a new table + printlog "open a new table" + initTable + sleep(1) + '/// click on the search button + printlog "click on the search button" + Kontext "Toolbar" + RecSearch.Click + sleep(1) + '/// check if the search dialog appear + printlog "check if the search dialog appear" + Kontext "RecordSearch" + if RecordSearch.Exists(3) then + '/// close the search dialog + printlog "close the search dialog" + CloseBtn.click + sleep(2) + else + warnlog "The search dialog doesn't appear" + end if + + + '/// close the table and the database + printlog "close the table and the database" + call fCloseTableView + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tSortAscending + + '/// open a new table + printlog "open a new table" + initTable + sleep(1) + '/// click on the search button + printlog "click on the search button" + Kontext "Toolbar" + SortAscending.Click + sleep(1) + + '/// close the table and the database + printlog "close the table and the database" + call fCloseTableView + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tSortDescending + + '/// open a new table + printlog "open a new table" + initTable + sleep(1) + '/// click on the search button + printlog "click on the search button" + Kontext "Toolbar" + SortDescending.Click + sleep(1) + + '/// close the table and the database + printlog "close the table and the database" + call fCloseTableView + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tAutoFilter + + '/// open a new table + printlog "open a new table" + initTable + sleep(1) + '/// click on the auto filter button + printlog "click on the auto filter button" + Kontext "Toolbar" + DBAutoFilter.Click + sleep(1) + + '/// close the table and the database + printlog "close the table and the database" + call fCloseTableView + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tDefaultFilter + + '/// open a new table + printlog "open a new table" + initTable + sleep(1) + '/// click on the DefaultFilter button + printlog "click on the DefaultFilter button" + Kontext "Toolbar" + DefaultFilter.Click + sleep(1) + '/// check if the default filter dialog appear + printlog "check if the default filter dialog appear" + Kontext "FilterDialog" + if FilterDialog.Exists(2) then + FilterDialog.Cancel + else + warnlog "The filter dialog doesn't appear" + end if + + '/// close the table and the database + printlog "close the table and the database" + call fCloseTableView + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tSortOrder + + '/// open a new table + printlog "open a new table" + initTable + sleep(1) + '/// click on the sort order button + printlog "click on the sort order button" + Kontext "Toolbar" + SortOrder.Click + sleep(1) + '/// check if the sort order dialog appear + printlog "check if the sort order dialog appear" + Kontext "SortOrder" + if SortOrder.Exists(2) then + SortOrder.Cancel + else + warnlog "The sort order dialog doesn't appear" + end if + + '/// close the table and the database + printlog "close the table and the database" + call fCloseTableView + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tRemoveFilter + + '/// open a new table + printlog "open a new table" + initTable + sleep(1) + '/// click on the remove filter button + printlog "click on the remove filter button" + Kontext "Toolbar" + DBAutoFilter.Click + sleep(1) + if RemoveFilter.isenabled then + RemoveFilter.Click + else + warnlog "The remove filter icon isn't activ" + end if + '/// close the table and the database + printlog "close the table and the database" + call fCloseTableView + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tApplyFilter + + '/// open a new table + printlog "open a new table" + initTable + sleep(1) + '/// click on the applay filter button + printlog "click on the apply filter button" + Kontext "Toolbar" + DBAutoFilter.Click + sleep(1) + if ApplyFilter.isenabled then + ApplyFilter.Click + else + warnlog "The apply filter icon isn't activ" + end if + '/// close the table and the database + printlog "close the table and the database" + call fCloseTableView + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tRefresh + + '/// open a new table + printlog "open a new table" + initTable + sleep(1) + '/// click on the applay filter button + printlog "click on the apply filter button" + Kontext "Toolbar" + Refresh.Click + sleep(1) + '/// close the table and the database + printlog "close the table and the database" + call fCloseTableView + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tEdit + + '/// open a new table + printlog "open a new table" + initTable + sleep(1) + '/// click on the applay filter button + printlog "click on the apply filter button" + Kontext "Toolbar" + DBEditDoc.Click + sleep(1) + '/// close the table and the database + printlog "close the table and the database" + call fCloseTableView + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tSave + + '/// open a new table + printlog "open a new table" + initTable + sleep(1) + '/// change a record + printlog "change a record" + Kontext "TableView" + TableView.TypeKeys "hello" , true + sleep(1) + '/// check if the save button is active + '/// but do not click on it + printlog "check if the save button is active" + printlog "but do not click on it" + Kontext "Toolbar" + if not RecSave.isEnabled then + warnlog "the save button is not enabled." + endif + sleep(1) + call fCloseTableView + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tCut + + '/// open a table + printlog "open a table" + initTable + sleep(1) + + '/// click on the cut button + printlog "click on the cut button" + Kontext "Toolbar" + Cut.Click + sleep(1) + + '/// check if the text is in the clipboard + printlog "check if the text is in the clipboard" + if getClipboard <> "GUR00" then + warnlog "The Cut button doesn't work" + end if + + '/// check if the cut icon is disabled + Kontext "Toolbar" + if Cut.isEnabled then + warnlog "The CUT icon is enabled, but I have nothing selected" + endif + sleep(1) + + '/// close the table and the database + printlog "close the table and the database" + call fCloseTableView + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tCopy + + '/// open a table + printlog "open a table" + initTable + sleep(1) + + '/// click on the copy button + printlog "click on the copy button" + Kontext "Toolbar" + Copy.Click + sleep(1) + + '/// check if the text is in the clipboard + printlog "check if the text is in the clipboard" + if getClipboard <> "GUR00" then + warnlog "The Cut button doesn't work" + end if + + '/// close the table and the database + printlog "close the table and the database" + call fCloseTableView + call fCloseDatabase + + +endcase +'------------------------------------------------------------------------- +testcase tPaste + + '/// opene new table + printlog "opene new table" + initTable + + '/// set a string to the clipboard + printlog "set a string to the clipboard" + setClipboard "word" + + '/// press the cursor left key + printlog "press the cursor left key" + Kontext "TableView" + TableView.TypeKeys "<LEFT>" , true + sleep(1) + '/// paste the text from the clipbaord + printlog "paste the text from the clipbaord" + Kontext "Toolbar" + Paste.Click + sleep(1) + '/// check if the text is pasted to the fieldname + printlog "check if the text is pasted to the fieldname" + Kontext "TableView" + TableView.TypeKeys "<HOME>" , true + sleep(1) + TableView.TypeKeys "<SHIFT END>" , true + sleep(1) + '/// click the copy icon + printlog "click the copy icon" + Kontext "Toolbar" + Copy.Click + sleep(1) + if getClipboard <> "wordGUR00" then + warnlog "the paste button doesn't work" + end if + '/// close the table design and the database + printlog "close the table design and the database" + call fCloseTableView + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tUndo + + '/// open a table + printlog "open a table" + initTable + + '/// set a string to the clipboard + printlog "set a string to the clipboard" + setClipboard "word" + + '/// press the cursor left key + printlog "press the cursor left key" + Kontext "TableView" + TableView.TypeKeys "<LEFT>" , true + sleep(1) + '/// paste the text from the clipbaord + printlog "paste the text from the clipbaord" + Kontext "Toolbar" + Paste.Click + sleep(1) + '/// check if the text is pasted to the fieldname + printlog "check if the text is pasted to the fieldname" + Kontext "TableView" + TableView.TypeKeys "<HOME>" , true + sleep(1) + TableView.TypeKeys "<SHIFT END>" , true + sleep(1) + '/// click the copy icon + printlog "click the copy icon" + Kontext "Toolbar" + Copy.Click + sleep(1) + if getClipboard <> "wordGUR00" then + warnlog "the paste button doesn't work" + end if + + + '/// click the undo icon + printlog "click the undo icon" + Kontext "Toolbar" + RecUndo.Click + sleep(1) + + '/// click the copy icon + Kontext "Toolbar" + Copy.Click + sleep(1) + if getClipboard <> "GUR00" then + warnlog "the undo button doesn't work" + end if + + '/// close the table design and the database + printlog "close the table design and the database" + call fCloseTableView + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +testcase tMainMenuBar + + dim iCount as integer ' the numbers of the items in the menu. + + call initTable + + Kontext "TableView" + TableView.UseMenu + + '/// check if there are between 8 and 12 items in the file menu. + printlog "check if there are between 8 and 12 items in the file menu." + '/// + there different count related to the file pick list. + printlog "+ there different count related to the file pick list." + hMenuSelectNr(1) ' the file menu + iCount = getMenuItemCount() + if (iCount <> 8 ) then + warnlog "There should between 8 and 12 items in the file menu but there are " + iCount + " items." + end if + + '/// check if there are 12 items in the FILE/NEW menu. + printlog "check if there are 12 items in the FILE/NEW menu." + printlog "check the FILE/NEW" + hMenuSelectNr(1) ' FILE/NEW menu + iCount = hMenuItemGetCount() + if (iCount <> 12) then + warnlog "There should 12 items in the FILE/NEW menu but there are " + iCount + " items." + end if + call hMenuClose() ' close the FILE menu + + '/// check the FILE/AUTOPILOTS + printlog "check the FILE/AUTOPILOTS" + TableView.UseMenu + hMenuSelectNr(1) ' the file menu + hMenuSelectNr(3) ' the autopilots menu + iCount = hMenuItemGetCount() + if (gOOO) then + if (iCount <> 10) then + warnlog "There should 10 items in the FILE/AUTOPILOTS menu but there are " + iCount + " items." + end if + else + if (iCount <> 8) then + warnlog "There should 8 items in the FILE/AUTOPILOTS menu but there are " + iCount + " items." + end if + endif + call hMenuClose() + + '/// check if there are 8 items in the edit menu. + printlog "check if there are 8 items in the edit menu." + TableView.UseMenu + hMenuSelectNr(2) + iCount = hMenuItemGetCount() + if (iCount <> 8) then + warnlog "There should 8 items in the edit menu but there are " + iCount + " items." + end if + call hMenuClose() + + '/// check if there are 2 items in the view menu. + printlog "check if there are 2 items in the view menu." + TableView.UseMenu + hMenuSelectNr(3) + iCount = hMenuItemGetCount() + if (iCount <> 2) then + warnlog "There should 2 items in the view menu but there are " + iCount + " items." + end if + call hMenuClose() + + '/// check if there are 4 items in the tools menu. + printlog "check if there are 4 items in the tools menu." + TableView.UseMenu + hMenuSelectNr(5) + iCount = hMenuItemGetCount() + if (iCount <> 4) then + warnlog "There should 4 items in the tools menu but there are " + iCount + " items." + end if + call hMenuClose() + + '/// check if there are 4 items in the TOOLS/MACRO menu. + printlog "check if there are 4 items in the TOOLS/MACRO menu." + TableView.UseMenu + hMenuSelectNr(5) + hMenuSelectNr(1) + iCount = hMenuItemGetCount() + if (iCount <> 4) then + warnlog "There should 4 items in the TOOLS/MACRO menu but there are " + iCount + " items." + end if + call hMenuClose() + + call fCloseTableView + + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +function fDateiOeffnen ( DocName$ ) + + Dim DieDatei as String + + DieDatei = ConvertPath ( DocName$ ) + + FileOpen + sleep (1) + Kontext "OeffnenDlg" + Dateiname.SetText DieDatei + sleep (3) + Oeffnen.Click + sleep (3) + + Kontext "Insight" + + fDateiOeffnen = true + +end function +'------------------------------------------------------------------------- +function getMenuItemCount as Integer +'use this function becasue this doesn't count the pick list + Dim i, j, Ende, nID as Integer + Sleep 2 + j=0 + for i=1 to MenuGetItemCount + if NOT MenuIsSeperator ( i ) then + dim s as String + s = Mid(MenuGetItemText( MenuGetItemID(i)),3,1) + 'printlog "s = " + s + 'printlog "MenuGetItemText( MenuGetItemID(i)) = " + MenuGetItemText( MenuGetItemID(i)) + if s <> ":" then + j=j+1 + endif + endif + next i + getMenuItemCount = j +end function +'------------------------------------------------------------------------- +sub initTable + + + call fDateiOeffnen(gOfficePath + ConvertPath("user/database/biblio.odb")) + + Kontext "Insight" + + Insight.MouseDown(50,50) + Insight.MouseUp(50,50) + + sleep(1) + + ViewTables + + Kontext "ContainerView" + TableTree.select 1 + + OpenTable + + sleep(2) + +end sub diff --git a/testautomation/dbaccess/required/includes/TableDesign.inc b/testautomation/dbaccess/required/includes/TableDesign.inc new file mode 100755 index 000000000000..f946098a2f61 --- /dev/null +++ b/testautomation/dbaccess/required/includes/TableDesign.inc @@ -0,0 +1,526 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: TableDesign.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 07:43:45 $ +'* +'* 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 : marc.neumann@sun.com +'* +'* short description : test the Main Table Design Application Window +'* +'************************************************************************ +'* +' #1 tEdit +' #1 tSave +' #1 tSaveAs +' #1 tIndexDesign +' #1 tCut +' #1 tCopy +' #1 tPaste +' #1 tUndo +' #1 tRedo +'* +'\*********************************************************************************** +sub TableDesign + + printlog "------------------ TableDesign.inc ---------------------" + + printlog "-------------------- main menu -------------------------" + call tMainMenuBar + + printlog "--------------------- toolbar --------------------------" + call tSave + call tIndexDesign + call tCut + call tCopy + call tPaste + call tUndo + call tRedo + +end sub +'------------------------------------------------------------------------- +testcase tSave + + '/// open a new table design + printlog "open a new table design" + initTableDesign + sleep(1) + '/// insert a fieldname + printlog "insert a fieldname" + Kontext "TableDesignTable" + Fieldname.setText "hello" + sleep(1) + '/// click on the save button + printlog "click on the save button" + Kontext "Toolbar" + Save.Click + sleep(1) + '/// check if the save dialog appear + printlog "check if the save dialog appear" + Kontext "DatabaseTableSaveAs" + if ( not DatabaseTableSaveAs.exists(3) ) then + warnlog "the save dialog doesn't appear." + else + '/// cancel the save dialog + printlog "cancel the save dialog" + DatabaseTableSaveAs.Cancel + end if + '/// close tables design and the database + printlog "close tables design and the database" + call fCloseTableDesign + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tIndexDesign + + '/// open a new table design + printlog "open a new table design" + initTableDesign + sleep(1) + '/// insert a fieldname + printlog "insert a fieldname" + Kontext "TableDesignTable" + Fieldname.setText "hello" + sleep(1) + '/// click on the save button + printlog "click on the save button" + Kontext "Toolbar" + Save.Click + sleep(1) + + Kontext "DatabaseTableSaveAs" + if ( not DatabaseTableSaveAs.exists(3) ) then + warnlog "the save dialog doesn't appear." + goto endsub + else + '/// save with the default name + printlog "save with the default name" + Kontext "DatabaseTableSaveAs" + TableName.setText("testtable1") + DatabaseTableSaveAs.OK + end if + '/// click on the index design icon + printlog "click on the index design icon" + Kontext "Toolbar" + DBIndexDesign.Click + sleep(1) + + '/// close the index design + printlog "close the index design" + Kontext "DatabaseIndexes" + DatabaseIndexesClose.click + + '/// close the table design + printlog "close the table design" + call fCloseTableDesign + + '/// delete the created table + printlog "delete the created table" + call fDeleteTable("testtable1") + + '/// close the database + printlog "close the database" + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tCut + + '/// open a new tabledesign + printlog "open a new tabledesign" + initTableDesign + sleep(1) + '/// insert a field name + printlog "insert a field name" + Kontext "TableDesignTable" + TableDesignTable.TypeKeys "hello" , true + sleep(1) + '/// select the field name with SHIFT HOME + printlog "select the field name with SHIFT HOME" + TableDesignTable.TypeKeys "<SHIFT HOME>" , true + sleep(1) + + '/// click on the cut button + printlog "click on the cut button" + Kontext "Toolbar" + Cut.Click + sleep(1) + + '/// check if the text is in the clipboard + printlog "check if the text is in the clipboard" + if getClipboard <> "hello" then + warnlog "The Cut button doesn't work" + end if + + '/// check if the fieldname is cutted + printlog "check if the fieldname is cutted" + Kontext "TableDesignTable" + if ( Fieldname.getText <> "" ) then + warnlog "the text was not cutted" + end if + + '/// close the table design and the database + printlog "close the table design and the database" + call fCloseTableDesign + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tCopy + '/// open a new tabledesign + printlog "open a new tabledesign" + initTableDesign + '/// insert a field name + printlog "insert a field name" + Kontext "TableDesignTable" + TableDesignTable.TypeKeys "hello" , true + sleep(1) + '/// select the field name with SHIFT HOME + printlog "select the field name with SHIFT HOME" + TableDesignTable.TypeKeys "<SHIFT HOME>" , true + sleep(1) + + '/// click on the copy icon + printlog "click on the copy icon" + Kontext "Toolbar" + Copy.Click + sleep(1) + + '/// check if the text is in the clipboard + printlog "check if the text is in the clipboard" + if getClipboard <> "hello" then + warnlog "The Cut button doesn't work" + end if + '/// close the table design and the database + printlog "close the table design and the database" + call fCloseTableDesign + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tPaste + + '/// opene new table design + printlog "opene new table design" + initTableDesign + + '/// set a string to the clipboard + printlog "set a string to the clipboard" + setClipboard "word" + + '/// press the cursor left key + printlog "press the cursor left key" + Kontext "TableDesignTable" + TableDesignTable.TypeKeys "<LEFT>" , true + + '/// paste the text from the clipbaord + printlog "paste the text from the clipbaord" + Kontext "Toolbar" + Paste.Click + sleep(1) + '/// check if the text is pasted to the fieldname + printlog "check if the text is pasted to the fieldname" + Kontext "TableDesignTable" + if Fieldname.getText <> "word" then + warnlog "the paste button doesn't work" + end if + '/// close the table design and the database + printlog "close the table design and the database" + call fCloseTableDesign + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tUndo + + '/// opene new table design + printlog "opene new table design" + initTableDesign + + '/// set a string to the clipboard + printlog "set a string to the clipboard" + setClipboard "word" + + Kontext "TableDesignTable" + TableDesignTable.TypeKeys "" , true + + '/// paste the text from the clipbaord + printlog "paste the text from the clipbaord" + Kontext "Toolbar" + Paste.Click + sleep(1) + '/// check if the text is pasted to the fieldname + printlog "check if the text is pasted to the fieldname" + Kontext "TableDesignTable" + if Fieldname.getText <> "word" then + warnlog "the paste button doesn't work" + end if + + '/// click the undo icon + printlog "click the undo icon" + Kontext "Toolbar" + Undo.Click + sleep(1) + + '/// check if the fieldname is empty again(undo work) + printlog "check if the fieldname is empty again(undo work)" + Kontext "TableDesignTable" + TableDesignTable.TypeKeys "<LEFT>" , true + if Fieldname.getText <> "" then + warnlog "the undo button doesn't work" + end if + '/// close the table design and the database + printlog "close the table design and the database" + call fCloseTableDesign + call fCloseDatabase + + +endcase +'------------------------------------------------------------------------- +testcase tRedo + + '/// opene new table design + printlog "opene new table design" + initTableDesign + + '/// set a string to the clipboard + printlog "set a string to the clipboard" + setClipboard "word" + + '/// press the cursor left key + printlog "press the cursor left key" + Kontext "TableDesignTable" + TableDesignTable.TypeKeys "<LEFT>" , true + + '/// paste the text from the clipbaord + printlog "paste the text from the clipbaord" + Kontext "Toolbar" + Paste.Click + sleep(1) + + '/// check if the text is pasted to the fieldname + printlog "check if the text is pasted to the fieldname" + Kontext "TableDesignTable" + if Fieldname.getText <> "word" then + warnlog "the paste button doesn't work" + end if + + '/// click the undo icon + printlog "click the undo icon" + Kontext "Toolbar" + Undo.Click + sleep(1) + + '/// press the cursor left key + printlog "press the cursor left key" + Kontext "TableDesignTable" + TableDesignTable.TypeKeys "<LEFT>" , true + if Fieldname.getText <> "" then + warnlog "the undo button doesn't work" + end if + + '/// click the redo icon + printlog "click the redo icon" + Kontext "Toolbar" + Redo.Click + sleep(1) + + '/// press the cursor left key + printlog "press the cursor left key" + Kontext "TableDesignTable" + TableDesignTable.TypeKeys "<LEFT>" , true + if Fieldname.getText <> "word" then + warnlog "the redo button doesn't work" + end if + + '/// close the tabledesign and the database + printlog "close the tabledesign and the database" + call fCloseTableDesign + call fCloseDatabase + + +endcase +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +testcase tMainMenuBar + + dim iCount as integer ' the numbers of the items in the menu. + + call initTableDesign + + Kontext "TableDesignTable" + TableDesignTable.UseMenu + + '/// check if there are between 8 and 12 items in the file menu. + printlog "check if there are between 8 and 12 items in the file menu." + '/// + there different count related to the file pick list. + printlog "+ there different count related to the file pick list." + hMenuSelectNr(1) ' the file menu + iCount = getMenuItemCount() + if (iCount <> 8 ) then + warnlog "There should between 8 and 12 items in the file menu but there are " + iCount + " items." + end if + + '/// check if there are 12 items in the FILE/NEW menu. + printlog "check if there are 12 items in the FILE/NEW menu." + printlog "check the FILE/NEW" + hMenuSelectNr(1) ' FILE/NEW menu + iCount = hMenuItemGetCount() + if (iCount <> 12) then + warnlog "There should 12 items in the FILE/NEW menu but there are " + iCount + " items." + end if + call hMenuClose() ' close the FILE menu + + '/// check the FILE/AUTOPILOTS + printlog "check the FILE/AUTOPILOTS" + TableDesignTable.UseMenu + hMenuSelectNr(1) ' the file menu + hMenuSelectNr(3) ' the autopilots menu + iCount = hMenuItemGetCount() + if (gOOO) then + if (iCount <> 10) then + warnlog "There should 10 items in the FILE/AUTOPILOTS menu but there are " + iCount + " items." + end if + else + if (iCount <> 8) then + warnlog "There should 8 items in the FILE/AUTOPILOTS menu but there are " + iCount + " items." + end if + endif + call hMenuClose() + + '/// check if there are 5 items in the edit menu. + printlog "check if there are 5 items in the edit menu." + TableDesignTable.UseMenu + hMenuSelectNr(2) + iCount = hMenuItemGetCount() + if (iCount <> 5) then + warnlog "There should 5 items in the edit menu but there are " + iCount + " items." + end if + call hMenuClose() + + '/// check if there are 2 items in the view menu. + printlog "check if there are 2 items in the view menu." + TableDesignTable.UseMenu + hMenuSelectNr(3) + iCount = hMenuItemGetCount() + if (iCount <> 2) then + warnlog "There should 2 items in the edit menu but there are " + iCount + " items." + end if + call hMenuClose() + + '/// check if there are 5 items in the tools menu. + printlog "check if there are 5 items in the tools menu." + TableDesignTable.UseMenu + hMenuSelectNr(4) + iCount = hMenuItemGetCount() + if (iCount <> 5) then + warnlog "There should 5 items in the tools menu but there are " + iCount + " items." + end if + call hMenuClose() + + '/// check if there are 4 items in the TOOLS/MACRO menu. + printlog "check if there are 4 items in the TOOLS/MACRO menu." + TableDesignTable.UseMenu + hMenuSelectNr(4) + hMenuSelectNr(2) + iCount = hMenuItemGetCount() + if (iCount <> 4) then + warnlog "There should 4 items in the TOOLS/MACRO menu but there are " + iCount + " items." + end if + call hMenuClose() + + call fCloseTableDesign + + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +function fDateiOeffnen ( DocName$ ) + + Dim DieDatei as String + + DieDatei = ConvertPath ( DocName$ ) + + FileOpen + sleep (1) + Kontext "OeffnenDlg" + Dateiname.SetText DieDatei + sleep (3) + Oeffnen.Click + sleep (3) + + Kontext "Insight" + + fDateiOeffnen = true + +end function +'------------------------------------------------------------------------- +function getMenuItemCount as Integer +'use this function becasue this doesn't count the pick list + Dim i, j, Ende, nID as Integer + Sleep 2 + j=0 + for i=1 to MenuGetItemCount + if NOT MenuIsSeperator ( i ) then + dim s as String + s = Mid(MenuGetItemText( MenuGetItemID(i)),3,1) + 'printlog "s = " + s + 'printlog "MenuGetItemText( MenuGetItemID(i)) = " + MenuGetItemText( MenuGetItemID(i)) + if s <> ":" then + j=j+1 + endif + endif + next i + getMenuItemCount = j +end function +'------------------------------------------------------------------------- +sub initTableDesign + + call fDateiOeffnen(gOfficePath + ConvertPath("user/database/biblio.odb")) + + Kontext "Insight" + + Insight.MouseDown(50,50) + Insight.MouseUp(50,50) + + sleep(1) + + ViewTables + + sleep(1) + + NewTableDesign + + sleep(2) + +end sub diff --git a/testautomation/dbaccess/required/includes/Wizards.inc b/testautomation/dbaccess/required/includes/Wizards.inc new file mode 100755 index 000000000000..94f6d5ee96b4 --- /dev/null +++ b/testautomation/dbaccess/required/includes/Wizards.inc @@ -0,0 +1,241 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: Wizards.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 07:43:45 $ +'* +'* 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 : marc.neumann@sun.com +'* +'* short description : test the Main Wizard Application Window +'* +'************************************************************************ +'* +' #1 tQueryWizard +' #1 tReportWizard +' #1 tTableWizard +' #1 tFormWizard +'* +'\*********************************************************************************** +sub Wizards + + printlog "------------------ Wizards.inc ---------------------" + + call tQueryWizard + call tReportWizard + call tFormWizard + call tTableWizard + +end sub +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +testcase tQueryWizard + + call fDateiOeffnen(gOfficePath + ConvertPath("user/database/biblio.odb")) + + Kontext "Insight" + + Insight.MouseDown(50,50) + Insight.MouseUp(50,50) + sleep(1) + + call fStartQueryWizard + + sleep(5) + + Kontext "QueryWizard" + Dialogtest(QueryWizard) + sleep(1) + + Tables.select 1 + sleep(1) + '/// add the third field + printlog "add the third field" + AvailableFields.select 3 + sleep(1) + Add.click + sleep(1) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + Dialogtest(QueryWizard) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + Dialogtest(QueryWizard) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + Dialogtest(QueryWizard) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + Dialogtest(QueryWizard) + '/// click CANCEL + printlog "click CANCEL" + CancelBtn.Click + sleep(1) + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tReportWizard + + call fDateiOeffnen(gOfficePath + ConvertPath("user/database/biblio.odb")) + + Kontext "Insight" + + Insight.MouseDown(50,50) + Insight.MouseUp(50,50) + sleep(1) + + StartReportWizard + + sleep(5) + + Kontext "ReportWizard" + Dialogtest(ReportWizard) + sleep(1) + Tables.select 1 + '/// add the third field + printlog "add the third field" + AvailableFields.select 3 + sleep(1) + Add.click + sleep(1) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + Dialogtest(ReportWizard) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + Dialogtest(ReportWizard) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + Dialogtest(ReportWizard) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + Dialogtest(ReportWizard) + '/// click CANCEL + printlog "click CANCEL" + CancelBtn.Click + sleep(1) + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tTableWizard + + call fDateiOeffnen(gOfficePath + ConvertPath("user/database/biblio.odb")) + + Kontext "Insight" + + Insight.MouseDown(50,50) + Insight.MouseUp(50,50) + sleep(1) + + ViewTables + + sleep(1) + + StartTableWizard + + sleep(5) + + Kontext "TableWizard" + Dialogtest(TableWizard) + sleep(1) + AddAll.click + sleep(1) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + Dialogtest(TableWizard) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + Dialogtest(TableWizard) + '/// click CANCEL + printlog "click CANCEL" + CancelBtn.Click + sleep(1) + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tFormWizard + + call fDateiOeffnen(gOfficePath + ConvertPath("user/database/biblio.odb")) + + Kontext "Insight" + + Insight.MouseDown(50,50) + Insight.MouseUp(50,50) + sleep(1) + + StartFormWizard + + sleep(5) + + Kontext "FormWizard" + Dialogtest(FormWizard) + sleep(1) + TablesOrQueriesMaster.select 1 + '/// add the third field + printlog "add the third field" + AvailableMasterFields.select 3 + sleep(1) + MasterMoveSelected.click + sleep(1) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + Dialogtest(FormWizard) + '/// click CANCEL + printlog "click CANCEL" + CancelBtn.Click + sleep(1) + call fCloseDatabase + +endcase diff --git a/testautomation/dbaccess/required/includes/Xforms01.inc b/testautomation/dbaccess/required/includes/Xforms01.inc new file mode 100755 index 000000000000..aa4c22c046c5 --- /dev/null +++ b/testautomation/dbaccess/required/includes/Xforms01.inc @@ -0,0 +1,491 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: Xforms01.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 07:43:45 $ +'* +'* 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 : marc.neumann@sun.com +'* +'* short description : XForms Main Test include file +'* +'************************************************************************ +'* +' #1 tPropertyBrowser +' #1 tDataNavigator +' #1 tDataNavigatorSubmission +' #1 tDataNavigatorBinding +' #1 tDataNavigatorInstance +' #1 tDataNavigatorInstanceData +' #1 tDataNavigatorModel +'* +'\*********************************************************************************** + +sub xforms_01 + + printlog "------------------ Xforms01.inc ---------------------" + + call tDataNavigatorModel + call tDataNavigatorInstance + call tDataNavigatorInstanceData + call tDataNavigatorSubmission + call tDataNavigatorBinding + call tPropertyBrowser + +end sub +'------------------------------------------------------------------------- +testcase tDataNavigatorModel + + '/// open new XML Form + printlog "open new XML Form" + + FileOpen "FileName", "private:factory/swriter?slot=21053" , "FrameName", "_default" , "SynchronMode" ,True + + sleep(5) + + call hToolbarSelect("FormDesignTools",true) + + '/// open the datanavigator + printlog "open the datanavigator" + + Kontext "XFormsDataNavigator" + if ( not XFormsDataNavigator.exists(2) ) then + Kontext "FormDesignTools" + XFormsDataNavigator.Click + endif + + sleep(1) + + Kontext "XFormsDataNavigator" + 'call DialogTest(XFormsDataNavigator) + XFormsDataNavigator.TypeKeys "<space>" , true + '/// open the add model dialog + printlog "open the add model dialog" + sleep(5) + ModelsBtn.Click + sleep(1) + hMenuSelectNr(1) + + sleep(1) + + Kontext "XFormAddModel" + call DialogTest(XFormAddModel) + '/// add Model2 as new name + printlog "add Model2 as new name" + ModelName.setText "Model2" + '/// click OK + printlog "click OK" + XFormAddModel.OK + + Kontext "XFormsDataNavigator" + if ( Models.getSelText <> "Model2" ) then + warnlog "The new Model is not added" + endif + '/// rename the Model + printlog "rename the Model" + ModelsBtn.Click + hMenuSelectNr(2) + sleep(1) + + Kontext "XFormAddModel" + ModelName.setText "Model3" + XFormAddModel.OK + + Kontext "XFormsDataNavigator" + if ( Models.getSelText <> "Model3" ) then + warnlog "The Model is not renamed" + endif + + '/// close the xform data navigator + printlog "close the xform data navigator" + + Kontext "XFormsDataNavigator" + XFormsDataNavigator.Close + sleep(1) + + '/// close the document + printlog "close the document" + + call hCloseDocument + +endcase +'------------------------------------------------------------------------- +testcase tDataNavigatorInstance + + '/// open new XML Form + printlog "open new XML Form" + + FileOpen "FileName", "private:factory/swriter?slot=21053" , "FrameName", "_default" , "SynchronMode" ,True + + sleep(5) + + call hToolbarSelect("FormDesignTools",true) + '/// open the datanavigator + printlog "open the datanavigator" + Kontext "XFormsDataNavigator" + if ( not XFormsDataNavigator.exists(2) ) then + Kontext "FormDesignTools" + XFormsDataNavigator.Click + endif + + sleep(1) + + '/// add a new instance + printlog "add a new instance" + Kontext "XFormsDataNavigator" + XFormsDataNavigator.TypeKeys "<space>" ,true + InstanceBtn.Click + hMenuSelectNr(1) + + Kontext "XFormAddInstance" + call DialogTest(XFormAddInstance) + InstanceName.setText "Instance2" + 'InstanceURL + 'LinkInstance + '/// open the browse dialog and close it again + printlog "open the browse dialog and close it again" + BrowseBtn.Click + + Kontext "GeneralFileDialog" + GeneralFileDialog.Cancel + + Kontext "XFormAddInstance" + XFormAddInstance.OK + sleep(1) + + '/// rename new instance + printlog "rename new instance" + Kontext "XFormsDataNavigator" + XFormsDataNavigator.TypeKeys "<space>" ,true + sleep(1) + InstanceBtn.Click + sleep(1) + hMenuSelectNr(2) + sleep(1) + + Kontext "XFormAddInstance" + InstanceName.setText "Instance3" + sleep(1) + XFormAddInstance.OK + sleep(1) + 'add a second instance due issue + Kontext "XFormsDataNavigator" + XFormsDataNavigator.TypeKeys "<space>" ,true + InstanceBtn.Click + sleep(1) + hMenuSelectNr(1) + sleep(1) + + Kontext "XFormAddInstance" + InstanceName.setText "Instance4" + sleep(1) + XFormAddInstance.OK + sleep(1) + + '/// delete instance + Kontext "XFormsDataNavigator" + XFormsDataNavigator.TypeKeys "<space>" ,true + InstanceBtn.Click + sleep(1) + hMenuSelectNr(3) + sleep(1) + + Kontext "MessageBox" + MessageBox.Yes + sleep(1) + + '/// close the xform data navigator + printlog "close the xform data navigator" + + Kontext "XFormsDataNavigator" + XFormsDataNavigator.Close + sleep(1) + + '/// close th document + printlog "close th document" + + call hCloseDocument + +endcase +'------------------------------------------------------------------------- +testcase tDataNavigatorInstanceData + + '/// open new XML Form + printlog "open new XML Form" + + FileOpen "FileName", "private:factory/swriter?slot=21053" , "FrameName", "_default", "SynchronMode" ,True + + sleep(5) + + call hToolbarSelect("FormDesignTools",true) + + sleep(1) + + '/// open the datanavigator + printlog "open the datanavigator" + Kontext "XFormsDataNavigator" + if ( not XFormsDataNavigator.exists(2) ) then + Kontext "FormDesignTools" + XFormsDataNavigator.Click + endif + + '/// select the submission tabpage + printlog "select the submission tabpage" + + Kontext "XFormsDataNavigator" + call DialogTest(XFormsDataNavigator) + while ( XFormsDataNavigatorTabControl.getPageID() <> 12 ) + XFormsDataNavigatorTabControl.TypeKeys("<RIGHT>") + wend + ItemList.select 1 + '/// click the add element icon + printlog "click the add element icon" + + Kontext "XFormToolbar" + AddElement.Click + + Kontext "XFormAddItemDLG" + call DialogTest(XFormAddItemDLG) + ElementName.setText "element1" + if iSprache = 82 then + printlog "because of issue i49557 there are only 12 items in a korean version." + if ( DataType.getItemCount <> 12) then + warnlog "there are not 12 data types in the listbox there are " + DataType.getItemCount + ". See issue i49557." + endif + else + if ( DataType.getItemCount <> 13) then + warnlog "there are not 13 data types in the listbox there are " + DataType.getItemCount + ". See issue i49557." + endif + endif + Required.check + RequiredBtn.click + Kontext "AddConditionDLG" + AddConditionDLG.Close + Kontext "XFormAddItemDLG" + Relevant.check + RelevantBtn.click + Kontext "AddConditionDLG" + AddConditionDLG.Close + Kontext "XFormAddItemDLG" + Constraint.check + ConstraintBtn.click + Kontext "AddConditionDLG" + AddConditionDLG.Close + Kontext "XFormAddItemDLG" + Calculate.check + CalculateBtn.click + Kontext "AddConditionDLG" + AddConditionDLG.Close + Kontext "XFormAddItemDLG" + ReadOnly.check + ReadOnlyBtn.click + Kontext "AddConditionDLG" + AddConditionDLG.Close + Kontext "XFormAddItemDLG" + XFormAddItemDLG.OK + + '/// close the xform data navigator + printlog "close the xform data navigator" + + Kontext "XFormsDataNavigator" + XFormsDataNavigator.Close + sleep(1) + + '/// close the document + printlog "close the document" + + call hCloseDocument + +endcase +'------------------------------------------------------------------------- +testcase tDataNavigatorSubmission + + '/// nopen ew XML Form + printlog "nopen ew XML Form" + + FileOpen "FileName", "private:factory/swriter?slot=21053" , "FrameName", "_default", "SynchronMode" ,True + + sleep(5) + + call hToolbarSelect("FormDesignTools",true) + + sleep(1) + + '/// open the datanavigator + printlog "open the datanavigator" + Kontext "XFormsDataNavigator" + if ( not XFormsDataNavigator.exists(2) ) then + Kontext "FormDesignTools" + XFormsDataNavigator.Click + endif + sleep(1) + + '/// select the submission tabpage + printlog "select the submission tabpage" + + Kontext "XFormsDataNavigator" + call DialogTest(XFormsDataNavigator) + while ( XFormsDataNavigatorTabControl.getPageID() <> 10 ) + XFormsDataNavigatorTabControl.TypeKeys("<RIGHT>") + wend + + '/// click the add submission icon + printlog "click the add submission icon" + + Kontext "XFormToolbar" + AddSubmission.Click + + Kontext "XFormAddSubmission" + call DialogTest(XFormAddSubmission) + + 'i35171 crash when click + 'SubmitBindingExpressionBtn.Click + + '/// close the add submission dialog + printlog "close the add submission dialog" + + XFormAddSubmission.Close + + sleep(10) + + '/// close the xform data navigator + printlog "close the xform data navigator" + + Kontext "XFormsDataNavigator" + XFormsDataNavigator.Close + sleep(1) + + '/// close th document + printlog "close th document" + + call hCloseDocument + +endcase +'------------------------------------------------------------------------- +testcase tDataNavigatorBinding + + '/// open new XML Form + printlog "open new XML Form" + + FileOpen "FileName", "private:factory/swriter?slot=21053" , "FrameName", "_default", "SynchronMode" ,True + + sleep(5) + + call hToolbarSelect("FormDesignTools",true) + + sleep(1) + + '/// open the datanavigator + printlog "open the datanavigator" + Kontext "XFormsDataNavigator" + if ( not XFormsDataNavigator.exists(2) ) then + Kontext "FormDesignTools" + XFormsDataNavigator.Click + endif + + sleep(1) + + '/// select the binding tabpage + printlog "select the binding tabpage" + + Kontext "XFormsDataNavigator" + call DialogTest(XFormsDataNavigator) + while ( XFormsDataNavigatorTabControl.getPageID() <> 11 ) + XFormsDataNavigatorTabControl.TypeKeys("<RIGHT>") + wend + + '/// click the add binding icon + printlog "click the add binding icon" + + Kontext "XFormToolbar" + AddBinding.Click + + Kontext "XFormAddItemDLG" + call DialogTest(XFormAddItemDLG) + + '/// close the add binding dialog + printlog "close the add binding dialog" + + XFormAddItemDLG.Close + + sleep(10) + + '/// close the xform data navigator + printlog "close the xform data navigator" + + Kontext "XFormsDataNavigator" + XFormsDataNavigator.Close + sleep(1) + + '/// close th document + printlog "close th document" + + call hCloseDocument + +endcase +'------------------------------------------------------------------------- + +testcase tPropertyBrowser + + '/// new XML Form + + FileOpen "FileName", "private:factory/swriter?slot=21053" , "FrameName", "_default", "SynchronMode" ,True + + sleep(5) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + Edit.Click + sleep(1) + '/// insert a text box + printlog "insert a text box" + call hDrawingWithSelection ( 40, 40, 50, 50 ) + sleep(2) + Kontext "FormControls" + ControlProperties.Click + sleep (10) + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabDataControl + Kontext "TabDataControl" + XFormDataModel.select 1 + TabDataControl.TypeKeys "<RETURN>", true + + XFormBindExpressionName.setText("testtool") + TabDataControl.TypeKeys "<RETURN>", true + + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.Close + sleep(1) + + call hCloseDocument + +endcase + |