diff options
Diffstat (limited to 'testautomation/dbaccess')
112 files changed, 27284 insertions, 0 deletions
diff --git a/testautomation/dbaccess/optional/dba_ctrl_Clipboard.bas b/testautomation/dbaccess/optional/dba_ctrl_Clipboard.bas new file mode 100755 index 000000000000..be3fe9ad0896 --- /dev/null +++ b/testautomation/dbaccess/optional/dba_ctrl_Clipboard.bas @@ -0,0 +1,54 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Control Clipboard +'* +'\*********************************************************************** +sub main + printlog "---------------------------------------------------------------------" + printlog "--- D B A C C E S S C O N T R O L C L I P B O A R D ---" + printlog "---------------------------------------------------------------------" + + use "dbaccess/optional/includes/ctrl_Clipboard.inc" + + call hStatusIn ("dbaccess" , "dba_ctrl_Clipboard.bas") + + call ctrl_Clipboard + + call hStatusOut + +end sub + + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_ctrl_General.bas b/testautomation/dbaccess/optional/dba_ctrl_General.bas new file mode 100755 index 000000000000..4e66c5633d3b --- /dev/null +++ b/testautomation/dbaccess/optional/dba_ctrl_General.bas @@ -0,0 +1,54 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Controls General +'* +'\*********************************************************************** +sub main + printlog "---------------------------------------------------------------------" + printlog "----- D B A C C E S S C O N T R O L G E N E R A L -----" + printlog "---------------------------------------------------------------------" + + use "dbaccess/optional/includes/ctrl_General.inc" + + call hStatusIn ("dbaccess" , "dba_ctrl_General.bas" ) + + call ctrl_General + + call hStatusOut + +end sub + + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_ctrl_Grid.bas b/testautomation/dbaccess/optional/dba_ctrl_Grid.bas new file mode 100755 index 000000000000..a143f43bf380 --- /dev/null +++ b/testautomation/dbaccess/optional/dba_ctrl_Grid.bas @@ -0,0 +1,55 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Grid Control Test +'* +'\*********************************************************************** + + +sub main + printlog "---------------------------------------------------------------------" + printlog "---- D B A C C E S S G R I D C O N T R O L T E S T ----" + printlog "---------------------------------------------------------------------" + + use "dbaccess/optional/includes/ctrl_Grid.inc" + + call hStatusIn ("dbaccess" , "dba_ctrl_Grid.bas" ) + + call ctrl_Grid + + call hStatusOut + +end sub + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_ctrl_PropertyBrowser.bas b/testautomation/dbaccess/optional/dba_ctrl_PropertyBrowser.bas new file mode 100755 index 000000000000..e8822bc6f7be --- /dev/null +++ b/testautomation/dbaccess/optional/dba_ctrl_PropertyBrowser.bas @@ -0,0 +1,54 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Property Browser +'* +'\*********************************************************************** +sub main + printlog "---------------------------------------------------------------------" + printlog "----- D B A C C E S S P R O P E R T Y B R O W S E R ----" + printlog "---------------------------------------------------------------------" + + use "dbaccess/optional/includes/ctrl_PropertyBrowser.inc" + + call hStatusIn ("dbaccess" , "dba_ctrl_PropertyBrowser.bas") + + call ctrl_PropertyBrowser + + call hStatusOut + +end sub + + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_ctrl_Several.bas b/testautomation/dbaccess/optional/dba_ctrl_Several.bas new file mode 100755 index 000000000000..9b831063ff5c --- /dev/null +++ b/testautomation/dbaccess/optional/dba_ctrl_Several.bas @@ -0,0 +1,56 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Controls Several +'* +'\*********************************************************************** +sub main + printlog "---------------------------------------------------------------------" + printlog "----- D B A C C E S S C O N T R O L S E V E R A L -----" + printlog "---------------------------------------------------------------------" + + use "dbaccess/optional/includes/ctrl_Several1.inc" + use "dbaccess/optional/includes/ctrl_Several2.inc" + + call hStatusIn ("dbaccess" , "dba_ctrl_Several.bas") + + call ctrl_Several1 + call ctrl_Several2 + + call hStatusOut + +end sub + + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_ctrl_Spreadsheet.bas b/testautomation/dbaccess/optional/dba_ctrl_Spreadsheet.bas new file mode 100755 index 000000000000..fb1e601d26fb --- /dev/null +++ b/testautomation/dbaccess/optional/dba_ctrl_Spreadsheet.bas @@ -0,0 +1,54 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Spreadsheets Controls +'* +'\*********************************************************************** +sub main + printlog "---------------------------------------------------------------------" + printlog "----- S P R E A D S H E E T C O N T R O L S -----" + printlog "---------------------------------------------------------------------" + + use "dbaccess/optional/includes/ctrl_Spreadsheet.inc" + + call hStatusIn ("dbaccess" , "dba_ctrl_Spreadsheet.bas" ) + + call ctrl_Spreadsheet + + call hStatusOut + +end sub + + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_ctrl_TextControl.bas b/testautomation/dbaccess/optional/dba_ctrl_TextControl.bas new file mode 100755 index 000000000000..6fc6ea2cb40f --- /dev/null +++ b/testautomation/dbaccess/optional/dba_ctrl_TextControl.bas @@ -0,0 +1,55 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Controls Several +'* +'\*********************************************************************** +sub main + printlog "---------------------------------------------------------------------" + printlog "-------- D B A C C E S S T E X T C O N T R O L ---------" + printlog "---------------------------------------------------------------------" + + use "dbaccess/optional/includes/ctrl_TextControl.inc" + + call hStatusIn ("dbaccess" , "dba_ctrl_TextControl.bas") + + call ctrl_TextControl + + call hStatusOut + +end sub + + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + use "global\tools\includes\optional\t_ui_filters.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_ctrl_Wizards.bas b/testautomation/dbaccess/optional/dba_ctrl_Wizards.bas new file mode 100755 index 000000000000..05b728090d81 --- /dev/null +++ b/testautomation/dbaccess/optional/dba_ctrl_Wizards.bas @@ -0,0 +1,54 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Control Wizard Test +'* +'\*********************************************************************** +sub main + printlog "---------------------------------------------------------------------" + printlog "------- D B A C C E S S C O N T R O L W I Z A R D S -------" + printlog "---------------------------------------------------------------------" + + use "dbaccess/optional/includes/ctrl_Wizards.inc" + + call hStatusIn ("dbaccess" , "dba_ctrl_Wizards.bas") + + call ctrl_Wizards + + call hStatusOut + +end sub + + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_db_ADOAccess.bas b/testautomation/dbaccess/optional/dba_db_ADOAccess.bas new file mode 100755 index 000000000000..78d33762e8dc --- /dev/null +++ b/testautomation/dbaccess/optional/dba_db_ADOAccess.bas @@ -0,0 +1,56 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Create ADO Access DS & Table & fill in Test +'* +'\*********************************************************************** +sub main + printlog "---------------------------------------------------------------------" + printlog "------- D B A C C E S S Create ADO Access Table -------" + printlog "---------------------------------------------------------------------" + + use "dbaccess/optional/includes/db_ADOAccess.inc" + use "dbaccess/optional/includes/db_Relations.inc" + use "dbaccess/optional/includes/db_Query.inc" + + call hStatusIn ("dbaccess" , "dba_db_ADOAccess.bas") + + call db_ADOAccess + + call hStatusOut + +end sub + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub + diff --git a/testautomation/dbaccess/optional/dba_db_AdabasD.bas b/testautomation/dbaccess/optional/dba_db_AdabasD.bas new file mode 100755 index 000000000000..d4adc067d343 --- /dev/null +++ b/testautomation/dbaccess/optional/dba_db_AdabasD.bas @@ -0,0 +1,56 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Create Adabas DS & Table & fill in Test +'* +'\*********************************************************************** +sub main + + printlog "------------------------------------------------------------------" + printlog "------ D B A C C E S S Create Adabas D 11.02 Table ------" + printlog "------------------------------------------------------------------" + + use "dbaccess/optional/includes/db_Relations.inc" + use "dbaccess/optional/includes/db_Query.inc" + use "dbaccess/optional/includes/db_AdabasD.inc" + + call hStatusIn ("dbaccess" , "dba_db_AdabasD.bas") + + call db_AdabasD + + call hStatusOut + +end sub + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_db_Addressbook.bas b/testautomation/dbaccess/optional/dba_db_Addressbook.bas new file mode 100755 index 000000000000..3a5a8fe218f9 --- /dev/null +++ b/testautomation/dbaccess/optional/dba_db_Addressbook.bas @@ -0,0 +1,67 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Address Book +'* +'\*********************************************************************** + +'* TODO: add testcase for issue i61611 + +' Information for this test under +' http://wiki.services.openoffice.org/wiki/Database_Automatic_Testing + + +sub main + printlog "---------------------------------------------------------------------" + printlog "----- D B A C C E S S A D D R E S S B O O K -----" + printlog "---------------------------------------------------------------------" + + use "dbaccess/optional/includes/db_Mozilla.inc" + use "dbaccess/optional/includes/db_Windows.inc" + + call hStatusIn ("dbaccess" , "dba_db_Addressbook.bas" ) + printlog "------------- Mozilla Address Book -----------------" + + call db_Mozilla + + printlog "--------------- Windows Address Book ------------------" + + call db_Windows + + call hStatusOut + +end sub + + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_db_Dbase.bas b/testautomation/dbaccess/optional/dba_db_Dbase.bas new file mode 100755 index 000000000000..a5f6712c6b6e --- /dev/null +++ b/testautomation/dbaccess/optional/dba_db_Dbase.bas @@ -0,0 +1,55 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Create dBase DS & Table & fill in Test +'* +'\*********************************************************************** +sub main + + printlog "---------------------------------------------------------------------" + printlog "--- D B A C C E S S Create dBase Table - T E S T ---" + printlog "---------------------------------------------------------------------" + + use "dbaccess/optional/includes/db_Query.inc" + use "dbaccess/optional/includes/db_Dbase.inc" + + call hStatusIn ("dbaccess" , "dba_db_Dbase.bas") + + call db_Dbase + + call hStatusOut + +end sub + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_db_JDBCMySQL.bas b/testautomation/dbaccess/optional/dba_db_JDBCMySQL.bas new file mode 100755 index 000000000000..7f0843575e2e --- /dev/null +++ b/testautomation/dbaccess/optional/dba_db_JDBCMySQL.bas @@ -0,0 +1,54 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Create JDBC MySQL DS & Table & fill in Test +'* +'\*********************************************************************** +sub main + printlog "--------------------------------------------------------------" + printlog "--- D B A C C E S S Create JDBC MySQL Table ---" + printlog "--------------------------------------------------------------" + + use "dbaccess/optional/includes/db_JDBCMySQL.inc" + use "dbaccess/optional/includes/db_Relations.inc" + + call hStatusIn ("dbaccess" , "dba_db_JDBCMYSQL.bas") + + call db_JDBCMySQL + + call hStatusOut + +end sub + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_db_Spreadsheet.bas b/testautomation/dbaccess/optional/dba_db_Spreadsheet.bas new file mode 100755 index 000000000000..e61dff1a44f1 --- /dev/null +++ b/testautomation/dbaccess/optional/dba_db_Spreadsheet.bas @@ -0,0 +1,55 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Create Spreadsheet DS & standard ds tests +'* +'\*********************************************************************** +sub main + printlog "---------------------------------------------------------" + printlog "--- D B A C C E S S Spreadsheet Database ---" + printlog "---------------------------------------------------------" + + use "dbaccess/optional/includes/db_Query.inc" + use "dbaccess/optional/includes/db_Spreadsheet.inc" + + call hStatusIn ("dbaccess" , "dba_db_Spreadsheet.bas") + + call db_Spreadsheet + + call hStatusOut + +end sub + + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_db_Text.bas b/testautomation/dbaccess/optional/dba_db_Text.bas new file mode 100755 index 000000000000..1193a3342569 --- /dev/null +++ b/testautomation/dbaccess/optional/dba_db_Text.bas @@ -0,0 +1,80 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Create Text DS & further standard db tests +'* +'\*********************************************************************** +sub main + printlog "---------------------------------------------------" + printlog "--- D B A C C E S S Text Table ---" + printlog "---------------------------------------------------" + + use "dbaccess/optional/includes/db_Query.inc" + use "dbaccess/optional/includes/db_Text.inc" + + call hStatusIn ("dbaccess" , "dba_db_Text.bas") + + Dim sFileName as string + sFileName = gOfficePath + "user/work/TT_Text.odb" + + Dim sDBURL as string + sDBURL = "user/work" + + 'needed for: tQuery testcase - query file is copied in the work directory + app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/text_datasource/TT_Query1.txt"),gOfficePath + ConvertPath("user/work/TT_Query1.txt") + + dim dbok as boolean + dbok = false + dbok = fCreateTextDatasource(sFileName, gOfficePath + ConvertPath(sDBURL)) + if dbok = true then + + + call db_Query(sFileName, "text") + + 'use "dbaccess/optional/includes/b_lvl1_Forms.inc" + 'call Forms_Test (sFileName) + + call db_Text(sFileName) + + + else + warnlog "Data Source could not be created - beyond testcases stopped" + endif + + call hStatusOut + +end sub + + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_db_dBase_functions.bas b/testautomation/dbaccess/optional/dba_db_dBase_functions.bas new file mode 100755 index 000000000000..58f5ff23914f --- /dev/null +++ b/testautomation/dbaccess/optional/dba_db_dBase_functions.bas @@ -0,0 +1,66 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Optional test for dBase functions +'* +'\*********************************************************************** +sub main + printlog "-----------------------------------------------------------------" + printlog "--- D B A C C E S S dBase functions ---" + printlog "-----------------------------------------------------------------" + + use "dbaccess/optional/includes/db_DbaseFunction.inc" + + dim dbok as boolean + + call hStatusIn ("dbaccess" , "dba_db_dBase_functions.bas") + + app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/dbase_datasource/TT_Func1.dbf"),gOfficePath + ConvertPath("user/work/TT_Func1.dbf") + + Dim sFileName as string + sFileName = gOfficePath + ConvertPath("user/work/tt_dbase_level2.odb") + + dbok = fCreateDbaseDatasource(sFileName,gOfficePath + ConvertPath("user/work")) + if dbok = true then + call db_DbaseFunction(sFileName) + else + warnlog "Data Source could not be created - beyond testcases stopped" + endif + + call hStatusOut + +end sub + + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_db_hsqldb.bas b/testautomation/dbaccess/optional/dba_db_hsqldb.bas new file mode 100755 index 000000000000..3aa06329a03a --- /dev/null +++ b/testautomation/dbaccess/optional/dba_db_hsqldb.bas @@ -0,0 +1,56 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : hsqldb test +'* +'\*********************************************************************** +sub main + + printlog "---------------------------------------------------------------------" + printlog "--- B A S E L E V E L - 1 h s q l d b - T E S T ---" + printlog "---------------------------------------------------------------------" + + use "dbaccess/optional/includes/db_hsqldb.inc" + use "dbaccess/optional/includes/db_Query.inc" + use "dbaccess/optional/includes/db_IndexDesign.inc" + + call hStatusIn ("dbaccess" , "dba_db_hsqldb.bas") + + call db_hsqldb + + call hStatusOut + +end sub + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_frm_FormFilter.bas b/testautomation/dbaccess/optional/dba_frm_FormFilter.bas new file mode 100755 index 000000000000..a820e1d36e58 --- /dev/null +++ b/testautomation/dbaccess/optional/dba_frm_FormFilter.bas @@ -0,0 +1,59 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Form Filter Test +'* +'\*********************************************************************** +sub main + printlog "------------------------------------------------------------" + printlog "------- D B A C C E S S F O R M F I L T E R --------" + printlog "------------------------------------------------------------" + + use "dbaccess/optional/includes/frm_FormFilter.inc" + + call hStatusIn ("dbaccess" , "dba_frm_FormFilter.bas") + + app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/dbase_datasource/TT_Forms.dbf"),gOfficePath + ConvertPath("user/work/TT_Forms.dbf") + app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/dbase_datasource/TT_Query1.dbf"),gOfficePath + ConvertPath("user/work/TT_Query1.dbf") + app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/dbase_datasource/TT_Query1.dbt"),gOfficePath + ConvertPath("user/work/TT_Query1.dbt") + + call fCreateDbaseDatasource(gOfficePath + ConvertPath("user/work/TT_FormFilter.odb"),gOfficePath + ConvertPath("user/work"),"TT_FormFilter") + + call frm_FormFilter + + call hStatusOut + +end sub + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_frm_Forms.bas b/testautomation/dbaccess/optional/dba_frm_Forms.bas new file mode 100755 index 000000000000..65d0a7280466 --- /dev/null +++ b/testautomation/dbaccess/optional/dba_frm_Forms.bas @@ -0,0 +1,58 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Forms Test +'* +'\*********************************************************************** +sub main + printlog "-----------------------------------------------------------------------" + printlog "--------- B A S E L E V E L - 1 F O R M S ---------" + printlog "-----------------------------------------------------------------------" + + use "dbaccess/optional/includes/frm_Forms.inc" + + call hStatusIn ("dbaccess" , "dba_frm_Forms.bas") + + app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/dbase_datasource/TT_Forms.dbf"),gOfficePath + ConvertPath("user/work/TT_Forms.dbf") + app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/dbase_datasource/TT_Query1.dbf"),gOfficePath + ConvertPath("user/work/TT_Query1.dbf") + app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/dbase_datasource/TT_Query1.dbt"),gOfficePath + ConvertPath("user/work/TT_Query1.dbt") + + call fCreateDbaseDatasource(gOfficePath + ConvertPath("user/work/tt_dbase-01.odb"),gOfficePath + ConvertPath("user/work"),"TT_Forms") + call frm_Forms("TT_Forms") + + call hStatusOut + +end sub + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_misc_Macros.bas b/testautomation/dbaccess/optional/dba_misc_Macros.bas new file mode 100755 index 000000000000..659396bb98aa --- /dev/null +++ b/testautomation/dbaccess/optional/dba_misc_Macros.bas @@ -0,0 +1,54 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Macros in Databases +'* +'\*********************************************************************** +sub main + printlog "------------------------------------------------------------" + printlog "--- D B A C C E S S Macros in Databases ---" + printlog "------------------------------------------------------------" + + use "dbaccess/optional/includes/misc_Macros.inc" + + call hStatusIn ("dbaccess" , "dba_misc_Macros.bas") + + call misc_Macros + + call hStatusOut + +end sub + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub + diff --git a/testautomation/dbaccess/optional/dba_misc_RegisterDatabase.bas b/testautomation/dbaccess/optional/dba_misc_RegisterDatabase.bas new file mode 100755 index 000000000000..125010d42120 --- /dev/null +++ b/testautomation/dbaccess/optional/dba_misc_RegisterDatabase.bas @@ -0,0 +1,54 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Register Databases +'* +'\*********************************************************************** +sub main + printlog "------------------------------------------------------------" + printlog "--- D B A C C E S S Register Database ---" + printlog "------------------------------------------------------------" + + use "dbaccess/optional/includes/misc_RegisterDatabase.inc" + + call hStatusIn ("dbaccess" , "dba_misc_RegisterDatabase.bas") + + call misc_RegisterDatabase + + call hStatusOut + +end sub + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub + diff --git a/testautomation/dbaccess/optional/dba_rpt_Charts.bas b/testautomation/dbaccess/optional/dba_rpt_Charts.bas new file mode 100644 index 000000000000..abe7817c7842 --- /dev/null +++ b/testautomation/dbaccess/optional/dba_rpt_Charts.bas @@ -0,0 +1,47 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Charts in Reports +'* +'\*********************************************************************** + +sub main + + use "dbaccess/optional/includes/rpt_Charts.inc" + + call rpt_Charts + +end sub + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_rpt_DateTime.bas b/testautomation/dbaccess/optional/dba_rpt_DateTime.bas new file mode 100755 index 000000000000..e53a92b97f1d --- /dev/null +++ b/testautomation/dbaccess/optional/dba_rpt_DateTime.bas @@ -0,0 +1,59 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Report Builder Date Time +'* +'\*********************************************************************** +sub main + + printlog "---------------------------------------------------------------------" + printlog "----- D B A C C E S S - R E P O R T B U I L D E R -----" + printlog "---------------------------------------------------------------------" + + use "dbaccess/optional/includes/rpt_DateTime.inc" + + call hStatusIn ("dbaccess" , "dba_rpt_DateTime.bas") + + if ( tools_reporttools_InstallExtension() = 0 ) then + call rpt_DateTime + else + warnlog "report extension could not installed" + endif + + call hStatusOut + +end sub + + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_rpt_ExecuteReport.bas b/testautomation/dbaccess/optional/dba_rpt_ExecuteReport.bas new file mode 100755 index 000000000000..e2e290daed42 --- /dev/null +++ b/testautomation/dbaccess/optional/dba_rpt_ExecuteReport.bas @@ -0,0 +1,59 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Report Builder Execute Report +'* +'\*********************************************************************** +sub main + + printlog "---------------------------------------------------------------------" + printlog "----- D B A C C E S S - R E P O R T B U I L D E R -----" + printlog "---------------------------------------------------------------------" + + use "dbaccess/optional/includes/rpt_ExecuteReport.inc" + + call hStatusIn ("dbaccess" , "dba_rpt_ExecuteReport.bas") + + if ( tools_reporttools_InstallExtension() = 0 ) then + call rpt_ExecuteReport + else + warnlog "report extension could not installed" + endif + + call hStatusOut + +end sub + + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_rpt_Formating.bas b/testautomation/dbaccess/optional/dba_rpt_Formating.bas new file mode 100755 index 000000000000..bcbb67a1e10e --- /dev/null +++ b/testautomation/dbaccess/optional/dba_rpt_Formating.bas @@ -0,0 +1,59 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Base Optional Test for Conditional Formating +'* +'\*********************************************************************** +sub main + + printlog "---------------------------------------------------------------------" + printlog "----- D B A C C E S S - R E P O R T B U I L D E R -----" + printlog "---------------------------------------------------------------------" + + use "dbaccess/optional/includes/rpt_Formating.inc" + + call hStatusIn ("dbaccess" , "dba_rpt_Formating.bas") + + if ( tools_reporttools_InstallExtension() = 0 ) then + call rpt_Formating + else + warnlog "report extension could not installed" + endif + + call hStatusOut + +end sub + + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_rpt_FunctionWizard.bas b/testautomation/dbaccess/optional/dba_rpt_FunctionWizard.bas new file mode 100755 index 000000000000..b0c868d7651a --- /dev/null +++ b/testautomation/dbaccess/optional/dba_rpt_FunctionWizard.bas @@ -0,0 +1,59 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Report Builder Function Wizard +'* +'\*********************************************************************** +sub main + + printlog "---------------------------------------------------------------------" + printlog "----- D B A C C E S S - R E P O R T B U I L D E R -----" + printlog "---------------------------------------------------------------------" + + use "dbaccess/optional/includes/rpt_FunctionWizard.inc" + + call hStatusIn ("dbaccess" , "dba_rpt_FunctionWizard.bas") + + if ( tools_reporttools_InstallExtension() = 0 ) then + call rpt_FunctionWizard + else + warnlog "report extension could not installed" + endif + + call hStatusOut + +end sub + + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_rpt_Grouping.bas b/testautomation/dbaccess/optional/dba_rpt_Grouping.bas new file mode 100755 index 000000000000..3702ba49a370 --- /dev/null +++ b/testautomation/dbaccess/optional/dba_rpt_Grouping.bas @@ -0,0 +1,59 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Report Builder Grouping Report +'* +'\*********************************************************************** +sub main + + printlog "---------------------------------------------------------------------" + printlog "----- D B A C C E S S - R E P O R T B U I L D E R -----" + printlog "---------------------------------------------------------------------" + + use "dbaccess/optional/includes/rpt_Grouping.inc" + + call hStatusIn ("dbaccess" , "dba_rpt_Grouping.bas") + + if ( tools_reporttools_InstallExtension() = 0 ) then + call rpt_Grouping + else + warnlog "report extension could not installed" + endif + + call hStatusOut + +end sub + + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_rpt_PageNumber.bas b/testautomation/dbaccess/optional/dba_rpt_PageNumber.bas new file mode 100755 index 000000000000..483b0522199e --- /dev/null +++ b/testautomation/dbaccess/optional/dba_rpt_PageNumber.bas @@ -0,0 +1,61 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Report Builder Page Number +'* +'\*********************************************************************** +sub main + + printlog "---------------------------------------------------------------------" + printlog "----- D B A C C E S S - R E P O R T B U I L D E R -----" + printlog "---------------------------------------------------------------------" + + use "dbaccess/optional/includes/rpt_PageNumber.inc" + + call hStatusIn ("dbaccess" , "dba_rpt_PageNumber.bas") + + if ( tools_reporttools_InstallExtension() = 0 ) then + call rpt_PageNumber + else + warnlog "report extension could not installed" + endif + + call hStatusOut + + printlog "---------------------------------------------------------------------" + +end sub + + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_rpt_PropertyBrowser.bas b/testautomation/dbaccess/optional/dba_rpt_PropertyBrowser.bas new file mode 100755 index 000000000000..e605369bed24 --- /dev/null +++ b/testautomation/dbaccess/optional/dba_rpt_PropertyBrowser.bas @@ -0,0 +1,59 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Test for the property browser +'* +'\*********************************************************************** +sub main + + printlog "---------------------------------------------------------------" + printlog "----- D B A C C E S S - Property Browser -----" + printlog "---------------------------------------------------------------" + + use "dbaccess/optional/includes/rpt_PropertyBrowser.inc" + + call hStatusIn ("dbaccess" , "dba_rpt_PropertyBrowser.bas") + + if ( tools_reporttools_InstallExtension() = 0 ) then + call rpt_PropertyBrowser + else + warnlog "report extension could not installed" + endif + + call hStatusOut + +end sub + + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_wiz_CopyTableWizard.bas b/testautomation/dbaccess/optional/dba_wiz_CopyTableWizard.bas new file mode 100755 index 000000000000..4a65067152e8 --- /dev/null +++ b/testautomation/dbaccess/optional/dba_wiz_CopyTableWizard.bas @@ -0,0 +1,54 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Copy Table Wizard +'* +'\*********************************************************************** +sub main + printlog "--------------------------------------------------------------" + printlog "-- D B A C C E S S C O P Y T A B L E W I Z A R D --" + printlog "--------------------------------------------------------------" + + use "dbaccess/optional/includes/wiz_CopyTableWizard.inc" + + call hStatusIn ("dbaccess" , "dba_wiz_CopyTableWizard.bas") + + call wiz_CopyTableWizard + + call hStatusOut + +end sub + + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_wiz_DatabaseWizards.bas b/testautomation/dbaccess/optional/dba_wiz_DatabaseWizards.bas new file mode 100755 index 000000000000..5e97e0dd1f76 --- /dev/null +++ b/testautomation/dbaccess/optional/dba_wiz_DatabaseWizards.bas @@ -0,0 +1,53 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Database Wizard Test +'* +'\*********************************************************************** +sub main + printlog "-------------------------------------------------------" + printlog "--- D B A C C E S S Database Wizard ---" + printlog "-------------------------------------------------------" + + use "dbaccess/optional/includes/wiz_DatabaseWizard.inc" + + call hStatusIn ("dbaccess" , "dba_wiz_DatabaseWizards.bas") + + call wiz_DatabaseWizard + + call hStatusOut + +end sub + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_wiz_FormWizard.bas b/testautomation/dbaccess/optional/dba_wiz_FormWizard.bas new file mode 100755 index 000000000000..75377cd71fcd --- /dev/null +++ b/testautomation/dbaccess/optional/dba_wiz_FormWizard.bas @@ -0,0 +1,53 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Form Wizard Test +'* +'\*********************************************************************** +sub main + printlog "-----------------------------------------------------------" + printlog "--------- D B A C C E S S F O R M W I Z A R D ---------" + printlog "-----------------------------------------------------------" + + use "dbaccess/optional/includes/wiz_FormWizard.inc" + + call hStatusIn ("dbaccess" , "dba_wiz_FormWizard.bas") + + call wiz_FormWizard + + call hStatusOut + +end sub + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_wiz_QueryWizard.bas b/testautomation/dbaccess/optional/dba_wiz_QueryWizard.bas new file mode 100755 index 000000000000..79b05f86de9a --- /dev/null +++ b/testautomation/dbaccess/optional/dba_wiz_QueryWizard.bas @@ -0,0 +1,53 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Query Autopilot Test +'* +'\*********************************************************************** +sub main + printlog "---------------------------------------------------------" + printlog "------- D B A C C E S S Q U E R Y W I Z A R D -------" + printlog "---------------------------------------------------------" + + use "dbaccess/optional/includes/wiz_QueryWizard.inc" + + call hStatusIn ("dbaccess" , "dba_wiz_QueryWizard.bas") + + call wiz_QueryWizard + + call hStatusOut + +end sub + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_wiz_ReportWizard.bas b/testautomation/dbaccess/optional/dba_wiz_ReportWizard.bas new file mode 100755 index 000000000000..984e1c2fd644 --- /dev/null +++ b/testautomation/dbaccess/optional/dba_wiz_ReportWizard.bas @@ -0,0 +1,56 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Report Wizard +'* +'\*********************************************************************** +sub main + printlog "------------------------------------------------------------" + printlog "------- D B A C C E S S R E P O R T W I Z A R D -------" + printlog "------------------------------------------------------------" + + use "dbaccess/optional/includes/wiz_ReportWizard.inc" + + Dim startes + startes = Now + + call hStatusIn ("dbaccess" , "dba_wiz_ReportWizard.bas") + + call wiz_ReportWizard + + call hStatusOut + +end sub + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_wiz_TableWizard.bas b/testautomation/dbaccess/optional/dba_wiz_TableWizard.bas new file mode 100755 index 000000000000..458976b3a419 --- /dev/null +++ b/testautomation/dbaccess/optional/dba_wiz_TableWizard.bas @@ -0,0 +1,53 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Table Wizard Test +'* +'\*********************************************************************** +sub main + printlog "------------------------------------------------" + printlog "--- D B A C C E S S Table Wizard ---" + printlog "------------------------------------------------" + + use "dbaccess/optional/includes/wiz_TableWizard.inc" + + call hStatusIn ("dbaccess" , "dba_wiz_TableWizard.bas") + + call wiz_TableWizard + + call hStatusOut + +end sub + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/dba_xf_Submission.bas b/testautomation/dbaccess/optional/dba_xf_Submission.bas new file mode 100755 index 000000000000..460cd8a13554 --- /dev/null +++ b/testautomation/dbaccess/optional/dba_xf_Submission.bas @@ -0,0 +1,53 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : XForm Submission Test +'* +'\*********************************************************************** +sub main + printlog "---------------------------------------------------------------------" + printlog "----- X F O R M S - S U B M I S S I O N T E S T -----" + printlog "---------------------------------------------------------------------" + + use "dbaccess/optional/includes/xf_Submission.inc" + + call hStatusIn ("dbaccess" , "dba_xf_Submission.bas") + + call xf_Submission + + call hStatusOut + +end sub + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/optional/includes/ctrl_Clipboard.inc b/testautomation/dbaccess/optional/includes/ctrl_Clipboard.inc new file mode 100644 index 000000000000..020f0bb8435b --- /dev/null +++ b/testautomation/dbaccess/optional/includes/ctrl_Clipboard.inc @@ -0,0 +1,492 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Clipboard test with controls between all application +'* +'\*********************************************************************** + +sub ctrl_Clipboard + + call tFromText 'copy control from text document and paste it to the other application and check + call tFromCalc 'copy control from calc document and paste it to the other application and check + call tFromDraw 'copy control from draw document and paste it to the other application and check + call tFromImpress 'copy control from impress document and paste it to the other application and check + +end sub +'-------------------------------------------------------------------------------------- +testcase tFromText + + '/// Open a new document and empty clipboard + printlog "Open a new document and empty clipboard" + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + setClipboard(" ") + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + PushButton.Click + sleep(1) + '/// insert a Push Button + printlog "insert a Push Button" + call hDrawingWithSelection ( 20, 20, 30, 30 ) + sleep(2) + Kontext "FormControls" + ControlProperties.Click + sleep (1) + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set control property: Name + printlog "set control property" + Kontext "TabGeneralControl" + if TabGeneralControl.exists(3) then + NameText.setText("FromText") + else warnlog "control property browser could not be opend" + endif + sleep (1) + '/// copy control to clipboard + printlog "copy control to clipboard" + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<F6>", TRUE + sleep (1) + DocumentWriter.TypeKeys "<COPY>", TRUE + sleep (1) + '/// close document + printlog "close document" + call hCloseDocument + + '/// open new document (to repeat for all documents except the document you copy from) + dim i as integer 'counter + for i = 1 to 3 + '/// paste control from clipboard and open control property browser + if i = 1 then + gApplication = "CALC" + printlog "-- Text to Calc Clipboard Test --" + printlog "open a new Calc document" + call hNewDocument + printlog "paste control from clipboard" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "<PASTE>", TRUE + sleep (1) + printlog "open control property browser from context" + DocumentCalc.TypeKeys "<SHIFT F10>", TRUE + call hMenuSelectNr(4) + endif + if i = 2 then + gApplication = "DRAW" + printlog "-- Text to Draw Clipboard Test --" + printlog "open a new Draw document" + call hNewDocument + printlog "paste control from clipboard" + Kontext "DocumentDraw" + DocumentDraw.TypeKeys "<PASTE>", TRUE + sleep (1) + printlog "open control property browser from context" + DocumentDraw.TypeKeys "<SHIFT F10>", TRUE + call hMenuSelectNr(2) + endif + if i = 3 then + gApplication = "IMPRESS" + printlog "-- Text to Impress Clipboard Test --" + printlog "open a new Impress document" + call hNewDocument + printlog "paste control from clipboard" + Kontext "DocumentImpress" + DocumentImpress.TypeKeys "<PASTE>", TRUE + sleep (1) + printlog "open control property browser from context" + DocumentImpress.TypeKeys "<SHIFT F10>", TRUE + call hMenuSelectNr(2) + endif + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// check if control was correctly stored in clipboard + Kontext "TabGeneralControl" + if TabGeneralControl.exists(3) then + if NameText.getText <> "FromText" then + warnlog "Control is not saved correctly" + else printlog "control was saved correctly" + endif + else warnlog "Control property browser could not be opend" + endif + sleep (1) + '/// Close document + printlog "close document" + call hCloseDocument + + next i + printlog "*** Testcase End ***" + +endcase + +'-------------------------------------------------------------------------------------- +testcase tFromCalc + + '/// Open a new document and empty clipboard + printlog "Open a new document and empty clipboard" + gApplication = "CALC" + call hNewDocument + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "tt_doc" , true + sleep(1) + setClipboard(" ") + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + PushButton.Click + sleep(1) + '/// insert a Push Button + printlog "insert a Push Button" + call hDrawingWithSelection ( 20, 20, 30, 30 ) + sleep(2) + Kontext "FormControls" + ControlProperties.Click + sleep (1) + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set control property: Name + printlog "set control property" + Kontext "TabGeneralControl" + if TabGeneralControl.exists(3) then + NameText.setText("FromCalc") + else warnlog "control property browser could not be opend" + endif + sleep (1) + '/// copy control to clipboard + printlog "copy control to clipboard" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "<F6>", TRUE + sleep (1) + DocumentCalc.TypeKeys "<COPY>", TRUE + sleep (1) + '/// close document + printlog "close document" + call hCloseDocument + + '/// open new document (to repeat for all documents except the document you copy from) + dim i as integer 'counter + for i = 1 to 3 + '/// paste control from clipboard and open control property browser + if i = 1 then + gApplication = "WRITER" + printlog "-- Calc to Text Clipboard Test --" + printlog "open a new Text document" + call hNewDocument + printlog "paste control from clipboard" + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<PASTE>", TRUE + sleep (1) + printlog "open control property browser from context" + DocumentWriter.TypeKeys "<SHIFT F10>", TRUE + call hMenuSelectNr(4) + endif + if i = 2 then + gApplication = "DRAW" + printlog "-- Calc to Draw Clipboard Test --" + printlog "open a new Draw document" + call hNewDocument + printlog "paste control from clipboard" + Kontext "DocumentDraw" + DocumentDraw.TypeKeys "<PASTE>", TRUE + sleep (1) + printlog "open control property browser from context" + DocumentDraw.TypeKeys "<SHIFT F10>", TRUE + call hMenuSelectNr(2) + endif + if i = 3 then + gApplication = "IMPRESS" + printlog "-- Calc to Impress Clipboard Test --" + printlog "open a new Impress document" + call hNewDocument + printlog "paste control from clipboard" + Kontext "DocumentImpress" + DocumentImpress.TypeKeys "<PASTE>", TRUE + sleep (1) + printlog "open control property browser from context" + DocumentImpress.TypeKeys "<SHIFT F10>", TRUE + call hMenuSelectNr(2) + endif + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// check if control was correctly stored in clipboard + Kontext "TabGeneralControl" + if TabGeneralControl.exists(3) then + if NameText.getText <> "FromCalc" then + warnlog "Control is not saved correctly. Name should be FromCalc but it is " + NameText.getText + else + printlog "control was saved correctly" + endif + else warnlog "Control property browser could not be opend" + endif + sleep (1) + '/// Close document + printlog "close document" + call hCloseDocument + + next i + printlog "*** Testcase End ***" + +endcase + +'-------------------------------------------------------------------------------------- +testcase tFromDraw + + '/// Open a new document and empty clipboard + printlog "Open a new document and empty clipboard" + gApplication = "DRAW" + call hNewDocument + Kontext "DocumentDraw" + DocumentDraw.TypeKeys "tt_doc" , true + sleep(1) + setClipboard(" ") + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + PushButton.Click + sleep(1) + '/// insert a Push Button + printlog "insert a Push Button" + call hDrawingWithSelection ( 20, 20, 30, 30 ) + sleep(2) + Kontext "FormControls" + ControlProperties.Click + sleep (1) + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set control property: Name + printlog "set control property" + Kontext "TabGeneralControl" + if TabGeneralControl.exists(3) then + NameText.setText("FromDraw") + else warnlog "control property browser could not be opend" + endif + sleep (1) + '/// copy control to clipboard + printlog "copy control to clipboard" + Kontext "DocumentDraw" + DocumentDraw.TypeKeys "<F6>", TRUE + sleep (1) + DocumentDraw.TypeKeys "<COPY>", TRUE + sleep (1) + '/// close document + printlog "close document" + call hCloseDocument + + '/// open new document (to repeat for all documents except the document you copy from) + dim i as integer 'counter + for i = 1 to 3 + '/// paste control from clipboard and open control property browser + if i = 1 then + gApplication = "WRITER" + printlog "-- Draw to Text Clipboard Test --" + printlog "open a new Text document" + call hNewDocument + printlog "paste control from clipboard" + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<PASTE>", TRUE + sleep (1) + printlog "open control property browser from context" + DocumentWriter.TypeKeys "<SHIFT F10>", TRUE + call hMenuSelectNr(4) + endif + if i = 2 then + gApplication = "CALC" + printlog "-- Draw to Calc Clipboard Test --" + printlog "open a new Calc document" + call hNewDocument + printlog "paste control from clipboard" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "<PASTE>", TRUE + sleep (1) + printlog "open control property browser from context" + DocumentCalc.TypeKeys "<SHIFT F10>", TRUE + call hMenuSelectNr(4) + endif + if i = 3 then + gApplication = "IMPRESS" + printlog "-- Draw to Impress Clipboard Test --" + printlog "open a new Impress document" + call hNewDocument + printlog "paste control from clipboard" + Kontext "DocumentImpress" + DocumentImpress.TypeKeys "<PASTE>", TRUE + sleep (1) + printlog "open control property browser from context" + DocumentImpress.TypeKeys "<SHIFT F10>", TRUE + call hMenuSelectNr(2) + endif + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// check if control was correctly stored in clipboard + Kontext "TabGeneralControl" + if TabGeneralControl.exists(3) then + if NameText.getText <> "FromDraw" then + warnlog "Control is not saved correctly" + else printlog "control was saved correctly" + endif + else warnlog "Control property browser could not be opend" + endif + sleep (1) + '/// Close document + printlog "close document" + call hCloseDocument + + next i + printlog "*** Testcase End ***" + +endcase + +'-------------------------------------------------------------------------------------- +testcase tFromImpress + + '/// Open a new document and empty clipboard + printlog "Open a new document and empty clipboard" + gApplication = "IMPRESS" + call hNewDocument + Kontext "DocumentImpress" + DocumentImpress.TypeKeys "tt_doc" , true + sleep(1) + setClipboard(" ") + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + PushButton.Click + sleep(1) + '/// insert a Push Button + printlog "insert a Push Button" + call hDrawingWithSelection ( 20, 20, 30, 30 ) + sleep(2) + Kontext "FormControls" + ControlProperties.Click + sleep (1) + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set control property: Name + printlog "set control property" + Kontext "TabGeneralControl" + if TabGeneralControl.exists(3) then + NameText.setText("FromImpress") + else warnlog "control property browser could not be opend" + endif + sleep (1) + '/// copy control to clipboard + printlog "copy control to clipboard" + Kontext "DocumentImpress" + DocumentImpress.TypeKeys "<F6>", TRUE + sleep (1) + DocumentImpress.TypeKeys "<COPY>", TRUE + sleep (1) + '/// close document + printlog "close document" + call hCloseDocument + + '/// open new document (to repeat for all documents except the document you copy from) + dim i as integer 'counter + for i = 1 to 3 + '/// paste control from clipboard and open control property browser + if i = 1 then + gApplication = "WRITER" + printlog "-- Impress to Text Clipboard Test --" + printlog "open a new Text document" + call hNewDocument + printlog "paste control from clipboard" + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<PASTE>", TRUE + sleep (1) + printlog "open control property browser from context" + DocumentWriter.TypeKeys "<SHIFT F10>", TRUE + call hMenuSelectNr(4) + endif + if i = 2 then + gApplication = "CALC" + printlog "-- Impress to Calc Clipboard Test --" + printlog "open a new Calc document" + call hNewDocument + printlog "paste control from clipboard" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "<PASTE>", TRUE + sleep (1) + printlog "open control property browser from context" + DocumentCalc.TypeKeys "<SHIFT F10>", TRUE + call hMenuSelectNr(4) + endif + if i = 3 then + gApplication = "DRAW" + printlog "-- Impress to Draw Clipboard Test --" + printlog "open a new Draw document" + call hNewDocument + printlog "paste control from clipboard" + Kontext "DocumentDraw" + DocumentDraw.TypeKeys "<PASTE>", TRUE + sleep (1) + printlog "open control property browser from context" + DocumentDraw.TypeKeys "<SHIFT F10>", TRUE + call hMenuSelectNr(2) + endif + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// check if control was correctly stored in clipboard + Kontext "TabGeneralControl" + if TabGeneralControl.exists(3) then + if NameText.getText <> "FromImpress" then + warnlog "Control is not saved correctly" + else printlog "control was saved correctly" + endif + else warnlog "Control property browser could not be opend" + endif + sleep (1) + '/// Close document + printlog "close document" + call hCloseDocument + + next i + printlog "*** Testcase End ***" + +endcase diff --git a/testautomation/dbaccess/optional/includes/ctrl_General.inc b/testautomation/dbaccess/optional/includes/ctrl_General.inc new file mode 100644 index 000000000000..b0ee0bea81dc --- /dev/null +++ b/testautomation/dbaccess/optional/includes/ctrl_General.inc @@ -0,0 +1,1153 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Data Source Administrator +'* +'\*********************************************************************** +sub ctrl_General + + call tLoad_Save_Print + call tAutomaticControlFocus1 + call tAutomaticControlFocus2' + call tPosAndSize_Protect_Position + call tPosAndSize_Protect_Size + call tPosAndSize_Keyboard + call tPosAndSize_Dialog + call tPosAndSize_KeepRatio + 'TODO Control the Setting on tabpage Rotation & Slant (should be inactive). + + call tTabStop + call tActivationOrder + call tAddFields + call tLabelFieldSelection + +end sub + +'-------------------------------------------------------------------------------------- + +testcase tLoad_Save_Print + + dim iXMLElementCount as integer + dim i as integer + '/// Load the document TT_All_Controls.odt + hFileOpen ( gTesttoolPath + ConvertPath("dbaccess/optional/input/TT_All_Controls.odt")) + 'TODO: Are all controlls shown right (color, fonts etc.)? + '/// save the doc under a diffrent name. + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_All_Controls.odt")) + '/// Reload & compare it with the origin doc. + hCloseDocument + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_All_Controls.odt")) + hCloseDocument + 'TODO: Print the doc & compare it with the origin. + '(Attention: Background can't be printed colored (Task: <A HREF="http://webserver1.stardiv.de/Bugtracker/Source/Body_ReportDetail.asp?ID=57223">57223</A>)). + +endcase +'-------------------------------------------------------------------------------------- +testcase tAutomaticControlFocus1 + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + Edit.Click + sleep(2) + '/// insert a Text Boxes + printlog "insert three Text Boxes" + call hDrawingWithSelection ( 40, 40, 55, 55 ) + + sleep(2) + + Kontext "FormControls" + ControlProperties.Click + sleep(2) + + fSetControlProperty("Edit","DefaultValue","tt_control") + sleep(1) + '/// activate the Automatic control focus. + printlog "activate the Automatic control focus." + + call hToolbarSelect("FormDesignTools",true) + + Kontext "FormDesignTools" + AutoControlFocus.Click + + sleep(2) + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_Control_Test1.odt")) + sleep(1) + hCloseDocument + sleep(1) + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_Control_Test1.odt")) + ' /// check if the control has the focus after reload. + printlog " check if the second control has the focus after reload." + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<MOD1 HOME>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 SHIFT END>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + if GetClipboard <> "tt_control" then + warnlog "The control has not the focus. The document has the focus." + endif + + hCloseDocument + +endcase +'-------------------------------------------------------------------------------------- +testcase tAutomaticControlFocus2 + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + Edit.Click + sleep(1) + '/// insert three Text Boxes + printlog "insert three Text Boxes" + call hDrawingWithSelection ( 50, 20, 60, 30 ) + sleep(2) + Kontext "FormControls" + ControlProperties.Click + sleep(2) + fSetControlProperty("Edit","DefaultValue","tt_control1") + + call hDrawingWithSelection ( 50, 40, 60, 50 ) + sleep(2) + ' open and close the form property browser to get the focus + Kontext "FormControls" + ControlProperties.Click + sleep(2) + ControlProperties.Click + sleep(2) + + fSetControlProperty("Edit","TabOrder","1") + + ' open and close the property browser + Kontext "FormControls" + ControlProperties.Click + sleep(2) + ControlProperties.Click + sleep(2) + + fSetControlProperty("Edit","DefaultValue","tt_control2") + + sleep(1) + + call hDrawingWithSelection ( 50, 60, 60, 70 ) + sleep(2) + ' open and close the form property browser to get the focus + Kontext "FormControls" + ControlProperties.Click + sleep(2) + ControlProperties.Click + sleep(2) + fSetControlProperty("Edit","DefaultValue","tt_control3") + + '/// activate the Automatic control focus. + printlog "activate the Automatic control focus." + + call hToolbarSelect("FormDesignTools",true) + + Kontext "FormDesignTools" + AutoControlFocus.Click + + sleep(2) + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_Control_Test2.odt")) + hCloseDocument + sleep(1) + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_Control_Test2.odt")) + ' /// check if the second control has the focus after reload. + printlog " check if the second control has the focus after reload." + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<MOD1 HOME>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 SHIFT END>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + if GetClipboard <> "tt_control2" then + warnlog "The wrong control has the focus." + endif + + hCloseDocument + +endcase +'-------------------------------------------------------------------------------------- +testcase tPosAndSize_Keyboard + + dim sPosX as String + dim sPosY as String + dim sWidth as String + dim sHeight as String + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + + sleep(1) + call hToolbarSelect("FormControls",true) + Kontext "FormControls" + Edit.Click + + '/// insert a Text Box + printlog "insert a Text Box" + Kontext "DocumentWriter" + DocumentWriter.MouseDown ( 45, 45 ) + DocumentWriter.MouseMove ( 55, 55 ) + DocumentWriter.MouseUp ( 55, 55 ) + sleep(2) + '/// open the position and size dialog. + printlog "open the position and size dialog." + + call fOpenPositionAndSizeDialog + + '/// remember the settings. + printlog "remember the settings." + Kontext "TabPositionAndSizeWriter" + sPosX = HorizontalBy.getText() + sPosY = Verticalby.getText() + sWidth = Width.getText() + sHeight = Height.getText() + TabPositionAndSizeWriter.OK + sleep(2) + + Kontext "DocumentWriter" + gMouseClick(50,50) + sleep(2) + + '/// move the control via keyboard + printlog "move the control via keyboard" + + DocumentWriter.TypeKeys "<DOWN>" , true + DocumentWriter.TypeKeys "<RIGHT>" , true + DocumentWriter.TypeKeys "<MOD1 TAB>" , true + DocumentWriter.TypeKeys "<DOWN>" , true + DocumentWriter.TypeKeys "<RIGHT>" , true + + sleep(2) + '/// open the position and size dialog + printlog "open the position and size dialog" + + call fOpenPositionAndSizeDialog + + Kontext "TabPositionAndSizeWriter" + '/// check the settings. + printlog "check the settings." + if sPosX = HorizontalBy.getText() then + warnlog "The X position has not change." + endif + if sPosY = VerticalBy.getText() then + warnlog "The Y position has not change." + endif + if sWidth = Width.getText() then + warnlog "The width position has not change." + endif + if sHeight = Height.getText() then + warnlog "The height position has not change." + endif + + TabPositionAndSizeWriter.OK + sleep(1) + + hCloseDocument + +endcase +'-------------------------------------------------------------------------------------- +testcase tPosAndSize_Dialog + + dim sPosX as String + dim sPosY as String + dim sWidth as String + dim sHeight as String + dim sText as String + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + Edit.Click + sleep(1) + '/// insert a Text Box + printlog "insert a Text Box" + call hDrawingWithSelection ( 40, 40, 60, 60 ) + sleep(2) + '/// open the position and size dialog + printlog "open the position and size dialog" + + call fOpenPositionAndSizeDialog + + '/// set values for X , Y , width and height + printlog "set values for X , Y , width and height" + Kontext "TabPositionAndSizeWriter" + ' uncheck KeepRatio because maybe it have set from a test before. + KeepRatio.UnCheck + HorizontalBy.setText("3") + VerticalBy.setText("3") + Width.setText("3") + Height.setText("3") + sleep(1) + TabPositionAndSizeWriter.OK + sleep(2) + '/// open the position and size dialog + printlog "open the position and size dialog" + + call fOpenPositionAndSizeDialog + + Kontext "TabPositionAndSizeWriter" + '/// check the settings. + printlog "check the settings." + sText = HorizontalBy.getText() + if Instr(sText,"3") = 0 then + warnlog "The X position has not changed." + endif + sText = VerticalBy.getText() + if Instr(sText,"3") = 0 then + warnlog "The Y position has not changed." + endif + sText = Width.getText() + if Instr(sText,"3") = 0 then + warnlog "The width has not changed." + endif + sText = Height.getText() + if Instr(sText,"3") = 0 then + warnlog "The height has not changed." + endif + + TabPositionAndSizeWriter.OK + sleep(1) + + hCloseDocument + +endcase +'-------------------------------------------------------------------------------------- +testcase tPosAndSize_Protect_Position + + dim sPosX as String + dim sPosY as String + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + Edit.Click + sleep(1) + '/// insert a Text Box + printlog "insert a Text Box" + call hDrawingWithSelection ( 40, 40, 60, 60 ) + sleep(2) + '/// open the position and size dialog + printlog "open the position and size dialog" + + call fOpenPositionAndSizeDialog + + Kontext "TabPositionAndSizeWriter" + sPosX = HorizontalBy.getText() + sPosY = VerticalBy.getText() + '/// check protect position + printlog "check protect position" + ProtectPosition.Check + TabPositionAndSizeWriter.OK + sleep(2) + + Kontext "DocumentWriter" + gMouseClick(50,50) + sleep(2) + 'Kontext "DocumentWriter" + '/// test if is possible to move the control via keyboard + printlog "test if is possible to move the control via keyboard" + DocumentWriter.TypeKeys "<DOWN>" , true + DocumentWriter.TypeKeys "<RIGHT>" , true + + sleep(2) + '/// open the position and size dialog + printlog "open the position and size dialog" + + call fOpenPositionAndSizeDialog + + Kontext "TabPositionAndSizeWriter" + '/// check the settings, if the position is changed. + printlog "check the settings, if the position is changed." + if sPosX <> HorizontalBy.getText() then + warnlog "The X position has change although the protect position is checked." + endif + if sPosY <> VerticalBy.getText() then + warnlog "The Y position has change although the protect position is checked." + endif + TabPositionAndSizeWriter.OK + sleep(1) + + hCloseDocument + +endcase +'-------------------------------------------------------------------------------------- +testcase tPosAndSize_KeepRatio + + dim sWidth as String + dim sHeight as String + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + Edit.Click + sleep(1) + '/// insert a Text Box + printlog "insert a Text Box" + call hDrawingWithSelection ( 40, 40, 60, 60 ) + sleep(2) + '/// open the position and size dialog + printlog "open the position and size dialog" + + call fOpenPositionAndSizeDialog + + sleep(1) + '/// set a width and height. + printlog "set a width and height." + Kontext "TabPositionAndSizeWriter" + KeepRatio.UnCheck + Width.setText("4") + sleep(1) + Height.setText("2") + sleep(1) + '/// check keep ratio + printlog "check keep ratio" + KeepRatio.Check + sleep(1) + Width.setText("6") + sleep(1) + '/// check if keep ratio is working + printlog "check if keep ratio is working" + if Instr(Height.getText(),"3") = -1 then + warnlog "The height doesn't keep the ratio" + endif + TabPositionAndSizeWriter.OK + sleep(2) + '/// open the position and size dialog + printlog "open the position and size dialog" + call fOpenPositionAndSizeDialog + + Kontext "TabPositionAndSizeWriter" + '/// check the settings. + printlog "check the settings." + if Instr(Width.getText(),"6") = -1 then + warnlog "The width isn't correct. " + Width.getText()+" instead of 6." + endif + if Instr(Height.getText(),"3") = -1 then + warnlog "The height isn't correct. " + height.getText()+" instead of 3." + endif + + TabPositionAndSizeWriter.OK + sleep(1) + + hCloseDocument + +endcase +'-------------------------------------------------------------------------------------- +testcase tPosAndSize_Protect_Size + + dim sWidth as String + dim sHeight as String + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + Edit.Click + sleep(1) + '/// insert a Text Box + printlog "insert a Text Box" + call hDrawingWithSelection ( 40, 40, 60, 60 ) + sleep(2) + '/// open the position and size dialog + printlog "open the position and size dialog" + + call fOpenPositionAndSizeDialog + + Kontext "TabPositionAndSizeWriter" + sWidth = Width.getText() + sHeight = Height.getText() + '/// check protect size + printlog "check protect size" + ProtectSize.Check + TabPositionAndSizeWriter.OK + sleep(2) + + Kontext "DocumentWriter" + gMouseClick(50,50) + sleep(2) + 'Kontext "DocumentWriter" + '/// test is is possible to change the size of the control via keyboard + printlog "test is is possible to change the size of the control via keyboard" + DocumentWriter.TypeKeys "<MOD1 TAB>" , true + DocumentWriter.TypeKeys "<DOWN>" , true + DocumentWriter.TypeKeys "<RIGHT>" , true + sleep(2) + '/// open the position and size dialog + printlog "open the position and size dialog" + + call fOpenPositionAndSizeDialog + + Kontext "TabPositionAndSizeWriter" + '/// check the settings + printlog "check the settings" + if sWidth <> Width.getText() then + warnlog "The width has change although the protect size is checked." + endif + if sHeight <> Height.getText() then + warnlog "The height has change although the protect size is checked." + endif + TabPositionAndSizeWriter.OK + sleep(1) + + hCloseDocument + +endcase +'------------------------------------------------------------------------- +testcase tTabStop + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + Edit.Click + sleep(1) + '/// insert one Text Box + printlog "insert one Text Box" + call hDrawingWithSelection ( 50, 20, 60, 30 ) + sleep(2) + + '/// open the control propery browser + printlog "open the control propery browser" + call fOpenControlPropertyBrowser + + '/// the the default text to tt_control1 + printlog "the the default text to tt_control1" + call fSetControlProperty("TextBox","DefaultValue","tt_control1") + + ' close the property browser + Kontext "FormControls" + ControlProperties.Click + + sleep(1) + + '/// insert again one Text Box + printlog "insert again one Text Box" + call hDrawingWithSelection ( 50, 40, 60, 50 ) + + sleep(2) + + '/// open the property browser + printlog "open the property browser" + call fOpenControlPropertyBrowser + + '/// set the Order property to 2 + printlog "set the Order property to 2" + call fSetControlProperty("TextBox","Order","2") + + 'close and reopen the control property browser to get the default focus + call fOpenControlPropertyBrowser + + '/// set the DefaultValue property to tt_control2 + call fSetControlProperty("TextBox","DefaultValue","tt_control2") + + 'close the control propery browser + Kontext "FormControls" + ControlProperties.Click + + '/// insert again one Text Box + printlog "insert again one Text Box" + call hDrawingWithSelection ( 50, 60, 60, 70 ) + + sleep(2) + + ' open and close the form property browser to get the focus + call fOpenControlPropertyBrowser + + '/// set the Order property to 1 + printlog "set the Order property to 1" + call fSetControlProperty("TextBox","Order","1") + + 'close and reopen the control property browser to get the default focus + call fOpenControlPropertyBrowser + + '/// set the DeaultValue property to tt_control3 + printlog "set the DeaultValue property to tt_control3" + call fSetControlProperty("TextBox","DefaultValue","tt_control3") + + call hToolbarSelect("FormDesignTools",true) + Kontext "FormDesignTools" + '/// activate the AutomaticControlFocus + printlog "activate the AutomaticControlFocus" + AutoControlFocus.Click + sleep(1) + '/// turn of the design view + printlog "turn of the design view" + Kontext "FormControls" + SwitchControlDesignMode.Click + printlog "after designview click" + sleep(4) + '/// check if the right control has the focus + printlog "check if the right control has the focus" + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<MOD1 HOME>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 SHIFT END>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + if GetClipboard = "tt_doc" then + warnlog "The control has not the focus. The document has the focus." + elseif GetClipboard <> "tt_control3" then + warnlog "The wrong control has the focus." + endif + '/// check that tyou travel to the right controls via TAB + printlog "check that tyou travel to the right controls via TAB" + DocumentWriter.TypeKeys "<TAB>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 HOME>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 SHIFT END>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + if GetClipboard <> "tt_control2" then + warnlog "The wrong control has the focus." + endif + + hCloseDocument + +endcase +'-------------------------------------------------------------------------------------- +testcase tActivationOrder + + Dim sSelText as string + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + Edit.Click + sleep(1) + + '/// insert one Text Box + printlog "insert one Text Box" + call hDrawingWithSelection ( 50, 20, 60, 30 ) + sleep(2) + + '/// open the control property browser + printlog "open the control property browser" + call fOpenControlPropertyBrowser + + '/// set the Name Property to tt_control1 + printlog "set the Name Property to tt_control1" + call fSetControlProperty("TextBox","NameText","tt_control1") + + 'close and reopen the control property browser to get the default focus + call fOpenControlPropertyBrowser + + '/// set the DefaultValue Property to tt_control1 + printlog "set the DefaultValue Property to tt_control1" + call fSetControlProperty("TextBox","DefaultValue","tt_control1") + + sleep(1) + + ' close the property browser + Kontext "FormControls" + ControlProperties.Click + + '/// insert one Text Box + printlog "insert one Text Box" + call hDrawingWithSelection ( 50, 40, 60, 50 ) + sleep(2) + + '/// open the control property browser + printlog "open the control property browser" + call fOpenControlPropertyBrowser + + '/// set the Name Property to tt_control2 + printlog "set the Name Property to tt_control2" + call fSetControlProperty("TextBox","NameText","tt_control2") + + 'close and reopen the control property browser to get the default focus + call fOpenControlPropertyBrowser + + '/// set the DefaultValue Property to tt_control2 + call fSetControlProperty("TextBox","DefaultValue","tt_control2") + + ' close the property browser + Kontext "FormControls" + ControlProperties.Click + + '/// insert one Text Box + printlog "insert one Text Box" + call hDrawingWithSelection ( 50, 60, 60, 70 ) + sleep(2) + + '/// open the control property browser + printlog "open the control property browser" + call fOpenControlPropertyBrowser + + '/// set the Name Property to tt_control3 + call fSetControlProperty("TextBox","NameText","tt_control3") + + 'close and reopen the control property browser to get the default focus + call fOpenControlPropertyBrowser + + '/// set the Defaultvalue property to tt_control3 + call fSetControlProperty("TextBox","DefaultValue","tt_control3") + + '/// open the tab order dialog + printlog "open the tab order dialog" + call fOpenTabOrder + + ' IndexKLiener + printlog "IndexKLiener" + Kontext "ActivationOrder" + sleep(1) + ControlList.TypeKeys "<END>" , true ' to select the first entry + sleep(1) + ControlList.TypeKeys "<HOME>" , true + sleep(1) + sSelText = ControlList.getSelText() + if sSelText <> "tt_control1" then + warnlog "Wrong control on first position in activation order dialog.(" + sSelText + ")" + endif + sleep(1) + ControlList.TypeKeys "<DOWN>" , true + sleep(1) + sSelText = ControlList.getSelText() + if sSelText <> "tt_control2" then + warnlog "Wrong control on second position in activation order dialog.(" + sSelText + ")" + endif + sleep(1) + ControlList.TypeKeys "<DOWN>" , true + sleep(1) + sSelText = ControlList.getSelText() + if sSelText <> "tt_control3" then + warnlog "Wrong control on third position in activation order dialog.(" + sSelText + ")" + endif + sleep(1) + MoveUp.Click + sleep(1) + ControlList.TypeKeys "<HOME>" , true + sleep(1) + ControlList.TypeKeys "<DOWN>" , true + sSelText = ControlList.getSelText() + if sSelText <> "tt_control3" then + warnlog "The move up button in activation order dialog doesn't work.(" + sSelText + ")" + endif + + + ActivationOrder.OK + sleep(1) + printlog "open TabOrder dialog" + call fOpenTabOrder + + Kontext "ActivationOrder" + sleep(1) + ControlList.TypeKeys "<END>" , true ' to select the first entry + sleep(1) + ControlList.TypeKeys "<HOME>" , true + sleep(1) + sSelText = ControlList.getSelText() + if sSelText <> "tt_control1" then + warnlog "Wrong control on first position in activation order dialog.(" + sSelText + ")" + endif + sleep(1) + MoveDown.Click + sleep(1) + ControlList.TypeKeys "<HOME>" , true + sleep(1) + ControlList.TypeKeys "<DOWN>" , true + sSelText = ControlList.getSelText() + if sSelText <> "tt_control1" then + warnlog "The move down button in activation order dialog doesn't work.(" + sSelText + ")" + endif + + ActivationOrder.OK + + sleep(1) + + call hToolbarSelect("FormDesignTools",true) + + Kontext "FormDesignTools" + + '/// activate the AutomaticControlFocus + printlog "activate the AutomaticControlFocus" + AutoControlFocus.Click + sleep(1) + '/// turn of the design view + printlog "turn of the design view" + Kontext "FormControls" + SwitchControlDesignMode.Click + printlog "after designview click" + sleep(4) + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<MOD1 HOME>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 SHIFT END>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + if GetClipboard = "tt_doc" then + warnlog "The control has not the focus. The document has the focus." + elseif GetClipboard <> "tt_control3" then + warnlog "The wrong control has the focus. (" + GetClipboard + ")" + endif + DocumentWriter.TypeKeys "<TAB>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 HOME>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 SHIFT END>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + if GetClipboard = "tt_doc" then + warnlog "The control has not the focus. The document has the focus." + elseif GetClipboard <> "tt_control1" then + warnlog "The wrong control has the focus. (" + GetClipboard + ")" + endif + + DocumentWriter.TypeKeys "<TAB>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 HOME>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 SHIFT END>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + if GetClipboard = "tt_doc" then + warnlog "The control has not the focus. The document has the focus." + elseif GetClipboard <> "tt_control2" then + warnlog "The wrong control has the focus. (" + GetClipboard + ")" + endif + + + printlog "turn of the design view" + Kontext "FormControls" + SwitchControlDesignMode.Click + printlog "after designview click" + sleep(4) + + printlog "open TabOrder dialog" + call fOpenTabOrder + + Kontext "ActivationOrder" + AutoOrder.Click + sleep(1) + ActivationOrder.OK + sleep(1) + + Kontext "FormControls" + '/// turn off the design view + printlog "turn of the design view" + SwitchControlDesignMode.Click + sleep(2) + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<MOD1 HOME>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 SHIFT END>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + if GetClipboard = "tt_doc" then + warnlog "The control has not the focus. The document has the focus." + elseif GetClipboard <> "tt_control1" then + warnlog "The wrong control has the focus.(" + GetClipboard + ")" + endif + DocumentWriter.TypeKeys "<TAB>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + if GetClipboard = "tt_doc" then + warnlog "The control has not the focus. The document has the focus." + elseif GetClipboard <> "tt_control2" then + warnlog "The wrong control has the focus.(" + GetClipboard + ")" + endif + + DocumentWriter.TypeKeys "<TAB>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + if GetClipboard = "tt_doc" then + warnlog "The control has not the focus. The document has the focus." + elseif GetClipboard <> "tt_control3" then + warnlog "The wrong control has the focus.(" + GetClipboard + ")" + endif + + sleep(1) + + call hCloseDocument + +endcase +'------------------------------------------------------------------------- +testcase tAddFields + + Dim sControlName1 as String + Dim sControlName2 as String + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + Edit.Click + sleep(1) + '/// insert three Text Boxes + printlog "insert three Text Boxes" + call hDrawingWithSelection ( 50, 20, 60, 30 ) + sleep(2) + Kontext "FormControls" + FormProperties.Click + sleep(1) + + Kontext "FormPropertiesDialog" + FormPropertiesTabControl.SetPage TabDataForm + + Kontext "TabDataForm" + sleep(1) + DataSource.Select "Bibliography" + TabDataForm.typeKeys("<RETURN>") + sleep(1) + Content.Select "biblio" + TabDataForm.typeKeys("<RETURN>") + sleep(1) + + Kontext "FormControls" + FormProperties.Click + sleep(1) + + call hToolbarSelect("FormDesignTools",true) + + Kontext "FormDesignTools" + AddField.Click + sleep(1) + + Kontext "FeldAuswahl" + Liste.Select 1 + sControlName1 = Liste.getSelText + Liste.TypeKeys "<RETURN>" + sleep(3) + + Kontext "FormDesignTools" + ShowFmExplorer.Click + sleep(1) + + Kontext "FormularNavigator" + Liste.TypeKeys "<HOME>" , true + Liste.TypeKeys "<DOWN>" , 4, true + sControlName2 = Liste.getSelText + if sControlName1 <> sControlName2 then + warnlog "The control name is not the same as the fieldname. controlname = " + sControlName2 + " fieldname = " + sControlName1 + endif + + sleep (2) + + call hCloseDocument + +endcase +'------------------------------------------------------------------------- +testcase tLabelFieldSelection + ' check if the assignment of lables to text fields work + dim sLabelText as String + + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + printlog "open the form control toolbar" + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + Label.Click + sleep(1) + + printlog "insert a label field" + call hDrawingWithSelection ( 20, 20, 30, 30 ) + sleep(2) + + Kontext "FormControls" + Edit.Click + sleep(1) + + printlog "insert a text field" + call hDrawingWithSelection ( 40, 40, 50, 50 ) + sleep(2) + + printlog "open the control property browser" + call fOpenControlPropertyBrowser + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + + printlog "click on button behind the lable field to open the field selection dialog" + Kontext "TabGeneralControl" + LabelFieldButton.Click + sleep(1) + + printlog "select the lable fiiel in the tree list box" + Kontext "LabelFieldSelection" + LabelFieldSelection.TypeKeys "<DOWN>",TRUE + LabelFieldSelection.TypeKeys "<DOWN>",TRUE + sleep(1) + printlog "close the field selection dialog" + LabelFieldSelection.OK + sleep(1) + + printlog "check if the lable field property contains some text" + 'TODO: check for the correct text this has a language dependencie + Kontext "TabGeneralControl" + sLabelText = LabelField.getText() + if(sLabelText = "") then + warnlog "the lable for a text field is not set" + else + printlog "the label for the text field is set" + endif + + printlog "click on button behind the lable field to open the field selection dialog" + Kontext "TabGeneralControl" + LabelFieldButton.Click + sleep(1) + + Kontext "LabelFieldSelection" + LabelFieldSelection.TypeKeys "<DOWN>",TRUE + LabelFieldSelection.TypeKeys "<DOWN>",TRUE + sleep(1) + printlog "select the lable field and check the checkbox 'no assignment'" + CBNoAssignment.check + printlog "close the field selection dialog" + LabelFieldSelection.OK + sleep(1) + + printlog "check if the lable field property contains no text" + Kontext "TabGeneralControl" + sLabelText = LabelField.getText() + if(sLabelText <> "") then + warnlog "the lable for a text field is not deleted" + else + printlog "the label for the text field is deleted" + endif + + printlog "close the document" + call hCloseDocument + +endcase +'------------------------------------------------------------------------- +function fOpenPositionAndSizeDialog + + call hToolbarSelect("FormDesignTools",true) + + Kontext "FormDesignTools" + PositionAndSizeDialog.Click + + fOpenPositionAndSizeDialog=true + +end function +'------------------------------------------------------------------------- +function fOpenTabOrder + + printlog "open FormControls Toolbar" + + call hToolbarSelect("FormDesignTools",true) + + Kontext "FormDesignTools" + TabDialog.Click + + fOpenTabOrder=true + +end function + +'------------------------------------------------------------------------- + + diff --git a/testautomation/dbaccess/optional/includes/ctrl_Grid.inc b/testautomation/dbaccess/optional/includes/ctrl_Grid.inc new file mode 100644 index 000000000000..4b41014a2257 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/ctrl_Grid.inc @@ -0,0 +1,521 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Grid Control Test +'* +'\*********************************************************************** +sub ctrl_Grid + + printlog "------------------- ctrl_Grid.inc ------------------------" + + call tCreateGridControlColumn + call tReplaceGridControlColumn + call tDeleteGridControlColumn + call tShowHideGridControlColumn + +end sub +'------------------------------------------------------------------------- +testcase tCreateGridControlColumn + + dim i as integer + + '/// open new document + printlog "open new document and tear off form function toolbar" + call hNewDocument + sleep(1) + + call hToolbarSelect("MoreControls",true) + + '/// insert a grid control + printlog "insert a grid control" + Kontext "MoreControls" + Grid.Click + sleep(4) + call hDrawingWithSelection ( 40, 20, 60, 40 ) + sleep(2) + '/// cancel the autopilot if exist + printlog "cancel the autopilot if exist" + Kontext "AutopilotTableElement" + if AutopilotTableElement.Exists(3) then AutopilotTableElement.Cancel + sleep(1) + + Kontext "DocumentWriter" + '/// select the gridcontrol and press return to get into the edit mode + printlog "select the gridcontrol and change in edit mode" + DocumentWriter.TypeKeys "<RETURN>" , true + sleep(1) + '/// press SHIFT F10 to open the context menu and insert a text controls + printlog "press SHIFT F10 to open the context menu and insert 3 controls" + for i = 1 to 3 + DocumentWriter.Typekeys "<SHIFT F10>" , true + myMenuSelectNr(1) + myMenuSelectNr(i) + sleep(1) + next i + sleep(1) + '/// save and close the document + printlog "save and close the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_GridControl_create.odt")) + hCloseDocument + sleep(1) + '/// load the document + printlog "load the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_GridControl_create.odt")) + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + SwitchControlDesignMode.Click + sleep(4) + + '/// check if the control are still there + printlog "check if the control are still there" + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" , true + sleep(1) + DocumentWriter.TypeKeys "<RETURN>" , true + sleep(1) + DocumentWriter.Typekeys "<MOD1 SHIFT SPACE>" , true + sleep(1) + DocumentWriter.Typekeys "<SHIFT F10>" , true + 'open the propety broser + myMenuSelectNr(5) + sleep(1) + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl + + if getControlType <> "text box" then + warnlog "column controls is wrong" + endif + ' close property browser + Kontext "TabGeneralControl" + TabGeneralControl.TypeKeys "<Escape>" + sleep(1) + + call hCloseDocument + +endcase +'------------------------------------------------------------------------- +testcase tDeleteGridControlColumn + + dim i as integer + + '/// open new document + printlog "open new document and tear off form function toolbar" + call hNewDocument + sleep(1) + + call hToolbarSelect("MoreControls",true) + + '/// insert a grid control + printlog "insert a grid control" + Kontext "MoreControls" + Grid.Click + sleep(4) + call hDrawingWithSelection ( 40, 20, 60, 40 ) + sleep(2) + '/// cancel the autopilot if exist + printlog "cancel the autopilot if exist" + Kontext "AutopilotTableElement" + if AutopilotTableElement.Exists(3) then AutopilotTableElement.Cancel + sleep(1) + + Kontext "DocumentWriter" + '/// select the gridcontrol and press return to get into the edit mode + printlog "select the gridcontrol and change in edit mode" + DocumentWriter.TypeKeys "<RETURN>" , true + sleep(1) + '/// press SHIFT F10 to open the context menu and insert a text controls + printlog "press SHIFT F10 to open the context menu and insert 3 controls" + for i = 1 to 3 + DocumentWriter.Typekeys "<SHIFT F10>" , true + myMenuSelectNr(1) + myMenuSelectNr(i) + sleep(1) + next i + sleep(1) + + '/// delete inserted columns + printlog "delete inserted columns" + DocumentWriter.Typekeys "<MOD1 SHIFT SPACE>" , true + sleep(1) + DocumentWriter.Typekeys "<RIGHT>" , true + sleep(1) + DocumentWriter.Typekeys "<SHIFT F10>" , true + myMenuSelectNr(3) + sleep(1) + DocumentWriter.Typekeys "<LEFT>" , true + sleep(1) + DocumentWriter.Typekeys "<MOD1 SHIFT SPACE>" , true + sleep(1) + DocumentWriter.Typekeys "<SHIFT F10>" , true + myMenuSelectNr(3) + sleep(1) + DocumentWriter.Typekeys "<LEFT>" , true + sleep(1) + DocumentWriter.Typekeys "<MOD1 SHIFT SPACE>" , true + sleep(1) + DocumentWriter.Typekeys "<SHIFT F10>" , true + myMenuSelectNr(3) + sleep(1) + '/// check deletion + printlog "check deletion" + DocumentWriter.Typekeys "<LEFT>" , true + sleep(1) + DocumentWriter.Typekeys "<MOD1 SHIFT SPACE>" , true + sleep(1) + DocumentWriter.Typekeys "<SHIFT F10>" , true + if hMenuItemGetCount <> 1 then 'context of a column has more than one item + warnlog "Deleting column went wrong" + else + printlog "deleting column successfull" + endif + sleep(1) + call hMenuClose() + '/// save and close the document + printlog "save and close the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_GridControl_delete.odt")) + hCloseDocument + sleep(1) + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_GridControl_delete.odt")) + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + SwitchControlDesignMode.Click + sleep(4) + + '/// check deletion after save-&reloading + printlog "check deletion after save-&reloading" + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" , true + sleep(1) + DocumentWriter.TypeKeys "<RETURN>" , true + sleep(1) + DocumentWriter.Typekeys "<MOD1 SHIFT SPACE>" , true + sleep(1) + DocumentWriter.Typekeys "<SHIFT F10>" , true + sleep(1) + if hMenuItemGetCount <> 1 then 'context of a column has more than one item + warnlog "Deleting column after save-&reloading went wrong" + else + printlog "deleting column after save-&reloading successfull" + endif + sleep(1) + 'close the open context menu + MenuSelect(0) + call hCloseDocument() + +endcase +'------------------------------------------------------------------------- +testcase tReplaceGridControlColumn + + '/// open new document + printlog "open new document and tear off form function toolbar" + call hNewDocument + sleep(1) + 'prepare document + + call hToolbarSelect("MoreControls",true) + + Kontext "MoreControls" + Grid.Click + sleep(4) + '/// insert a grid control + printlog "insert a grid control" + printlog "insert a grid control" + call hDrawingWithSelection ( 40, 20, 60, 40 ) + sleep(2) + '/// cancel the autopilot if exist + printlog "cancel the autopilot if exist" + printlog "cancel the autopilot if exist" + Kontext "AutopilotTableElement" + if AutopilotTableElement.Exists(3) then AutopilotTableElement.Cancel + sleep(1) + '/// - check replacing columns from context - + printlog "- check replacing columns from context -" + printlog "" + printlog "- check replacing columns from context -" + + '/// press SHIFT F10 to open the context menu and insert a text controls + printlog "press SHIFT F10 to open the context menu and insert a text controls" + Kontext "DocumentWriter" + DocumentWriter.Typekeys "<RETURN>" , true + sleep(1) + DocumentWriter.Typekeys "<SHIFT F10>" , true + myMenuSelectNr(1) + myMenuSelectNr(1) + + + '/// replace the text control with a list box controls + printlog "replace the text control with a list box controls" + Kontext "DocumentWriter" + + DocumentWriter.Typekeys "<MOD1 SHIFT SPACE>" , true + sleep(1) + DocumentWriter.Typekeys "<SHIFT F10>" , true + myMenuSelectNr(2) + myMenuSelectNr(3) + sleep(1) + + '/// check if the control was replaced + printlog "check if the control was replaced" + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<RETURN>" , true + sleep(1) + DocumentWriter.Typekeys "<MOD1 SHIFT SPACE>" , true + sleep(1) + DocumentWriter.Typekeys "<SHIFT F10>" , true + 'open the propety broser + myMenuSelectNr(4) + sleep(1) + if getControlType <> "list box" then + warnlog "Replacing column controls went wrong" + endif + ' close the property browser + Kontext "TabGeneralControl" + TabGeneralControl.TypeKeys "<Escape>" + sleep(1) + + '/// save and close the document + printlog "save and close the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_GridControl_replacing.odt")) + hCloseDocument + sleep(1) + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_GridControl_replacing.odt")) + sleep(1) + 'prepare document + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + SwitchControlDesignMode.Click + sleep(4) + '/// check replacing after save-&reloading + printlog "check replacing after save-&reloading" + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" , true + sleep(1) + DocumentWriter.TypeKeys "<RETURN>" , true + sleep(1) + DocumentWriter.Typekeys "<MOD1 SHIFT SPACE>" , true + sleep(1) + DocumentWriter.Typekeys "<SHIFT F10>" , true + ' open property browser + myMenuSelectNr(4) + if getControlType <> "list box" then + warnlog "Replacing column controls not present after reload" + endif + ' close property browser + Kontext "TabGeneralControl" + TabGeneralControl.TypeKeys "<Escape>" + sleep(1) + call hCloseDocument + +endcase +'------------------------------------------------------------------------- +testcase tShowHideGridControlColumn + + dim i as integer + + '/// open new document + printlog "open new document" + call hNewDocument + sleep(1) + + call hToolbarSelect("MoreControls",true) + + Kontext "MoreControls" + Grid.Click + sleep(4) + + '/// insert a grid control + printlog "insert a grid control" + call hDrawingWithSelection ( 40, 20, 60, 40 ) + sleep(2) + + '/// cancel the autopilot if exist + printlog "cancel the autopilot if exist" + Kontext "AutopilotTableElement" + if AutopilotTableElement.Exists(3) then AutopilotTableElement.Cancel + sleep(1) + + '/// select the gridcontrol and press return to get into the edit mode + printlog "select the gridcontrol and change in edit mode" + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<RETURN>" , true + sleep(1) + + '/// press SHIFT F10 to open the context menu and insert controls + printlog "press SHIFT F10 to open the context menu and insert controls" + for i = 1 to 3 + DocumentWriter.Typekeys "<SHIFT F10>" , true + myMenuSelectNr(1) + myMenuSelectNr(i) + sleep(1) + next i + sleep(1) + '/// hide the first column + printlog "hide the first column" + Kontext "DocumentWriter" + sleep(1) + DocumentWriter.TypeKeys "<RETURN>" , true + sleep(1) + DocumentWriter.Typekeys "<MOD1 SHIFT SPACE>" , true + sleep(1) + DocumentWriter.Typekeys "<SHIFT F10>" , true + myMenuSelectNr(4) + sleep(1) + DocumentWriter.TypeKeys "<RETURN>" , true + sleep(1) + DocumentWriter.Typekeys "<MOD1 SHIFT SPACE>" , true + sleep(1) + + '/// check hiding column + printlog "check hiding column" + DocumentWriter.TypeKeys "<RETURN>" , true + sleep(1) + DocumentWriter.Typekeys "<SHIFT F10>" , true + if hMenuItemGetCount <> 6 then 'context of a column after hiding has 6 items (normal 5) + warnlog "Hiding column went wrong" + else + printlog "hiding column successfull" + endif + call hMenuClose() + '/// save and close the document + printlog "save and close the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_GridControl_hide_show.odt")) + hCloseDocument + sleep(1) + + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_GridControl_hide_show.odt")) + sleep(1) + + '/// check hiding column after saving and reloading + printlog "check hiding column after saving and reloadin" + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + SwitchControlDesignMode.Click + sleep(4) + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" , true + sleep(1) + DocumentWriter.TypeKeys "<RETURN>" , true + sleep(1) + DocumentWriter.Typekeys "<MOD1 SHIFT SPACE>" , true + sleep(1) + DocumentWriter.Typekeys "<SHIFT F10>" , true + if hMenuItemGetCount <> 6 then 'context of a column after hiding has 6 items (normal 5) + warnlog "Hiding column after saving and reloading went wrong" + else + printlog "hiding column after saving and reloading successfull" + endif + + '/// show column after saving and reloading + printlog "show column after saving and reloading" + myMenuSelectNr(5) + myMenuSelectNr(3) + sleep(1) + DocumentWriter.Typekeys "<SHIFT F10>" , true + if hMenuItemGetCount <> 5 then 'context of a column normal has 5 items (before show column 6) + warnlog "Show column after saving and reloading went wrong" + else + printlog "show column after saving and reloading successfull" + endif + sleep(1) + 'close the open context menu + MenuSelect(0) + call hCloseDocument + +endcase +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +function getControlType + 'control property browser must be open + 'check what properties are present and so find out what control type + dim sControlString as string + Kontext "TabGeneralControl" + if TabGeneralControl.exists(3) then + TabGeneralControl.TypeKeys "<TAB>" , true ' this tab is importent, I don't not why but it is. + if DefaultState.exists then + sControlString = "check box" + elseif LineCount.exists then + if MaxTextLen.exists then + sControlString = "combo box" + else + sControlString = "list box" + endif + elseif EditMask.exists then + sControlString = "pattern field" + elseif FormatKey.exists then + sControlString = "formatted field" + elseif CurrencySymbol.exists then + sControlString = "currency field" + elseif TimeMin.exists then + sControlString = "time field" + elseif DateMin.exists then + sControlString = "date field" + elseif StrictFormat.exists then + sControlString = "numeric field" + elseif MaxTextLen.exists then + if EditMask.exists then + sControlString = "pattern field" + else + sControlString = "text box" + endif + else + sControlString = "unkown" + endif + else + warnlog "TabGeneralControl not there." + endif + sleep(1) + getControlType = sControlString +end function +'------------------------------------------------------------------------- +sub myMenuSelectNr ( EintragsNr as Integer ) as String + Dim nID as Integer + Sleep 1 + nID = MenuGetItemID ( EintragsNr ) + sleep(1) + MenuSelect ( nID ) + sleep(1) +end sub diff --git a/testautomation/dbaccess/optional/includes/ctrl_PropertyBrowser.inc b/testautomation/dbaccess/optional/includes/ctrl_PropertyBrowser.inc new file mode 100644 index 000000000000..f51b14ea191b --- /dev/null +++ b/testautomation/dbaccess/optional/includes/ctrl_PropertyBrowser.inc @@ -0,0 +1,510 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Property Browser +'* +'\*********************************************************************** + +sub ctrl_PropertyBrowser + + call tPushButton + call tTextBox + call tListBox + call tComboBox + call tImageButton + call tImageControl + call tForms + +end sub +'-------------------------------------------------------------------------------------- +testcase tPushButton + + call sCloseAllToolbars + + '/// Open a new document + printlog "Open a new document" + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + PushButton.Click + sleep(1) + '/// insert a Push Button + printlog "insert a Push Button" + call hDrawingWithSelection ( 50, 20, 60, 30 ) + sleep(2) + Kontext "FormControls" + ControlProperties.Click + sleep(2) + '/// change Buttontype to URL + printlog "change Buttontype to URL" + Kontext "TabGeneralControl" + fsetControlProperty("PushButton","ButtonType", "4") + '/// check if the URLField property is enabled + printlog "check if the URLField property is enabled" + if NOT URL.isEnabled then + warnlog "The URL fields doesn't gets enabled" + end if + '/// add url to URLField + printlog "add url to URLField" + fsetControlProperty("PushButton","URL", "http://www.sun.com") + Kontext "TabGeneralControl" + TabGeneralControl.typekeys("<RETURN>",true) + '/// check if the Frame property is enabled + printlog "check if the Frame property is enabled" + if NOT Frame.isEnabled then + warnlog "The Frame fields doesn't gets enabled" + end if + sleep(1) + '/// add graphicfile to URLField + printlog "add graphicfile to URLField" + fsetControlProperty("PushButton","Graphics", gOfficePath + ConvertPath("share/gallery/bullets/blkpearl.gif")) + '/// check if the GraphicsAlignment property is enabled + printlog "check if the GraphicsAlignment property is enabled" + if NOT GraphicsAlignment.isEnabled then + warnlog "The GraphicsAlignment doesn't gets enabled" + end if + '/// close the controlproperty browser + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.close + sleep(1) + hCloseDocument + +endcase +'-------------------------------------------------------------------------------------- +testcase tTextBox + + call sCloseAllToolbars + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + Edit.Click + sleep(1) + '/// insert a text box + printlog "insert a text box" + call hDrawingWithSelection ( 50, 20, 60, 30 + sleep(2) + Kontext "FormControls" + ControlProperties.Click + sleep(2) + '/// change the propety multiline to yes + printlog "change the propety multiline to yes" + fsetControlProperty("TextBox","TextType","2") + '/// check if the scrollbars property is enabled + printlog "check if the scrollbars property is enabled" + if NOT Scrollbars.isEnabled then + warnlog "The scrollbars doesn't gets enabled" + end if + '/// check if the password char is enabled + printlog "check if the password char is enabled" + if Password.isEnabled then + warnlog "The pasword is enabled ( issue 29477 ) " + end if + + '/// change the propety multiline to no + printlog "change the propety multiline to no" + fsetControlProperty("TextBox","TextType","1") + '/// check if the scrollbars property is disabled + printlog "check if the scrollbars property is disabled" + if Scrollbars.isEnabled then + warnlog "The scrollbars is enabled" + end if + '/// check if the password char is disabled + printlog "check if the password char is disabled" + if NOT Password.isEnabled then + warnlog "The pasword doesn't gets enabled" + end if + '/// close the controlproperty browser + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.close + '/// close the document + printlog "close the document" + sleep(1) + hCloseDocument + +endcase +'-------------------------------------------------------------------------------------- +testcase tListBox + + call sCloseAllToolbars + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + ListBox.Click + sleep(1) + UseWizards.Click + sleep(1) + '/// insert a list box + printlog "insert a list box" + call hDrawingWithSelection ( 50, 20, 60, 30 + sleep(2) + Kontext "FormControls" + ControlProperties.Click + sleep(2) + '/// change the property DropDown to yes + printlog "change the propety multiline to yes" + fsetControlProperty("ListBox","DropDown","2") + '/// check if the scrollbars property is enabled + printlog "check if the LineCount property is enabled" + if NOT LineCount.isEnabled then + warnlog "The LineCount doesn't gets enabled" + end if + + + '/// change the propety multiline to no + printlog "change the propety multiline to no" + fsetControlProperty("ListBox","DropDown","1") + '/// check if the scrollbars property is disabled + printlog "check if the LineCount property is disabled" + if LineCount.isEnabled then + warnlog "The LineCount is enabled" + end if + + Kontext "FormControls" + UseWizards.Click + '/// close the controlproperty browser + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.close + '/// close the document + printlog "close the document" + sleep(1) + hCloseDocument + +endcase +'-------------------------------------------------------------------------------------- +testcase tComboBox + + call sCloseAllToolbars + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + ComboBox.Click + sleep(1) + UseWizards.Click + sleep(1) + '/// insert a list box + printlog "insert a list box" + call hDrawingWithSelection ( 50, 20, 60, 30 + sleep(2) + Kontext "FormControls" + ControlProperties.Click + sleep(2) + '/// change the property DropDown to yes + printlog "change the propety multiline to yes" + fsetControlProperty("ComboBox","DropDown","2") + '/// check if the scrollbars property is enabled + printlog "check if the LineCount property is enabled" + if NOT LineCount.isEnabled then + warnlog "The LineCount doesn't gets enabled" + end if + + + '/// change the propety multiline to no + printlog "change the propety multiline to no" + fsetControlProperty("ComboBox","DropDown","1") + '/// check if the scrollbars property is disabled + printlog "check if the LineCount property is disabled" + if LineCount.isEnabled then + warnlog "The LineCount is enabled" + end if + + Kontext "FormControls" + UseWizards.Click + '/// close the controlproperty browser + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.close + '/// close the document + printlog "close the document" + sleep(1) + hCloseDocument + +endcase +'-------------------------------------------------------------------------------------- +testcase tImageButton + + call sCloseAllToolbars + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + call hToolbarSelect("MoreControls",true) + + Kontext "MoreControls" + Imagebutton.Click + sleep(1) + '/// insert an image control + printlog "insert an image control" + call hDrawingWithSelection ( 50, 20, 60, 30 + sleep(2) + call hToolbarSelect("FormControls",true) + Kontext "FormControls" + ControlProperties.Click + sleep(2) + '/// change the property ButtonType to URL + fsetControlProperty("ImagesButton","ButtonType", "4") + '/// check if the URL property is enabled + if NOT URL.isEnabled then + warnlog "The URL fields doesn't gets enabled" + end if + '/// add url to URLField + printlog "add url to URLField" + 'ISSUE: see i29478 + 'fsetControlProperty("ImagesButton","URL", "www.sun.com") + fsetControlProperty("ImagesButton","URL", "http://www.sun.com") + Kontext "TabGeneralControl" + TabGeneralControl.typekeys("<RETURN>",true) + '/// check if the Frame property is enabled + printlog "check if the Frame property is enabled" + if NOT Frame.isEnabled then + warnlog "The Frame fields doesn't gets enabled" + end if + sleep(1) + '/// add graphicfile to GraphicField + fsetControlProperty("ImagesButton","Graphics", gOfficePath + ConvertPath("share/gallery/bullets/blkpearl.gif")) + '/// check if the GraphicsAlignment property is enabled + printlog "check if the Scale property is enabled" + if NOT Scale.isEnabled then + warnlog "The Scale doesn't gets enabled" + end if + '/// close the controlproperty browser + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.close + sleep(1) + hCloseDocument + +endcase +'-------------------------------------------------------------------------------------- +testcase tImageControl + + call sCloseAllToolbars + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + call hToolbarSelect("MoreControls",true) + Kontext "MoreControls" + ImageControl.Click + + sleep(1) + '/// insert an image control + printlog "insert an image control" + call hDrawingWithSelection ( 50, 20, 60, 30 + sleep(2) + call hToolbarSelect("FormControls",true) + Kontext "FormControls" + ControlProperties.Click + sleep(2) + '/// add graphicfile to GraphicField + printlog "add graphicfile to GraphicField" + fsetControlProperty("ImagesButton","Graphics", gOfficePath + ConvertPath("share/gallery/bullets/blkpearl.gif")) + '/// check if the Scale property is enabled + printlog "check if the Scale property is enabled" + if NOT Scale.isEnabled then + warnlog "The Scale doesn't gets enabled" + end if + '/// close the controlproperty browser + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.close + sleep(1) + hCloseDocument + +endcase +'-------------------------------------------------------------------------------------- +testcase tForms + + call sCloseAllToolbars + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + PushButton.Click + sleep(1) + '/// insert a Push Button + printlog "insert a Push Button" + call hDrawingWithSelection ( 50, 20, 60, 30 + sleep(2) + Kontext "FormControls" + FormProperties.Click + sleep(2) + + Kontext "FormPropertiesDialog" + FormPropertiesTabControl.setPage TabGeneralForm + + Kontext "TabGeneralForm" + '/// set encoding to Multipart + printlog "set encoding to Multipart" + Encoding.select 2 + sleep(1) + '/// check if the SubmitMethod get enabled + printlog "check if the SubmitMethod get enabled" + if SubmitMethod.isEnabled then + warnlog "The SubmitMethod fields doesn't gets enabled" + end if + '/// set encoding to URL + printlog "set encoding to URL" + Encoding.select 1 + sleep(1) + '/// check if the SubmitMethod get disabled + printlog "check if the SubmitMethod get disabled" + if NOT SubmitMethod.isEnabled then + warnlog "The SubmitMethod fields doesn't gets disabled" + end if + '/// set URL + printlog "set URL" + 'ISSUE: see i29478 + 'URL.setText("www.sun.com") + URL.setText("http://www.sun.com") + TabGeneralForm.TypeKeys("<RETURN>") + '/// check if the frame property gets enabled + printlog "check if the frame property gets enabled" + if NOT Frame.isEnabled then + warnlog "The frame fields doesn't gets enabled" + end if + + Kontext "FormPropertiesDialog" + FormPropertiesTabControl.setPage TabDataForm + + Kontext "TabDataForm" + '/// select first datasource + printlog "select first datasource" + DataSource.select 1 + sleep(2) + '/// select SQL Command as Type + printlog "select SQL Command as Type" + ContentType.select 3 + sleep(2) + '/// check if the SQL Design button gets enabled + printlog "check if the SQL Design button gets enabled" + if OpenQueryDesign.isenabled then + '/// open the query design with the button + printlog "open the query design with the button" + OpenQueryDesign.click + sleep(5) + '/// check if the querydesign open + printlog "check if the querydesign open" + Kontext "QueryDesignTable" + if NOT QueryDesignTable.exists(3) then + warnlog "The Query Design doesn't open." + end if + Kontext "AddTables" + AddTables.Close + Kontext "QueryDesignTable" + QueryDesignTable.UseMenu + hMenuSelectNr(1) + hMenuSelectNr(4) + + else + warnlog "the openQueryDesign button is not enabled" + end if + Kontext "TabDataForm" + printlog "select table as Type" + ContentType.select 1 + sleep(1) + Content.setText("biblio") + sleep(1) + TabDataForm.TypeKeys "<RETURN>" , true + + '/// close the FormProperty Browser + printlog "close the FormProperty Browser" + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.close + + '/// open the form property browser + printlog "open the form property browser" + Kontext "FormControls" + FormProperties.Click + sleep(2) + + Kontext "FormPropertiesDialog" + FormPropertiesTabControl.setPage TabDataForm + + '/// click on the filter button + Kontext "TabDataForm" + FilterDLGButton.Click + '/// check if the filter dialog appear + Kontext "FilterDialog" + FilterDialog.OK + + '/// click on the sort button + Kontext "TabDataForm" + SortDLGButton.click + '/// check if the sort dialog appear + Kontext "SortOrder" + SortOrder.OK + + '/// close the controlproperty browser + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.close + sleep(1) + hCloseDocument + +endcase diff --git a/testautomation/dbaccess/optional/includes/ctrl_Several1.inc b/testautomation/dbaccess/optional/includes/ctrl_Several1.inc new file mode 100644 index 000000000000..4e0cd9334800 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/ctrl_Several1.inc @@ -0,0 +1,648 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Control Serveral Part 1 - check each control and each property +'* +'\*********************************************************************** + +sub ctrl_Several1 + + call fSwitchAutopilotOff(true) ' has to run first to switch off the autopilot + + call tCheckBox ' tested properties: Tristate, Enabled, Label field + call tTextBox ' tested properties: Background color, Additional Info, Scrollbars, Password + call tFormattedField ' tested properties: Value max, Value min, Formatting + call tPushButton ' tested properties: Graphic, Alignment, Default button, Toggle, Take Focus + call tOptionButton ' tested properties: Print, Reference value, Default status + call tListBox ' tested properties: Line count, Multiselection, List Entries, Default selection + call tComboBox ' tested properties: Auto fill, Max text length, Hide selection, Border color + call tLabelField ' tested properties: Alignment, Help text + + call fSwitchAutopilotOff(false) + +end sub + +'-------------------------------------------------------------------------------------- +' todo: testcase: tTextBox and tLabelFild contain 'multiline' settings, but HelpID disappeared - has to be reworked +'-------------------------------------------------------------------------------------- + +testcase tCheckBox + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + Kontext "FormControls" + addControl("Label", 40, 30, 50, 40) + addControl("CheckBox", 55, 30, 65, 40 ) + + call fOpenControlPropertyBrowser + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set properties: Label - therefore needed: a present label field + printlog "set properties: Label - therefore needed: a present label field" + Kontext "TabGeneralControl" + LabelFieldButton.Click + sleep(1) + Kontext "LabelFieldSelection" + LabelFieldSelection.TypeKeys "<DOWN>",TRUE + LabelFieldSelection.TypeKeys "<DOWN>",TRUE + sleep(1) + LabelFieldSelection.OK + sleep(1) + '/// set properties: Tristate, Enabled + call fSetControlProperty("CheckBox","TriState","2") + sleep(1) + call fSetControlProperty("CheckBox","Enabled","1") 'listbox property: no + sleep(1) + '/// close control property browser + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.close + sleep(1) + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_CheckBox.odt")) + hCloseDocument + sleep(1) + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_CheckBox.odt")) + + call fSwitchControlDesignMode() + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + DocumentWriter.TypeKeys "<TAB>" ' select the second control + sleep(1) + + call fOpenControlPropertyBrowser + + '/// check if the values are saved + printlog "check if the values are saved" + sleep(2) + Kontext "TabGeneralControl" + TabGeneralControl.TypeKeys "<TAB>" , true ' this tab is importent, I don't not why but it is. + sleep(1) + + if fGetControlProperty("CheckBox","TriState") <> "2" then + warnlog "the value 'tristate' is not saved correctly" + endif + + if fGetControlProperty("CheckBox","Enabled") <> "1" then + warnlog "the value 'enabled' is not saved correctly" + endif + + printlog "property character set text: " & LabelField.getText + if LabelField.getText = "" then + warnlog "the value 'label' is not saved correctly" + endif + + call closePropertyBrowserAndDocument() + +endcase +'-------------------------------------------------------------------------------------- + +testcase tTextBox + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + Kontext "FormControls" + addControl("Edit", 40, 40, 30, 30) + + call fOpenControlPropertyBrowser + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set properties: Background color, Additional Info, Scrollbars, Password + printlog "set properties" + call fSetControlProperty("TextBox","Background","92") + call fSetControlProperty("TextBox","AdditionalInfo","my only friend the end.") + call fSetControlProperty("TextBox","TextType","2") 'needed for activate scrollbar + call fSetControlProperty("TextBox","Scrollbars","4") + call fSetControlProperty("TextBox","TextType","1") 'needed for activate password + call fSetControlProperty("TextBox","Password","p") + '/// close control property browser + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.close + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_TextBox.odt")) + hCloseDocument + sleep(1) + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_TextBox.odt")) + + call fSwitchControlDesignMode() + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + + call fOpenControlPropertyBrowser + + '/// check if the values are saved + printlog "check if the values are saved" + sleep(2) + Kontext "TabGeneralControl" + TabGeneralControl.TypeKeys "<TAB>" , true ' this tab is importent, I don't not why but it is. + + if fGetControlProperty("TextBox","Background") <> "92" then + warnlog "the value: background is not saved" + endif + + if fGetControlProperty("TextBox","AdditionalInfo") <> "my only friend the end." then + warnlog "the AdditionalInfo value is not saved" + endif + call fSetControlProperty("TextBox","TextType","2") 'needed for activate scrollbar + sleep(1) + if fGetControlProperty("TextBox","Scrollbars") <> "4" then + warnlog "the value: Scrollbars are not saved" + endif + call fSetControlProperty("TextBox","TextType","1") 'needed for activate password + sleep(1) + if fGetControlProperty("TextBox","Password") <> "p" then + warnlog "the value: Password is not saved" + endif + + call closePropertyBrowserAndDocument() + +endcase +'-------------------------------------------------------------------------------------- + +testcase tFormattedField + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + Kontext "FormControls" + addControl("FormattedField", 50, 20, 60, 30) + + call fOpenControlPropertyBrowser + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set ValueMin to 2 and ValueMax to 9 and any Formatting + printlog "set ValueMin to 2 and ValueMax to 9 and any Formatting" + Kontext "TabGeneralControl" 'set any formatting + FormatkeyButton.Click + Kontext "TabZahlen" + TabZahlen.TypeKeys "<DOWN>", true + TabZahlen.TypeKeys "<RETURN>", true + sleep(1) + fsetControlProperty("FormattedField","ValueMax","9") + sleep(1) + fsetControlProperty("FormattedField","ValueMin","2") + '/// close control property browser + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.close + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_FormattedField.odt")) + hCloseDocument + sleep(1) + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_FormattedField.odt")) + + call fSwitchControlDesignMode() + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + + call fOpenControlPropertyBrowser + + '/// check if the values are saved + printlog "check if the values are saved" + sleep(2) + Kontext "TabGeneralControl" + TabGeneralControl.TypeKeys "<TAB>" , true ' this tab is importent, I don't not why but it is. + if fgetControlProperty("FormattedField","ValueMax") = "" then + warnlog "the value ValueMax is not saved" + endif + if fgetControlProperty("FormattedField","ValueMin") = "" then + warnlog "the value ValueMin is not saved" + endif + if fgetControlProperty("FormattedField","Formatkey") = "" then + warnlog "the value ValueMin is not saved" + endif + + call closePropertyBrowserAndDocument() + +endcase +'-------------------------------------------------------------------------------------- + +testcase tPushButton + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + Kontext "FormControls" + addControl("PushButton", 50, 20, 60, 30) + + call fOpenControlPropertyBrowser + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set a graphic for this button + printlog "set a graphic for this button" + Kontext "TabGeneralControl" + call fSetControlProperty("PushButton","Graphics", gOfficePath + ConvertPath("share/gallery/bullets/blkpearl.gif")) + '/// set further properties: default button, toggle, graphics alignment + printlog "set further properties" + call fSetControlProperty("PushButton","DefaultButton","2") 'listbox property: yes + call fSetControlProperty("PushButton","ToggleProp","2") 'listbox property: yes + call fSetControlProperty("PushButton","GraphicsAlignment","5") + call fSetControlProperty("PushButton","TakeFocus","1") + '/// close control property browser + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.close + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_PushButton.odt")) + hCloseDocument + sleep(1) + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_PushButton.odt")) + '/// check if the graphic still displayed + printlog "check if the graphic still displayed" + call fSwitchControlDesignMode() + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + + call fOpenControlPropertyBrowser + + '/// check if everything is saved right + printlog "check if everything is saved right" + dim bScrOK as boolean 'control variable if all properties are correct + bScrOK = true + dim sGraphics as String 'variable for graphics path + 'check if the graphic is saved + sGraphics = fGetControlProperty("PushButton","Graphics") + if Right(sGraphics,12) <> "blkpearl.gif" then + warnlog "The graphics file name is not saved" + bScrOK = false + endif + if fGetControlProperty("PushButton","GraphicsAlignment") <> "5" then + warnlog "the pushbutton is not saved with property: Graphics Alignment" + bScrOK = false + endif + 'check if the default button is saved + if fGetControlProperty("PushButton","DefaultButton") <> "2" then + warnlog "the pushbutton is not saved with property: Default Button" + bScrOK = false + endif + if fGetControlProperty("PushButton","ToggleProp") <> "2" then + warnlog "the pushbutton is not saved with property: Toggle" + bScrOK = false + endif + if fGetControlProperty("PushButton","TakeFocus") <> "1" then + warnlog "the pushbutton is not saved with property: Take Focus on click" + bScrOK = false + endif + sleep(1) + if bScrOK = true then printlog "Pushbutton was saved correctly" + + call closePropertyBrowserAndDocument() + +endcase +'-------------------------------------------------------------------------------------- + +testcase tOptionButton + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + Kontext "FormControls" + addControl("RadioButton", 50, 20, 60, 30) + + call fOpenControlPropertyBrowser + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set properties: Print, Reference value, Default status + printlog "set properties" + call fSetControlProperty("Radiobutton","Printable","1") 'listbox property: no + call fSetControlProperty("Radiobutton","ReferenceValue","777") + call fSetControlProperty("Radiobutton","DefaultState","2") 'listbox property: selected + '/// close control property browser + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.close + + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_Optionbutton.odt")) + hCloseDocument + sleep(1) + + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_Optionbutton.odt")) + + call fSwitchControlDesignMode() + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + call fOpenControlPropertyBrowser + + '/// check if property values are inserted + printlog "check if property values are inserted" + Kontext "TabGeneralControl" + dim bScrOK as boolean 'control variable if all properties are correct + bScrOK = true + if fGetControlProperty("Radiobutton","Printable") <> "1" then + warnlog "the Optionbutton is not saved with property: Print" + bScrOK = false + endif + if fGetControlProperty("Radiobutton","ReferenceValue") <> "777" then + warnlog "the Optionbutton is not saved with property: ReferenceValue" + bScrOK = false + endif + if fGetControlProperty("Radiobutton","DefaultState") <> "2" then + warnlog "the Optionbutton is not saved with property: ReferenceValue" + bScrOK = false + endif + if bScrOK = true then printlog "Optionbutton was saved correctly" + + call closePropertyBrowserAndDocument() + +endcase +'-------------------------------------------------------------------------------------- + +testcase tListBox + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + Kontext "FormControls" + addControl("ListBox", 50, 20, 60, 30) + + call fOpenControlPropertyBrowser + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set properties: default selection, line count, list entries, multiselection + printlog "set properties" + Kontext "TabGeneralControl" + 'set property: list entries + call fSetControlProperty("ListBox","ListEntries","My only friend the end.") + 'set property: line count + call fSetControlProperty("ListBox","DropDown","2") 'needed for activate line count + sleep (1) + call fSetControlProperty("ListBox","LineCount","10") + sleep (1) + 'set property: multiselection + call fSetControlProperty("ListBox","Multiselection","2") 'yes + sleep (1) + 'set property: default selection + call fSetControlProperty("ListBox","DefaultSelection2","88") + '/// close control property browser + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.close + + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_ListBox.odt")) + hCloseDocument + sleep(1) + + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_ListBox.odt")) + + call fSwitchControlDesignMode() + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + + call fOpenControlPropertyBrowser + + '/// check if property values are inserted + printlog "check if property values are inserted" + Kontext "TabGeneralControl" + dim bScrOK as boolean 'control variable if all properties are correct + bScrOK = true + '(special field - cannot be read out) + 'if fGetControlProperty("ListBox","ListEntries") = "" then + 'warnlog "the listbox is not saved with property: ListEntries" + 'bScrOK = false + 'endif + '(special field - cannot be read out) + 'if fGetControlProperty("ListBox","DefaultSelection2") = "" then + 'warnlog "the listbox is not saved with property: DefaultSelection2" + 'bScrOK = false + 'endif + if fGetControlProperty("ListBox","LineCount") <> "10" then + warnlog "the listbox is not saved with property: LineCount" + bScrOK = false + endif + if fGetControlProperty("ListBox","Multiselection") <> "2" then + warnlog "the listbox is not saved with property: Multiselection" + bScrOK = false + endif + if bScrOK = true then printlog "listbox was saved correctly" + + call closePropertyBrowserAndDocument() + +endcase +'-------------------------------------------------------------------------------------- + +testcase tComboBox + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + Kontext "FormControls" + addControl("ComboBox", 50, 20, 60, 30) + + call fOpenControlPropertyBrowser + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set properties: Auto fill, Max text length, Hide Selection, Border color + printlog "set properties" + Kontext "TabGeneralControl" + call fSetControlProperty("ComboBox","MaxTextLen","6") + call fSetControlProperty("ComboBox","AutoComplete","1") 'no + call fSetControlProperty("ComboBox","HideSelection","1") 'no + call fSetControlProperty("ComboBox","Border","3") 'needed to activate Border Color + call fSetControlProperty("ComboBox","BorderColor","13") + '/// close control property browser + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.close + + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_ComboBox.odt")) + hCloseDocument + sleep(1) + + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_ComboBox.odt")) + + call fSwitchControlDesignMode() + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + + call fOpenControlPropertyBrowser + + '/// check if property values are inserted + printlog "check if property values are inserted" + Kontext "TabGeneralControl" + dim bScrOK as boolean 'control variable if all properties are correct + bScrOK = true + if fGetControlProperty("ComboBox","MaxTextLen") <> "6" then + warnlog "the combobox is not saved with property: MaxTextLen" + bScrOK = false + endif + if fGetControlProperty("ComboBox","AutoComplete") <> "1" then + warnlog "the combobox is not saved with property: AutoComplete" + bScrOK = false + endif + if fGetControlProperty("ComboBox","HideSelection") <> "1" then + warnlog "the combobox is not saved with property: Hide Selection" + bScrOK = false + endif + if fGetControlProperty("ComboBox","BorderColor") <> "13" then + warnlog "the combobox is not saved with property: Border Color" + bScrOK = false + endif + if bScrOK = true then printlog "Combobox was saved correctly" + + call closePropertyBrowserAndDocument() + +endcase +'-------------------------------------------------------------------------------------- + +testcase tLabelField + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + Kontext "FormControls" + addControl("Label", 50, 20, 60, 30) + + call fOpenControlPropertyBrowser + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set properties: alignment, multiline, help text + printlog "set properties" + call fSetControlProperty("LabelField","Align","4") 'set to right + call fSetControlProperty("LabelField","HelpText","Filled in Text") + '/// close control property browser + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.close + + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_LabelField.odt")) + hCloseDocument + sleep(1) + + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_LabelField.odt")) + + call fSwitchControlDesignMode() + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + + call fOpenControlPropertyBrowser + + '/// check if the values are saved + printlog "check if the values are saved" + sleep(2) + Kontext "TabGeneralControl" + TabGeneralControl.TypeKeys "<TAB>" , true ' this tab is importent, I don't not why but it is. + if fGetControlProperty("LabelField","Align") <> "4" then + warnlog "the value: align is not saved" + endif + if fGetControlProperty("LabelField","HelpText") <> "Filled in Text" then + warnlog "the value: HelpText is not saved" + endif + + call closePropertyBrowserAndDocument() + +endcase + + diff --git a/testautomation/dbaccess/optional/includes/ctrl_Several2.inc b/testautomation/dbaccess/optional/includes/ctrl_Several2.inc new file mode 100644 index 000000000000..717cf149b902 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/ctrl_Several2.inc @@ -0,0 +1,924 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Control Serveral Part 2 (more controls) - check each control and each property +'* +'\*********************************************************************** + +sub ctrl_Several2 + + call fSwitchAutopilotOff(true) ' has to run first to switch off the autopilot + + call tSpinButton ' tested properties: Repeat, Name, Symbol color (disabled bug:i39944), Background color + call tScrollBar ' tested properties: Scroll value min, Scroll value max, Default Scroll value, Orientation, Line increment (small change), Block increment (large change), Delay, Visible Size + call tImageButton ' tested properties: Scale, Frame (disabled bug:i39970) + call tImageControl ' tested properties: Help URL + call tFileControl ' tested properties: Border, Tabstop + call tDateField ' tested properties: Date max, Date min, Date format, Dropdown + call tTimeField ' tested properties: Time min, Time max, Time format + call tNumericField ' tested properties: Spin Button, Strict format, Thousands Seperator, Value step + call tCurrencyField ' tested properties: Inc/dec value, Prefix symbol, Currency symbol, Accuracy + call tPatternField ' tested properties: Read only, Edit mask, Literal mask, Order + call tGroupBox ' tested properties: Character set, Label + call tTableControl ' tested properties: Navigation bar, Record marker, Row high + call tNavigationBar ' tested properties: IconSize, Positioning, Navigation, RecordActions, FilteringSorting + + call fSwitchAutopilotOff(false) + +end sub + + +'-------------------------------------------------------------------------------------- + +testcase tSpinButton + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + call addControl ( "SpinButton", 50, 20, 60, 30 ) + sleep(2) + '/// open the control property browser + call fOpenControlPropertyBrowser + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set properties: Repeat, Name + printlog "set properties" + call fsetControlProperty("ScrollBar","Repeat","1") 'listbox property: no + call fsetControlProperty("ScrollBar","NameText","Changed") + call fsetControlProperty("ScrollBar","Background","55") + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_Spinbutton.odt")) + hCloseDocument + sleep(1) + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_Spinbutton.odt")) + Kontext "Toolbar" + call hToolbarSelect("MoreControls",true) + call hToolbarSelect("FormControls",true) + call fSwitchControlDesignMode + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + + call fOpenControlPropertyBrowser + + '/// check if inserted property values are saved right + printlog "check if property values are inserted" + Kontext "TabGeneralControl" + dim bScrOK as boolean 'control variable if all properties are correct + bScrOK = true + if fgetControlProperty("Spinbutton","Repeat") <> "1" then + warnlog "the spinbutton is not saved with property: Repeat" + bScrOK = false + endif + if fgetControlProperty("Spinbutton","NameText") <> "Changed" then + warnlog "the spinbutton is not saved with property: NameText" + bScrOK = false + endif + if fgetControlProperty("Spinbutton","Background") <> "55" then + warnlog "the spinbutton is not saved with property: Background" + bScrOK = false + endif + if bScrOK = true then printlog "Spinbutton was saved correctly" + sleep(1) + + call closePropertyBrowserAndDocument() + +endcase +'-------------------------------------------------------------------------------------- + +testcase tScrollBar + + dim sMem as string 'comparing variable + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + call addControl("ScrollBar", 50, 20, 60, 30 ) + + printlog "open the control property browser" + call fOpenControlPropertyBrowser + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set properties: Scroll value min, Scroll value max, Default Scroll value, Orientation, Line increment, Block increment, Delay, symbol color, Visible Size + printlog "set properties" + call fsetControlProperty("ScrollBar","ScrollValueMin","10") + call fsetControlProperty("ScrollBar","ScrollValueMax","90") + call fsetControlProperty("ScrollBar","ScrollValueDefault","5") + call fsetControlProperty("ScrollBar","Orientation","2") 'listbox property: vertical + call fsetControlProperty("ScrollBar","LineIncrement","10") + call fsetControlProperty("ScrollBar","BlockIncrement","25") + call fsetControlProperty("ScrollBar","Delay","100") + TabGeneralControl.TypeKeys "<RETURN>" , true 'an ms is added to 100 -> 100ms + sMem = fgetControlProperty("ScrollBar","Delay") + call fsetControlProperty("ScrollBar","VisibleSize","10") + + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_Scrollbar.odt")) + hCloseDocument + + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_Scrollbar.odt")) + + Kontext "Toolbar" + call hToolbarSelect("MoreControls",true) + call hToolbarSelect("FormControls",true) + call fSwitchControlDesignMode + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + + call fOpenControlPropertyBrowser + + '/// check if inserted property values are saved right + printlog "check if property values are inserted" + Kontext "TabGeneralControl" + dim bScrOK as boolean 'control variable if all properties are correct + bScrOK = true + if fgetControlProperty("ScrollBar","ScrollValueMin") <> "10" then + warnlog "the scrollbar is not saved with property: ScrollValueMin" + bScrOK = false + endif + if fgetControlProperty("ScrollBar","ScrollValueMax") <> "90" then + warnlog "the scrollbar is not saved with property: ScrollValueMax" + bScrOK = false + endif + if fgetControlProperty("ScrollBar","ScrollValueDefault") <> "5" then + warnlog "the scrollbar is not saved with property: ScrollValueDefault" + bScrOK = false + endif + if fgetControlProperty("ScrollBar","Orientation") <> "2" then + warnlog "the scrollbar is not saved with property: Orientation" + bScrOK = false + endif + if fgetControlProperty("ScrollBar","LineIncrement") <> "10" then + warnlog "the scrollbar is not saved with property: LineIncrement" + bScrOK = false + endif + if fgetControlProperty("ScrollBar","BlockIncrement") <> "25" then + warnlog "the scrollbar is not saved with property: BlockIncrement" + bScrOK = false + endif + if fgetControlProperty("ScrollBar","Delay") <> sMem then + warnlog "the scrollbar is not saved with property: Delay" + bScrOK = false + endif + if fgetControlProperty("ScrollBar","VisibleSize") <> "10" then + warnlog "the scrollbar is not saved with property: VisibleSize" + bScrOK = false + endif + if bScrOK = true then printlog "Scrollbar was saved correctly" + sleep(1) + + call closePropertyBrowserAndDocument() + +endcase +'-------------------------------------------------------------------------------------- + +testcase tImageButton + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + + call addControl("ImageButton", 50, 20, 60, 30 ) + + printlog "open the control property browser" + call fOpenControlPropertyBrowser + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set properties + printlog "set properties" + 'to activate property: scale, following properties must be active: Graphics (with choosen path) + Kontext "TabGeneralControl" + fsetControlProperty("ImageButton","Graphics", gOfficePath + ConvertPath("share/gallery/bullets/blkpearl.gif")) + + sleep(1) + TabGeneralControl.TypeKeys "<RETURN>" , true + fsetControlProperty("ImageControl","Scale","1") 'listbox content: no + 'fsetControlProperty("ImageControl","Frame","4") + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_ImageButton.odt")) + hCloseDocument + sleep(1) + '/// reload and prepare the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_ImageButton.odt")) + Kontext "Toolbar" + call hToolbarSelect("MoreControls",true) + call hToolbarSelect("FormControls",true) + call fSwitchControlDesignMode + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + call fOpenControlPropertyBrowser + '/// check if property values are inserted + printlog "check if property values are inserted" + Kontext "TabGeneralControl" + dim bScrOK as boolean 'control variable if all properties are correct + bScrOK = true + if fgetControlProperty("ImageButton","Scale") <> "1" then + warnlog "the imagebutton is not saved with property: Frame" + bScrOK = false + endif + 'if fgetControlProperty("ImageButton","Frame") <> "4" then + 'warnlog "the imagebutton is not saved with property: Frame" + 'bScrOK = false + 'endif + if bScrOK = true then printlog "Imagebutton was saved correctly" + + call closePropertyBrowserAndDocument() + +endcase +'-------------------------------------------------------------------------------------- +testcase tImageControl + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + + call addControl("ImageControl", 50, 20, 60, 30 ) + + printlog "open the control property browser" + call fOpenControlPropertyBrowser + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set HelpURL + printlog "set HelpURL" + fsetControlProperty("ImageControl","HelpURL","customcontrol2") + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_ImageControl.odt")) + hCloseDocument + sleep(1) + '/// reload and prepare the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_ImageControl.odt")) + Kontext "Toolbar" + call hToolbarSelect("MoreControls",true) + call hToolbarSelect("FormControls",true) + call fSwitchControlDesignMode + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + call fOpenControlPropertyBrowser + '/// check if property values are inserted + printlog "check if property values are inserted" + Kontext "TabGeneralControl" + dim bScrOK as boolean 'control variable if all properties are correct + bScrOK = true + if fgetControlProperty("ImageControl","HelpURL") <> "customcontrol2" then + warnlog "the imagecontrol is not saved with property: HelpURL" + bScrOK = false + endif + if bScrOK = true then printlog "Imagecontrol was saved correctly" + sleep(1) + + call closePropertyBrowserAndDocument() + +endcase +'-------------------------------------------------------------------------------------- + +testcase tFileControl + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + + call addControl("FileControl", 50, 20, 60, 30 ) + + printlog "open the control property browser" + call fOpenControlPropertyBrowser + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set properties: border to flat, tabstop to no + printlog "set border to flat" + fsetControlProperty("FileControl","Border","3") + fsetControlProperty("FileControl","TabStop","1") + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_FileControl.odt")) + hCloseDocument + sleep(1) + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_FileControl.odt")) + Kontext "Toolbar" + call hToolbarSelect("MoreControls",true) + call hToolbarSelect("FormControls",true) + call fSwitchControlDesignMode + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + call fOpenControlPropertyBrowser + '/// check if the values are saved + printlog "check if the values are saved" + sleep(2) + Kontext "TabGeneralControl" + TabGeneralControl.TypeKeys "<TAB>" , true ' this tab is importent, I don't know why but it is. + if fgetControlProperty("FileControl","Border") <> "3" then + warnlog "the value border is not saved" + endif + if fgetControlProperty("FileControl","TabStop") <> "1" then + warnlog "the value border is not saved" + endif + + call closePropertyBrowserAndDocument() + +endcase +'-------------------------------------------------------------------------------------- + +testcase tDateField + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + + call addControl("DateField", 50, 20, 60, 30 ) + + printlog "open the control property browser" + call fOpenControlPropertyBrowser + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set DateMin to 09/09/2009 and DateMax to 10/10/2010 + printlog "set DateMin to 09/09/2009 and DateMax to 10/10/2010" + if iSystemSprache = 01 then + fsetControlProperty("DateField","DateMin","09/09/2009") + fsetControlProperty("DateField","DateMax","10/10/2010") + elseif iSystemSprache = 49 then + fsetControlProperty("DateField","DateMin","09.09.2009") + fsetControlProperty("DateField","DateMax","10.10.2010") + endif + '/// set date format, dropdown + printlog "set date format, date format" + fsetControlProperty("DateField","DateFormat","7") 'YY/MM/DD + printlog "set date format, dropdown" + fsetControlProperty("DateField","DropDown","2") 'yes + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_DateField.odt")) + hCloseDocument + sleep(1) + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_DateField.odt")) + Kontext "Toolbar" + call hToolbarSelect("MoreControls",true) + call hToolbarSelect("FormControls",true) + call fSwitchControlDesignMode + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + call fOpenControlPropertyBrowser + '/// check if the values are saved + printlog "check if the values are saved" + sleep(2) + Kontext "TabGeneralControl" + TabGeneralControl.TypeKeys "<TAB>" , true ' this tab is importent, I don't not why but it is. + if iSystemSprache = 01 then + if fgetControlProperty("DateField","DateMin") <> "09/09/2009" then + warnlog "the value date min is not saved" + endif + if fgetControlProperty("DateField","DateMax") <> "10/10/2010" then + warnlog "the value date max is not saved" + endif + elseif iSystemSprache = 49 then + if fgetControlProperty("DateField","DateMin") <> "09.09.2009" then + warnlog "the value date min is not saved" + endif + if fgetControlProperty("DateField","DateMax") <> "10.10.2010" then + warnlog "the value date max is not saved" + endif + endif + if fgetControlProperty("DateField","DateFormat") <> "7" then + warnlog "the value date format is not saved" + endif + if fgetControlProperty("DateField","DropDown") <> "2" then + warnlog "the value dropdown is not saved" + endif + sleep(1) + printlog " - testcase end" + + call closePropertyBrowserAndDocument() + +endcase +'-------------------------------------------------------------------------------------- + +testcase tTimeField + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + + call addControl("TimeField", 50, 20, 60, 30 ) + + printlog "open the control property browser" + call fOpenControlPropertyBrowser + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set TimeMin to 09:09:09 and TimeMax to 10:10:10 and time format to 01:45 PM + printlog "set TimeMin to 09:09:09 and TimeMax to 10:10:10 and time format to 01:45 PM" + fsetControlProperty("TimeField","TimeMin","09:09:09") + fsetControlProperty("TimeField","TimeMax","10:10:10") + fsetControlProperty("TimeField","TimeFormat","3") + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_TimeField.odt")) + hCloseDocument + sleep(1) + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_TimeField.odt")) + Kontext "Toolbar" + call hToolbarSelect("MoreControls",true) + call hToolbarSelect("FormControls",true) + call fSwitchControlDesignMode + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + call fOpenControlPropertyBrowser + '/// check if the values are saved + printlog "check if the values are saved" + sleep(2) + Kontext "TabGeneralControl" + TabGeneralControl.TypeKeys "<TAB>" , true ' this tab is importent, I don't not why but it is. + if fgetControlProperty("TimeField","TimeMin") <> "09:09:09" then + warnlog "the value time min is not saved" + endif + if fgetControlProperty("TimeField","TimeMax") <> "10:10:10" then + warnlog "the value time max is not saved" + endif + if fgetControlProperty("TimeField","TimeFormat") <> "3" then + warnlog "the value time format is not saved" + endif + sleep(1) + printlog " - testcase end" + + call closePropertyBrowserAndDocument() + +endcase +'-------------------------------------------------------------------------------------- + +testcase tNumericField + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + + call addControl("NumericField", 50, 20, 60, 30 ) + + printlog "open the control property browser" + call fOpenControlPropertyBrowser + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set properties: spinbutton, Strict format, Thousands seperator + printlog "set properties: spinbutton, Default value, Strict format, Tabstop, Thousands seperator" + fsetControlProperty("NumericField","StrictFormat","2") 'yes + fsetControlProperty("NumericField","ThousandSeperator","2") 'yes + fsetControlProperty("NumericField","Spin","2") 'yes + fsetControlProperty("NumericField","ValueStep","6") + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_NumericField.odt")) + hCloseDocument + sleep(1) + '/// reload and prepare the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_NumericField.odt")) + Kontext "Toolbar" + call hToolbarSelect("MoreControls",true) + call hToolbarSelect("FormControls",true) + call fSwitchControlDesignMode + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + call fOpenControlPropertyBrowser + '/// check if property values are inserted + printlog "check if property values are inserted" + Kontext "TabGeneralControl" + dim bScrOK as boolean 'control variable if all properties are correct + bScrOK = true + if fgetControlProperty("NumericField","StrictFormat") <> "2" then + warnlog "the NumericField is not saved with property: StrictFormat" + bScrOK = false + endif + if fgetControlProperty("NumericField","ThousandSeperator") <> "2" then + warnlog "the NumericField is not saved with property: ThousandSeperator" + bScrOK = false + endif + if fgetControlProperty("NumericField","Spin") <> "2" then + warnlog "the NumericField is not saved with property: Spin" + bScrOK = false + endif + '(spin field - cannot be read out) + 'if fgetControlProperty("NumericField","ValueStep") <> "2" then + 'warnlog "the NumericField is not saved with property: Value Step" + 'bScrOK = false + 'endif + if bScrOK = true then printlog "Numeric field was saved correctly" + sleep(1) + + call closePropertyBrowserAndDocument() + +endcase +'-------------------------------------------------------------------------------------- + +testcase tCurrencyField + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + + call addControl("CurrencyField", 50, 20, 60, 30 ) + + printlog "open the control property browser" + call fOpenControlPropertyBrowser + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set valueStep to 5 and prefix symbol to yes and current symbol to zoq + printlog "set valueStep to 5 and prefix symbol to yes and current symbol to zoq" + fsetControlProperty("CurrencyField","CurrSymPosition","2") + fsetControlProperty("CurrencyField","ValueStep","5") + fsetControlProperty("CurrencyField","CurrencySymbol","nin") + fsetControlProperty("CurrencyField","Accuracy","3") + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_CurrencyField.odt")) + hCloseDocument + sleep(1) + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_CurrencyField.odt")) + Kontext "Toolbar" + call hToolbarSelect("MoreControls",true) + call hToolbarSelect("FormControls",true) + call fSwitchControlDesignMode + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + call fOpenControlPropertyBrowser + '/// check if the values are saved + printlog "check if the values are saved" + sleep(2) + Kontext "TabGeneralControl" + TabGeneralControl.TypeKeys "<TAB>" , true ' this tab is importent, I don't not why but it is. + if fgetControlProperty("CurrencyField","CurrSymPosition") <> "2" then + warnlog "the prefix symbol is not saved" + endif + if fgetControlProperty("CurrencyField","ValueStep") <> "5" then + warnlog "the value step is not saved" + endif + if fgetControlProperty("CurrencyField","CurrencySymbol") <> "nin" then + warnlog "the CurrencySymbol is not saved" + endif + '(spin field - cannot be read out) + 'if fgetControlProperty("CurrencyField","Accuracy") <> "3" then + 'warnlog "the CurrencySymbol is not saved" + 'endif + sleep(1) + printlog " - testcase end" + + call closePropertyBrowserAndDocument() + +endcase +'-------------------------------------------------------------------------------------- + +testcase tPatternField + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + + call addControl("PatternField", 50, 20, 60, 30 ) + + printlog "open the control property browser" + call fOpenControlPropertyBrowser + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set properties: Readonly, Edit mask, Literal mask, Order + printlog "set properties: Readonly, Edit mask, Literal mask, Order" + fsetControlProperty("PatternField","Readonly","2") + fsetControlProperty("PatternField","EditMask","oxox") + fsetControlProperty("PatternField","LiteralMask","ooxoo") + fsetControlProperty("PatternField","Order","7") + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_PatternField.odt")) + hCloseDocument + sleep(1) + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_PatternField.odt")) + Kontext "Toolbar" + call hToolbarSelect("MoreControls",true) + call hToolbarSelect("FormControls",true) + call fSwitchControlDesignMode + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + call fOpenControlPropertyBrowser + '/// check if the values are saved + printlog "check if the values are saved" + sleep(2) + Kontext "TabGeneralControl" + TabGeneralControl.TypeKeys "<TAB>" , true ' this tab is importent, I don't not why but it is. + if fgetControlProperty("PatternField","Readonly") <> "2" then + warnlog "the value readonly is not saved" + endif + if fgetControlProperty("PatternField","EditMask") <> "oxox" then + warnlog "the value EditMask is not saved" + endif + if fgetControlProperty("PatternField","LiteralMask") <> "ooxoo" then + warnlog "the value LiteralMask is not saved" + endif + if fgetControlProperty("PatternField","Order") <> "7" then + warnlog "the value Order is not saved" + endif + sleep(1) + printlog " - testcase end" + + call closePropertyBrowserAndDocument() + +endcase +'-------------------------------------------------------------------------------------- + +testcase tGroupBox + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + + addControl("GroupBox", 50, 20, 60, 30 ) + + printlog "open the control property browser" + call fOpenControlPropertyBrowser + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + '/// set properties: Label, Character set + printlog "set properties" + Kontext "TabGeneralControl" + TabGeneralControl.TypeKeys "<TAB>",TRUE 'label + TabGeneralControl.TypeKeys "Changed label name",TRUE + CharacterSetButton.Click 'character set + sleep(1) + Kontext "TabFont" + TabFont.TypeKeys "<DOWN>",TRUE + TabFont.OK + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_GroupBox.odt")) + hCloseDocument + sleep(1) + '/// reload and prepare the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_GroupBox.odt")) + Kontext "Toolbar" + call hToolbarSelect("MoreControls",true) + call hToolbarSelect("FormControls",true) + call fSwitchControlDesignMode + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + call fOpenControlPropertyBrowser + '/// check if property values are inserted + printlog "check if property values are inserted" + Kontext "TabGeneralControl" + TabGeneralControl.TypeKeys "<TAB>" , true + TabGeneralControl.TypeKeys "<MOD1 C>" , true + if getclipboard() <> "Changed label name" then + warnlog "Property: Label is not saved correctly" + endif + 'printlog "property character set text: " & CharacterSet.getText + if CharacterSet.getText = "" then + warnlog "Property: Character set is not saved correctly" + endif + sleep(1) + printlog " - testcase end" + + call closePropertyBrowserAndDocument() + +endcase +'-------------------------------------------------------------------------------------- + +testcase tTableControl + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + + call addControl("Grid", 50, 20, 60, 30 ) + + printlog "open the control property browser" + call fOpenControlPropertyBrowser + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set properties: Navigation bar, Record marker, Row high + printlog "set properties" + fsetControlProperty("TableControl","NavigationBar","1") 'listbox content: no + fsetControlProperty("TableControl","RecordMarker","1") 'listbox content: no + fsetControlProperty("TableControl","RowHeight","5") + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_TableControl.odt")) + hCloseDocument + sleep(1) + '/// reload and prepare the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_TableControl.odt")) + Kontext "Toolbar" + call hToolbarSelect("MoreControls",true) + call hToolbarSelect("FormControls",true) + call fSwitchControlDesignMode + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + call fOpenControlPropertyBrowser + '/// check if property values are inserted + printlog "check if property values are inserted" + Kontext "TabGeneralControl" + dim bScrOK as boolean 'control variable if all properties are correct + bScrOK = true + if fgetControlProperty("TableControl","NavigationBar") <> "1" then + warnlog "the imagebutton is not saved with property: NavigationBar" + bScrOK = false + endif + if fgetControlProperty("TableControl","RecordMarker") <> "1" then + warnlog "the imagebutton is not saved with property: RecordMarker" + bScrOK = false + endif + if fgetControlProperty("TableControl","RowHeight") = "" then + warnlog "the imagebutton is not saved with property: RowHeight" + bScrOK = false + endif + if bScrOK = true then printlog "TableControl was saved correctly" + sleep(1) + + call closePropertyBrowserAndDocument() + +endcase +'-------------------------------------------------------------------------------------- + +testcase tNavigationBar + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + + call addControl("NavigationBar", 50, 20, 60, 30 ) + + printlog "open the control property browser" + call fOpenControlPropertyBrowser + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen + sleep(2) + '/// set properties: IconSize, Positioning, Navigation, RecordActions, FilteringSorting + printlog "set properties" + fsetControlProperty("NavigationBar","IconSize","2") 'listbox content: large + fsetControlProperty("NavigationBar","Positioning","1") 'listbox content: no + fsetControlProperty("NavigationBar","Navigation","1") 'listbox content: no + fsetControlProperty("NavigationBar","RecordActions","1") 'listbox content: no + fsetControlProperty("NavigationBar","FilteringSorting","1") 'listbox content: no + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_NavigationBar.odt")) + hCloseDocument + sleep(1) + '/// reload and prepare the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_NavigationBar.odt")) + Kontext "Toolbar" + call hToolbarSelect("MoreControls",true) + call hToolbarSelect("FormControls",true) + call fSwitchControlDesignMode + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + call fOpenControlPropertyBrowser + '/// check if property values are inserted + printlog "check if property values are inserted" + Kontext "TabGeneralControl" + dim bScrOK as boolean 'control variable if all properties are correct + bScrOK = true + if fgetControlProperty("NavigationBar","IconSize") <> "2" then + warnlog "the NavigationBar is not saved with property: IconSize" + bScrOK = false + endif + if fgetControlProperty("NavigationBar","Positioning") <> "1" then + warnlog "the NavigationBar is not saved with property: Positioning" + bScrOK = false + endif + if fgetControlProperty("NavigationBar","Navigation") <> "1" then + warnlog "the NavigationBar is not saved with property: Navigation" + bScrOK = false + endif + if fgetControlProperty("NavigationBar","RecordActions") <> "1" then + warnlog "the NavigationBar is not saved with property: RecordActions" + bScrOK = false + endif + if fgetControlProperty("NavigationBar","FilteringSorting") <> "1" then + warnlog "the NavigationBar is not saved with property: FilteringSorting" + bScrOK = false + endif + if bScrOK = true then printlog "NavigationBar was saved correctly" + sleep(1) + + call closePropertyBrowserAndDocument() + +endcase +'-------------------------------------------------------------------------------------- +'-------------------------------------------------------------------------------------- + + + +'make shure that design mode is not off, else switch on +function fSwitchOn_DesignMode +Kontext "FormControls" + try + PushButton.Click + catch + SwitchControlDesignMode.Click + sleep(2) + endcatch +end function diff --git a/testautomation/dbaccess/optional/includes/ctrl_Spreadsheet.inc b/testautomation/dbaccess/optional/includes/ctrl_Spreadsheet.inc new file mode 100644 index 000000000000..57a7973a8f89 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/ctrl_Spreadsheet.inc @@ -0,0 +1,387 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Controls linked to spreadsheet cells +'* +'\*********************************************************************** + +'* preconditions : no FormDesignToolbar should be open +'* testpurpose : test if controls linked to cells work correct + +sub ctrl_Spreadsheet + + call preCon_CloseFormDesignToolbar + call tTextBox + call tListBox + call tCheckBox + +end sub +'-------------------------------------------------------------------------------------- +testcase tListBox + + Dim j as integer + Dim k as integer + dim i as integer + printlog "- Formular toolbox: List box element (" & gApplication & ")" + '/// open a spreadsheet, insert a listbox (the wizard appears) + gApplication = "CALC" + call hNewDocument + Kontext "DocumentCalc" + DocumentCalc.TypeKeys("Value1") + DocumentCalc.TypeKeys("<RETURN>") + DocumentCalc.TypeKeys("Value2") + DocumentCalc.TypeKeys("<RETURN>") + DocumentCalc.TypeKeys("Value3") + DocumentCalc.TypeKeys("<RETURN>") + DocumentCalc.TypeKeys("Value4") + DocumentCalc.TypeKeys("<RETURN>") + DocumentCalc.TypeKeys("Value5") + DocumentCalc.TypeKeys("<RETURN>") + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + Listbox.Click + sleep(3) + call hDrawingWithSelection ( 60, 40, 70, 55 ) + sleep(3) + Kontext "AutoPilotListComboBox" + AutoPilotListComboBox.MouseDown(10,10) + AutoPilotListComboBox.MouseUp(10,10) + '/// close the autopilot + if AutoPilotListComboBox.Exists(1) then + AutopilotListComboBox.Cancel + end if + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + ControlProperties.Click + sleep(1) + call fsetControlProperty("ListBox","CellRange","A1:A5") + call fsetControlProperty("ListBox","CellBound","B1") + sleep(1) + '/// close control property browser + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.Close + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_ListBox.ods")) + hCloseDocument + sleep(1) + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_ListBox.ods")) + sleep 1 + KOntext "DocumentCalc" + DocumentCalc.TypeKeys "<MOD1 F5>" , true + sleep(1) + DocumentCalc.TypeKeys "<DOWN>" , true + sleep(1) + DocumentCalc.TypeKeys "<DOWN>" , true + sleep(1) + DocumentCalc.TypeKeys "<MOD1 F6>" , true + sleep(1) + DocumentCalc.TypeKeys "<MOD1 HOME>" , true + sleep(1) + DocumentCalc.TypeKeys "<RIGHT>" , true + sleep(1) + DocumentCalc.TypeKeys "<MOD1 C>" , true + sleep(1) + Dim str1 as String + str1 = getClipboardText() + if str1 <> "Value2" then + warnlog "the value is not right. Is should be Value2 but it is " + str1 + endif + hCloseDocument + +endcase +'-------------------------------------------------------------------------------------- +testcase tTextBox + + '/// Open a new document, + gApplication = "CALC" + printlog "Open a new document," + call hNewDocument + Kontext "DocumentCalc" + 'DocumentWriter.TypeKeys "tt_doc" , true + + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + + Edit.Click + sleep(1) + + '/// insert a text box + printlog "insert a text box" + sleep(3) + call hDrawingWithSelection ( 30, 30, 40, 40 ) + sleep(2) + Kontext "FormControls" + ControlProperties.Click + sleep(2) + '/// set multiline and alignment to right + call fsetControlProperty("TextBox","CellBound","A1") + + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.Close + + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_TextBox.ods")) + hCloseDocument + sleep(1) + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_TextBox.ods")) + + call hToolbarSelect("FormControls",true) + + sleep(1) + Kontext "FormControls" + SwitchControlDesignMode.Click + sleep(1) + Kontext "DocumentCalc" + DocumentCalc.typeKeys "Hello world" , true ' this is important to get the focus into the document + sleep(1) + DocumentCalc.typeKeys "<F6>" , 6 , true ' it's important that you don't do this in 6 lines + sleep(1) + + call hToolbarSelect("FormDesignTools",true) + + Kontext "DocumentCalc" + DocumentCalc.MouseDown(50,50) + DocumentCalc.MouseUp(50,50) + + Kontext "FormDesignTools" + ShowFmExplorer.Click + + Kontext "FormularNavigator" + Liste.TypeKeys "<HOME>" + sleep(1) + Liste.TypeKeys "<DOWN>" + sleep(1) + Liste.TypeKeys "<DOWN>" + sleep(1) + + Liste.OpenContextmenu + sleep(1) + call hMenuSelectNr(5) + sleep(1) + + 'Kontext "FormControls" + ' try + ' ControlProperties.Click + ' sleep(1) + ' catch + ' warnlog "error while open the control properties browser" + ' call hCloseDocument + ' goto endsub + ' endcatch + '/// check if the values are saved + printlog "check if the values are saved" + sleep(2) + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.SetPage TabDataControl + sleep(1) + if fgetControlProperty("TextBox","CellBound") <> "A1" then + warnlog "the bound cell is not saved" + call hCloseDocument + goto endsub + endif + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + SwitchControlDesignMode.Click + sleep(1) + + Kontext "DocumentCalc" + Documentcalc.TypeKeys "<MOD1 F5>", true + sleep(1) + Documentcalc.TypeKeys "<MOD1 HOME>", true + sleep(1) + Documentcalc.TypeKeys "<MOD1 SHIFT END>", true + sleep(1) + Documentcalc.TypeKeys "<MOD1 C>", true + sleep(1) + printlog getClipboard + if getClipboard <> "Hello world" then + warnlog "the cell bound doesn't work" + endif + hCloseDocument + gApplication = "WRITER" + +endcase +'-------------------------------------------------------------------------------------- +testcase tCheckBox + + '/// Open a new document, + gApplication = "CALC" + printlog "Open a new document," + call hNewDocument + Kontext "DocumentCalc" + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + CheckBox.Click + sleep(3) + '/// insert a checkbox box + printlog "insert a checkbox box" + call hDrawingWithSelection ( 50, 50, 70, 70 ) + sleep(2) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + ControlProperties.Click + sleep(2) + '/// set multiline and alignment to right + call fsetControlProperty("CheckBox","CellBound","A1") + call fsetControlProperty("CheckBox","ReferenceValueOff","unchecked") + call fsetControlProperty("CheckBox","ReferenceValue","checked") + '/// close control property browser + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.Close + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_CheckBox.ods")) + hCloseDocument + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_CheckBox.ods")) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + SwitchControlDesignMode.Click + sleep(1) + 'Kontext "DocumentCalc" + ' DocumentCalc.typeKeys "hello world" , true ' this is important to get the focus into the document + + call hToolbarSelect("FormDesignTools",true) + + Kontext "FormDesignTools" + ShowFmExplorer.Click + + Kontext "FormularNavigator" + Liste.TypeKeys "<HOME>" + sleep(1) + Liste.TypeKeys "<DOWN>" + sleep(1) + Liste.TypeKeys "<DOWN>" + sleep(1) + Liste.OpenContextmenu + sleep(1) + call hMenuSelectNr(5) + sleep(1) + + 'Kontext "FormControls" + ' try + ' ControlProperties.Click + ' catch + ' warnlog "error while open the control properties browser" + ' call hCloseDocument + ' goto endsub + ' endcatch + + '/// check if the values are saved + printlog "check if the values are saved" + sleep(2) + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.SetPage TabGeneralControl + Kontext "TabGeneralControl" + TabGeneralControl.TypeKeys "<TAB>" , true ' this tab is importent, I don't not why but it is. + if fgetControlProperty("CheckBox","CellBound") <> "A1" then + warnlog "the bound cell is not saved" + call hCloseDocument + goto endsub + endif + sleep(1) + + call hToolbarSelect("FormControls",true) + Kontext "FormControls" + SwitchControlDesignMode.Click + sleep(1) + + Kontext "DocumentCalc" + DocumentCalc.MouseDown(20,20) + DocumentCalc.MouseUp(20,20) + + sleep(1) + + Kontext "DocumentCalc" + Documentcalc.TypeKeys "<MOD1 F5>", true + sleep(1) + Documentcalc.TypeKeys "<SPACE>", true + sleep(2) + + ' need to activate the document again + Documentcalc.MouseDown(10,10) + Documentcalc.MouseUp(10,10) + + sleep(2) + + DocumentCalc.TypeKeys "<MOD1 HOME>" , true + + sleep(1) + + Documentcalc.TypeKeys "<MOD1 C>", true + + sleep(1) + + Dim str2 as String + str2 = getClipboardText() + printlog str2 + ' use STRCOMP to compare the strings thats works. + if StrComp(str2,"checked") <> 0 then + printlog StrComp(str2,"checked") + warnlog "the cell bound doesn't work" + endif + hCloseDocument + gApplication = "WRITER" + +endcase +'------------------------------------------------------------------------- +function preCon_CloseFormDesignToolbar + + printlog "preCondition close FormDesignToolbar" + call hNewDocument + call hToolbarSelect("FormDesignTools",false) + call hCloseDocument + call ExitRestartTheOffice + +end function diff --git a/testautomation/dbaccess/optional/includes/ctrl_TextControl.inc b/testautomation/dbaccess/optional/includes/ctrl_TextControl.inc new file mode 100644 index 000000000000..4abf5a19b73d --- /dev/null +++ b/testautomation/dbaccess/optional/includes/ctrl_TextControl.inc @@ -0,0 +1,290 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Text Control +'* +'\*********************************************************************** + +sub ctrl_TextControl + + call tTextControl + call tRichTextControl + call tRichTextControlDraw + +end sub +'-------------------------------------------------------------------------------------- +testcase tTextControl + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + Edit.Click + sleep(1) + '/// insert a text box + printlog "insert a text box" + call hDrawingWithSelection ( 50, 20, 60, 30 ) + sleep(1) + Kontext "FormControls" + ControlProperties.Click + sleep(2) + '/// set properties: Background color, Horizontal scrollbar, Vertical scrollbar, Password + printlog "set properties" + fsetControlProperty("TextBox","Background","92") + fsetControlProperty("TextBox","TextType","3") + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_TextBox.odt")) + hCloseDocument + sleep(1) + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_TextBox.odt")) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + SwitchControlDesignMode.Click + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" + sleep(1) + Kontext "FormControls" + try + ControlProperties.Click + catch + warnlog "error while open the control properties browser" + call hCloseDocument + goto endsub + endcatch + '/// check if the values are saved + printlog "check if the values are saved" + sleep(2) + if fgetControlProperty("TextBox","Background") <> "92" then + warnlog "the value: background is not saved" + endif + + if fgetControlProperty("TextBox","TextType") <> "3" then + warnlog "the value: TextType is not saved" + endif + sleep(1) + hCloseDocument +endcase +'-------------------------------------------------------------------------------------- +testcase tRichTextControl + + '/// Open a new document, + printlog "Open a new document," + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + Edit.Click + sleep(1) + '/// insert a text box + printlog "insert a text box" + call hDrawingWithSelection ( 50, 20, 60, 30 ) + sleep(2) + Kontext "FormControls" + ControlProperties.Click + sleep(2) + '/// set properties: Background color, Horizontal scrollbar, Vertical scrollbar, Password + printlog "set properties" + fsetControlProperty("TextBox","TextType","3") + '/// turn off the design view + printlog "turn off the design view" + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + SwitchControlDesignMode.Click + '/// insert some text in the control + printlog "insert some text in the control" + Kontext "DocumentWriter" + sleep(1) + DocumentWriter.TypeKeys "<MOD1 F5>" , true + sleep(1) + DocumentWriter.TypeKeys "this is a blind text" , true + sleep(1) + DocumentWriter.TypeKeys "<SHIFT MOD1 LEFT>" ,2, true + sleep(1) + FormatStyleStrikeThrough + sleep(1) + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_RichTextBox.odt")) + hCloseDocument + sleep(1) + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_RichTextBox.odt")) + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<MOD1 F5>" , true + qaerrorlog "workaround for issue 102010" + DocumentWriter.TypeKeys "<RIGHT>" , true + DocumentWriter.TypeKeys "<LEFT>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 SHIFT END>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + 'printlog "getClipboard = " + getClipboard + if ( getClipboard <> "this is a blind text" ) then + warnlog "The text in the control is not saved (" + getClipboard() + ")" + end if + DocumentWriter.TypeKeys "<END>" , true + sleep(1) + DocumentWriter.TypeKeys "<SHIFT MOD1 LEFT>" ,2, true + sleep(1) + FormatCharacter + Kontext + active.SetPage TabFontEffects + Kontext "TabFontEffects" + if StrikeThrough.getSelIndex() <> 2 then + warnlog "StrikeThrought is not set" + else + printlog "StrikeThrought is set" + end if + TabFontEffects.Cancel + + sleep(1) + + hCloseDocument +endcase +'-------------------------------------------------------------------------------------- +testcase tRichTextControlDraw + + '/// Open a new document, + printlog "Open a new document," + gApplication = "DRAW" + call hNewDocument + Kontext "DocumentDraw" + DocumentDraw.TypeKeys "tt_doc" , true + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "DocumentDraw" + DocumentDraw.MouseDown ( 20, 20 ) + sleep(1) + DocumentDraw.MouseUp ( 20, 20 ) + sleep(1) + Kontext "FormControls" + sleep(1) + Edit.Click + sleep(1) + call hDrawingWithSelection ( 50, 20, 60, 30 ) + sleep(2) + Kontext "FormControls" + ControlProperties.Click + sleep(2) + '/// set properties: Background color, Horizontal scrollbar, Vertical scrollbar, Password + printlog "set properties" + fsetControlProperty("TextBox","TextType","3") + '/// turn off the design view + printlog "turn off the design view" + + printlog "close control property browser" + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.close + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + SwitchControlDesignMode.Click + '/// insert some text in the control + printlog "insert some text in the control" + Kontext "DocumentDraw" + sleep(1) + DocumentDraw.TypeKeys "<MOD1 F5>" , true + sleep(1) + DocumentDraw.TypeKeys "<MOD1 F5>" , true + sleep(1) + DocumentDraw.TypeKeys "this is a blind text" , true + sleep(1) + DocumentDraw.TypeKeys "<SHIFT MOD1 LEFT>" ,2, true + sleep(1) + FormatStyleStrikeThrough + sleep(1) + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_RichTextBox.odg"),gDrawFilter) + hCloseDocument + sleep(1) + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_RichTextBox.odg")) + Kontext "DocumentDraw" + DocumentDraw.TypeKeys "<MOD1 F5>" , true + sleep(1) + DocumentDraw.TypeKeys "<MOD1 F5>" , true + qaerrorlog "workaround for issue 102010" + DocumentDraw.TypeKeys "<RIGHT>" , true + DocumentDraw.TypeKeys "<LEFT>" , true + sleep(1) + DocumentDraw.TypeKeys "<MOD1 SHIFT END>" , true + sleep(1) + DocumentDraw.TypeKeys "<MOD1 C>" , true + sleep(1) + printlog "getClipboard = " + getClipboard + if ( getClipboard <> "this is a blind text" ) then + warnlog "The text in the control is not saved" + end if + DocumentDraw.TypeKeys "<END>" , true + sleep(1) + DocumentDraw.TypeKeys "<SHIFT MOD1 LEFT>" ,2, true + sleep(1) + FormatCharacter + Kontext + active.SetPage TabFontEffects + Kontext "TabFontEffects" + if StrikeThrough.getSelIndex() <> 2 then + warnlog "StrikeThrought is not set (issue 32921)" + else + printlog "StrikeThrought is set" + end if + TabFontEffects.Cancel + + sleep(1) + + hCloseDocument +endcase +'-------------------------------------------------------------------------------------- +'-------------------------------------------------------------------------------------- +'-------------------------------------------------------------------------------------- + diff --git a/testautomation/dbaccess/optional/includes/ctrl_Wizards.inc b/testautomation/dbaccess/optional/includes/ctrl_Wizards.inc new file mode 100644 index 000000000000..2f51183a40a1 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/ctrl_Wizards.inc @@ -0,0 +1,860 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Control Wizards Test +'* +'\*********************************************************************** +global sDSName as String +global sFileName as String + +sub ctrl_Wizards + + printlog "---------------- Control Wizards -------------------" + + sDSName = "TT" + + app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/hsql_datasource/TT_hsqldb.odb"),gOfficePath + ConvertPath("user/work/TT_hsqldb.odb") + call fRegisterDatabaseFile(gOfficePath + ConvertPath("user/work/TT_hsqldb.odb"),"TT") + + call fSwitchAutopilotOff(false) ' has to run first to switch on the autopilot + call tGroupBoxWithDatasource + call tGroupBoxWithoutDatasource + call tListBox + call tComboBox + call tTableControl + call fDeRegisterDatabaseFile(sDSName) + +end sub + +'-------------------------------------------------------------------- + +testcase tGroupBoxWithDatasource + + '/// open a new text document + printlog "open a new text document" + call hNewDocument + sleep(1) + '/// create a new form via the form navigator + printlog "create a new form via the form navigator" + + call hToolbarSelect("FORMDESIGN",true) + Kontext "FormDesignTools" + ShowFmExplorer.Click + sleep(2) + + Kontext "FormularNavigator" + Liste.TypeKeys "<SPACE>" + sleep(3) + Liste.OpenContextmenu + sleep(2) + hMenuSelectNr (1) + sleep(2) + hMenuSelectNr (1) + sleep(3) + Liste.TypeKeys "<RETURN>",true + sleep(3) + Liste.OpenContextmenu + sleep(2) + hMenuSelectNr (6) + sleep(4) + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.SetPage TabDataControl + Kontext "TabDataForm" + '/// set the datasource TT + printlog "set the datasource TT" + DataSource.setText(sDSName) + DataSource.TypeKeys "<RETURN>" , true + sleep(1) + '/// insert password 'testtool' into login dialog + printlog "insert password 'testtool' into login dialog" + Kontext "LoginDialog" + if LoginDialog.Exists then + LoginPassword.setText "testtool" + LoginDialog.OK + sleep(1) + else + printlog "Login dialog doesn't exists. Why?" + endif + Kontext "LoginDialog" + if LoginDialog.Exists then + LoginPassword.setText "testtool" + LoginDialog.OK + sleep(1) + else + printlog "Login dialog doesn't exists. Why?" + endif + Kontext "TabDataForm" + '/// set the table TT_Control + printlog "set the table TT_Control" + Content.setText("TT_Control") + Content.TypeKeys "<RETURN>" , true + sleep(1) + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.Close + sleep(3) + Kontext "FormularNavigator" + FormularNavigator.Close + sleep(4) + + call hToolbarSelect("MoreControls",true) + Kontext "MoreControls" + '/// insert a groupbox (the wizard appears) + printlog "insert a groupbox (the wizard appears)" + Groupbox.Click + + call hDrawingWithSelection ( 50, 20, 60, 30 ) + sleep(10) + + Dim i as integer + Kontext "AutopilotGroupElement" + AutopilotGroupElement.MouseDown (10,10) + AutopilotGroupElement.MouseUp (10,10) + '/// insert three fields with the names: red, green, blue & next + printlog "insert three fields with the names: red, green, blue & next" + Kontext "TabGroupBoxData" + Names.setText "red" + AddTo.Click + sleep(1) + Names.setText "green" + AddTo.Click + sleep(1) + Names.setText "blue" + AddTo.Click + sleep(1) + Kontext "AutopilotGroupElement" + if NextButton.IsEnabled then + NextButton.Click + else + warnlog "In first window the 'Next'-button is disabled!" + AutopilotGroupElement.Cancel + goto endsub + end if + printlog " - Autopilot group box: Page 2/5" + Kontext "TabDefaultFieldSelection" + '/// choose no default and click two times next + printlog "choose no default and click two times next" + NoSelected.check + Kontext "AutopilotGroupElement" + if NextButton.IsEnabled then + NextButton.Click + else + warnlog "In second window the 'Next'-button is disabled!!" + AutopilotGroupElement.Cancel + goto endsub + end if + sleep(1) + printlog " - Autopilot group box: Page 3/5" + Kontext "TabDatabaseValues" + ' nothing + Kontext "AutopilotGroupElement" + if NextButton.IsEnabled then + NextButton.Click + else + warnlog "In third window the 'Next'-button is disabled!" + AutopilotGroupElement.Cancel + end if + sleep(3) + printlog " - Autopilot group box: Page 4/5" + '/// choose the database field Colors + printlog "choose the database field Colors" + 'Kontext "TabDatabaseValues" + Kontext "TabDatabaseField" ' dbp:TabPage:RID_PAGE_OPTION_DBFIELD + YesSaveIt.check + Fieldbox.select 2 + Kontext "AutopilotGroupElement" + if NextButton.IsEnabled then + NextButton.Click + else + warnlog "In fourth window the 'Next'-button is disabled!" + AutopilotGroupElement.Cancel + goto endsub + end if + sleep(1) + printlog " - Autopilot group box: Page 5/5" + Kontext "TabCreateOptionGroup" + ' nothing + Kontext "AutopilotGroupElement" + if CreateButton.IsEnabled then + CreateButton.Click + else + warnlog "In fifth window the 'Create'-button is disabled!" + AutopilotGroupElement.Cancel + goto endsub + end if + + sleep(1) + + call hToolbarSelect("FORMDESIGN",true) + Kontext "FormDesignTools" + ShowFmExplorer.Click + sleep(3) + + Kontext "FormularNavigator" + sleep(1) + 'Liste.TypeKeys "<DOWN>" , true + sleep(1) + Liste.TypeKeys "<HOME>" , true + sleep(1) + Liste.TypeKeys "<DOWN>" , true + sleep(1) + Liste.TypeKeys "<DOWN>" , true + sleep(1) + Liste.TypeKeys "<DOWN>" , true + sleep(1) + Liste.OpenContextmenu + sleep(2) + hMenuSelectNr (5) + sleep(5) + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl + + Kontext "TabGeneralControl" + TabGeneralControl.TypeKeys "<TAB>" , true 'this tab is importent, I don't not why but it is. + sleep(1) + HelpURL.setText "customcontrol1" + HelpURL.TypeKeys "<RETURN>",true + sleep(1) + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.close + + 'open and close the formnavigator to get the focus + call hToolbarSelect("FORMDESIGN",true) + Kontext "FormDesignTools" + ShowFmExplorer.Click + sleep(2) + + Kontext "FormDesignTools" + ShowFmExplorer.Click + sleep(2) + + Kontext "FormularNavigator" + 'Liste.TypeKeys "<DOWN>" , true ' this is needed , I don't know why + sleep(1) + Liste.TypeKeys "<HOME>" , true + sleep(1) + Liste.TypeKeys "<DOWN>" , true + sleep(1) + Liste.TypeKeys "<DOWN>" , true + sleep(1) + Liste.TypeKeys "<DOWN>" , true + sleep(1) + Liste.TypeKeys "<DOWN>" , true + sleep(1) + Liste.OpenContextmenu + sleep(2) + hMenuSelectNr (5) + sleep(5) + + Kontext "TabGeneralControl" + TabGeneralControl.TypeKeys "<TAB>" , true 'this tab is importent, I don't not why but it is. + sleep(1) + HelpURL.setText "customcontrol2" + HelpURL.TypeKeys "<RETURN>", true + sleep(1) + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.close + + 'open and close the frmnavigator to get the focus + call hToolbarSelect("FORMDESIGN",true) + Kontext "FormDesignTools" + ShowFmExplorer.Click + sleep(2) + + Kontext "FormDesignTools" + ShowFmExplorer.Click + sleep(2) + + Kontext "FormularNavigator" + 'Liste.TypeKeys "<DOWN>" , true ' this is needed , I don't know why + sleep(1) + Liste.TypeKeys "<HOME>" , true + sleep(1) + Liste.TypeKeys "<DOWN>" , true + sleep(1) + Liste.TypeKeys "<DOWN>" , true + sleep(1) + Liste.TypeKeys "<DOWN>" , true + sleep(1) + Liste.TypeKeys "<DOWN>" , true + sleep(1) + Liste.TypeKeys "<DOWN>" , true + sleep(1) + Liste.OpenContextmenu + sleep(2) + hMenuSelectNr (5) + sleep(5) + + Kontext "TabGeneralControl" + TabGeneralControl.TypeKeys "<TAB>" , true ' this tab is importent, I don't not why but it is. + HelpURL.setText "customcontrol3" + HelpURL.TypeKeys "<RETURN>", true + sleep(1) + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.close + + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_AP_GroupBox.odt")) + hCloseDocument + sleep(1) + + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_AP_GroupBox.odt")) + + '/// check if the options buttons work right + printlog "check if the options buttons work right" + + dim a as boolean + dim b as boolean + dim c as boolean + + Kontext "MSC_Special_Dialog" + a = MSC_Special_Dialog.ischecked + Kontext "MSC_Special_Dialog2" + b = MSC_Special_Dialog2.ischecked + Kontext "MSC_Special_Dialog3" + c = MSC_Special_Dialog3.ischecked + + if not a AND not b AND c then + printlog "ok" + else + warnlog "the third option isn't checked" + endif + + printlog "next record" + FM_Next_Record + sleep(1) + Kontext "MSC_Special_Dialog" + a = MSC_Special_Dialog.ischecked + Kontext "MSC_Special_Dialog2" + b = MSC_Special_Dialog2.ischecked + Kontext "MSC_Special_Dialog3" + c = MSC_Special_Dialog3.ischecked + + if not a AND b AND not c then + 'nothing + else + warnlog "the second option isn't checked" + endif + + printlog "next record" + FM_Next_Record + sleep(1) + Kontext "MSC_Special_Dialog" + a = MSC_Special_Dialog.ischecked + Kontext "MSC_Special_Dialog2" + b = MSC_Special_Dialog2.ischecked + Kontext "MSC_Special_Dialog3" + c = MSC_Special_Dialog3.ischecked + + if a AND not b AND not c then + 'nothing + else + warnlog "the first option isn't checked" + endif + sleep(1) + call hCloseDocument +endcase + +'-------------------------------------------------------------------- + +testcase tGroupBoxWithoutDatasource + + '/// open a textdocument + printlog "open a textdocument" + + call hNewDocument + sleep(1) + + call hToolbarSelect("MoreControls",true) + + Kontext "MoreControls" + '/// insert a groupbox (the wizard appears) + printlog "insert a groupbox (the wizard appears)" + Groupbox.Click + call hDrawingWithSelection ( 50, 20, 60, 30 ) + sleep(2) + Dim i as integer + Kontext "AutopilotGroupElement" + AutopilotGroupElement.MouseDown (10,10) + AutopilotGroupElement.MouseUp (10,10) + sleep (1) + if AutopilotGroupElement.Exists(3) then + printlog " - Autopilot group element: Page 1/4" + '/// insert 6 diffent options + printlog "insert 6 diffent options" + Kontext "TabGroupBoxData" + for i = 1 to 6 + Names.Settext "Option field " + i + if AddTo.IsEnabled then + AddTo.Click + else + warnlog "Entry couldn't be overtaken in first window of the group box autopilot!" + AutopilotGroupElement.Cancel + end if + next + Kontext "AutopilotGroupElement" + if NextButton.IsEnabled then + NextButton.Click + else + warnlog "In first window the 'Next'-button is disabled!" + AutopilotGroupElement.Cancel + end if + sleep(3) + printlog " - Autopilot group box: Page 2/4" + Kontext "TabDefaultFieldSelection" + sleep (1) + '/// set Option Field 3 as default selection + printlog "set Option Field 3 as default selection" + YesFollowing.Check + Selection.Select "Option field 3" + Kontext "AutopilotGroupElement" + if NextButton.IsEnabled then + NextButton.Click + else + warnlog "In second window the 'Next'-button is disabled!!" + AutopilotGroupElement.Cancel + end if + sleep(3) + printlog " - Autopilot group box: Page 3/4" + Kontext "TabDatabaseValues" + dim iCountOptionFields + iCountOptionFields = OptionFields.getitemCount + if iCountOptionFields <> 6 then + warnlog "there are not 6 options." + AutopilotGroupElement.Cancel + goto endsub + end if + '/// set some new reference for the options fields + printlog "set some new reference for the options fields" + OptionFields.select 1 + WhichValue.setText "a" + OptionFields.select 2 + WhichValue.setText "b" + OptionFields.select 3 + WhichValue.setText "c" + OptionFields.select 4 + WhichValue.setText "d" + OptionFields.select 5 + WhichValue.setText "e" + OptionFields.select 6 + WhichValue.setText "f" + + Kontext "AutopilotGroupElement" + if NextButton.IsEnabled then + NextButton.Click + else + warnlog "In third window the 'Next'-button is disabled!" + AutopilotGroupElement.Cancel + end if + sleep(3) + + printlog " - Autopilot group box: Page 4/4" + '/// change the goup name to Group 123 + printlog "change the goup name to Group 123" + Kontext "TabCreateOptionGroup" + GroupCaption.setText "Group 123" + Kontext "AutopilotGroupElement" + if CreateButton.IsEnabled then + CreateButton.Click + else + warnlog "In fourth window the 'Create'-button is disabled!" + AutopilotGroupElement.Cancel + end if + else + warnlog "- Autopilot for Group Box didn't appear!" + end if + sleep(2) + + '/// save the document + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_AP_GroupBox2.odt")) + hCloseDocument + sleep(1) + + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_AP_GroupBox2.odt")) + + call hToolbarSelect("FormControls",true) + + sleep(1) + Kontext "FormControls" + SwitchControlDesignMode.Click + sleep(1) + + call hToolbarSelect("FormDesignTools",true) + Kontext "FormDesignTools" + ShowFmExplorer.Click + sleep(1) + Kontext "FormularNavigator" + Liste.TypeKeys "<HOME>" + Liste.TypeKeys "<DOWN>" + Liste.TypeKeys "<DOWN>" + sleep (2) + Liste.OpenContextmenu + sleep(1) + try + hMenuSelectNr (5) + catch + printlog "Control property browser already open." + endcatch + sleep (2) + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.SetPage TabGeneralControl + sleep (2) + Kontext "TabGeneralControl" + if Label.getText() <> "Group 123" then + warnlog "The label of the groupbox is not right." + getClipboard + end if + sleep (2) + Kontext "FormularNavigator" + Liste.TypeKeys "<DOWN>" + sleep (2) + + if fgetControlproperty("RadioButton","DefaultState") <> "1" then + warnlog "The default state is set to not selected" + end if + + sleep 1 + Kontext "FormularNavigator" + Liste.TypeKeys "<DOWN>" + Liste.TypeKeys "<DOWN>" + sleep (2) + + if fgetControlproperty("RadioButton","DefaultState") <> "2" then + warnlog "The default state is set to not selected" + end if + + if fgetControlproperty("RadioButton","ReferenceValue") <> "c" then + warnlog "The reference value is not right, it have to be c but it is " + ReferenceValue.getText + end if + sleep(2) + call hCloseDocument +endcase + +'-------------------------------------------------------------------- + +testcase tListBox + + Dim j as integer + Dim k as integer + dim i as integer + printlog "- Formular toolbox: List box element (" & gApplication & ")" + '/// open a text, insert a listbox (the wizard appears) + call hNewDocument + sleep(1) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + Listbox.Click + call hDrawingWithSelection ( 50, 20, 60, 25 ) + sleep(3) + Kontext "AutoPilotListComboBox" + AutoPilotListComboBox.MouseDown(10,10) + AutoPilotListComboBox.MouseUp(10,10) + + if AutoPilotListComboBox.Exists(1) then + printlog " - Autopilot List/Combo Box: Page 1/4" + Kontext "TabListBoxData" + '/// choose database TT & click next + DataSource.Select(sDSName) + Kontext "LoginDialog" + if LoginDialog.Exists(3) then + printlog "login dialog" + LoginPassword.SetText "testtool" + LoginDialog.OK + sleep 1 + end if + '/// choose table TPCoA-1 & click next + Kontext "TabListBoxData" + Table.Select("TT_Control") + sleep(1) + Kontext "AutopilotListComboBox" + if NextButton.IsEnabled then + NextButton.Click + else + warnlog "In first window the 'Next'-button is disabled!" + AutopilotListComboBox.Cancel + end if + sleep(1) + printlog " - Autopilot List/Combo Box: Page 2/4" + Kontext "TabTableSelection" + TableSelection.Select("TT_Control") + sleep(1) + Kontext "AutopilotListComboBox" + if NextButton.IsEnabled then + NextButton.Click + else + warnlog "In second window the 'Next'-button is disabled!!" + AutopilotListComboBox.Cancel + goto endsub + end if + sleep(1) + printlog " - Autopilot List/Combo Box: Page 3/4" + Kontext "TabFieldSelection" + '/// choose InfoColor as displayed field & click next + ExistingFields.Select("InfoColor") + sleep(3) + Kontext "AutopilotListComboBox" + if NextButton.IsEnabled then + NextButton.Click + else + warnlog "In third window the 'Next'-button is disabled!" + AutopilotListComboBox.Cancel + end if + sleep(1) + printlog " - Autopilot List/Combo Box: Page 4/4" + Kontext "TabFieldLink" + '/// take Colors as value field, ID as list field & click create + ValueTable.Select("Colors") + sleep(1) + ListTable.Select("ID") + sleep(1) + Kontext "AutopilotListComboBox" + if CreateButton.IsEnabled then + CreateButton.Click + else + warnlog "In fourth window the 'Create'-button is disabled!" + AutopilotListComboBox.Cancel + end if + else + warnlog "The Autopilot doesn't start!" + end if + sleep(1) + + Kontext "FormControls" + ControlProperties.Click + sleep(1) + '/// check if the list box is in dropdown style + if fGetControlProperty("ListBox","DropDown") <> "2" then + warnlog "The dropdown style is not active." + endif + sleep(1) + fSetControlProperty("ListBox","HelpURL","customcontrol1") + sleep(1) + '/// save the document + printlog "save the document" + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_AP_ListBox.odt")) + hCloseDocument + sleep(1) + '/// reload the document + printlog "reload the document" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_AP_ListBox.odt")) + + '/// open the listbox, and ccheck the list entries + Kontext "MSC_Special_Dialog" + dim ii as integer + ii = MSC_Special_Dialog.GetItemCount + dim stext as string + for i = 1 to ii + MSC_Special_Dialog.Select (i) + wait 500 + sText = MSC_Special_Dialog.GetSelText + select case i + case 1 + if sText <> "" then + warnlog "The 1. entry is not empty" + endif + case 2 + if sText <> "red = 1" then + warnlog "The 2. entry is not red = 1" + endif + case 3 + if sText <> "green = 2" then + warnlog "The 3. entry is not green = 2" + endif + case 4 + if sText <> "blue = 3" then + warnlog "The 4. entry is not blue = 3" + endif + end select + next + sleep 1 + hCloseDocument + +endcase + +'-------------------------------------------------------------------- + +testcase tComboBox + + Dim k as integer + printlog "- Formular toolbox: List box element (" & gApplication & ")" + '/// open new text document + call hNewDocument + sleep(1) + + call hToolbarSelect("FormControls",true) + + '/// insert a new combo box + Kontext "FormControls" + Combobox.Click + call hDrawingWithSelection ( 50, 20, 60, 30 ) + sleep(10) + + Kontext "AutoPilotListComboBox" + AutoPilotListComboBox.MouseDown (10,10) + AutoPilotListComboBox.MouseUp (10,10) + if AutoPilotListComboBox.Exists(3) then + printlog " - Autopilot List/Combo Box: Page 1/4" + Kontext "TabListBoxData" + DataSource.Select(sDSName) + Table.Select("TT_Control") + Kontext "AutopilotListComboBox" + if NextButton.IsEnabled then + NextButton.Click + else + warnlog "In first window the 'Next'-button is disabled!" + AutopilotListComboBox.Cancel + goto endsub + end if + sleep(3) + printlog " - Autopilot List/Combo Box: Page 2/4" + Kontext "TabTableSelection" + TableSelection.Select("TT_Control") + sleep(3) + Kontext "AutopilotListComboBox" + if NextButton.IsEnabled then + NextButton.Click + else + warnlog "In second window the 'Next'-button is disabled!!" + AutopilotListComboBox.Cancel + goto endsub + end if + sleep(3) + printlog " - Autopilot List/Combo Box: Page 3/4" + Kontext "TabFieldSelection" + ExistingFields.Select(1) + sleep(3) + Kontext "AutopilotListComboBox" + if NextButton.IsEnabled then + NextButton.Click + else + warnlog "In third window the 'Next'-button is disabled!" + AutopilotListComboBox.Cancel + goto endsub + end if + sleep(3) + printlog " - Autopilot List/Combo Box: Page 4/4" + Kontext "TabDatabaseField" + sleep(3) + Kontext "AutopilotListComboBox" + if CreateButton.IsEnabled then + CreateButton.Click + else + warnlog "In fourth window the 'Create'-button is disabled!" + AutopilotListComboBox.Cancel + goto endsub + end if + else + warnlog "- Autopilot for Combo Box didn't appear!" + end if + sleep(2) + call hCloseDocument + +endcase + +'-------------------------------------------------------------------- + +testcase tTableControl + + printlog "- Formular toolbox: Tablecontrol element (" & gApplication & ")" + '/// open a new textdocument & insert a table control + call hNewDocument + sleep(1) + + call hToolbarSelect("MoreControls",true) + + Kontext "MoreControls" + Grid.Click + call hDrawingWithSelection ( 40, 20, 60, 40 ) + sleep(10) + '/// take as datasource table biblio, mark it & next + '/// select some fields (in both directions) & create + '/// switch off the design view & open the database beamer (TODO) + '/// compare the header & the contents with the table control (TODO) + Dim k as integer + Kontext "AutopilotTableElement" + AutopilotTableElement.MouseDown (10,10) + AutopilotTableElement.MouseUp (10,10) + if AutopilotTableElement.Exists(3) then + printlog " - Autopilot Table Element: Page 1/2" + Kontext "TabListBoxData" + DataSource.Select(sDSName) + sleep (1) + Kontext "LoginDialog" + if LoginDialog.Exists(3) then + printlog "login dialog" + LoginPassword.SetText "testtool" + LoginDialog.OK + sleep (1) + end if + sleep (1) + Kontext "TabListBoxData" + Table.Select("TT_Control") + sleep(3) + Kontext "AutopilotTableElement" + if NextButton.IsEnabled then + NextButton.Click + else + warnlog "In first window the 'Next'-button is disabled!" + AutopilotTableElement.Cancel + end if + sleep(1) + printlog " - Autopilot Table Element: Page 2/2" + Kontext "TabTableFieldSelection" + ExistingFields.Select("ID") + AddTo.Click + ExistingFields.Select("Colors") + AddTo.Click + ExistingFields.Select("InfoColor") + AddTo.Click + sleep(1) + Kontext "AutopilotTableElement" + if CreateButton.IsEnabled then + CreateButton.Click + else + warnlog "In fourth window the 'Create'-button is disabled!" + AutopilotTableElement.Cancel + end if + else + warnlog "- Autopilot for Table Element didn't appear!" + end if + sleep(2) + + hCloseDocument + +endcase + +'------------------------------------------------------------------------- + diff --git a/testautomation/dbaccess/optional/includes/db_ADOAccess.inc b/testautomation/dbaccess/optional/includes/db_ADOAccess.inc new file mode 100644 index 000000000000..aeb14d7616ac --- /dev/null +++ b/testautomation/dbaccess/optional/includes/db_ADOAccess.inc @@ -0,0 +1,175 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Create ADO Access DS & Table & fill in Test +'* +'\*********************************************************************** +testcase db_ADOAccess + + if gtSYSName = "Mac OS X" or gtSYSName = "Solaris SPARC" or gtSYSName = "Solaris x86" or gtSYSName = "Linux" then + printlog "This is an ADO test and works only on Windosen" + printlog "You have a: " + gtSYSName + " OS - Test Stopped !" + else + + ' ********************************************************************* + ' databases specific settings for ADO Access OLEDB 4.0 on Windosen + ' ********************************************************************* + + Dim i_fieldcount as integer 'amount of field types - columns + i_fieldcount = 16 + + Dim ifieldrow_amount as integer 'amount of inserted rows + ifieldrow_amount = 3 + + Dim sFileName as string + sFileName = gOfficePath + ConvertPath("user/work/TT_Ado_Access.odb") + + Dim sDBURL as string + sDBURL = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" + + Dim sTableName as string + sTableName = "tt_test_create-table" + + Dim sPWD as string + sPWD = "ignore" + + dim sCatalog as string + sCatalog = " " ' not used in this ds + + dim sSchema as string + sSchema = " " ' not used in this ds + + dim sRelTable1 as string 'for relation test (tRelation1&2) + sRelTable1 = "TT_Rel1" + + dim sRelTable2 as string 'for relation test (tRelation1&2) + sRelTable2 = "TT_Rel2" + + dim sRelTable3 as string 'for relation test (tRelation2) + sRelTable3 = "TT_Rel3" + + + Dim aFields(i_fieldcount,2) as string + + aFields(1,1)="tt_bit" 'name of fieldtype + aFields(1,2)="bit" 'number of fieldtype (listbox entry) + + aFields(2,1)="tt_byte" + aFields(2,2)="byte" + + aFields(3,1)="tt_guid" + aFields(3,2)="guid" + + aFields(4,1)="tt_bigbinary" + aFields(4,2)="bigbinary" + + aFields(5,1)="tt_longbinary" + aFields(5,2)="longbinary" + + aFields(6,1)="tt_varbinary" + aFields(6,2)="varbinary" + + 'SQL Null [ ] is a foult in metadata of driver bug: #108535 in OLEDB 4.0 (number without field -> field does not exist) + + aFields(7,1)="tt_decimal" ' bug #108512 - should work after that + aFields(7,2)="decimal" + + aFields(8,1)="tt_long" + aFields(8,2)="long" + + aFields(9,1)="tt_short" + aFields(9,2)="short" + + aFields(10,1)="tt_single" + aFields(10,2)="single" + + aFields(11,1)="tt_double" + aFields(11,2)="double" + + aFields(12,1)="tt_currency" + aFields(12,2)="currency" + + aFields(13,1)="tt_longtext" + aFields(13,2)="longtext" + + aFields(14,1)="tt_varchar" + aFields(14,2)="varchar" + + aFields(15,1)="tt_datetime" + aFields(15,2)="datetime" + + + Dim aFieldsContent(1,16) as string + + aFieldsContent(1,1)="1" + aFieldsContent(1,2)="<space>" + aFieldsContent(1,3)="1" + aFieldsContent(1,4)="1" + aFieldsContent(1,5)="" + aFieldsContent(1,6)="" + aFieldsContent(1,7)="" + aFieldsContent(1,8)="" + aFieldsContent(1,9)="1" + aFieldsContent(1,10)="1" + aFieldsContent(1,11)="1" + aFieldsContent(1,12)="1" + aFieldsContent(1,13)="1" + aFieldsContent(1,14)="1" + aFieldsContent(1,15)="1" + aFieldsContent(1,16)="1" + + dim dbok as boolean + dbok = false + + ' restart the office to unlock the mdb file. Remember the Quickstarter + printlog "tart the office to unlock the mdb file. Remember the Quickstarter" + ExitRestartTheOffice + + app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/ado_datasource/testdb.mdb"),gOfficePath + ConvertPath("user/work/testdb.mdb") + dbok = fCreateADODatasource( sFileName, sDBURL + gOfficePath + ConvertPath("user/work/testdb.mdb")) + if dbok = true then + + call fOpendatabase(sFileName) + call fCreateTable(aFields(),sTableName) + call fInsertIntoTable( aFieldsContent(), sTableName) + call fDeleteTable(sTableName) + call fCloseDatabase + + call tRelation( sFileName, sPWD, sRelTable1, sRelTable2 ) + call tDoubleRelation( sFileName, sPWD, sRelTable1, sRelTable2, sRelTable3 ) + + call db_Query(sFileName) + + else + warnlog "Data Source could not be created - beyond testcases stopped" + endif + endif + +endcase + diff --git a/testautomation/dbaccess/optional/includes/db_AdabasD.inc b/testautomation/dbaccess/optional/includes/db_AdabasD.inc new file mode 100644 index 000000000000..d5498582fa0a --- /dev/null +++ b/testautomation/dbaccess/optional/includes/db_AdabasD.inc @@ -0,0 +1,156 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Create Adabas DS & Table & fill in Test +'* +'\*********************************************************************** +testcase db_AdabasD + + printlog "------------------ db_AdabasD.inc ---------------------" + + if gPlatform = "x86" then + printlog "No Adabas available under x86." + elseif gOOO then + printlog "No Adabas available under OpenOffice.org." + else + + ' ************************************************** + ' databases specific settings for Adabas D 11.02 + ' ************************************************** + + Dim sFileName as string + sFileName = gOfficePath + "user/work/TT_Adabas.odb" + + Dim sTableName as string + sTableName = "tt_test_table" 'table name lenght restriction + + dim sCatalog as string + sCatalog = " " ' empty for adabas + + dim sSchema as string + sSchema = "TESTTOOL" ' case sensitive ! + + dim sRelTable1 as string 'for relation test (tRelation1&2) + sRelTable1 = "tt_rel1" + + dim sRelTable2 as string 'for relation test (tRelation1&2) + sRelTable2 = "tt_rel2" + + dim sRelTable3 as string 'for relation test (tRelation2) + sRelTable3 = "tt_rel3" + + Dim aFieldTypeContent(17,3) as string 'database specific data matrix + + aFieldTypeContent(1,1)="tt_boolean" 'name of fieldtype + aFieldTypeContent(1,2)="boolean" 'number of fieldtype (listbox entry) + + aFieldTypeContent(2,1)="tt_long_byte" + aFieldTypeContent(2,2)="long byte" + + aFieldTypeContent(3,1)="tt_varchar_byte" + aFieldTypeContent(3,2)="varchar() byte" + + aFieldTypeContent(4,1)="tt_char_byte" + aFieldTypeContent(4,2)="char() byte" + + aFieldTypeContent(5,1)="tt_long" ' does not work #69846 + aFieldTypeContent(5,2)="long" + + aFieldTypeContent(6,1)="tt_char" + aFieldTypeContent(6,2)="char" + + aFieldTypeContent(7,1)="tt_decimal" ' will probably work after #108512 is fixed + aFieldTypeContent(7,2)="decimal" + + aFieldTypeContent(8,1)="tt_fixed" ' will probably work after #108512 is fixed + aFieldTypeContent(8,2)="fixed" + + aFieldTypeContent(9,1)="tt_integer" + aFieldTypeContent(9,2)="integer" + + aFieldTypeContent(10,1)="tt_smallint" + aFieldTypeContent(10,2)="smallint" + + aFieldTypeContent(11,1)="tt_float" + aFieldTypeContent(11,2)="float" + + aFieldTypeContent(12,1)="tt_real" + aFieldTypeContent(12,2)="real" + + aFieldTypeContent(13,1)="tt_double_precision" + aFieldTypeContent(13,2)="double precision" + + aFieldTypeContent(14,1)="tt_varchar" + aFieldTypeContent(14,2)="varchar" + + aFieldTypeContent(15,1)="tt_date" + aFieldTypeContent(15,2)="date" + + aFieldTypeContent(16,1)="tt_time" + aFieldTypeContent(16,2)="time" + + aFieldTypeContent(17,1)="tt_timestamp" + aFieldTypeContent(17,2)="timestamp" + + Dim aFieldContent(1,4) as string + aFieldContent(1,1)="<Space>" + aFieldContent(1,2)="1" + aFieldContent(1,3)="1" + aFieldContent(1,4)="1" + + dim dbok as boolean + dbok = false + + dim aDatabaseProperties(5) as string + aDatabaseProperties() = tools_dbtools_fgetAdabasDatabaseProperties() + + ' if and only if no properties are defined in the environment file the test is stopped + if(aDatabaseProperties(1) = "no") then + qaerrorlog "No database properties from Adabas defiened. The Test is stopped here." + goto endsub + endif + + dbok = fCreateAdabasDatasource( sFileName, aDatabaseProperties(2), aDatabaseProperties(3), aDatabaseProperties(4)) + + if dbok = true then + call fOpenDatabase(sFileName,"testtool") + call fDeleteTable( sTableName ) + call fCreateTable( aFieldTypeContent(), sTableName ) + call fInsertIntoTable( aFieldContent(), sTableName ) + call fCloseDatabase + + call tRelation( sFileName, sRelTable1, sRelTable2 ) + call tDoubleRelation( sFileName, aDatabaseProperties(5), sRelTable1, sRelTable2, sRelTable3 ) + call db_Query(sFileName,"adabas",aDatabaseProperties(5)) + + else + warnlog "Data Source could not be created - beyond testcases stopped" + endif + endif +endcase diff --git a/testautomation/dbaccess/optional/includes/db_Dbase.inc b/testautomation/dbaccess/optional/includes/db_Dbase.inc new file mode 100644 index 000000000000..7b5a67e7496d --- /dev/null +++ b/testautomation/dbaccess/optional/includes/db_Dbase.inc @@ -0,0 +1,118 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Create dBase DS & Table & fill in Test +'* +'\*********************************************************************** +testcase db_Dbase + + ' ********************************************************************* + ' databases specific settings for dBase + ' ********************************************************************* + + Dim i_fieldcount as integer 'amount of field types - columns + i_fieldcount = 7 'amount of field types (no primary key supported in dBase) normally: 7 + + Dim ifieldrow_amount as integer 'amount of inserted rows + ifieldrow_amount = 3 + + Dim sFileName as string + sFileName = gOfficePath + ConvertPath("user/work/tt_dbase-01.odb") + + Dim sDBURL as string + sDBURL = "user/work" + + Dim sTableName as string + sTableName = "tt_test_create-table" + + Dim sPWD as string + sPWD = "ignore" + + Dim sCatalog as string + sCatalog = " " ' not used in this ds + + Dim sSchema as string + sSchema = " " ' not used in this ds + + + Dim aFieldTypeContent(i_fieldcount,2) as string 'database specific data matrix + + aFieldTypeContent(1,1)="tt_boolean" 'name of fieldtype + aFieldTypeContent(1,2)="boolean" 'number of fieldtype (listbox entry) + + aFieldTypeContent(2,1)="tt_longvar" + aFieldTypeContent(2,2)="longvarchar" + + aFieldTypeContent(3,1)="tt_char" + aFieldTypeContent(3,2)="char" + + aFieldTypeContent(4,1)="tt_decimal" + aFieldTypeContent(4,2)="decimal" + + aFieldTypeContent(5,1)="tt_varchar" + aFieldTypeContent(5,2)="varchar" + + aFieldTypeContent(6,1)="tt_date" + aFieldTypeContent(6,2)="date" + + Dim aFieldContent(1,6) as string 'database specific data matrix + + aFieldContent(1,1)="<space>" + aFieldContent(1,2)="this is a memo field" + aFieldContent(1,3)="char" + aFieldContent(1,4)="1" + aFieldContent(1,5)="this is a text field" + aFieldContent(1,6)="13.05.2004 " + + dim dbok as boolean + dbok = fCreateDbaseDatasource(sFileName,gOfficePath + ConvertPath("user/work"),"TT_dBase") + if dbok = true then + + 'needed for: tQuery testcase - query file is copied in the work directory + ' the files need to be copy before the datasource is open + app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/dbase_datasource/TT_Forms.dbf"),gOfficePath + ConvertPath("user/work/TT_Forms.dbf") + app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/dbase_datasource/TT_Query1.dbf"),gOfficePath + ConvertPath("user/work/TT_Query1.dbf") + app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/dbase_datasource/TT_Query1.dbt"),gOfficePath + ConvertPath("user/work/TT_Query1.dbt") + + call fOpendatabase(sFileName) + call fCreateTable( aFieldTypeContent(), sTableName) + call fInsertIntoTable( aFieldContent(), sTableName) + call fCloseDatabase + + call db_Query(sFileName,"dbase") + + use "dbaccess/optional/includes/db_IndexDesign.inc" + call tIndex(sFileName, sTableName) + + else + warnlog "Data Source could not be created - beyond testcases stopped" + endif + +endcase + diff --git a/testautomation/dbaccess/optional/includes/db_DbaseFunction.inc b/testautomation/dbaccess/optional/includes/db_DbaseFunction.inc new file mode 100644 index 000000000000..6d690a29225a --- /dev/null +++ b/testautomation/dbaccess/optional/includes/db_DbaseFunction.inc @@ -0,0 +1,886 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Dbase function test +'* +'\*********************************************************************** +global gFileName as string +sub db_DbaseFunction(sfilename as string) + +'/// this test need a datasource TT1 and the table TT_Func1 from dbaccess/optional/input/dbase_datasource/TT_Func1.dbf +'/// see http://dba.openoffice.org/specifications/file_based_functions.html for details for each function + + gFileName = sfilename + + call tLOWER() + call tLCASE() + call tUPPER() + call tUCASE() + call tASCII() + call tLENGTH() + call tOCTET_LENGTH() + call tCHAR_LENGTH() + call tCHARACTER_LENGTH() + call tCHAR() + call tCONCAT() + call tLOCATE() + call tSUBSTRING1() + call tSUBSTRING2() + call tSUBSTRING3() + call tLTRIM() + call tRTRIM() + call tSPACE() + call tREPLACE() + call tREPEAT() + call tINSERT() + call tLEFT() + call tRIGHT() +'------------------------------------------------------------------------- +'Numeric fucntions +'------------------------------------------------------------------------- + call tABS() + call tSIGN() + call tMOD() + call tFLOOR() + call tCEILING() + call tROUND1() + call tROUND2() + call tEXP() + call tLN() + call tLOG1() + call tLOG2() + call tLOG10() + call tPOWER() + call tSQRT() + call tPI() + call tCOS() + call tSIN() + call tTAN() + call tACOS() + call tASIN() + call tATAN() + call tATAN2() + call tDEGREES() + call tRADIANS() +'------------------------------------------------------------------------- +'Date / Time fucntions +'------------------------------------------------------------------------- + call tDAYOFWEEK() + call tDAYOFMONTH() + call tDAYOFYEAR() + call tMONTH() + call tDAYNAME() + call tMONTHNAME() + call tQUARTER() + call tWEEK() + call tWEEK2() + call tYEAR() + call tHOUR() + call tMINUTE() + call tSECOND() + call tCURDATE() + call tCURTIME() + call tNOW() + +end sub +'------------------------------------------------------------------------- +testcase tLOWER() + + sInit(gFileName,"TT_Func1") + sSet("LOWER(f_text)") + if fExcecute then + sCheckValue("text") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tLCASE() + + sInit(gFileName,"TT_Func1") + sSet("LCASE(f_text)") + if fExcecute then + sCheckValue("text") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tUPPER() + + sInit(gFileName,"TT_Func1") + sSet("UPPER(f_text)") + if fExcecute then + sCheckValue("TEXT") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tUCASE() + + sInit(gFileName,"TT_Func1") + sSet("UCASE(f_text)") + if fExcecute then + sCheckValue("TEXT") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tASCII() + + sInit(gFileName,"TT_Func1") + sSet("ASCII(f_text)") + if fExcecute then + sCheckValue("116") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tLENGTH() + + sInit(gFileName,"TT_Func1") + sSet("LENGTH(f_text)") + if fExcecute then + sCheckValue("4") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tOCTET_LENGTH() + + sInit(gFileName,"TT_Func1") + sSet("OCTET_LENGTH(f_text)") + if fExcecute then + sCheckValue("4") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tCHAR_LENGTH() + + sInit(gFileName,"TT_Func1") + sSet("CHAR_LENGTH(f_text)") + if fExcecute then + sCheckValue("4") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tCHARACTER_LENGTH() + + sInit(gFileName,"TT_Func1") + sSet("CHARACTER_LENGTH(f_text)") + if fExcecute then + sCheckValue("4") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tCHAR() + + sInit(gFileName,"TT_Func1") + sSet("CHAR(120,121)") ' xy + if fExcecute then + sCheckValue("xy") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tCONCAT() + + sInit(gFileName,"TT_Func1") + sSet("CONCAT(f_text,f_text)") + if fExcecute then + sCheckValue("texttext") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tLOCATE() + + sInit(gFileName,"TT_Func1") + sSet("LOCATE('ex',f_text)") + if fExcecute then + sCheckValue("2") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tSUBSTRING1() + + sInit(gFileName,"TT_Func1") + sSet("SUBSTRING(f_text,2)") + if fExcecute then + sCheckValue("ext") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tSUBSTRING2() + + sInit(gFileName,"TT_Func1") + sSet("SUBSTRING(f_text,2,2)") + if fExcecute then + sCheckValue("ex") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tSUBSTRING3() + + sInit(gFileName,"TT_Func1") + sSet("SUBSTRING(f_text FROM 2 FOR 2)") + if fExcecute then + sCheckValue("ex") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tLTRIM() + + sInit(gFileName,"TT_Func1") + sSet("LTRIM(' text ')") + if fExcecute then + sCheckValue("text ") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tRTRIM() + + sInit(gFileName,"TT_Func1") + sSet("RTRIM(' text ')") + if fExcecute then + sCheckValue(" text") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tSPACE() + + sInit(gFileName,"TT_Func1") + sSet("SPACE(5)") + if fExcecute then + sCheckValue(" ") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tREPLACE() + + sInit(gFileName,"TT_Func1") + sSet("REPLACE(f_text,'ex','xe')") + if fExcecute then + sCheckValue("txet") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tREPEAT() + + sInit(gFileName,"TT_Func1") + sSet("REPEAT(f_text,5)") + if fExcecute then + sCheckValue("texttexttexttexttext") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tINSERT() + + sInit(gFileName,"TT_Func1") + sSet("INSERT(f_text,2,2,'tt')") + if fExcecute then + sCheckValue("tttt") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tLEFT() + + sInit(gFileName,"TT_Func1") + sSet("LEFT(f_text,2)") + if fExcecute then + sCheckValue("te") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tRIGHT() + + sInit(gFileName,"TT_Func1") + sSet("RIGHT(f_text,2)") + if fExcecute then + sCheckValue("xt") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +'Numeric fucntions +'------------------------------------------------------------------------- +testcase tABS() + + sInit(gFileName,"TT_Func1") + sSet("ABS('1,6')") + if fExcecute then + sCheckValue("1") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tSIGN() + + sInit(gFileName,"TT_Func1") + sSet("SIGN('-2')") + if fExcecute then + sCheckValue("-1") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tMOD() + + sInit(gFileName,"TT_Func1") + sSet("MOD(1,0)") + if fExcecute then + 'sCheckValue("1.#NAN") ' this doens't work because sometimes the result is + '1.#NAN and sometimes it is -1.#NAN. This have to be investigate in the future. + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tFLOOR() + + sInit(gFileName,"TT_Func1") + sSet("FLOOR(1.789)") + if fExcecute then + sCheckValue("1") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tCEILING() + + sInit(gFileName,"TT_Func1") + sSet("CEILING(1.789)") + if fExcecute then + sCheckValue("2") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tROUND1() + + sInit(gFileName,"TT_Func1") + sSet("ROUND(1.789)") + if fExcecute then + sCheckValue("2") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tROUND2() + + sInit(gFileName,"TT_Func1") + sSet("ROUND(1.789,1)") + if fExcecute then + sCheckValue("1.8") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tEXP() + + sInit(gFileName,"TT_Func1") + sSet("EXP(1)") + if fExcecute then + sCheckValue("2.72") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tLN() + + sInit(gFileName,"TT_Func1") + sSet("LN(1)") + if fExcecute then + sCheckValue("0") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tLOG1() + + sInit(gFileName,"TT_Func1") + sSet("LOG(1)") + if fExcecute then + sCheckValue("0") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tLOG2() + + sInit(gFileName,"TT_Func1") + sSet("LOG(2,3)") + if fExcecute then + sCheckValue("0.63") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tLOG10() + + sInit(gFileName,"TT_Func1") + sSet("LOG10(1)") + if fExcecute then + sCheckValue("0") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tPOWER() + + sInit(gFileName,"TT_Func1") + sSet("POWER(2,3)") + if fExcecute then + sCheckValue("8") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tSQRT() + + sInit(gFileName,"TT_Func1") + sSet("SQRT(2)") + if fExcecute then + sCheckValue("1.41") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tPI() + + sInit(gFileName,"TT_Func1") + sSet("PI()") + if fExcecute then + sCheckValue("3.14") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tCOS() + + sInit(gFileName,"TT_Func1") + sSet("COS(2)") + if fExcecute then + sCheckValue("-0.42") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tSIN() + + sInit(gFileName,"TT_Func1") + sSet("SIN(2)") + if fExcecute then + sCheckValue("0.91") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tTAN() + + sInit(gFileName,"TT_Func1") + sSet("TAN(2)") + if fExcecute then + sCheckValue("-2.19") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tACOS() + + sInit(gFileName,"TT_Func1") + sSet("ACOS(0.2)") + if fExcecute then + sCheckValue("1.37") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tASIN() + + sInit(gFileName,"TT_Func1") + sSet("ASIN(0.2)") + if fExcecute then + sCheckValue("0.2") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tATAN() + + sInit(gFileName,"TT_Func1") + sSet("ATAN(2)") + if fExcecute then + sCheckValue("1.11") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tATAN2() + + sInit(gFileName,"TT_Func1") + sSet("ATAN2(2,2)") + if fExcecute then + sCheckValue("0.79") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tDEGREES() + + sInit(gFileName,"TT_Func1") + sSet("DEGREES(2)") + if fExcecute then + sCheckValue("114.59") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tRADIANS() + + sInit(gFileName,"TT_Func1") + sSet("RADIANS(2)") + if fExcecute then + sCheckValue("0.03") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +'Date / Time fucntions +'------------------------------------------------------------------------- +testcase tDAYOFWEEK() + + sInit(gFileName,"TT_Func1") + sSet("DAYOFWEEK('2003-10-13')") + if fExcecute then + sCheckValue("2") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tDAYOFMONTH() + + sInit(gFileName,"TT_Func1") + sSet("DAYOFMONTH('2003-10-13')") + if fExcecute then + sCheckValue("13") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tDAYOFYEAR() + + sInit(gFileName,"TT_Func1") + sSet("DAYOFYEAR('2003-10-13')") + if fExcecute then + sCheckValue("286") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tMONTH() + + sInit(gFileName,"TT_Func1") + sSet("MONTH('2003-10-13')") + if fExcecute then + sCheckValue("10") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tDAYNAME() + + sInit(gFileName,"TT_Func1") + sSet("DAYNAME('2003-10-13')") + if fExcecute then + sCheckValue("Monday") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tMONTHNAME() + + sInit(gFileName,"TT_Func1") + sSet("MONTHNAME('2003-10-13')") + if fExcecute then + sCheckValue("October") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tQUARTER() + + sInit(gFileName,"TT_Func1") + sSet("QUARTER('2003-10-13')") + if fExcecute then + sCheckValue("4") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tWEEK() + + sInit(gFileName,"TT_Func1") + sSet("WEEK('2003-10-13')") + if fExcecute then + sCheckValue("42") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tWEEK2() + + sInit(gFileName,"TT_Func1") + sSet("WEEK('2003-10-13',1)") + if fExcecute then + sCheckValue("41") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tYEAR() + + sInit(gFileName,"TT_Func1") + sSet("YEAR('2003-10-13')") + if fExcecute then + sCheckValue("2003") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tHOUR() + + sInit(gFileName,"TT_Func1") + sSet("HOUR('12:14:25')") + if fExcecute then + sCheckValue("12") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tMINUTE() + + sInit(gFileName,"TT_Func1") + sSet("MINUTE('12:14:25')") + if fExcecute then + sCheckValue("14") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tSECOND() + + sInit(gFileName,"TT_Func1") + sSet("SECOND('12:14:25')") + if fExcecute then + sCheckValue("25") + endif + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tCURDATE() + + sInit(gFileName,"TT_Func1") + sSet("CURDATE()") + fExcecute + 'the value can't be checked + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tCURTIME() + + sInit(gFileName,"TT_Func1") + sSet("CURTIME()") + fExcecute + 'the value can't be checked + sDeInit() + +endcase +'------------------------------------------------------------------------- +testcase tNOW() + + sInit(gFileName,"TT_Func1") + sSet("NOW()") + fExcecute + 'the value can't be checked + sDeInit() + +endcase +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +'-----------P R I V A T E F U N C T I O N S---------------------------- +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +sub sSet( sString ) + Kontext "QueryDesignCriterion" + '/// set value for the field + printlog "set " + sString + " for the field" + Field.setText(sString) + sleep(1) +end sub +'------------------------------------------------------------------------- +function fExcecute + + Dim bOK as boolean + bOK = true + Kontext "Toolbar" + '/// Execute the query + printlog "Execute the query" + ExecuteBtn.Click + sleep(3) + Kontext "MessageBox" + if MessageBox.exists(3) then + warnlog "error message when executing query" + MessageBox.OK + bOK = false + endif + Kontext "TableView" + if NOT AllRecords.Exists(3) then + warnlog "Execution of a query failed!" + bOK = false + endif + fExcecute = bOK +end function +'------------------------------------------------------------------------- +sub sInit( gFileName, sTableName ) + + call fOpenDatabase(gFileName) + + call fOpenNewQueryDesign + + call fChooseTableInAddTableDialog(sTableName) + +end sub +'------------------------------------------------------------------------- +sub sDeInit + + call fCloseQueryDesign + call fCloseDatabase + +end sub +'------------------------------------------------------------------------- +sub sCheckValue(sValue) + Dim sClipboard as string + Dim i as integer + '/// check if the value is right + printlog "check if the value is " + sValue + Kontext "TableView" + if AllRecords.Exists(3) then + Kontext "TableView" + TableView.TypeKeys "<HOME>" , true + wait(100) + TableView.TypeKeys "<SHIFT END>" , true + wait(100) + TableView.TypeKeys "<MOD1 C>" , true + wait(100) + sClipboard = GetClipboard + i = instr(sClipboard,",") + if i <> 0 then + sClipboard = Left(sClipboard,i -1) + "." + Right(sClipboard,len(sClipboard) - i) + end if + if StrComp (sValue, sClipboard , 1) <> 0 then + warnlog "it should " + sValue + " it is " + GetClipboard + endif + else + warnlog "Execution of a query failed!" + end if +end sub + diff --git a/testautomation/dbaccess/optional/includes/db_IndexDesign.inc b/testautomation/dbaccess/optional/includes/db_IndexDesign.inc new file mode 100644 index 000000000000..a41f2b396042 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/db_IndexDesign.inc @@ -0,0 +1,92 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ + +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : tests for indexes +'* +'\*********************************************************************** + +function tIndex(sFileName as String, sTableName as String) + + printlog sTableName + printlog sFileName + + call fOpendatabase(sFileName) + + call fOpenTableInDesign(sTableName) + + Kontext "TableDesignTable" + TableDesignTable.UseMenu + hMenuSelectNr(4) ' the tools menu + hMenuSelectNr(1) ' the IndexDesign + + Kontext "DatabaseIndexes" + if ( not DatabaseIndexes.exists(3) ) then + warnlog "The index design doesn't exists" + endif + NewIndex.Click + sleep(1) + DatabaseIndexes.TypeKeys("<RETURN>") + IndexFields.select 6 + DatabaseIndexesClose.Click + + Kontext "MessageBox" + MessageBox.Yes + + '/// remove the created index again + + Kontext "TableDesignTable" + TableDesignTable.UseMenu + hMenuSelectNr(4) ' the tools menu + hMenuSelectNr(1) ' the IndexDesign + + Kontext "DatabaseIndexes" + if ( not DatabaseIndexes.exists(3) ) then + warnlog "The index design doesn't exists" + endif + IndexList.select 1 + DropIndex.Click + Kontext "MessageBox" + MessageBox.Yes + sleep(1) + + Kontext "DatabaseIndexes" + DatabaseIndexesClose.Click + + Kontext "MessageBox" + if MessageBox.exists(2) then + MessageBox.Yes + endif + + + call fCloseTableDesign() + + call fCloseDatabase() + +end function diff --git a/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc b/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc new file mode 100644 index 000000000000..cc3be846569c --- /dev/null +++ b/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc @@ -0,0 +1,210 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Create JDBC MySQL DS & Table & fill in Test +'* +'\*********************************************************************** +testcase db_JDBCMySQL + + ' ************************************************** + ' databases specific settings for JDBC MySQL + ' ************************************************** + + dim sDBConfigFile as string + + sDBConfigFile = environ ( "VTT_DB_CONFIG_FILE" ) + + printlog sDBConfigFile + + if (sDBConfigFile = "") then + qaerrorlog "settings for external databases not found. see wiki page. This test ist stopped now" + goto endsub + else + if Dir( sDBConfigFile ) = "" then ' the file does not exists + qaerrorlog "settings for external databases not found. see wiki page. This test ist stopped now" + else + ' file exists , so we can do th next step + endif + + endif + + + + Dim sFileName as string + sFileName = gOfficePath + Convertpath("user/work/TT_JDBC-MYSQL.odb") + + Dim sTableName as string + sTableName = "tt_test_create-table" + + Dim sUser as string + sUser = "testtool" + + Dim sPWD as string + sPWD = "testtool" + + dim sCatalog as string + sCatalog = " " ' not used in this ds + + dim sSchema as string + sSchema = " " ' not used in this ds + + Dim aFieldTypeContent(30,2) as string 'database specific data matrix + + aFieldTypeContent(1,1)="tt_bool" + aFieldTypeContent(1,2)="bool" + + aFieldTypeContent(2,1)="tt_tinyint" + aFieldTypeContent(2,2)="tinyint" + + aFieldTypeContent(3,1)="tt_bigint" + aFieldTypeContent(3,2)="bigint" + + aFieldTypeContent(4,1)="tt_long_varbinary" + aFieldTypeContent(4,2)="long varbinary" + + aFieldTypeContent(5,1)="tt_mediumblob" + aFieldTypeContent(5,2)="mediumblob" + + aFieldTypeContent(6,1)="tt_longblob" + aFieldTypeContent(6,2)="longblob" + + aFieldTypeContent(7,1)="tt_blob" + aFieldTypeContent(7,2)="blob" + + aFieldTypeContent(8,1)="tt_tinyblob" + aFieldTypeContent(8,2)="tinyblob" + + aFieldTypeContent(9,1)="tt_varbinary" + aFieldTypeContent(9,2)="varbinary" + + aFieldTypeContent(10,1)="tt_binary" + aFieldTypeContent(10,2)="binary" + + aFieldTypeContent(11,1)="tt_longvarchar" + aFieldTypeContent(11,2)="long varchar" + + aFieldTypeContent(12,1)="tt_mediumtext" + aFieldTypeContent(12,2)="mediumtext" + + aFieldTypeContent(13,1)="tt_longtext" + aFieldTypeContent(13,2)="longtext" + + aFieldTypeContent(14,1)="tt_text" + aFieldTypeContent(14,2)="text" + + aFieldTypeContent(15,1)="tt_tinytext" + aFieldTypeContent(15,2)="tinytext" + + aFieldTypeContent(16,1)="tt_char" + aFieldTypeContent(16,2)="char" + + aFieldTypeContent(17,1)="tt_numeric" + aFieldTypeContent(17,2)="numeric" + + aFieldTypeContent(18,1)="tt_decimal" + aFieldTypeContent(18,2)="decimal" + + aFieldTypeContent(19,1)="tt_integer" + aFieldTypeContent(19,2)="integer" + + aFieldTypeContent(20,1)="tt_int" + aFieldTypeContent(20,2)="int" + + aFieldTypeContent(21,1)="tt_mediumint" + aFieldTypeContent(21,2)="mediumint" + + aFieldTypeContent(22,1)="tt_smallint" + aFieldTypeContent(22,2)="smallint" + + aFieldTypeContent(23,1)="tt_float" + aFieldTypeContent(23,2)="float" + + aFieldTypeContent(24,1)="tt_varchar" + aFieldTypeContent(24,2)="varchar" + + aFieldTypeContent(25,1)="tt_date" + aFieldTypeContent(25,2)="date" + + aFieldTypeContent(26,1)="tt_time" + aFieldTypeContent(26,2)="time" + + aFieldTypeContent(27,1)="tt_datetime" + aFieldTypeContent(27,2)="datetime" + + aFieldTypeContent(28,1)="tt_timestamp" + aFieldTypeContent(28,2)="timestamp" + + aFieldTypeContent(29,1)="tt_bit" + aFieldTypeContent(29,2)="bit" + + + + Dim aFieldContent(1,6) as string 'database specific data matrix + + aFieldContent(1,1)="1" + aFieldContent(1,2)="<space>" + aFieldContent(1,3)="1" + aFieldContent(1,4)="1" + aFieldContent(1,5)="1" + aFieldContent(1,6)="1" + + dim aDatabaseProperties(7) as string + aDatabaseProperties() = tools_dbtools_fgetMySQLJDBCDatabaseProperties(sDBConfigFile) + + call fSetJDBCDriverFiles(aDatabaseProperties(7)) + 'after changing the classpath the office has to be restarted. + call ExitRestartTheOffice + + dim dbok as boolean + dbok = false + + ' if and only if no properties are defined in the environment file the test is stopped + if(aDatabaseProperties(1) = "no") then + qaerrorlog "No database properties from Mysql defiened. The Test is stopped here." + goto endsub + endif + + dbok = fCreateMySQL_JDBC_Datasource(sFileName,aDatabaseProperties(3),aDatabaseProperties(2),aDatabaseProperties(4),aDatabaseProperties(5)) + if dbok = true then + call fOpendatabase(sFileName,aDatabaseProperties(6)) + call fCreateTable( aFieldTypeContent(), sTableName) + call fInsertIntoTable( aFieldContent(), sTableName) + call fCloseDatabase + + use "dbaccess/optional/includes/db_Query.inc" + call db_Query(sFileName,"MYSQL_JDBC",aDatabaseProperties(6)) + + call tRelation( sFileName, aDatabaseProperties(6), "rel1", "rel2" ) + + else + warnlog "Data Source could not be created - beyond testcases stopped" + endif + +endcase + diff --git a/testautomation/dbaccess/optional/includes/db_Mozilla.inc b/testautomation/dbaccess/optional/includes/db_Mozilla.inc new file mode 100644 index 000000000000..236b6a5e79ed --- /dev/null +++ b/testautomation/dbaccess/optional/includes/db_Mozilla.inc @@ -0,0 +1,154 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Address book mozilla +'* +'\*********************************************************************** +sub db_Mozilla + + if(gPlatform = "osx") then + ' on Mac platform the Mozilla address book is not available + ' so I call only the testcases to satisfied the database + tQueryAddressbook("") + tSortAddressbook("") + else + + ' Information for this test under + ' http://wiki.services.openoffice.org/wiki/Database_Automatic_Testing#Testing_the_mozilla_Address_book + + if fCreateMozillaAddressbookDatasource(gOfficePath + ConvertPath("user/work/TT_Mozilla.odb")) then + + tQueryAddressbook(gOfficePath + ConvertPath("user/work/TT_Mozilla.odb")) + tSortAddressbook(gOfficePath + ConvertPath("user/work/TT_Mozilla.odb")) + else + tQueryAddressbook("") + tSortAddressbook("") + endif + endif + +end sub +'------------------------------------------------------------------------- +testcase tQueryAddressbook( sFileName ) + + if(gPlatform = "osx") then + printlog "mozilla address book not available on Mac" + goto endsub + endif + + if ( not fOpenDatabase(sFileName) ) then + warnlog "Database can't be open" + printlog "May be you find a solution under http://wiki.services.openoffice.org/wiki/Database_Automatic_Testing#Testing_the_mozilla_Address_book" + goto endsub + endif + + fOpenNewQueryDesign + + Kontext "AddTables" + TableName.Select 1 + '/// Add database table to Query. + AddTable.Click + sleep(2) + if AddTables.exists(2) then + CloseDlg.Click ' When the AddTables dialog still exists then close him + endif + sleep(1) + Kontext "QueryDesignCriterion" + Field.Select(1) + sleep(1) + Kontext "Toolbar" + '/// Executing query + printlog "- Executing query" + ExecuteBtn.Click + sleep(5) + Kontext "TableView" + if NOT DataWindow.Exists(3) then + warnlog "Execution of a query failed!" + end if + + call fCloseQueryDesign() + + call fCloseDatabase() + +endcase +'------------------------------------------------------------------------- +testcase tSortAddressbook( sFileName ) + + if(gPlatform = "osx") then + printlog "mozilla address book not available on Mac" + goto endsub + endif + + Dim sRecordCount as String + + '/// open the database file created in the bas file + printlog "open the database file created in the bas file" + + if ( not fOpenDatabase(sFileName) ) then + warnlog "Database can't be open" + goto endsub + endif + + '/// open the first table + printlog "open the first table" + Kontext "ContainerView" + ViewTables + TableTree.select(1) + OpenTable ' uno-Slot .uno:DB/Open + + sleep(2) + + '/// count the records in the table + printlog "count the records in the table" + Kontext "TableView" + LastRecord.Click + sRecordCount = AllRecords.caption() + + '/// sort the table + printlog "sort the table" + Kontext "Toolbar" + SortAscending.Click + sleep(1) + + '/// count the table again and check if there are the same count of records then before sorting + printlog "count the table again and check if there are the same count of records then before sorting" + Kontext "TableView" + LastRecord.Click + if (sRecordCount <> AllRecords.caption() ) then + warnlog "issue i61611 occur. The records are double after sorting." + endif + + '/// close the table + printlog "close the table" + call fCloseTableView() + + '/// close the database + printlog "close the database" + call fCloseDatabase() + +endcase diff --git a/testautomation/dbaccess/optional/includes/db_ODBCMySQL.inc b/testautomation/dbaccess/optional/includes/db_ODBCMySQL.inc new file mode 100644 index 000000000000..0fd0a8bcfb5f --- /dev/null +++ b/testautomation/dbaccess/optional/includes/db_ODBCMySQL.inc @@ -0,0 +1,192 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : ODBC MySQL Test +'* +'\*********************************************************************** + +testcase db_ODBCMySQL + + if gtSYSName = "MAC" or gtSYSName = "Solaris SPARC" or gtSYSName = "Solaris x86" then + printlog "This test does work only under linux and windows yet." + printlog "You have a: " + gtSYSName + " OS - Test Stopped !" + else + + ' ************************************************** + ' databases specific settings for ODBC MySQL + ' ************************************************** + + Dim sFileName as string + sFileName = gOfficePath + Convertpath("user/work/TT_ODBC-MYSQL.odb") + + Dim sTableName as string + sTableName = "tt_test_create-table" + + Dim sUser as string + sUser = "testtool" + + Dim sPWD as string + sPWD = "testtool" + + dim sCatalog as string + sCatalog = " " ' not used in this ds + + dim sSchema as string + sSchema = " " ' not used in this ds + + Dim aFieldTypeContent(30,2) as string 'database specific data matrix + + aFieldTypeContent(1,1)="tt_bool" + aFieldTypeContent(1,2)="bool" + + aFieldTypeContent(2,1)="tt_tinyint" + aFieldTypeContent(2,2)="tinyint" + + aFieldTypeContent(3,1)="tt_bigint" + aFieldTypeContent(3,2)="bigint" + + aFieldTypeContent(4,1)="tt_long_varbinary" + aFieldTypeContent(4,2)="long varbinary" + + aFieldTypeContent(5,1)="tt_mediumblob" + aFieldTypeContent(5,2)="mediumblob" + + aFieldTypeContent(6,1)="tt_longblob" + aFieldTypeContent(6,2)="longblob" + + aFieldTypeContent(7,1)="tt_blob" + aFieldTypeContent(7,2)="blob" + + aFieldTypeContent(8,1)="tt_tinyblob" + aFieldTypeContent(8,2)="tinyblob" + + aFieldTypeContent(9,1)="tt_varbinary" + aFieldTypeContent(9,2)="varbinary" + + aFieldTypeContent(10,1)="tt_binary" + aFieldTypeContent(10,2)="binary" + + aFieldTypeContent(11,1)="tt_longvarchar" + aFieldTypeContent(11,2)="long varchar" + + aFieldTypeContent(12,1)="tt_mediumtext" + aFieldTypeContent(12,2)="mediumtext" + + aFieldTypeContent(13,1)="tt_longtext" + aFieldTypeContent(13,2)="longtext" + + aFieldTypeContent(14,1)="tt_text" + aFieldTypeContent(14,2)="text" + + aFieldTypeContent(15,1)="tt_tinytext" + aFieldTypeContent(15,2)="tinytext" + + aFieldTypeContent(16,1)="tt_char" + aFieldTypeContent(16,2)="char" + + aFieldTypeContent(17,1)="tt_numeric" + aFieldTypeContent(17,2)="numeric" + + aFieldTypeContent(18,1)="tt_decimal" + aFieldTypeContent(18,2)="decimal" + + aFieldTypeContent(19,1)="tt_integer" + aFieldTypeContent(19,2)="integer" + + aFieldTypeContent(20,1)="tt_int" + aFieldTypeContent(20,2)="int" + + aFieldTypeContent(21,1)="tt_mediumint" + aFieldTypeContent(21,2)="mediumint" + + aFieldTypeContent(22,1)="tt_smallint" + aFieldTypeContent(22,2)="smallint" + + aFieldTypeContent(23,1)="tt_float" + aFieldTypeContent(23,2)="float" + + aFieldTypeContent(24,1)="tt_varchar" + aFieldTypeContent(24,2)="varchar" + + aFieldTypeContent(25,1)="tt_date" + aFieldTypeContent(25,2)="date" + + aFieldTypeContent(26,1)="tt_time" + aFieldTypeContent(26,2)="time" + + aFieldTypeContent(27,1)="tt_datetime" + aFieldTypeContent(27,2)="datetime" + + aFieldTypeContent(28,1)="tt_timestamp" + aFieldTypeContent(28,2)="timestamp" + + aFieldTypeContent(29,1)="tt_bit" + aFieldTypeContent(29,2)="bit" + + + + Dim aFieldContent(1,6) as string 'database specific data matrix + + aFieldContent(1,1)="1" + aFieldContent(1,2)="<space>" + aFieldContent(1,3)="1" + aFieldContent(1,4)="1" + aFieldContent(1,5)="1" + aFieldContent(1,6)="1" + + dim dbok as boolean + dbok = false + + dim aDatabaseProperties(5) as string + aDatabaseProperties() = tools_dbtools_fgetMySQLODBCDatabaseProperties() + + ' if and only if no properties are defined in the environment file the test is stopped + if(aDatabaseProperties(1) = "no") then + qaerrorlog "No database properties from Mysql defiened. The Test is stopped here." + goto endsub + endif + + dbok = fCreateMySQL_ODBC_Datasource(sFileName,aDatabaseProperties(2),aDatabaseProperties(3)) + + if dbok = true then + + call fOpendatabase(sFileName,aDatabaseProperties(4)) + call fCreateTable( aFieldTypeContent(), sTableName) + call fInsertIntoTable( aFieldContent(), sTableName) + call fCloseDatabase + + 'use "dbaccess/optional/includes/b_lvl1_Query.inc" + 'call b_lvl1_Query(sFileName,"dbase") + + else + warnlog "Data Source could not be created - beyond testcases stopped" + endif + endif +endcase + diff --git a/testautomation/dbaccess/optional/includes/db_Query.inc b/testautomation/dbaccess/optional/includes/db_Query.inc new file mode 100644 index 000000000000..b9d88142698f --- /dev/null +++ b/testautomation/dbaccess/optional/includes/db_Query.inc @@ -0,0 +1,1021 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Query Test Library +'* +'\*********************************************************************** +'TODO: testcase for distinct values +function db_Query( sFileName , optional sType , optional sPassword) + + if isMissing (sType) then + sType = "1" + else + printlog sType + sType = UCase(sType) + printlog sType + select case sType + case "TEXT", "CALC" + sType = "1" + case "ODBC", "JDBC" + sType = "2" + case "HSQLDB" + sType = "2" + case "MYSQL_JDBC" + sType = "3" + case else + sType = "1" + end select + endif + + call tQueryCriterion( sFileName , sType , sPassword) + + if sType <> "1" then 'run only with database from type >1 + call tQueryJoin( sFileName , sType, sPassword ) + call tQueriesInQueries(sFileName) + endif + + if sType = "3" then 'run only with database type MYSQL_JDBC + call tCastQuery( sFileName , sPassword ) + endif + + call tSortQueryWithAlias(sFileName , sPassword) + +end function +'------------------------------------------------------------------------- +function tQueryJoin( sFileName , optional sType, optional sPassword ) +'TODO: check Join Type ( LEFT , INNER etc bug i17390) + Dim SelEntry as string + Dim sTableName as string + + sTableName = "TT_Query2" + + if IsMissing(sPassword) then + if ( not fOpenDatabase(sFileName) ) then + warnlog "Database can't be open" + exit function + endif + else + if ( not fOpenDatabase(sFileName,sPassword) ) then + warnlog "Database can't be open" + exit function + endif + endif + + fOpenNewQueryDesign + + Kontext "AddTables" + 'TODO: add a test to click on the execute button, before the add table dialog is closed. + dim ix as integer + dim i as integer + ix = TableName.getItemCount + for i = 1 to ix + TableName.Select i + TableName.TypeKeys "<ADD>" + 'printlog "ix = " + ix + 'printlog "TableName.getItemCount = " + TableName.getItemCount + if TableName.getItemCount > ix then + ix = TableName.getItemCount + 'printlog "TableName.getItemCount > ix" + endif + 'printlog "TableName.getSeltext = " + TableName.getSeltext + if TableName.getSeltext = sTableName then + i = ix + endif + next + if TableName.getSeltext <> sTableName then + warnlog "Can find the table " + sTableName + "." + _ + "Make sure that the table exists when starting this test." + DatabaseClose + sleep(5) + Kontext "Messagebox" + if Messagebox.Exists(3) then + if Messagebox.getRT = 304 then + Messagebox.No + end if + end if + call hCloseDocument + exit function + endif + printlog "- Add " + sTableName +" table to query design" + '/// Add database table to Query. + AddTable.Click + '######## add table TT_Query2 ######### + sTableName = "TT_Query3" + Kontext "AddTables" + 'TODO: add a test to click on the execute button, before the add table dialog is closed. + ix = TableName.getItemCount + for i = 1 to ix + TableName.Select i + TableName.TypeKeys "<ADD>" + if TableName.getItemCount > ix then + ix = TableName.getItemCount + + endif + if TableName.getSeltext = sTableName then + i = ix + endif + next + + if TableName.getSeltext <> sTableName then + warnlog "Can find the table " + sTableName + "." + _ + "Make sure that the table exists when starting this test." + exit function + endif + + printlog "- Add " + sTableName +" table to query design" + '/// Add database table to Query. + AddTable.Click + + sleep(2) + if AddTables.exists(2) then + CloseDlg.Click ' When the AddTables dialog still exists then close him + endif + sleep(1) + + Kontext "QueryDesignTable" + QueryDesignTable.useMenu + sleep(1) + hMenuSelectNr(4) + sleep(1) + hMenuSelectNr(1) + sleep(1) + + Kontext "JoinProperties" + JoinProperties.TypeKeys "<TAB>" , true + sleep(1) + JoinProperties.TypeKeys "<TAB>" , true + sleep(1) + JoinProperties.TypeKeys "<TAB>" , true + sleep(1) + JoinProperties.TypeKeys "<TAB>" , true + sleep(1) + JoinProperties.TypeKeys "<MOD1 DOWN>" , true + sleep(1) + JoinProperties.TypeKeys "<TAB>" , true + sleep(1) + JoinProperties.TypeKeys "<MOD1 DOWN>" , true + sleep(1) + JoinProperties.OK + + Kontext "QueryDesignCriterion" + sleep(1) + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + mywait() + QueryDesignCriterion.TypeKeys "<HOME>" , true + mywait() + QueryDesignCriterion.TypeKeys "<DOWN>" , 2 , true + + QueryDesignCriterion.TypeKeys "<MOD1 DOWN>" , true + + QueryDesignCriterion.TypeKeys "<UP>" , 2 , true + + QueryDesignCriterion.TypeKeys "<MOD1 UP>" , 3 , true + + QueryDesignCriterion.TypeKeys "<DOWN>" , 5 , true + mywait() + QueryDesignCriterion.TypeKeys "<MOD1 DOWN>" , 2 , true + mywait() + sleep(1) + Kontext "Toolbar" + ExecuteBtn.Click + + Kontext "TableView" + if TableView.Exists(3) then + + DataWindow.TypeKeys "<MOD1 C>" + if GetClipboard <> "4" then + warnlog "Wrong result, maybe the join doesn't work." + endif + endif + sleep(1) + call fCloseQueryDesign + + call fCloseDatabase + +end function +'------------------------------------------------------------------------- +function tQueryCriterion( sFileName , optional sType , optional sPassword) + + Dim SelEntry as string + Dim sTableName as string + + sTableName = "TT_Query1" + + if IsMissing(sPassword) then + if ( not fOpenDatabase(sFileName) ) then + warnlog "Database can't be open" + exit function + endif + else + if ( not fOpenDatabase(sFileName,sPassword) ) then + warnlog "Database can't be open" + exit function + endif + endif + + fOpenNewQueryDesign + + + Kontext "AddTables" + 'TODO: add a test to click on the execute button, before the add table dialog is closed. + dim ix as integer + dim i as integer + ix = TableName.getItemCount + for i = 1 to ix + TableName.Select i + TableName.TypeKeys "<ADD>" + 'printlog "ix = " + ix + 'printlog "TableName.getItemCount = " + TableName.getItemCount + if TableName.getItemCount > ix then + ix = TableName.getItemCount + 'printlog "TableName.getItemCount > ix" + endif + 'printlog "TableName.getSeltext = " + TableName.getSeltext + if TableName.getSeltext = sTableName then + i = ix + endif + next + if TableName.getSeltext <> sTableName then + warnlog "Can find the table " + sTableName + "." + _ + "Make sure that the table exists when starting this test." + DatabaseClose + sleep(5) + Kontext "Messagebox" + if Messagebox.Exists(3) then + if Messagebox.getRT = 304 then + Messagebox.No + end if + end if + call hCloseDocument + exit function + endif + printlog "- Add " + sTableName +" table to query design" + '/// Add database table to Query. + AddTable.Click + sleep(2) + if AddTables.exists(2) then + CloseDlg.Click ' When the AddTables dialog still exists then close him + endif + sleep(1) + Kontext "QueryDesignCriterion" + Field.Select(1) + sleep(1) + Kontext "Toolbar" + '/// Executing query + printlog "- Executing query" + ExecuteBtn.Click + sleep(5) + Kontext "TableView" + if NOT DataWindow.Exists(3) then + warnlog "Execution of a query failed!" + end if + ' #### don't comment a test, because they depends on each other #### + if sType <> "1" then + '/// start the 1. test ############################# + printlog "start the 1. test #############################" + call tTest1 + '/// start the 2. test + printlog "start the 2. test" + call tTest2 + '/// start the 3. test + printlog "start the 3. test" + call tTest3 + '/// start the 4. test + printlog "start the 4. test" + call tTest4 + '/// start the 5. test + printlog "start the 5. test" + call tTest5 + '/// start the 6. test + printlog "start the 6. test" + call tTest6 + '/// start the 7. test + printlog "start the 7. test" + call tTest7 + '/// start the 8. test + printlog "start the 8. test" + call tTest8 + ' main test end ############################### + printlog "main test end ###############################" + endif + fCloseQueryDesign + fCloseDatabase + +end function +'------------------------------------------------------------------------- +function tQueriesInQueries( sFileName , optional sType , optional sPassword) + + Dim SelEntry as string + Dim sTableName as string + + sTableName = "TT_Query1" + + if IsMissing(sPassword) then + if ( not fOpenDatabase(sFileName) ) then + warnlog "Database can't be open" + exit function + endif + else + if ( not fOpenDatabase(sFileName,sPassword) ) then + warnlog "Database can't be open" + exit function + endif + endif + + '/// open new query design + printlog "open new query design" + call fOpenNewQueryDesign + + '/// choose table TT_Query1 from AddTable dialog + printlog "choose table TT_Query1 from AddTable dialog" + call fChooseTableInQueryAddTableDialog("TT_Query1") + + '/// insert fields name1 and name2 + printlog "insert fields name1 and name2" + Kontext "QueryDesignCriterion" + sleep(1) + printlog "Go to the top left field." + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + mywait() + QueryDesignCriterion.TypeKeys "<HOME>" , true + mywait() + QueryDesignCriterion.TypeKeys "<MOD1 UP>" , 7, true + mywait() + QueryDesignCriterion.TypeKeys "<RETURN>" , true + mywait() + QueryDesignCriterion.TypeKeys "<MOD1 UP>" , 6, true + mywait() + QueryDesignCriterion.TypeKeys "<RETURN>" , true + mywait() + sleep(1) + + '/// save the query as Query_test_1 + printlog "save the query as Query_test_1" + call fSaveQueryDesign("Query_test_1") + + '/// close the query design + printlog "close the query design" + call fCloseQueryDesign() + + '/// open new query design + printlog "open new query design" + call fOpenNewQueryDesign + + '/// choose query Query_test_1 from AddTable dialog + printlog "choose query Query_test_1 from AddTable dialog" + call fChooseQueryInQueryAddTableDialog("Query_test_1") + + '/// insert fields name1 + printlog "insert fields name1" + Kontext "QueryDesignCriterion" + sleep(1) + printlog "Go to the top left field." + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + mywait() + QueryDesignCriterion.TypeKeys "<HOME>" , true + mywait() + QueryDesignCriterion.TypeKeys "<MOD1 UP>" , 2, true + mywait() + QueryDesignCriterion.TypeKeys "<RETURN>" , true + sleep(1) + + + '/// save the query with the name Query_test_2 + printlog "save the query with the name Query_test_2" + call fSaveQueryDesign("Query_test_2") + + '/// close the query design + printlog "close the query design" + call fCloseQueryDesign() + + '/// close the query design + printlog "close the query design" + call fCloseDatabase(true) + + '/// open the database again + printlog "open the database again" + if IsMissing(sPassword) then + if ( not fOpenDatabase(sFileName) ) then + warnlog "Database can't be open" + exit function + endif + else + if ( not fOpenDatabase(sFileName,sPassword) ) then + warnlog "Database can't be open" + exit function + endif + endif + + '/// execute the QueryInQuery "Query_test_2" + printlog "execute the QueryInQuery Query_test_2" + if ( fOpenQuery("Query_test_2") = false ) then + warnlog "Can't open query Query_test_2" + call fCloseDatabase() + exit function + endif + + '/// close Query view + printlog "close Query view" + call fCloseQueryView() + + '/// close database + printlog "close database" + call fCloseDatabase() + +end function +'------------------------------------------------------------------------- +sub mywait() + 'sleep(1) +end sub + +sub tTest1 + '/// insert the <b>* as field</b> + '/// take <b>count</b> from the <b>function</b> listbox + '/// <b>Execute</b> the query + '/// the <b>result</b> should be <b>11</b> + Kontext "QueryDesignCriterion" + sleep(1) + printlog "Go to the top left field." + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + mywait() + QueryDesignCriterion.TypeKeys "<HOME>" , true + mywait() + QueryDesignCriterion.TypeKeys "<DOWN>" , 5 , true + mywait() + QueryDesignCriterion.TypeKeys "<MOD1 DOWN>" , true + mywait() + sleep(1) + Kontext "Toolbar" + printlog "- Executing query" + ExecuteBtn.Click + sleep(5) + Kontext "TableView" + if TableView.Exists(3) then + DataWindow.TypeKeys "<MOD1 C>" + if GetClipboard <> "11" then + warnlog "There should be 11 records but there are " + GetClipboard + else + printlog GetClipboard + " records available." + endif + else + warnlog "Execution of a query failed!" + end if + sleep(2) +end sub + +sub tTest2 + '/// add the field <b>'name1'</b> to the field list + '/// set the field <b>invisible</b> + '/// as criterion insert <b>LIKE 'F*'</b> + '/// <b>execute</b> the query + '/// the <b>result</b> should be <b>3</b> + Kontext "QueryDesignCriterion" + sleep(1) + printlog "Go to the top left field." + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + mywait() + QueryDesignCriterion.TypeKeys "<HOME>" , true + mywait() + QueryDesignCriterion.TypeKeys "<TAB>" , true + mywait() + QueryDesignCriterion.TypeKeys "<SHIFT PAGEUP>" , true + mywait() + QueryDesignCriterion.TypeKeys "<MOD1 DOWN>" , 2 , true + mywait() + QueryDesignCriterion.TypeKeys "<DOWN>" , 4 , true + mywait() + QueryDesignCriterion.TypeKeys "<SPACE>" , true + mywait() + QueryDesignCriterion.TypeKeys "<DOWN>" , 2 , true + mywait() + QueryDesignCriterion.TypeKeys "LIKE 'F*'" , true + mywait() + QueryDesignCriterion.TypeKeys "<RETURN>" , true + mywait() + sleep(1) + Kontext "Toolbar" + printlog "- Executing query" + ExecuteBtn.Click + sleep(5) + Kontext "TableView" + if TableView.Exists(3) then + + DataWindow.TypeKeys "<MOD1 C>" + if GetClipboard <> "3" then + warnlog "There should be 3 records but there are " + GetClipboard + else + printlog GetClipboard + " records available." + endif + else + warnlog "Execution of a query failed!" + end if + sleep(2) +end sub + +sub tTest3 + '/// add the field <b>'date'</b> to the field list + '/// set the field <b>invisible</b> + '/// as criterion insert <b>IS NULL</b> + '/// b>execute</b> the query + '/// the <b>result</b> should be <b>1</b> + Kontext "QueryDesignCriterion" + sleep(1) + printlog "Go to the top left field." + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + mywait() + QueryDesignCriterion.TypeKeys "<HOME>" , true + mywait() + QueryDesignCriterion.TypeKeys "<TAB>" , 2 , true + mywait() + QueryDesignCriterion.TypeKeys "<SHIFT PAGEUP>" , true + mywait() + QueryDesignCriterion.TypeKeys "<MOD1 DOWN>" , 7 , true + mywait() + QueryDesignCriterion.TypeKeys "<DOWN>" , 4 , true + mywait() + QueryDesignCriterion.TypeKeys "<SPACE>" , true + mywait() + QueryDesignCriterion.TypeKeys "<DOWN>" , 2 , true + mywait() + QueryDesignCriterion.TypeKeys "IS NULL" , true + mywait() + QueryDesignCriterion.TypeKeys "<RETURN>" , true + mywait() + 'TODO: check if the right localazied string appear + sleep(1) + Kontext "Toolbar" + printlog "- Executing query" + ExecuteBtn.Click + sleep(5) + Kontext "TableView" + if TableView.Exists(3) then + + DataWindow.TypeKeys "<MOD1 C>" + if GetClipboard <> "1" then + warnlog "There should be 1 records but there are " + GetClipboard + else + printlog GetClipboard + " records available." + endif + else + warnlog "Execution of a query failed!" + end if + sleep(2) +end sub + +sub tTest4 + '/// <b>change</b> the criterion for field <b>date</b> to <b>is not null</b> + '/// <b>execute</b> the query + '/// the <b>result</b> should be <b>2</b> + Kontext "QueryDesignCriterion" + + printlog "Go to the top left field." + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + mywait() + QueryDesignCriterion.TypeKeys "<HOME>" , true + mywait() + QueryDesignCriterion.TypeKeys "<TAB>" , 2 , true + mywait() + QueryDesignCriterion.TypeKeys "<DOWN>" , 6 , true + mywait() + QueryDesignCriterion.TypeKeys "<SHIFT END>" , true + mywait() + QueryDesignCriterion.TypeKeys "IS NOT NULL" , true + mywait() + QueryDesignCriterion.TypeKeys "<RETURN>" , true + mywait() + 'TODO: check if the right localazied string appear + sleep(1) + Kontext "Toolbar" + printlog "- Executing query" + ExecuteBtn.Click + sleep(5) + Kontext "TableView" + if TableView.Exists(3) then + + DataWindow.TypeKeys "<MOD1 C>" + if GetClipboard <> "2" then + warnlog "There should be 2 records but there are " + GetClipboard + else + printlog GetClipboard + " records available." + endif + else + warnlog "Execution of a query failed!" + end if + sleep(2) +end sub + +sub tTest5 + '/// <b>remove</b> the fields <b>'name1' and 'date'</b> + '/// <b>add</b> field <b>ID</b> + '/// set <b>ID invisible</b> + '/// as <b>criterion</b> insert <b>BETWEEN 4 AND 7</b> + '/// <b>execute</b> the query + '/// the <b>result</b> should be <b>4</b> + Kontext "QueryDesignCriterion" + sleep(1) + printlog "Go to the top left field." + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + mywait() + QueryDesignCriterion.TypeKeys "<HOME>" , true + mywait() + QueryDesignCriterion.TypeKeys "<TAB>" , true + mywait() + QueryDesignCriterion.TypeKeys "<SHIFT END>" , true + mywait() + QueryDesignCriterion.TypeKeys "<DELETE>" , true + mywait() + QueryDesignCriterion.TypeKeys "<SHIFT PAGEUP>" , true + mywait() + QueryDesignCriterion.TypeKeys "<MOD1 DOWN>" , true + mywait() + QueryDesignCriterion.TypeKeys "<DOWN>" , 6 , true + mywait() + QueryDesignCriterion.TypeKeys "<SHIFT END>" , true + mywait() + QueryDesignCriterion.TypeKeys "<DELETE>" , true + mywait() + QueryDesignCriterion.TypeKeys "BETWEEN 4 AND 7" , true + mywait() + QueryDesignCriterion.TypeKeys "<RETURN>" , true + mywait() + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + mywait() + QueryDesignCriterion.TypeKeys "<SHIFT END>" , true + mywait() + QueryDesignCriterion.TypeKeys "<DELETE>" , true + mywait() + QueryDesignCriterion.TypeKeys "<RETURN>" , true + mywait() + 'TODO: check if the right localazied string appear + sleep(1) + Kontext "Toolbar" + printlog "- Executing query" + ExecuteBtn.Click + sleep(5) + Kontext "TableView" + if TableView.Exists(3) then + + DataWindow.TypeKeys "<MOD1 C>" + if GetClipboard <> "4" then + warnlog "There should be 4 records but there are " + GetClipboard + else + printlog GetClipboard + " records available." + endif + else + warnlog "Execution of a query failed!" + end if + sleep(2) +end sub + +sub tTest6 + '/// <b>change the criterion</b> for field ID to <b>NOT BETWEEN 4 AND 7</b> + '/// <b>execute</b> the query + '/// the <b>result</b> should be <b>7</b> + Kontext "QueryDesignCriterion" + sleep(1) + printlog "Go to the top left field." + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + mywait() + QueryDesignCriterion.TypeKeys "<HOME>" , true + mywait() + QueryDesignCriterion.TypeKeys "<TAB>" , true + mywait() + QueryDesignCriterion.TypeKeys "<DOWN>" , 6 , true + mywait() + QueryDesignCriterion.TypeKeys "<SHIFT END>" , true + mywait() + QueryDesignCriterion.TypeKeys "NOT BETWEEN 4 AND 7" , true + mywait() + QueryDesignCriterion.TypeKeys "<RETURN>" , true + mywait() + 'TODO: check if the right localazied string appear + sleep(1) + Kontext "Toolbar" + printlog "- Executing query" + ExecuteBtn.Click + sleep(5) + Kontext "TableView" + if TableView.Exists(3) then + + DataWindow.TypeKeys "<MOD1 C>" + if GetClipboard <> "7" then + warnlog "There should be 7 records but there are " + GetClipboard + else + printlog GetClipboard + " records available." + endif + else + warnlog "Execution of a query failed!" + end if + sleep(2) +end sub + +sub tTest7 + '/// remove the field ID + '/// <b>add</b> field <b>name1</b> + '/// set name1 <b>invisible</b> + '/// as <b>criterion</b> insert <b>IN ('Heinz','Freddi')</b> + '/// <b>execute</b> the query + '/// the <b>result</b> should be <b>2</b> + Kontext "QueryDesignCriterion" + sleep(1) + printlog "Go to the top left field." + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + mywait() + QueryDesignCriterion.TypeKeys "<HOME>" , true + mywait() + QueryDesignCriterion.TypeKeys "<TAB>" , true + mywait() + QueryDesignCriterion.TypeKeys "<SHIFT END>" , true + mywait() + QueryDesignCriterion.TypeKeys "<DELETE>" , true + mywait() + QueryDesignCriterion.TypeKeys "<SHIFT PAGEUP>" , true + mywait() + QueryDesignCriterion.TypeKeys "<MOD1 DOWN>" , 2 , true + mywait() + QueryDesignCriterion.TypeKeys "<DOWN>" , 6 , true + mywait() + QueryDesignCriterion.TypeKeys "<SHIFT END>" , true + mywait() + QueryDesignCriterion.TypeKeys "<DELETE>" , true + mywait() + QueryDesignCriterion.TypeKeys "IN ('Heinz','Freddi')" , true + mywait() + sleep(1) + 'TODO: check if the right localazied string appear + sleep(1) + Kontext "Toolbar" + printlog "- Executing query" + ExecuteBtn.Click + sleep(5) + Kontext "TableView" + if TableView.Exists(3) then + + DataWindow.TypeKeys "<MOD1 C>" + if GetClipboard <> "2" then + warnlog "There should be 2 records but there are " + GetClipboard + else + printlog GetClipboard + " records available." + endif + else + warnlog "Execution of a query failed!" + end if + sleep(2) +end sub + +sub tTest8 + '/// change <b>criterion</b> to <b>NOT IN ('Heinz','Freddi')</b> + '/// <b>execute</b> the query + '/// the <b>result</b> should be <b>9</b> + Kontext "QueryDesignCriterion" + sleep(1) + printlog "Go to the top left field." + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + mywait() + QueryDesignCriterion.TypeKeys "<HOME>" , true + mywait() + QueryDesignCriterion.TypeKeys "<TAB>" , true + mywait() + QueryDesignCriterion.TypeKeys "<DOWN>" , 6 , true + mywait() + QueryDesignCriterion.TypeKeys "<SHIFT END>" , true + mywait() + QueryDesignCriterion.TypeKeys "NOT IN ('Heinz','Freddi')" , true + mywait() + QueryDesignCriterion.TypeKeys "<RETURN>" , true + mywait() + 'TODO: check if the right localazied string appear + sleep(1) + Kontext "Toolbar" + printlog "- Executing query" + ExecuteBtn.Click + sleep(5) + Kontext "TableView" + if TableView.Exists(3) then + + DataWindow.TypeKeys "<MOD1 C>" + if GetClipboard <> "9" then + warnlog "There should be 9 records but there are " + GetClipboard + else + printlog GetClipboard + " records available." + endif + else + warnlog "Execution of a query failed!" + end if + sleep(2) +end sub +'-------------------------------------------------------------------- +sub tCastQuery( sFileName , sPassword ) + + fOpenDatabase(sFileName,sPassword) + + if ( fOpenNewQueryDesign ) then + if ( fChooseTableInQueryAddTableDialog("TT_Query3") ) then + Kontext "QueryDesignCriterion" + sleep(1) + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "cast(f_date_s as date)" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<RETURN>" , true + sleep(1) + Kontext "Toolbar" + printlog "- Executing query" + ExecuteBtn.Click + sleep(5) + + Kontext "TableView" + if TableView.Exists(3) then + + DataWindow.TypeKeys "<MOD1 C>" + if GetClipboard <> "40219" then + warnlog "the result should be 40219 but it is " + GetClipboard + else + printlog "the result is OK" + endif + else + warnlog "Execution of a query failed!" + end if + + call fCloseQueryDesign + + endif + endif + call fCloseDatabase + +end sub +'-------------------------------------------------------------------- +function tSortQueryWithAlias(sFileName, optional sPassword) ' test for isse 27832 + + if IsMissing(sPassword) then + if ( not fOpenDatabase(sFileName) ) then + warnlog "Database can't be open" + exit function + endif + else + if ( not fOpenDatabase(sFileName,sPassword) ) then + warnlog "Database can't be open" + exit function + endif + endif + + if ( fOpenNewQueryDesign ) then + if ( fChooseTableInQueryAddTableDialog("TT_Query1") ) then + Kontext "QueryDesignCriterion" + sleep(1) + QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<MOD1 SHIFT DOWN>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<MOD1 SHIFT DOWN>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "<DOWN>" , true + sleep(1) + QueryDesignCriterion.TypeKeys "test" , true + sleep(1) + Kontext "Toolbar" + printlog "- Executing query" + ExecuteBtn.Click + sleep(5) + + call fCloseQueryDesign + + endif + endif + call fCloseDatabase + +end function +'-------------------------------------------------------------------- +function fChooseTableInQueryAddTableDialog(sTableName as string) as boolean + + + Kontext "AddTables" + if ( not AddTables.exists(1) ) then + fChooseTableInQueryAddTableDialog = false + exit function + endif + + 'TODO: add a test to click on the execute button, before the add table dialog is closed. + dim ix as integer + dim i as integer + ix = TableName.getItemCount + for i = 1 to ix + TableName.Select i + TableName.TypeKeys "<ADD>" + 'printlog "ix = " + ix + 'printlog "TableName.getItemCount = " + TableName.getItemCount + if TableName.getItemCount > ix then + ix = TableName.getItemCount + 'printlog "TableName.getItemCount > ix" + endif + 'printlog "TableName.getSeltext = " + TableName.getSeltext + if TableName.getSeltext = sTableName then + i = ix + endif + next + if TableName.getSeltext <> sTableName then + warnlog "Can find the table " + sTableName + "." + _ + "Make sure that the table exists when starting this test." + DatabaseClose + sleep(5) + Kontext "Messagebox" + if Messagebox.Exists(3) then + if Messagebox.getRT = 304 then + Messagebox.No + end if + end if + call hCloseDocument + exit function + endif + printlog "- Add " + sTableName +" table to query design" + '/// Add database table to Query. + AddTable.Click + sleep(2) + if AddTables.exists(2) then + CloseDlg.Click ' When the AddTables dialog still exists then close him + endif + sleep(1) + fChooseTableInQueryAddTableDialog = true + +end function +'-------------------------------------------------------------------- +function fChooseQueryInQueryAddTableDialog(sQueryName as string) as boolean + + + Kontext "AddTables" + if ( not AddTables.exists(1) ) then + fChooseQueryInQueryAddTableDialog = false + exit function + endif + Queries.check + + + 'TODO: add a test to click on the execute button, before the add table dialog is closed. + dim ix as integer + dim i as integer + ix = QueryName.getItemCount + for i = 1 to ix + QueryName.Select i + QueryName.TypeKeys "<ADD>" + 'printlog "ix = " + ix + 'printlog "TableName.getItemCount = " + TableName.getItemCount + if QueryName.getItemCount > ix then + ix = QueryName.getItemCount + 'printlog "TableName.getItemCount > ix" + endif + 'printlog "TableName.getSeltext = " + TableName.getSeltext + if QueryName.getSeltext = sQueryName then + i = ix + endif + next + if QueryName.getSeltext <> sQueryName then + warnlog "Can find the table " + sTableName + "." + _ + "Make sure that the table exists when starting this test." + DatabaseClose + sleep(5) + Kontext "Messagebox" + if Messagebox.Exists(3) then + if Messagebox.getRT = 304 then + Messagebox.No + end if + end if + call hCloseDocument + exit function + endif + printlog "- Add " + sQueryName +" table to query design" + '/// Add database table to Query. + AddTable.Click + sleep(2) + if AddTables.exists(2) then + CloseDlg.Click ' When the AddTables dialog still exists then close him + endif + sleep(1) + fChooseQueryInQueryAddTableDialog = true + +end function diff --git a/testautomation/dbaccess/optional/includes/db_Relations.inc b/testautomation/dbaccess/optional/includes/db_Relations.inc new file mode 100644 index 000000000000..98a94562c743 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/db_Relations.inc @@ -0,0 +1,435 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Base Level 1 Create Relations between Test Tables +'* +'\*********************************************************************** +function tRelation( sFileName, sPWD, sRelTable1, sRelTable2 ) + '/// create an 1:1 and 1:n relation between two test tables + Dim i as integer 'counter + Dim j as integer 'counter + Dim ix as integer 'counter + Dim iNoDS as integer 'number of data source in listbox + Dim iNoTab as integer 'number of tables in grid + Dim DSOK as boolean 'datasource present check + + call fOpenDatabase(sFileName, sPWD) + + call fOpenRelationDesign + + '/// searching and adding of the two needed testtables + + bDelete_Container() 'delete all disturbing table container + sleep(1) + + '/// insert add tables dialog if not present + Kontext "AddTables" + if (AddTables.exists(1) = false) then + printlog "open add table dialog" + Kontext "RelationDesign" + sleep(1) + RelationDesign.UseMenu + sleep(1) + hMenuSelectNr (4) + sleep(1) + hMenuSelectNr (2) + sleep(1) + endif + sleep(1) + 'call fChooseTableInAddTableDialog(sRelTable1) + + '/// searching and adding the two needed testtables + Kontext "AddTables" + dim sRelTable as string 'buffer variable + dim breltablefound as integer 'control if both needed table are found + breltablefound = 0 + + for j = 1 to 2 + if j = 1 then + sRelTable = sRelTable1 'first table + else + sRelTable = sRelTable2 'second table + endif + ix = TableName.getItemCount + for i = 1 to ix + TableName.Select i + TableName.TypeKeys "<ADD>" 'adding test table + if TableName.getItemCount > ix then + ix = TableName.getItemCount + endif + if TableName.getSeltext = sRelTable then + printlog "table found: " + sRelTable + breltablefound = breltablefound +1 + i = ix + endif + next i + sleep(1) + AddTable.Click + sleep(1) + next j + CloseDlg.Click + + if breltablefound <> 2 then 'two needed tables not found if variable <> 2 + warnlog "proper tables: " + sRelTable1 + " and/or " + sRelTable2 + " not found - test abort" + call fCloseRelationDesign + call fCloseDatabase + exit function + else + printlog "both needed tables found and added" + endif + sleep(1) + + Kontext "RelationDesign" + '/// open relation property menue + sleep(1) + RelationDesign.UseMenu + sleep(1) + hMenuSelectNr (4) + sleep(1) + hMenuSelectNr (1) + sleep(1) + Kontext "RelationProperties" + '/// create 1:1 relation: open relation design and choose the ID fields from each table/listbox + sleep(1) + printlog "open relation design and choose the ID fields from each table/listbox" + RelationProperties.TypeKeys "<TAB>",TRUE + RelationProperties.TypeKeys "<TAB>",TRUE + RelationProperties.TypeKeys "<MOD2 DOWN>",TRUE + sleep(1) + RelationProperties.TypeKeys "<DOWN>",TRUE + ' RelationProperties.TypeKeys "<RETURN>",TRUE + sleep(1) + RelationProperties.TypeKeys "<TAB>",TRUE + RelationProperties.TypeKeys "<MOD2 DOWN>",TRUE + sleep(1) + RelationProperties.TypeKeys "<DOWN>",TRUE + ' RelationProperties.TypeKeys "<RETURN>",TRUE + sleep(1) + RelationProperties.OK + printlog "1:1 relation between test tables created" + sleep(1) + + Kontext "RelationDesign" + '/// delete relation connector + dim k as integer 'injurance that routine do not loop + dim l as integer 'buffer for hMenuItemGetCount + k = 0 + Do + '/// checkout wich kontext has two entries (only relation connector has) + Kontext "RelationDesign" + RelationDesign.TypeKeys "<TAB>",TRUE + sleep(1) + RelationDesign.TypeKeys "<SHIFT F10>",TRUE + sleep(1) + try + l = hMenuItemGetCount + catch + endcatch + MenuSelect 0 + sleep(1) + k = k + 1 + 'printlog "k = " + k + 'printlog "hMenuItemGetCount = " + l + Loop Until k = 10 or l = 2 + if k = 10 then + warnlog "abort deleting relation: searching for relation connector went wrong" + endif + printlog "relation connector deleted" + RelationDesign.TypeKeys "<SHIFT F10>",TRUE + hMenuSelectNr (1) + sleep(1) + + '/// create 1:n relation + Kontext "RelationDesign" + '/// open relation property menue + printlog "open relation property menue for 1:n relation" + sleep(1) + RelationDesign.UseMenu + sleep(1) + hMenuSelectNr (4) + sleep(1) + hMenuSelectNr (1) + sleep(1) + Kontext "RelationProperties" + '/// open relation design and change listbox content + printlog "open relation design and choose proper fields from table/listbox" + RelationProperties.TypeKeys "<TAB>",TRUE + RelationProperties.TypeKeys "<TAB>",TRUE + RelationProperties.TypeKeys "<MOD2 DOWN>",TRUE + sleep(1) + RelationProperties.TypeKeys "<DOWN>",TRUE + RelationProperties.TypeKeys "<DOWN>",TRUE + sleep(1) + RelationProperties.TypeKeys "<TAB>",TRUE + RelationProperties.TypeKeys "<MOD2 DOWN>",TRUE + sleep(1) + RelationProperties.TypeKeys "<DOWN>",TRUE + RelationProperties.TypeKeys "<RETURN>",TRUE + sleep(1) + RelationProperties.OK + printlog "1:n relation between test tables created" + sleep (1) + + bDelete_Container() 'delete all table container to leave place clear + sleep (1) + + fCloseRelationDesign(true)'close relation design and save it" + + + call fCloseDatabase +end function +'------------------------------------------------------------------------- +function tDoubleRelation( sFileName, sPWD, sRelTable1, sRelTable2, sRelTable3 ) + '/// create an 1:1 relation, close and save relation dialog, + '/// reopen the dialog and add an 1:n relation with third test table + Dim i as integer 'counter + Dim j as integer 'counter + Dim ix as integer 'counter + Dim iNoDS as integer 'number of data source in listbox + Dim iNoTab as integer 'number of tables in grid + Dim DSOK as boolean 'datasource present check + + + call fOpenDatabase(sFileName, sPWD) + + call fOpenRelationDesign + + '/// searching and adding of the two needed testtables + + bDelete_Container() 'init + + '/// insert add tables dialog if not present + Kontext "AddTables" + if (AddTables.exists(1) = false) then + '/// open add table dialog + printlog "open add table dialog" + Kontext "RelationDesign" + sleep(1) + RelationDesign.UseMenu + sleep(1) + hMenuSelectNr (4) + sleep(1) + hMenuSelectNr (2) + sleep(1) + endif + sleep(1) + + '/// add the needed testtables + Kontext "AddTables" + dim sRelTable as string 'buffer for tablenames + dim breltablefound as integer 'control if both needed table are found + breltablefound = 0 + for j = 1 to 2 + if j = 1 then + sRelTable = sRelTable1 'first table + else + sRelTable = sRelTable2 'second table + endif + ix = TableName.getItemCount + for i = 1 to ix + TableName.Select i + TableName.TypeKeys "<ADD>" + if TableName.getItemCount > ix then + ix = TableName.getItemCount + endif + if TableName.getSeltext = sRelTable then + printlog "table found: " + sRelTable + breltablefound = breltablefound +1 + i = ix + endif + next i + sleep(1) + AddTable.Click + sleep(1) + next j + CloseDlg.Click + + if breltablefound <> 2 then 'two needed tables not found if variable <> 2 + warnlog "proper tables: " + sRelTable1 + " and/or " + sRelTable2 + " not found - test abort" + call fCloseRelationDesign + call fCloseDatabase + exit function + else + printlog "both tables found and added" + endif + sleep(1) + + '/// create 1:1 relation + Kontext "RelationDesign" + '/// open relation property menue + printlog "open relation property menue" + sleep(1) + RelationDesign.UseMenu + sleep(1) + hMenuSelectNr (4) + sleep(1) + hMenuSelectNr (1) + sleep(1) + Kontext "RelationProperties" + '/// open relation design and choose proper fields from table/listbox + printlog "open relation design and choose proper fields from table/listbox" + RelationProperties.TypeKeys "<TAB>",TRUE + RelationProperties.TypeKeys "<TAB>",TRUE + RelationProperties.TypeKeys "<MOD1 DOWN>",TRUE + sleep(1) + RelationProperties.TypeKeys "<TAB>",TRUE + RelationProperties.TypeKeys "<MOD1 DOWN>",TRUE + sleep(1) + RelationProperties.OK + printlog "1:1 relation between test tables created" + + '/// close and save relation design and save design + call fCloseRelationDesign(true) + +'/// Second Part: adding 1:n relation + printlog "" + printlog "Second Part: adding 1:n relation" + + call fOpenRelationDesign + + '/// insert add tables dialog if not present + Kontext "AddTables" + if (AddTables.exists(1) = false) then + '/// open add table dialog + printlog "open add table dialog" + Kontext "RelationDesign" + sleep(1) + RelationDesign.UseMenu + sleep(1) + hMenuSelectNr (4) + sleep(1) + hMenuSelectNr (2) + sleep(1) + endif + sleep(1) + + '/// searching and adding proper table + Kontext "AddTables" + breltablefound = 0 + for j = 1 to 1 + sRelTable = sRelTable3 'third table + ix = TableName.getItemCount + for i = 1 to ix + TableName.Select i + TableName.TypeKeys "<ADD>" + if TableName.getItemCount > ix then + ix = TableName.getItemCount + endif + if TableName.getSeltext = sRelTable then + printlog "table found: " + sRelTable + breltablefound = breltablefound +1 + i = ix + endif + next i + sleep(1) + AddTable.Click + sleep(1) + next j + CloseDlg.Click + + if breltablefound <> 1 then 'needed table not found if variable <> 1 + warnlog "proper table: " + sRelTable3 + " not found - test abort" + call fCloseRelationDesign + call fCloseDatabase + exit function + else + printlog "third table found and added" + endif + sleep(1) + + + '/// add 1:n relation + Kontext "RelationDesign" + '/// open relation property menue + printlog "open relation property menue" + sleep(1) + RelationDesign.UseMenu + sleep(1) + hMenuSelectNr (4) + sleep(1) + hMenuSelectNr (1) + sleep(1) + Kontext "RelationProperties" + '/// open relation design and choose the proper fields from table/listbox + printlog "open relation design and choose the proper fields from table/listbox" + RelationProperties.TypeKeys "<TAB>",TRUE + RelationProperties.TypeKeys "<MOD1 DOWN>",TRUE + RelationProperties.TypeKeys "<MOD1 DOWN>",TRUE + sleep(1) + RelationProperties.TypeKeys "<TAB>",TRUE + RelationProperties.TypeKeys "<MOD1 DOWN>",TRUE + RelationProperties.TypeKeys "<MOD1 DOWN>",TRUE + sleep(1) + RelationProperties.TypeKeys "<TAB>",TRUE + RelationProperties.TypeKeys "<MOD1 DOWN>",TRUE + sleep(1) + RelationProperties.OK + + Kontext "MessageBox" + if MessageBox.exists(1) then + MessageBox.OK + Kontext "RelationProperties" + RelationProperties.OK + endif + printlog "1:n relation between test tables created" + sleep(1) + + bDelete_Container() 'delete all table container to leave place clear + sleep (1) + + + call fCloseRelationDesign 'close relation design and save init design" + + call fCloseDatabase + +end function + + +function bDelete_Container() as boolean + dim bcontainer_exist as boolean + bcontainer_exist = true + '/// delete container if present + Do + sleep(2) + Kontext "RelationDesign" + RelationDesign.MouseDown(2,2) + RelationDesign.MouseUp(2,2) + sleep(1) + RelationDesign.TypeKeys "<DELETE>",TRUE + sleep(2) + Kontext "MessageBox" + '/// container present if opening context menue possible + if MessageBox.exists(2) then + MessageBox.Yes + else + bcontainer_exist = false + endif + Loop Until bcontainer_exist = false + printlog "deleted container to init relation design" +end function diff --git a/testautomation/dbaccess/optional/includes/db_Spreadsheet.inc b/testautomation/dbaccess/optional/includes/db_Spreadsheet.inc new file mode 100644 index 000000000000..87eb5e1ce240 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/db_Spreadsheet.inc @@ -0,0 +1,61 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Create Spreadsheet DS & standard ds tests +'* +'\*********************************************************************** +testcase db_Spreadsheet + + Dim sFileName as string + sFileName = gOfficePath + ConvertPath("user/work/TT_Spreadsheet.odb") + + Dim sDBURL as string + sDBURL = "user/work/TT_Query1.ods" + + 'needed for: tQuery testcase - query file is copied in the work directory + app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/spreadsheet_datasource/TT_Query1.ods"),gOfficePath + ConvertPath("user/work/TT_Query1.ods") + + dim dbok as boolean + dbok = false + dbok = fCreateSpreadsheetDatasource(sFileName, gOfficePath + ConvertPath(sDBURL),"tt_spreadsheet") + if dbok = true then + + call db_Query(sFileName, "CALC") + + 'outcomment because of several bugs inside forms + 'use "dbaccess/optional/includes/b_lvl1_Forms.inc" + 'call b_lvl1_Forms("tt_spreadsheet") + + else + warnlog "Data Source could not be created - beyond testcases stopped" + endif + + +endcase + diff --git a/testautomation/dbaccess/optional/includes/db_Text.inc b/testautomation/dbaccess/optional/includes/db_Text.inc new file mode 100644 index 000000000000..6130aee378b8 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/db_Text.inc @@ -0,0 +1,148 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : test for a text database +'* +'\*********************************************************************** + +sub db_Text(sFilename as string) + + call tCountCharacterSet(sFilename) + call tOpenUTF8File(sFilename) + +end sub +'------------------------------------------------------------------------- +testcase tCountCharacterSet(sFilename as string) + + '/// open the text database create in the bas file + call fOpendatabase(sFileName) + + '/// open the properties dialog of the open database + printlog "open the properties dialog of the open database" + Kontext "DATABASE" + Database.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(1) + + '/// switch to the Text Tabpage + printlog "switch to the Text Tabpage" + Kontext "DatabaseProperties" + TabControl.setPage TabTextBase + + '/// check if there are 54 character sets + printlog "check if there are 54 character sets" + Kontext "TabTextBase" + dim i as integer + i = CharSet.getItemCount() + if i <> 54 then + warnlog "The count of the charsets is wrong. It have to be 54 but it is:" + i + else + printlog "The count of the charsets is correct.There are 54 character sets." + endif + '/// close the properties dialog with OK + printlog "close the properties dialog with OK" + Kontext "DatabaseProperties" + DatabaseProperties.OK + + '/// close the database + printlog "close the database" + call fCloseDatabase() + +endcase +'------------------------------------------------------------------------- +testcase tOpenUTF8File(sFilename as string) + + '/// copy the file TesttoolPath + dbaccess/optional/input/text_datasource/text_database.txt" to your local wotk directory + printlog "copy the file TesttoolPath + dbaccess/optional/input/text_datasource/text_database.txt to your local wotk directory" + app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/text_datasource/text_database.txt"),gOfficePath + ConvertPath("user/work/text_database.txt") + + '/// open the text database create in the bas file + call fOpendatabase(sFileName) + + '/// open the properties dialog of the open database + printlog "open the properties dialog of the open database" + Kontext "DATABASE" + Database.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(1) + + '/// switch to the Text Tabpage + printlog "switch to the Text Tabpage" + Kontext "DatabaseProperties" + TabControl.setPage TabTextBase + + '/// set UTF-8 as character set + printlog "set UTF-8 as character set" + Kontext "TabTextBase" + dim iCount as integer + dim i as integer + iCount = CharSet.getItemCount() + for i = 1 to iCount + CharSet.select(i) + if (Instr(CharSet.getSelText(),"(UTF-8)") <> 0 ) then + i = iCount + endif + next + + '/// close the properties dialog with OK + printlog "close the properties dialog with OK" + Kontext "DatabaseProperties" + DatabaseProperties.OK + + '/// save and close the database + call fCloseDatabase(true) + + '/// open the text database again + call fOpendatabase(sFileName) + + '/// open the table text_database + printlog "open the table text_Database" + call fOpenTable("text_database") + + '/// check if the first row contains the string öäü + printlog "check if the first row contains the string öäü" + kontext "TableView" + TableView.TypeKeys("<MOD1 C>",true) + if ( getClipboard = "1;öäü") then + printlog "The table is load with an UTF-8 locale -> OK" + else + warnlog "The table is not load ed with an UTF-8 locale -> FAILED" + endif + + '/// close the table + printlog "close the table" + call fCloseTableView + + '/// close the database + printlog "close the database" + call fCloseDatabase() + +endcase diff --git a/testautomation/dbaccess/optional/includes/db_Windows.inc b/testautomation/dbaccess/optional/includes/db_Windows.inc new file mode 100644 index 000000000000..6d675f2dd07f --- /dev/null +++ b/testautomation/dbaccess/optional/includes/db_Windows.inc @@ -0,0 +1,81 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Addressbook Windows +'* +'\*********************************************************************** +sub db_Windows + + if gPlatGroup = "w95" then + if fCreateWindowsAddressbookDatasource(gOfficePath + ConvertPath("user/work/TT_Windows.odb")) then + call tQueryAddressbook( gOfficePath + ConvertPath("user/work/TT_Windows.odb")) + endif + else + printlog "This test works only under Windows" + endif + +end sub +'------------------------------------------------------------------------- +testcase tQueryAddressbook( sFileName ) + + Dim SelEntry as string + Dim sTableName as string + + sTableName = "TT_Addressbook" + + if ( not fOpenDatabase(sFileName) ) then + warnlog "Database can't be open" + printlog "May be you find a solution under http://wiki.services.openoffice.org/wiki/Database_Automatic_Testing#Testing_the_windows_Address_book" + goto endsub + endif + + fOpenNewQueryDesign + + Kontext "AddTables" + TableName.Select 1 + AddTable.Click + sleep(1) + Kontext "QueryDesignCriterion" + Field.Select(1) + sleep(1) + Kontext "Toolbar" + '/// Executing query + printlog "- Executing query" + ExecuteBtn.Click + sleep(5) + Kontext "TableView" + if NOT DataWindow.Exists(3) then + warnlog "Execution of a query failed!" + end if + + call fCloseQueryDesign() + + call fCloseDatabase() + +endcase diff --git a/testautomation/dbaccess/optional/includes/db_hsqldb.inc b/testautomation/dbaccess/optional/includes/db_hsqldb.inc new file mode 100644 index 000000000000..061f786017ba --- /dev/null +++ b/testautomation/dbaccess/optional/includes/db_hsqldb.inc @@ -0,0 +1,288 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : hsqldb test +'* +'\*********************************************************************** +sub db_hsqldb + + call tGeneral + call ExitRestartTheOffice + call tRenameTable + call tOpenDatabaseWithViews + call tRenameTableWhichUsedInViews + + call tQueryOpenInSQLMode + call ExitRestartTheOffice + + app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/hsql_datasource/TT_hsqldb.odb") , gOfficePath + ConvertPath("user/work/TT_hsqldb.odb") + call db_Query(gOfficePath + "user/work/TT_hsqldb.odb" ,"hsqldb") + +end sub + +testcase tGeneral + + ' ********************************************************************* + ' databases specific settings for hsqldb + ' ********************************************************************* + + Dim i_fieldcount as integer 'amount of field types - columns + i_fieldcount = 8 'amount of field types (no primary key supported in dBase) normally: 7 + + Dim ifieldrow_amount as integer 'amount of inserted rows + ifieldrow_amount = 3 + + Dim sFileName as string + sFileName = gOfficePath + ConvertPath("user/work/tt_hsqldb.odb") + + Dim sTableName as string + sTableName = "tt_test_create-table" + + Dim sPWD as string + sPWD = "ignore" + + Dim sCatalog as string + sCatalog = " " ' not used in this ds + + Dim sSchema as string + sSchema = " " ' not used in this ds + + + Dim aFieldTypeContent(i_fieldcount,2) as string 'database specific data matrix + + aFieldTypeContent(1,1)="tt_boolean" 'name of fieldtype + aFieldTypeContent(1,2)="boolean" 'number of fieldtype (listbox entry) + + aFieldTypeContent(2,1)="tt_longvarchar" + aFieldTypeContent(2,2)="longvarchar" + + aFieldTypeContent(3,1)="tt_char" + aFieldTypeContent(3,2)="char" + + aFieldTypeContent(4,1)="tt_decimal" + aFieldTypeContent(4,2)="decimal" + + aFieldTypeContent(5,1)="tt_varchar" + aFieldTypeContent(5,2)="varchar" + + aFieldTypeContent(6,1)="tt_date" + aFieldTypeContent(6,2)="date" + + aFieldTypeContent(7,1)="tt_time_stamp" + aFieldTypeContent(7,2)="timestamp" + + Dim aFieldContent(1,7) as string 'database specific data matrix + + aFieldContent(1,1)="<space>" + aFieldContent(1,2)="this is a memo field" + aFieldContent(1,3)="char" + aFieldContent(1,4)="1" + aFieldContent(1,5)="this is a text field" + aFieldContent(1,6)="13.05.2004 " + aFieldContent(1,7)="0" + + dim dbok as boolean + dbok = fCreateHSQLDatasource(sFileName) + 'dbok = true + if dbok = true then + + call fOpendatabase(sFileName) + dim bCreateTable as boolean + bCreateTable = fCreateTable( aFieldTypeContent(), sTableName) + if bCreateTable = true then 'the table was created + call fInsertIntoTable( aFieldContent(), sTableName) + end if + call fCloseDatabase + + if bCreateTable = true then + 'test the index design + call tIndex(sFileName, sTableName) + end if + + 'outcomment because of some bugs in forms + 'use "dbaccess/optional/includes/b_lvl1_Forms.inc" + 'call b_lvl1_Forms ("TT_dBase") + + + else + warnlog "Data Source could not be created - beyond testcases stopped" + endif + +endcase +'------------------------------------------------------------------------- +testcase tRenameTable + + app.FileCopy ConvertPath(gTesttoolPath + "dbaccess/optional/input/hsql_datasource/TT_hsqldb.odb"),ConvertPath(gOfficePath + "user/work/TT_hsqldb.odb") + call fOpenDatabase(ConvertPath(gOfficePath + "user/work/TT_hsqldb.odb")) + + fFindTable("TT_1") + + printlog "rename the selected table" + Kontext "DATABASE" + Database.UseMenu + call hMenuSelectNr(2) + call hMenuSelectNr(7) + + printlog "insert any new name" + Kontext "FormFolderNameDialog" + FolderReName.setText("newname") + printlog "and close the rename dialog with OK" + FormFolderNameDialog.OK + + printlog "check if a message box appear" + Kontext "MessageBox" + if (MessageBox.exists()) then + warnlog MessageBox.GetFixedText(1) + endif + + printlog "Save and Close the database" + fCloseDatabase(true) + + call fOpenDatabase(ConvertPath(gOfficePath + "user/work/TT_hsqldb.odb")) + + fOpenTable("newname") + + fCloseTableView() + + fCloseDatabase() + +endcase +'------------------------------------------------------------------------- +testcase tOpenDatabaseWithViews + + app.FileCopy ConvertPath(gTesttoolPath + "dbaccess/optional/input/hsql_datasource/TT_hsqldb_2.0.0.odb"),ConvertPath(gOfficePath + "user/work/TT_hsqldb_2.0.0.odb") + + call fOpenDatabase(ConvertPath(gOfficePath + "user/work/TT_hsqldb_2.0.0.odb")) + + if fOpenTable("View 1") then + printlog "View 1 successful open" + call fCloseTableView() + else + warnlog "View 1 not successful open" + + endif + + call fCloseDatabase() + +endcase +'------------------------------------------------------------------------- +testcase tRenameTableWhichUsedInViews + + '/// check is issue 64885 occurr + + Dim s as String + printlog "copy the file $TesttoolPath/dbaccess/optional/input/hsql_datasource/TT_hsqldb.odb to a locale place" + app.FileCopy ConvertPath(gTesttoolPath + "dbaccess/optional/input/hsql_datasource/TT_hsqldb.odb"),ConvertPath(gOfficePath + "user/work/TT_hsqldb.odb") + + printlog "open the data base TT_hsqldb.odb" + call fOpenDatabase(ConvertPath(gOfficePath + "user/work/TT_hsqldb.odb")) + + '/// select the table TT_TableForView + printlog "select the table TT_TableForView" + fFindTable("TT_TableForView") + + '/// rename the selcted table + printlog "rename the selcted table" + Kontext "DATABASE" + Database.UseMenu + call hMenuSelectNr(2) + call hMenuSelectNr(7) + + '/// insert any new name + printlog "insert any new name" + Kontext "FormFolderNameDialog" + FolderReName.setText("newname") + '///+ and close the rename dialog with OK + printlog "and close the rename dialog with OK" + FormFolderNameDialog.OK + + '/// check if a message box appear that the table is used inside a view + printlog "check if a message box appear that the table is used inside a view" + Kontext "MessageBox" + if (MessageBox.exists()) then + s = MessageBox.GetFixedText(1) + if ( InStr(s,"Table is referenced by view") = 0 ) then + warnlog "There is a messagebox but the message $chr(13) does not tell something about the view $chr(13)" + printlog "The content of the messages box is: " + s + else + printlog "OK. The right messge box appear" + endif + '/// close the message box with OK + printlog "close the message box with OK" + MessageBox.OK + '/// cancel the rename dialog + printlog "cancel the rename dialog" + Kontext "FormFolderNameDialog" + FormFolderNameDialog.Cancel + else + warnlog "There is no messages box, but there should one." + endif + + '/// close the database + printlog "close the database" + call fCloseDatabase() + +endcase +'------------------------------------------------------------------------- +testcase tQueryOpeninSQLMode + + '/// check feature issue 64651 + + Dim s as String + printlog "copy the file $TesttoolPath/dbaccess/optional/input/hsql_datasource/TT_hsqldb.odb to a locale place" + app.FileCopy ConvertPath(gTesttoolPath + "dbaccess/optional/input/hsql_datasource/TT_hsqldb.odb"),ConvertPath(gOfficePath + "user/work/TT_hsqldb.odb") + + printlog "open the data base TT_hsqldb.odb" + call fOpenDatabase(ConvertPath(gOfficePath + "user/work/TT_hsqldb.odb")) + + '/// open a ew Query SQL Design + call fOpenNewSQLQueryDesign + + sleep(2) + + Kontext "QueryEditWindow" + QueryEditWindow.typeKeys ("Select * from TT_Query1" ,true) + + '/// save the sql query design + call fSaveSQLQueryDesign("q1") + + '/// close the sql query design + call fCloseSQLQueryDesign() + + '/// open the query in sql mode + call fOpenQueryInSQLDesign("q1") + + '/// close the sql query design + call fCloseSQLQueryDesign() + '/// close the database + printlog "close the database" + call fCloseDatabase() + + +endcase diff --git a/testautomation/dbaccess/optional/includes/frm_FormFilter.inc b/testautomation/dbaccess/optional/includes/frm_FormFilter.inc new file mode 100644 index 000000000000..74edeb1df3aa --- /dev/null +++ b/testautomation/dbaccess/optional/includes/frm_FormFilter.inc @@ -0,0 +1,240 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Form Filter Test Library +'* +'\*********************************************************************** +dim bDatabaseOK as boolean + +sub frm_FormFilter + + call tLoadForm + call tFF_Navigator + +end sub +'-------------------------------------------------------------------------------------- +testcase tLoadForm + '/// open the text document from dbaccess/optional/input/TT_Form_Filter.odt + printlog "open the text document from dbaccess/optional/input/TT_Form_Filter.odt" + hFileOpen (gTesttoolPath + ConvertPath("dbaccess/optional/input/TT_Form_Filter.odt")) + sleep(1) + Kontext "DocumentWriter" + '/// press CTRL + F5 to get into the first textbox + printlog "press CTRL + F5 to get into the first textbox" + DocumentWriter.TypeKeys "<MOD1 F6>" , true + wait(1000) + DocumentWriter.TypeKeys "<MOD1 F5>" , true + 'sleep(1) + 'DocumentWriter.TypeKeys "<MOD1 C>" , true + 'sleep(1) + 'printlog GetClipboard + sleep(1) + '/// activate the form based filter + printlog "activate the form based filter" + FM_FormFilter_Start + wait(1000) + '/// insert 2 in the first textbox + printlog "insert 2 in the first textbox" + DocumentWriter.TypeKeys "<MOD1 F6>" , true + wait(1000) + DocumentWriter.TypeKeys "<MOD1 F5>" , true + sleep(1) + DocumentWriter.TypeKeys "2" , true + 'DocumentWriter.TypeKeys "<RETURN>" , true + wait(1000) + '/// execute the form filter + printlog "execute the form filter" + FM_FF_Execute + wait(1000) + printlog "workaround issue 102010" + DocumentWriter.TypeKeys "<MOD1 F6>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 F5>" , true + sleep(1) + '/// use tab to get in the second textbox + printlog "use tab to get in the second textbox" + DocumentWriter.TypeKeys "<TAB>" , true + wait(1000) + '/// use CTRL + C to get the text into the Clipboard + printlog "use CTRL + C to get the text into the Clipboard" + DocumentWriter.TypeKeys "<MOD1 C>" , true + if GetClipboard <> "Value2" then + warnlog "The field has not the right content. It have to be Test2 but it is " + GetClipboard + endif + wait(1000) + '/// remove the filter + printlog "remove the filter" + FM_Remove_Filter + wait(1000) + '/// start the form filter again + printlog "start the form filter again" + FM_FormFilter_Start + wait(1000) + '/// insert into the second textbox like '%2' + printlog "insert into the second textbox like '%2'" + DocumentWriter.TypeKeys "<MOD1 F6>" , true + wait(1000) + DocumentWriter.TypeKeys "<MOD1 F5>" , true + sleep(1) + DocumentWriter.TypeKeys "<TAB>" , true + sleep(1) + DocumentWriter.TypeKeys "like '%2'" , true + wait(1000) + '/// execute the filter + printlog "execute the filter" + FM_FF_Execute + wait(1000) + + printlog "workaround issue 102010" + DocumentWriter.TypeKeys "<MOD1 F6>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 F5>" , true + sleep(1) + + '/// use tab to get in the second textbox + printlog "use tab to get in the second textbox" + DocumentWriter.TypeKeys "<TAB>" , true + sleep(1) + '/// select the text in the second textbox + printlog "select the text in the second textbox" + DocumentWriter.TypeKeys "<SHIFT END>" , true + wait(1000) + '/// press CTRL + C to get the text in the Clipboard + printlog "press CTRL + C to get the text in the Clipboard" + DocumentWriter.TypeKeys "<MOD1 C>" , true + if GetClipboard <> "Value2" then + warnlog "#i41523# The field has not the right content. It have to be Test2 but it is " + GetClipboard + endif + wait(1000) + '/// close the document + printlog "close the document" + call hCloseDocument + +endcase + +'-------------------------------------------------------------------------------------- +testcase tFF_Navigator + '/// open the text document from dbaccess/optional/input/TT_Form_Filter.odt + printlog "open the text document from dbaccess/optional/input/TT_Form_Filter.odt" + hFileOpen ( gTesttoolPath + "dbaccess/optional/input/TT_Form_Filter.odt") + sleep(1) + Kontext "DocumentWriter" + '/// press CTRL + F5 to get into the first textbox + printlog "press CTRL + F5 to get into the first textbox" + DocumentWriter.TypeKeys "<MOD1 F5>" , true + sleep(1) + '/// activate the form based filter + printlog "activate the form based filter" + FM_FormFilter_Start + wait(1000) + Kontext "DocumentWriter" + '/// press CTRL + F5 to get into the first textbox + printlog "press CTRL + F5 to get into the first textbox" + DocumentWriter.TypeKeys "<MOD1 F5>" , true + wait(1000) + '/// insert 1 into the first textbox + printlog "insert 1 into the first textbox" + DocumentWriter.TypeKeys "1" , true + '/// press return + printlog "press return" + DocumentWriter.TypeKeys "<RETURN>" , true + '/// insert like '%value%' into the second textbox + printlog "insert like '%value%' into the second textbox" + DocumentWriter.TypeKeys "like '%value%'" , true + DocumentWriter.TypeKeys "<RETURN>" , true + wait(1000) + Kontext "FilterNavigator" + '/// open the FormFilterNavigator + printlog "open the FormFilterNavigator" + if( NOT FilterNavigator.exists(3)) then + FM_FF_Navigator + endif + wait(1000) + '/// check if the filter criterion is insert in the form filter navigator + printlog "check if the filter criterion is insert in the form filter navigator" + FilterNavigator.TypeKeys "<END>" + wait(1000) + FilterNavigator.TypeKeys "<HOME>" + wait(1000) + FilterNavigator.TypeKeys "<DOWN>" + wait(1000) + FilterNavigator.TypeKeys "<ADD>" + wait(1000) + FilterNavigator.TypeKeys "<DOWN>" + wait(1000) + if FilterNavigator.getSelText <> "1" then + warnlog "The text is not right in the filter navigator. It have to be 1 but it is " + FilterNavigator.getSelText + endif + wait(1000) + FilterNavigator.TypeKeys "<DOWN>" + wait(1000) + if iSprache = 01 then + if FilterNavigator.getSelText <> "LIKE '*value*'" then + warnlog "The text is not right in the filter navigator. It have to be LIKE '*value*' but it is " + FilterNavigator.getSelText + endif + elseif iSprache = 33 then + if FilterNavigator.getSelText <> "COMME '*value*'" then + warnlog "The text is not right in the filter navigator. It have to be COMME '*value*' but it is " + FilterNavigator.getSelText + endif + elseif iSprache = 34 then + if FilterNavigator.getSelText <> "COMO '*value*'" then + warnlog "The text is not right in the filter navigator. It have to be COMO '*value*' but it is " + FilterNavigator.getSelText + endif + elseif iSprache = 39 then + if FilterNavigator.getSelText <> "COME '*value*'" then + warnlog "The text is not right in the filter navigator. It have to be COME '*value*' but it is " + FilterNavigator.getSelText + endif + elseif iSprache = 46 then + if FilterNavigator.getSelText <> "SOM '*value*'" then + warnlog "The text is not right in the filter navigator. It have to be SOM '*value*' but it is " + FilterNavigator.getSelText + endif + elseif iSprache = 49 then + if FilterNavigator.getSelText <> "WIE '*value*'" then + warnlog "The text is not right in the filter navigator. It have to be WIE '*value*' but it is " + FilterNavigator.getSelText + endif + elseif iSprache = 50 then + if FilterNavigator.getSelText <> "LIKE '*value*'" then + warnlog "The text is not right in the filter navigator. It have to be LIKE '*value*' but it is " + FilterNavigator.getSelText + endif + elseif iSprache = 81 then + + elseif iSprache = 82 then + + elseif iSprache = 86 then + + elseif iSprache = 88 then + + endif + wait(1000) + '/// close the document + printlog "close the document" + call hCloseDocument + +endcase + diff --git a/testautomation/dbaccess/optional/includes/frm_Forms.inc b/testautomation/dbaccess/optional/includes/frm_Forms.inc new file mode 100644 index 000000000000..630e1920cbce --- /dev/null +++ b/testautomation/dbaccess/optional/includes/frm_Forms.inc @@ -0,0 +1,1065 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Form Test +'* +'\*********************************************************************** +global gDSName as String + +sub frm_Forms(sdsname) + + gDSName = sdsname + call tCreateForm + call tNavigate + call tSearch + call tSort + call tViewAsGrid + call tNewSaveDelete + call tCreateSubForms + call tCheckSubForm + call tCreateSubFormsNewMethod + call tCheckSubForm + + 'test forms inside a database + app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/hsql_datasource/TT_hsqldb.odb"),gOfficePath + ConvertPath("user/work/TT_hsqldb.odb") + + call tDatabaseFormsMain + call tNewFolder + call tRenameFolder + + 'activate after cws fwkdbdesign01 is integrated + call tKeyboardNavigate + + ' test for issue 78286 + call tViewAsGridEmbeddedForm + +end sub +'-------------------------------------------------------------------------------------- +testcase tDatabaseFormsMain + + call fOpenDatabase(gOfficePath + "user/work/TT_hsqldb.odb") + + call fOpenNewFormDesign + + call hToolbarSelect("FormControls",true) + + '/// insert a textfield + printlog "insert a textfield" + Kontext "FormControls" + Edit.Click + call hDrawingWithSelection ( 50, 20, 60, 30 ) + sleep(1) + + Kontext "FormControls" + ControlProperties.Click + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.SetPage TabDataControl + sleep(1) + + Kontext "TabDataControl" + DataField.setText "id" + sleep(1) + + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.Close + sleep(1) + + '/// save the form under the name TT_form1 + printlog "save the form under the name TT_form1" + call fSaveForm( "TT_Form1", true ) + + '/// close the database + printlog "close the database" + call fCloseDatabase + + '/// open the database again + printlog "open the database again" + call fOpenDatabase(gOfficePath + "user/work/TT_hsqldb.odb") + + '/// open the form + printlog "open the form" + call fOpenForm("TT_Form1") + + '/// close the form + printlog "close the form" + call fCloseForm() + + '/// close the database + printlog "close the database" + call fCloseDatabase() + +endcase +'-------------------------------------------------------------------------------------- +testcase tCreateForm + + '/// open a new text document + printlog "open a new text document" + call hNewDocument + sleep(1) + '/// create a new form via the form navigator + printlog "create a new form via the form navigator" + call hToolbarSelect("FORMDESIGNTOOLS",true) + + Kontext "FormDesignTools" + ShowFmExplorer.Click + sleep(2) + Kontext "FormularNavigator" + Liste.TypeKeys "<SPACE>" + sleep(3) + Liste.OpenContextmenu + sleep(2) + hMenuSelectNr (1) + sleep(2) + hMenuSelectNr (1) + sleep(3) + Liste.TypeKeys "<RETURN>" + sleep(3) + Liste.OpenContextmenu + sleep(2) + hMenuSelectNr (6) + sleep(4) + + Kontext "FormPropertiesDialog" + FormPropertiesTabControl.SetPage TabDataForm + sleep(1) + Kontext "TabDataForm" + '/// set the datasource gDatasourceName + printlog "set the datasource " + gDSName + DataSource.setText(gDSName) + TabDataForm.TypeKeys("<RETURN>") + sleep(1) + '/// set the table TT_Forms + printlog "set the table TT_Forms" + Content.setText("TT_Forms") + TabDataForm.TypeKeys("<RETURN>") + sleep(1) + Kontext "FormPropertiesDialog" + FormPropertiesDialog.Close + sleep(3) + Kontext "FormularNavigator" + FormularNavigator.Close + sleep(4) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + '/// insert a textfield + printlog "insert a textfield" + Edit.Click + call hDrawingWithSelection ( 50, 30, 60, 40 ) + sleep(1) + + Kontext "FormControls" + ControlProperties.Click + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.SetPage TabDataControl + sleep(1) + Kontext "TabDataControl" + DataField.setText "id" + TabDataControl.TypeKeys("<RETURN>") + sleep(1) + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.Close + sleep(1) + + Kontext "FormControls" + SwitchControlDesignMode.Click + sleep(1) + + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_Forms.odt")) + + call hCloseDocument + +endcase +'------------------------------------------------------------------------- +testcase tNavigate + + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_Forms.odt")) + + FM_Next_Record + sleep(1) + FM_Last_Record + sleep(1) + FM_Previous_Record + sleep(1) + FM_First_Record + sleep(1) + + hCloseDocument + +endcase +'------------------------------------------------------------------------- +testcase tKeyboardNavigate + + '/// open the database <OfficePath>/user/work/TT_hsqldb.odb + printlog "open the database " + gOfficePath + "user/work/TT_hsqldb.odb" + call fOpenDatabase(gOfficePath + "user/work/TT_hsqldb.odb") + + call fOpenForm("TT_Form1") + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys("<MOD1 MOD2 END>") + + DocumentWriter.TypeKeys "<MOD1 F5>" , true + sleep(1) + DocumentWriter.TypeKeys "<SHIFT END>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + if getClipboard = "3" then + printlog "right record is displayed." + else + warnlog "wrong record is displayed. It should be 3 but it is " + getClipboard + endif + + DocumentWriter.TypeKeys("<MOD1 MOD2 HOME>") + + DocumentWriter.TypeKeys "<MOD1 F5>" , true + sleep(1) + DocumentWriter.TypeKeys "<SHIFT END>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + if getClipboard = "1" then + printlog "right record is displayed." + else + warnlog "wrong record is displayed. It should be 1 but it is " + getClipboard + endif + + DocumentWriter.TypeKeys("<MOD1 MOD2 RIGHT>") + + DocumentWriter.TypeKeys "<MOD1 F5>" , true + sleep(1) + DocumentWriter.TypeKeys "<SHIFT END>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + if getClipboard = "2" then + printlog "right record is displayed." + else + warnlog "wrong record is displayed. It should be 2 but it is " + getClipboard + endif + + DocumentWriter.TypeKeys("<MOD1 MOD2 LEFT>") + + DocumentWriter.TypeKeys "<MOD1 F5>" , true + sleep(1) + DocumentWriter.TypeKeys "<SHIFT END>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + if getClipboard = "1" then + printlog "right record is displayed." + else + warnlog "wrong record is displayed. It should be 1 but it is " + getClipboard + endif + + sleep(10) + + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tSearch + + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_Forms.odt")) + sleep(1) + FM_Search + sleep(1) + Kontext "RecordSearch" + SearchText.setText "3" + Search.Click + sleep(1) + CloseBtn.Click + + sleep(1) + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<MOD1 F5>" , true + sleep(1) + DocumentWriter.TypeKeys "<HOME>" , true + sleep(1) + DocumentWriter.TypeKeys "<SHIFT END>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + if getClipboard <> "3" then + warnlog "wrong record is displayed" + endif + sleep(1) + hCloseDocument + +endcase +'------------------------------------------------------------------------- +testcase tSort + + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_Forms.odt")) + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<MOD1 F5>" , true + + FM_Sort_Des + sleep(1) + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<MOD1 F5>" , true + sleep(1) + DocumentWriter.TypeKeys "<HOME>" , true + sleep(1) + DocumentWriter.TypeKeys "<SHIFT END>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + if getClipboard <> "3" then + warnlog "wrong record is displayed. It is " + getClipboard + " but it have to 3" + endif + sleep(1) + + FM_Sort_Asc + sleep(1) + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<MOD1 F5>" , true + sleep(1) + DocumentWriter.TypeKeys "<HOME>" , true + sleep(1) + DocumentWriter.TypeKeys "<SHIFT END>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + if getClipboard <> "1" then + warnlog "wrong record is displayed. It is " + getClipboard + " but it have to 1" + endif + sleep(1) + + FM_Sort_Des + sleep(1) + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<MOD1 F5>" , true + sleep(1) + DocumentWriter.TypeKeys "<HOME>" , true + sleep(1) + DocumentWriter.TypeKeys "<SHIFT END>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + if getClipboard <> "3" then + warnlog "wrong record is displayed. It is " + getClipboard + " but it have to 3" + endif + sleep(1) + + FM_Remove_Filter + sleep(1) + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<MOD1 F5>" , true + sleep(1) + DocumentWriter.TypeKeys "<HOME>" , true + sleep(1) + DocumentWriter.TypeKeys "<SHIFT END>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + if getClipboard <> "1" then + warnlog "wrong record is displayed. It is " + getClipboard + " but it have to 1" + endif + sleep(1) + + FM_Sort_Order + sleep(1) + Kontext "SortOrder" + FieldName1.select 2 + Order1.select 2 + SortOrder.OK + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<MOD1 F5>" , true + sleep(1) + DocumentWriter.TypeKeys "<HOME>" , true + sleep(1) + DocumentWriter.TypeKeys "<SHIFT END>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + if getClipboard <> "3" then + warnlog "wrong record is displayed. It is " + getClipboard + " but it have to 3" + endif + sleep(1) + hCloseDocument + +endcase +'------------------------------------------------------------------------- +testcase tViewAsGrid + + '///open the document TT_Forms.odt + printlog "pen the document TT_Forms.odt" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_Forms.odt")) + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<MOD1 F5>" , true + + '/// click on the icon view as grid + printlog "click on the icon view as grid" + FM_View_As_Grid + + sleep(1) + + '/// check if the grid appear + printlog "check if the grid appear" + Kontext "TableView" + if CurrentRecord.getText <> "1" then + warnlog "the first record is wrong" + endif + sleep(1) + NextRecord.Click + if CurrentRecord.getText <> "2" then + warnlog "the next record button in the table grid doesn't work" + endif + sleep(1) + + '/// close the view + printlog "close the view" + FM_View_As_Grid + + sleep(1) + + '/// close the document + printlog "close the document" + hCloseDocument + +endcase +'------------------------------------------------------------------------- +testcase tNewSaveDelete + + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_Forms.odt")) + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<MOD1 F5>" , true + + FM_New_Record + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "7" , true + + FM_Save_Record + + FM_First_Record + FM_Last_Record + + FM_Delete_Record + + Kontext "MessageBox" + if MessageBox.exists(3) then + MessageBox.Yes + else + warnlog "No confirm dialog when press delete record" + endif + + sleep(1) + hCloseDocument + +endcase +'------------------------------------------------------------------------- +testcase tCreateSubForms + + '/// open a new text document + printlog "open a new text document" + call hNewDocument + sleep(1) + '/// create a new form via the form navigator + printlog "create a new form via the form navigator" + + call hToolbarSelect("FORMDESIGNTOOLS",true) + + Kontext "FormDesignTools" + ShowFmExplorer.Click + sleep(2) + + Kontext "FormularNavigator" + Liste.TypeKeys "<SPACE>" + sleep(3) + Liste.OpenContextmenu + sleep(2) + hMenuSelectNr (1) + sleep(2) + hMenuSelectNr (1) + sleep(3) + Liste.TypeKeys "<RETURN>" + sleep(3) + Liste.OpenContextmenu + sleep(2) + hMenuSelectNr (6) + sleep(4) + + Kontext "FormPropertiesDialog" + FormPropertiesTabControl.SetPage TabDataForm + Kontext "TabDataForm" + '/// set the datasource gDatasourceName + printlog "set the datasource gDatasourceName" + DataSource.setText(gDSName) + TabDataForm.TypeKeys("<RETURN>") + '/// set the table TT_Forms + printlog "set the table TT_Forms" + Content.setText("TT_Forms") + sleep(1) + Content.TypeKeys("<RETURN>",true) + sleep(1) + Kontext "FormPropertiesDialog" + sleep(1) + FormPropertiesDialog.Close + sleep(3) + Kontext "FormularNavigator" + FormularNavigator.Close + sleep(4) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + '/// insert a textfield + printlog "insert a textfield" + Edit.Click + call hDrawingWithSelection ( 50, 30, 60, 40 ) + sleep(1) + + Kontext "FormControls" + ControlProperties.Click + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.SetPage TabDataControl + Kontext "TabDataControl" + DataField.setText "id" + TabDataControl.TypeKeys("<RETURN>",true) + sleep(1) + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.Close + + '/// now create the sub form + + call hToolbarSelect("FORMDESIGNTOOLS",true) + + Kontext "FormDesignTools" + ShowFmExplorer.Click + sleep(2) + + Kontext "FormularNavigator" + Liste.TypeKeys "<HOME>" ' move to the first entry in the formnavigator tree + sleep(1) + Liste.TypeKeys "<LEFT>" ' collaps the tree + sleep(1) + Liste.TypeKeys "<RIGHT>" ' expand the tree + sleep(1) + Liste.TypeKeys "<DOWN>" ' go one down + sleep(1) + Liste.OpenContextmenu + sleep(2) + hMenuSelectNr (1) + sleep(2) + hMenuSelectNr (1) + sleep(3) + Liste.TypeKeys "<RETURN>" + sleep(3) + Liste.OpenContextmenu + sleep(2) + hMenuSelectNr (6) + sleep(4) + + Kontext "FormPropertiesDialog" + FormPropertiesTabControl.SetPage TabDataForm + Kontext "TabDataForm" + '/// set the datasource gDatasourceName + printlog "set the datasource gDatasourceName" + DataSource.setText(gDSName) + TabDataForm.TypeKeys("<RETURN>",true) + '/// set the contenttype SQL + printlog "set the contenttype SQL" + ContentType.select 3 + sleep(1) + '/// set the sql string : select * from TT_Forms where id=:var1" + printlog "set the sql string : select * from TT_Forms where id=:var1" + TabDataForm.TypeKeys "<RETURN>" , true + sleep(1) + Content.TypeKeys "select * from TT_Forms where id=:var1" , true + sleep(1) + TabDataForm.TypeKeys("<RETURN>") + sleep(1) + '/// set link master field + printlog "set link master field" + TabDataForm.TypeKeys "<TAB>" , 11 , true + sleep(1) + TabDataForm.TypeKeys "id" , true + sleep(1) + TabDataForm.TypeKeys "<RETURN>" , true + sleep(1) + '/// set link slave field + printlog "set link slave field" + TabDataForm.TypeKeys "<RETURN>" , true + sleep(1) + TabDataForm.TypeKeys "var1" , true + sleep(1) + TabDataForm.TypeKeys("<RETURN>",true) + sleep(1) + + Kontext "FormPropertiesDialog" + FormPropertiesDialog.Close + sleep(3) + Kontext "FormularNavigator" + FormularNavigator.Close + sleep(4) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + + '/// insert a textfield + printlog "insert a textfield" + 'Edit.Click + call hDrawingWithSelection ( 50, 50, 60, 60 ) + sleep(1) + + Kontext "FormControls" + ControlProperties.Click + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.SetPage TabDataControl + Kontext "TabDataControl" + DataField.setText "id" + TabDataControl.TypeKeys("<RETURN>") + sleep(1) + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.Close + + Kontext "FormControls" + SwitchControlDesignMode.Click + sleep(1) + + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_SubForm.odt")) + + call hCloseDocument + +endcase +'------------------------------------------------------------------------- +testcase tCheckSubForm + + '/// open the file TTSubForm.sxw + printlog "open the file TTSubForm.sxw" + hFileOpen ( gOfficePath + ConvertPath("user/work/TT_SubForm.odt")) + + '/// set cursor into the first control + printlog "set cursor into the first control" + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<MOD1 F6>" , true + wait(1000) + DocumentWriter.TypeKeys "<MOD1 F5>" , true + sleep(1) + + FM_Next_Record + sleep(1) + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<TAB>" , true + sleep(1) + DocumentWriter.TypeKeys "<SHIFT END>" , true + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(1) + if getClipboard <> "2" then + warnlog "wrong record is displayed in subform. It is " + getClipboard + " but it have to 2" + endif + sleep(1) + call hCloseDocument + +endcase +'------------------------------------------------------------------------- +testcase tCreateSubFormsNewMethod + + '/// open a new text document + printlog "open a new text document" + call hNewDocument + sleep(1) + '/// create a new form via the form navigator + printlog "create a new form via the form navigator" + + call hToolbarSelect("FORMDESIGNTOOLS",true) + + Kontext "FormDesignTools" + ShowFmExplorer.Click + sleep(2) + + Kontext "FormularNavigator" + Liste.TypeKeys "<SPACE>" + sleep(3) + Liste.OpenContextmenu + sleep(2) + hMenuSelectNr (1) + sleep(2) + hMenuSelectNr (1) + sleep(3) + Liste.TypeKeys "<RETURN>" + sleep(3) + Liste.OpenContextmenu + sleep(2) + hMenuSelectNr (6) + sleep(4) + + Kontext "FormPropertiesDialog" + FormPropertiesTabControl.SetPage TabDataForm + Kontext "TabDataForm" + '/// set the datasource gDatasourceName + printlog "set the datasource gDatasourceName" + DataSource.setText(gDSName) + TabDataForm.TypeKeys "<RETURN>" , true + '/// set the table TT_Forms + printlog "set the table TT_Forms" + Content.setText("TT_Forms") + TabDataForm.TypeKeys "<RETURN>" , true + sleep 1 + Kontext "FormPropertiesDialog" + FormPropertiesDialog.Close + sleep(3) + Kontext "FormularNavigator" + FormularNavigator.Close + sleep(4) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + '/// insert a textfield + printlog "insert a textfield" + Edit.Click + call hDrawingWithSelection ( 50, 30, 60, 40 ) + sleep(1) + + Kontext "FormControls" + ControlProperties.Click + sleep 1 + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.SetPage TabDataControl + sleep 1 + Kontext "TabDataControl" + DataField.setText "id" + TabDataControl.TypeKeys "<RETURN>" , true + sleep(1) + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.Close + sleep 1 + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys("subform",true) + + '/// now create the sub form + call hToolbarSelect("FORMDESIGNTOOLS",true) + + Kontext "FormDesignTools" + ShowFmExplorer.Click + sleep(2) + + Kontext "FormularNavigator" + Liste.TypeKeys "<HOME>" ' move to the first entry in the formnavigator tree + sleep(1) + Liste.TypeKeys "<LEFT>" ' collaps the tree + sleep(1) + Liste.TypeKeys "<RIGHT>" ' expand the tree + sleep(1) + Liste.TypeKeys "<DOWN>" ' go one down + sleep(1) + Liste.OpenContextmenu + sleep(2) + hMenuSelectNr (1) + sleep(2) + hMenuSelectNr (1) + sleep(3) + Liste.TypeKeys "<RETURN>" + sleep(3) + Liste.OpenContextmenu + sleep(2) + hMenuSelectNr (6) + sleep(4) + + Kontext "FormPropertiesDialog" + FormPropertiesTabControl.SetPage TabDataForm + Kontext "TabDataForm" + '/// set the datasource gDatasourceName + printlog "set the datasource gDatasourceName" + DataSource.setText(gDSName) + TabDataForm.TypeKeys("<RETURN>", true) + sleep 1 + '/// set the contenttype SQL + printlog "set the contenttype to table" + ContentType.select 1 + TabDataForm.TypeKeys("<RETURN>", true) + sleep(1) + '/// set the table TT_Forms + printlog "set the table TT_Forms" + Content.select 1 + sleep(1) + TabDataForm.TypeKeys("<RETURN>", true) + sleep 1 + '/// open the Form Link dialog set link master field + printlog "open the Form Link dialog set link master field" + FormLinkDLGButton.click + sleep(1) + Kontext "FormLinkDialog" + '/// select the field id for the master and the link field + printlog "select the field id for the master and the link field" + LinkDetail1.select 1 + LinkMaster1.select 1 + '/// close the dialog with OK + printlog "close the dialog with OK" + FormLinkDialog.OK + + Kontext "FormPropertiesDialog" + FormPropertiesDialog.Close + sleep(3) + + Kontext "FormularNavigator" + FormularNavigator.Close + sleep(4) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + + '/// insert a textfield + printlog "insert a textfield" + 'Edit.Click + call hDrawingWithSelection ( 50, 40, 60, 50 ) + sleep(1) + + Kontext "FormControls" + ControlProperties.Click + + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.SetPage TabDataControl + Kontext "TabDataControl" + DataField.setText "id" + TabDataControl.TypeKeys("<RETURN>" , true) + sleep(1) + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.Close + sleep(1) + + Kontext "FormControls" + SwitchControlDesignMode.Click + sleep(1) + + hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_SubForm.odt")) + + call hCloseDocument + +endcase +'-------------------------------------------------------------------------------------- +testcase tNewFolder + + '/// test the folder feature inside the form container + + '/// open the database <OfficePath>/user/work/TT_hsqldb.odb + printlog "open the database " + gOfficePath + "user/work/TT_hsqldb.odb" + call fOpenDatabase(gOfficePath + "user/work/TT_hsqldb.odb") + + '/// display the form container + printlog "display the form container" + Kontext "ContainerView" + ViewForms + if ( Not FormTree.exists(1) ) then + warnlog "The form tree doesn't exists" + goto endsub + end if + + '/// insert a new folder via INSERT/FOLDER menu + printlog "insert a new folder via INSERT/FOLDER menu" + Kontext "DATABASE" + Database.UseMenu + hMenuSelectNr(4) + hMenuSelectNr(8) + + '/// insert a new folder name + printlog "insert a new folder name" + Kontext "FormFolderNameDialog" + Foldername.setText("Folder1") + FormFolderNameDialog.OK + + '/// close the database and save changes + printlog "close the database and save changes" + call fCloseDatabase(true) + + '/// open the database again + printlog "open the database again" + call fOpenDatabase(gOfficePath + "user/work/TT_hsqldb.odb") + + '/// check if he folder still exists + printlog "check if he folder still exists" + if (fFindForm("Folder1")) then + printlog "Folder available after save and reload" + else + warnlog "Folder _not_ available after save and reload" + endif + + '/// close the database again + printlog "close the database again" + call fCloseDatabase() + +endcase +'-------------------------------------------------------------------------------------- +testcase tRenameFolder + + '/// test the folder feature inside the form container + '/// test for issue 75723 + + '/// open the database <OfficePath>/user/work/TT_hsqldb.odb + printlog "open the database " + gOfficePath + "user/work/TT_hsqldb.odb" + call fOpenDatabase(gOfficePath + "user/work/TT_hsqldb.odb") + + '/// display the form container + printlog "display the form container" + Kontext "ContainerView" + ViewForms + if ( Not FormTree.exists(1) ) then + warnlog "The form tree doesn't exists" + goto endsub + end if + + '/// insert a new folder via INSERT/FOLDER menu + printlog "insert a new folder via INSERT/FOLDER menu" + Kontext "DATABASE" + Database.UseMenu + hMenuSelectNr(4) + hMenuSelectNr(8) + + '/// insert a new folder name + printlog "insert a new folder name" + Kontext "FormFolderNameDialog" + Foldername.setText("Folder2") + FormFolderNameDialog.OK + + '/// check if he folder still exists + printlog "check if he folder still exists" + if (fFindForm("Folder2")) then + printlog "new folder available" + else + warnlog "new folder not available" + goto endsub + endif + + '/// insert a new folder under the first folder + printlog "insert a new folder under the first folder" + + Kontext "DATABASE" + Database.UseMenu + hMenuSelectNr(4) + hMenuSelectNr(8) + + '/// insert a new folder name + printlog "insert a new folder name" + Kontext "FormFolderNameDialog" + Foldername.setText("Folder3") + FormFolderNameDialog.OK + + '/// select the first folder + printlog "select the first folder" + if (fFindForm("Folder2")) then + printlog "first folder selected" + else + warnlog "first folder not found" + goto endsub + endif + + '/// rename the firt folder + printlog "rename the firt folder" + Kontext "DATABASE" + Database.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(7) + + Kontext "FormFolderNameDialog" + FolderReName.setText("Folder4") + FormFolderNameDialog.OK + + '/// check if the folder still exists + printlog "check if the folder still exists" + if (fFindForm("Folder3")) then + printlog "folder found" + else + warnlog "#i75723# folder not found." + endif + + '/// close the database and discade changes + printlog "close the database and discade changes" + call fCloseDatabase(false) + +endcase +'------------------------------------------------------------------------- +testcase tViewAsGridEmbeddedForm + + '/// open the database <OfficePath>/user/work/TT_hsqldb.odb + printlog "open the database " + gOfficePath + "user/work/TT_hsqldb.odb" + call fOpenDatabase(gOfficePath + "user/work/TT_hsqldb.odb") + + + '/// open form Form1 + printlog "open form Form1" + call fOpenForm("Form1") + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<MOD1 F5>" , true + + '/// click on the icon view as grid + printlog "click on the icon view as grid" + FM_View_As_Grid + + sleep(1) + + '/// check if the grid appear + printlog "check if the grid appear" + Kontext "TableView" + if CurrentRecord.getText <> "1" then + warnlog "the first record is wrong" + endif + sleep(1) + NextRecord.Click + if CurrentRecord.getText <> "2" then + warnlog "the next record button in the table grid doesn't work" + endif + sleep(1) + + '/// close the view + printlog "close the view" + FM_View_As_Grid + + sleep(1) + + '/// close the form + printlog "close the form" + fCloseForm + + '/// close the database + printlog "close the database" + call fCloseDatabase + +endcase + diff --git a/testautomation/dbaccess/optional/includes/misc_Macros.inc b/testautomation/dbaccess/optional/includes/misc_Macros.inc new file mode 100644 index 000000000000..e707682e3218 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/misc_Macros.inc @@ -0,0 +1,115 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : macros in databases +'* +'\*********************************************************************** + +sub misc_Macros + + printlog "------------------- misc_Macros.inc ------------------------" + + call tMacros + +end sub +'------------------------------------------------------------------------- +testcase tMacros + + hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_LOW ) + + dim sFileName as String + sFileName = ConvertPath(gOfficePath + "/user/work/hsql_macros_in_subdocument.odb") + app.FileCopy ConvertPath(gTesttoolPath + "/dbaccess/optional/input/hsql_datasource/hsql_macros_in_subdocument.odb"), ConvertPath(gOfficePath + "/user/work/hsql_macros_in_subdocument.odb") + + ' delete the backup file + if fileexists(sFileName + "backup.odb") then + app.kill sFileName + "backup.odb" + endif + + FileOpen + sleep (1) + Kontext "OeffnenDlg" + '/// open the given file + printlog "open the file: " + sFileName + Dateiname.SetText sFileName + sleep (3) + Oeffnen.Click + sleep (3) + + printlog "check if the subdocument contains macros dialog appear" + Kontext "MessageBox" + if (MessageBox.exists(1)) then + MessageBox.OK + else + warnlog "the subdocument contains macros dialog does not appear" + endif + + MigrateMacros + + WaitSlot(10) + + Kontext "MacroMigration" + if not (MacroMigration.exists(1)) then + warnlog "MacroMigration wizard does not appear" + endif + + NextButton.click + + BackupLocation.settext sFileName + "backup.odb" + + NextButton.click + sleep(20) + MacroMigration.OK + + call fCloseDatabase + + printlog "open the database again to see if the message box appear again" + + FileOpen + sleep (1) + Kontext "OeffnenDlg" + '/// open the given file + printlog "open the file: " + sFileName + Dateiname.SetText sFileName + sleep (3) + Oeffnen.Click + sleep (3) + + Kontext "MessageBox" + if (MessageBox.exists(1)) then + warnlog "MessageBox about macros appear. Should not after migration." + else + 'nothing + endif + + call fCloseDatabase + + hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT ) + +endcase diff --git a/testautomation/dbaccess/optional/includes/misc_RegisterDatabase.inc b/testautomation/dbaccess/optional/includes/misc_RegisterDatabase.inc new file mode 100644 index 000000000000..7e9eabf664d9 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/misc_RegisterDatabase.inc @@ -0,0 +1,63 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Register database +'* +'\*********************************************************************** + +sub misc_RegisterDatabase + + printlog "------------------- misc_RegisterDatabase.inc ------------------------" + + call tRegisterDatabase + +end sub +'------------------------------------------------------------------------- +testcase tRegisterDatabase + + ' if the cws dba30 is integrated use revision 1.5 of this file + + call fCreateDbaseDatasource(gOfficePath + "user/work/TT_RegisterTest.odb",gOfficePath + "user/work") + call fRegisterDatabaseFile(gOfficePath + "user/work/TT_RegisterTest.odb","TT_Register") + + call hNewDocument + + ViewCurrentDatabase + + if ( not fSelectDatasourceInBeamer("TT_Register") ) then + warnlog "the datasource registration doesn't work. The database is not displayed in the beamer" + endif + + call fDeRegisterDatabaseFile("TT_Register") + + call hCloseDocument + +endcase + + diff --git a/testautomation/dbaccess/optional/includes/rpt_Charts.inc b/testautomation/dbaccess/optional/includes/rpt_Charts.inc new file mode 100644 index 000000000000..cb7fc8ab1ce4 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/rpt_Charts.inc @@ -0,0 +1,94 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : +'* +'* short description : +'* +'\*********************************************************************** + +sub rpt_Charts + + tInsertChart + +end sub +'-------------------------------------------------------------------------------------- +testcase tInsertChart + + printlog "open Bibliography database" + call fOpenDataBase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + printlog "open the report designer" + call fOpenNewReportDesign + + sleep(1) + + printlog "select the first table in the content list box" + Kontext "ReportDataProperties" + Content.select 1 + Content.typeKeys("<RETURN>",true) ' important to leave the listbox + + 'close the Add Field dialog to get the focus back to the design + call fCloseAddFieldDialog + + printlog "insert a chart" + Kontext "StandardBar" + CreateChart.Click + sleep(1) + + Kontext "ReportDesign" + ReportDesign.MouseDown ( 30, 10 ) + ReportDesign.MouseMove ( 40, 20 ) + ReportDesign.MouseUp ( 40, 20 ) + + sleep(1) + + '/// execute the report + printlog "execute the report" + call fExecuteReport + + sleep(10) + + '/// check if the report is created + printlog "check if the report is created" + Kontext "DocumentWriter" + if (DocumentWriter.exists(10)) then + hFileSaveAsKill(gOfficePath + ConvertPath("user/work/report01.odt")) + call fCloseReportView + else + warnlog "No report is created." + endif + + '/// close the report designer + printlog "close the report designer" + call fCloseReportDesign + + '/// close the database + printlog "close the database" + call fCloseDatabase + +endcase
\ No newline at end of file diff --git a/testautomation/dbaccess/optional/includes/rpt_DateTime.inc b/testautomation/dbaccess/optional/includes/rpt_DateTime.inc new file mode 100644 index 000000000000..53c9570a5d75 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/rpt_DateTime.inc @@ -0,0 +1,298 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Date Time Dialog +'* +'\*********************************************************************************** +sub rpt_DateTime + + printlog "------------------ rpt_DateTime.inc ---------------------" + + call tDefaultSetting + call tDateTime + +end sub +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +testcase tDefaultSetting + + '/// FILE / OPEN / biblio.odb + printlog "FILE / OPEN / biblio.odb" + call fOpenDataBase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + '/// INSERT / REPORT + printlog "INSERT / REPORT" + call fOpenNewReportDesign + + sleep(1) + + '/// select any section to get the insert page number menu item activated + printlog "select any section to get the insert page number menu item activated" + Kontext "ReportDesign" + ReportDesign.MouseDown(50, 10) + ReportDesign.MouseUp(50, 10) + + '/// INSERT / DATE TIME + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(4) + hMenuSelectNr(2) + + sleep(1) + '/// check if the "Date Time" dialog appear + printlog "check if the ""Date Time"" dialog appear" + Kontext "ReportDateTime" + if (ReportDateTime.exists(3)) then + + '/// check if ""IncludeDate"" is checked + printlog "check if ""IncludeDate"" is checked" + if ( IncludeDate.isChecked() ) then + printlog "Default ""IncludeDate"" is checked" + else + warnlog "Default ""IncludeDate"" is not checked" + endif + + '/// check if the date format list box is enabled + printlog "check if the date format list box is enabled" + if DateFormat.isEnabled() then + printlog "Date fomat List box is enabled" + else + printlog "Date fomat List box is disabled" + endif + + '/// check if ""IncludeTime"" is checked + printlog "check if ""IncludeTime"" is checked" + if ( IncludeTime.isChecked() ) then + printlog "Default ""IncludeTime"" is checked" + else + warnlog """IncludeTime"" is not checked" + endif + + '/// check if the time format list box is enabled + printlog "check if the time format list box is enabled" + if TimeFormat.isEnabled() then + printlog "Time fomat list box is enabled" + else + printlog "Time fomat Llst box is disabled" + endif + + '/// close dialog with OK + printlog "close dialog with OK" + ReportDateTime.OK + else + warnlog "ReportDateTime doesn't exists" + endif + + '/// close the report designer with WINDOW / CLOSE + printlog "close the report designer with WINDOW / CLOSE" + call fCloseReportDesign + + '/// close the database with FILE / CLOSE + printlog "close the database with FILE / CLOSE" + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tDateTime + + '/// 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 + + sleep(1) + + '/// 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 + + 'close the Add Field dialog to get the focus back to the design + call fCloseAddFieldDialog + + '/// turn off the page header + call fSwitchPageHeader + + '/// 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 ) + + Kontext "ReportDesign" + ReportAlignLeft + ReportAlignUp + + sleep(1) + + '/// select the first field in the property browser for this control + printlog "select the first field in the property browser for this control" + Kontext "ReportPropertiesTabControl" + ReportPropertiesTabControl.setPage ReportDataProperties + + Kontext "ReportDataProperties" + DataField.select 1 + DataField.typeKeys("<RETURN>",true) ' important to leave the listbox + + ' select detail section with unselect the control + Kontext "ReportDesign" + ReportDesign.MouseDown(50, 10) + ReportDesign.MouseUp(50, 10) + + '/// set the Detail sectio to the minial height + printlog "set the Detail sectio to the minial height" + Kontext "ReportGeneralProperties" + Height.setText("0") + Height.typeKeys("<RETURN>",true) + + '/// tunr on pageHeader again + call fSwitchPageHeader + + '/// select the page header + Kontext "ReportDesign" + ReportDesign.MouseDown(50, 10) + ReportDesign.MouseUp(50, 10) + + '/// INSERT / DATE TIME + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(4) + hMenuSelectNr(2) + + sleep(1) + + '/// check the 3. date and time option + printlog "check the 3. date and time option" + Kontext "ReportDateTime" + DateFormat.select 3 + TimeFormat.select 3 + + '/// close dialog with OK + printlog "close dialog with OK" + ReportDateTime.OK + + sleep(2) + + '/// select the date field and check if the date field contain the function TODAY() + printlog "select the date field and check if the date field contain the function TODAY()" + Kontext "ReportDesign" + ReportDesign.typeKeys("<TAB>",true) + sleep(1) + Kontext "ReportPropertiesTabControl" + ReportPropertiesTabControl.setPage ReportDataProperties + sleep(1) + Kontext "ReportDataProperties" + dim s as string + s = DataField.getSelText() + if (instr(s,"TODAY()") = 0) then + warnlog "The date function is not correct.The function is " + s + else + printlog "The date function is correct." + endif + + '/// select the time field and check if the data field contains the function now() + printlog "select the time field and check if the data field contains the function now()" + Kontext "ReportDesign" + ReportDesign.typeKeys("<MOD1 F6>",true) ' go to the document window + sleep(1) + ReportDesign.typeKeys("<MOD1 F6>",true) ' really go to the document window + sleep(1) + ReportDesign.typeKeys("<TAB>",true) + sleep(1) + + Kontext "ReportPropertiesTabControl" + ReportPropertiesTabControl.setPage ReportDataProperties + sleep(1) + Kontext "ReportDataProperties" + s = DataField.getSelText() + if (instr(s,"NOW()") = 0) then + warnlog "The time function is not correct.The function is " + s + else + printlog "The time function is correct." + endif + + '/// execute the report + call fExecuteReport + + sleep(10) + + '/// check if the report is created + printlog "check if the report is created" + Kontext "DocumentWriter" + if (DocumentWriter.exists(10)) then + hFileSaveAsKill(gOfficePath + ConvertPath("user/work/report_date_time.odt")) + call fCloseReportView + else + warnlog "No report is created." + endif + + '/// close the report designer with WINDOW / CLOSE + printlog "close the report designer with WINDOW / CLOSE" + call fCloseReportDesign + + '/// close the database with FILE / CLOSE + printlog "close the database with FILE / CLOSE" + call fCloseDatabase + + + + '---- check the saved report with SAX parser + dim iNumberOfChilds as integer + dim sText as string + + UnpackStorage( gOfficePath & ConvertPath("user/work/report_date_time.odt") , gOfficePath & ConvertPath("user/work/report_date_time") ) + + SAXReadFile(gOfficePath & ConvertPath("user/work/report_date_time/content.xml")) + + SAXSeekElement("office:document-content") + SAXSeekElement("office:body") + SAXSeekElement("office:text") + SAXSeekElement("table:table") + + iNumberOfChilds = SAXGetChildCount + 'print iNumberOfChilds + + + SAXRelease + + '--- end of SAX check + +endcase +'------------------------------------------------------------------------- + diff --git a/testautomation/dbaccess/optional/includes/rpt_ExecuteReport.inc b/testautomation/dbaccess/optional/includes/rpt_ExecuteReport.inc new file mode 100644 index 000000000000..7ba19ac8e449 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/rpt_ExecuteReport.inc @@ -0,0 +1,229 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Execute Report +'* +'\*********************************************************************************** +sub rpt_ExecuteReport + + printlog "------------------ rpt_ExecuteReport.inc ---------------------" + + call tExecute + +end sub +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +testcase tExecute + + '/// 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 + + sleep(1) + + '/// 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 + + 'close the Add Field dialog to get the focus back to the design + call fCloseAddFieldDialog + + '/// turn of the page header + call fSwitchPageHeader + + '/// 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 ) + '/// align the control top left + printlog "align the control top left" + Kontext "ReportDesign" + ReportAlignLeft + ReportAlignUp + sleep(1) ' need a sleep before using the propety browser + Kontext "ReportPropertiesTabControl" + ReportPropertiesTabControl.setPage ReportDataProperties + + '/// bind the first field of the tabel to the control + printlog "bind the first field of the tabel to the control" + Kontext "ReportDataProperties" + DataField.select 1 + DataField.typeKeys("<RETURN>",true) ' important to leave the listbox + + Kontext "ReportPropertiesTabControl" + ReportPropertiesTabControl.setPage ReportGeneralProperties + + sleep(1) + + '/// select the 11. color (light green) for the background color + printlog "select the 11. color (light green) for the background color" + Kontext "ReportGeneralProperties" + ControlBackgroundTransparent.select 1 + sleep(1) + BackGroundColor.select 11 + sleep(2) + Height.setText("5") + Height.typeKeys("<RETURN>",true) + + ' select detail section with unselect the control + Kontext "ReportDesign" + ReportDesign.MouseDown(50, 10) + ReportDesign.MouseUp(50, 10) + sleep(1) + Kontext "ReportGeneralProperties" + Height.setText("5") + Height.typeKeys("<RETURN>",true) + + sleep(1) + + '/// execute the report + printlog "execute the report" + call fExecuteReport + + sleep(10) + + '/// check if the report is created + printlog "check if the report is created" + Kontext "DocumentWriter" + if (DocumentWriter.exists(10)) then + hFileSaveAsKill(gOfficePath + ConvertPath("user/work/report01.odt")) + call fCloseReportView + else + warnlog "No report is created." + endif + + '/// close the report designer + printlog "close the report designer" + call fCloseReportDesign + + '/// close the database + printlog "close the database" + call fCloseDatabase + + '---- check the saved report with SAX parser + dim iNumberOfChilds as integer + dim sText as string + + UnpackStorage( gOfficePath & ConvertPath("user/work/report01.odt") , gOfficePath & ConvertPath("user/work/report01") ) + + SAXReadFile(gOfficePath & ConvertPath("user/work/report01/content.xml")) + + SAXSeekElement("office:document-content") + SAXSeekElement("office:body") + SAXSeekElement("office:text") + SAXSeekElement("table:table") + + iNumberOfChilds = SAXGetChildCount + dim iLoop as integer + dim iCount as integer + iCount = 0 + for iLoop = 1 to iNumberOfChilds + SAXSeekElement(iLoop) + if ( SAXGetElementName() = "table:table-row" ) then + iCount = iCount + 1 + endif + SAXSeekElement(0) + next + + if (iCount <> 59 ) then + warnlog "there should be 59 rows in the table, but there are " + iNumberOfChilds + SAXRelease + goto endsub + endif + SAXSeekElement("table:table-row",10) + + ' printlog SAXGetChildCount + SAXSeekElement("table:table-cell") + SAXSeekElement("text:p") + SAXSeekElement(1) + sText = SAXGetChars + + if (sText <> "SUN02") then + warnlog "The text in the 10. row should be GRA00, but it is " + sText + endif + + 'check background color + SAXSeekElement("/") + SAXSeekElement("office:document-content") + SAXSeekElement("office:body") + SAXSeekElement("office:text") + SAXSeekElement("table:table") + SAXSeekElement("table:table-row",10) + SAXSeekElement("table:table-cell") + SAXSeekElement("text:p") + + 'text:style-name="P1 + dim sStyle as string + sStyle = SAXGetAttributeValue("text:style-name") + 'printlog sStyle + + dim iChildCount as integer + dim iChildNumber as integer + dim sBackgroundColor as string + dim a as string + SAXSeekElement("/") + SAXSeekElement("office:document-content") + SAXSeekElement("office:automatic-styles") + a = SAXGetChildCount + for iChildNumber = 1 to iChildCount + SAXSeekElement("/") + SAXSeekElement("office:document-content") + SAXSeekElement("office:automatic-styles") + SAXSeekElement(iChildNumber) + 'printlog SAXGetAttributeValue("style:name") + if SAXGetAttributeValue("style:name") = sStyle then + SAXSeekElement("style:paragraph-properties") + sBackgroundColor = SAXGetAttributeValue("fo:background-color") + if sBackgroundColor <> "#00ff00" then + warnlog "wrong color. It should be #00ff00 but it is " + sBackgroundColor + else + 'printlog "right color" + endif + endif + next + SAXRelease + + '--- end of SAX check + +endcase +'------------------------------------------------------------------------- + diff --git a/testautomation/dbaccess/optional/includes/rpt_Formating.inc b/testautomation/dbaccess/optional/includes/rpt_Formating.inc new file mode 100644 index 000000000000..4bde542bd176 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/rpt_Formating.inc @@ -0,0 +1,201 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Formating +'* +'\*********************************************************************************** +sub rpt_Formating + + printlog "------------------ rpt_Formating.inc ---------------------" + + call tConditionalFormating + call tGrowAndShrink + +end sub +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +testcase tConditionalFormating + + dim iCount as Integer + + '/// 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 + + sleep(1) + + '/// insert a data control + printlog "insert a data control" + Kontext "FormControls" + Edit.Click + sleep(1) + + Kontext "ReportDesign" + ReportDesign.MouseDown ( 30, 40 ) + ReportDesign.MouseMove ( 40, 50 ) + ReportDesign.MouseUp ( 40, 50 ) + 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 there is one condition + printlog "check if there is one condition" + + '/// add 2 more conditions and check if the dialog grows + printlog "add 2 more conditions and check if the dialog grows" + + '/// add one more condition and check if the scrollbar gets enabled + printlog "add one more condition and check if the scrollbar gets enabled" + + '/// check if the right condition is displayed + printlog "check if the right condition is displayed" + + '/// remove the second condition and check if the scrollbar gets disabled + printlog "remove the second condition and check if the scrollbar gets disabled" + + '/// remove 2 conditions and check if the dialog skrink + printlog "remove 2 conditions and check if the dialog skrink" + + '/// close the Conditional Formating Dialog + printlog "close the Conditional Formating Dialog" + Kontext "ConditionalFormating" + ConditionalFormating.OK + + '/// close the report designer + printlog "close the report designer" + call fCloseReportDesign + + '/// close the database + printlog "close the database" + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tGrowAndShrink + + dim iCount as Integer + dim iSizeY as Integer + + '/// 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 + + sleep(1) + + '/// insert a data control + printlog "insert a data control" + Kontext "FormControls" + Edit.Click + sleep(1) + + Kontext "ReportDesign" + ReportDesign.MouseDown ( 30, 40 ) + ReportDesign.MouseMove ( 40, 50 ) + ReportDesign.MouseUp ( 40, 50 ) + 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) + + sleep(1) + + '/// add 1 more conditions and check if the dialog grows + printlog "add 1 more conditions and check if the dialog grows" + + Kontext "ConditionalFormating" + ' save the height + iSizeY = ConditionalFormating.getSizeY() + ' add one more condition + ConditionalFormating.TypeKeys("<TAB>",true) + ConditionalFormating.TypeKeys("<TAB>",true) + ConditionalFormating.TypeKeys("<TAB>",true) + ConditionalFormating.TypeKeys("<RETURN>",true) + 'compare the both height + if (iSizeY >= ConditionalFormating.getSizeY()) then + warnlog "the dialog doesn't grow" + endif + + '/// remove 1 conditions and check if the dialog skrink + printlog "remove 1 conditions and check if the dialog skrink" + Kontext "ConditionalFormating" + ' save the height + iSizeY = ConditionalFormating.getSizeY() + ' add one more condition + ConditionalFormating.TypeKeys("<TAB>",true) + ConditionalFormating.TypeKeys("<TAB>",true) + ConditionalFormating.TypeKeys("<TAB>",true) + ConditionalFormating.TypeKeys("<TAB>",true) + ConditionalFormating.TypeKeys("<TAB>",true) + ConditionalFormating.TypeKeys("<RETURN>",true) + 'compare the both height + if (iSizeY <= ConditionalFormating.getSizeY()) then + warnlog "the dialog doesn't shrink" + endif + + ConditionalFormating.Close() + + '/// add one more condition and check if the scrollbar gets enabled + printlog "add one more condition and check if the scrollbar gets enabled" + + '/// check if the right condition is displayed + printlog "check if the right condition is displayed" + + '/// remove the second condition and check if the scrollbar gets disabled + printlog "remove the second condition and check if the scrollbar gets disabled" + + + + '/// close the report designer + printlog "close the report designer" + call fCloseReportDesign + + '/// close the database + printlog "close the database" + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- diff --git a/testautomation/dbaccess/optional/includes/rpt_FunctionWizard.inc b/testautomation/dbaccess/optional/includes/rpt_FunctionWizard.inc new file mode 100644 index 000000000000..810b2168c3ce --- /dev/null +++ b/testautomation/dbaccess/optional/includes/rpt_FunctionWizard.inc @@ -0,0 +1,117 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Function Wizard +'* +'\*********************************************************************************** +sub rpt_FunctionWizard + + printlog "------------------ rpt_FunctionWizard.inc ---------------------" + + call tFunctionWizard + +end sub +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +testcase tFunctionWizard + + printlog "open Bibliography database" + call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + printlog "open the report designer" + call fOpenNewReportDesign + + 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() + + 'press 2 time tab to select the edit field + Kontext "ReportDesign" + ReportDesign.TypeKeys("<TAB>",true) + ReportDesign.TypeKeys("<TAB>",true) + + sleep(1) + + printlog "click on the ... button behind the datafield property in the property browser" + Kontext "ReportDataProperties" + OpenFormularWizard.Click + + printlog "check if the function wizard appear" + Kontext "FunctionWizard" + if(FunctionWizard.exists(5)) then + printlog "The function wizard appear -> OK" + + CategoryLB.select(5) + sleep(1) + FunctionLB.select(6) + sleep(1) + NextBt.Click + sleep(1) + Editfield1.setText("""12/18/2008""") + sleep(1) + + FunctionWizard.OK + else + warnlog "The function wizard does not appear -> FAILED" + endif + + call fExecuteReport + + sleep(10) + + '/// check if the report is created + printlog "check if the report is created" + Kontext "DocumentWriter" + if (DocumentWriter.exists(10)) then + call fCloseReportView + else + warnlog "No report is created." + endif + + printlog "close the report designer" + call fCloseReportDesign + printlog "close the database" + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- + diff --git a/testautomation/dbaccess/optional/includes/rpt_Grouping.inc b/testautomation/dbaccess/optional/includes/rpt_Grouping.inc new file mode 100644 index 000000000000..229aebb7f599 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/rpt_Grouping.inc @@ -0,0 +1,156 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Grouping Report +'* +'\*********************************************************************************** +sub rpt_Grouping + + printlog "------------------ rpt_Grouping.inc ---------------------" + + call tGrouping + +end sub +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +testcase tGrouping + + '/// 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 + + sleep(1) + + '/// 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 + + 'close the Add Field dialog to get the focus back to the design + call fCloseAddFieldDialog + + '/// turn of the page header + call fSwitchPageHeader + + '/// 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 ) + + Kontext "ReportDesign" + + '/// align the control to the left + ReportDesign.UseMenu + hMenuSelectNr(5) + hMenuSelectNr(5) + hMenuSelectNr(1) + + '/// align the control to the top + ReportDesign.UseMenu + hMenuSelectNr(5) + hMenuSelectNr(5) + hMenuSelectNr(4) + + sleep(1) + + Kontext "ReportPropertiesTabControl" + ReportPropertiesTabControl.setPage ReportDataProperties + + Kontext "ReportDataProperties" + DataField.select 1 + DataField.typeKeys("<RETURN>",true) ' important to leave the listbox + + ' select detail section with unselect the control + Kontext "ReportDesign" + ReportDesign.MouseDown(50, 10) + ReportDesign.MouseUp(50, 10) + + Kontext "ReportGeneralProperties" + Height.setText("0") + Height.typeKeys("<RETURN>",true) + + + + '/// open the sorting and grouping + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(3) + hMenuSelectNr(4) + + sleep(1) + + Kontext "ReportSortingGrouping" + if (ReportSortingGrouping.exists(3)) then + Groups.typeKeys("Type",true) + Groups.typeKeys("<return>",true) + sleep(1) + ReportSortingGrouping.Close + else + warnlog "ReportSortingGrouping doesn't exists" + endif + + sleep(1) + + '/// execute the report + call fExecuteReport + + sleep(10) + + '/// check if the report is created + printlog "check if the report is created" + Kontext "DocumentWriter" + if (DocumentWriter.exists(10)) then + call fCloseReportView + else + warnlog "No report is created." + endif + + '/// close the report designer + printlog "close the report designer" + call fCloseReportDesign + + '/// close the database + printlog "close the database" + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- + diff --git a/testautomation/dbaccess/optional/includes/rpt_PageNumber.inc b/testautomation/dbaccess/optional/includes/rpt_PageNumber.inc new file mode 100644 index 000000000000..a7fae4c7ffd4 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/rpt_PageNumber.inc @@ -0,0 +1,257 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Page Number +'* +'\*********************************************************************************** +sub rpt_PageNumber + + printlog "------------------ rpt_PageNumber.inc ---------------------" + + call tDefaultSetting + call tPageNumber + +end sub +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +testcase tDefaultSetting + + '/// FILE / OPEN / biblio.odb + printlog "FILE / OPEN / biblio.odb" + call fOpenDataBase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + '/// INSERT / REPORT + printlog "INSERT / REPORT" + call fOpenNewReportDesign + + sleep(1) + + '/// select any section to get the insert page number menu item activated + printlog "select any section to get the insert page number menu item activated" + Kontext "ReportDesign" + ReportDesign.MouseDown(50, 10) + ReportDesign.MouseUp(50, 10) + + '/// INSERT / PAGE NUMBER + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(4) + hMenuSelectNr(1) + + sleep(1) + '/// check if the "Page Number" dialog appear + printlog "check if the ""Page Number"" dialog appear" + Kontext "ReportPageNumber" + if (ReportPageNumber.exists(3)) then + + '/// check if PageN is checked + printlog "check if PageN is checked" + if ( PageN.isChecked() ) then + printlog "Default PageN is checked" + else + warnlog "Default PageN is not checked" + endif + + '/// check if PageOfPage is checked + printlog "check if PageOfPage is checked" + if TopOfPage.isChecked() then + printlog "Default TopOfPage is checked" + else + warnlog "Default TopOfpage is not checked" + endif + + '/// check if PageAlignment is set to center + printlog "check if PageAlignment is set to center" + if ( PageNumberAlignment.getSelIndex() = 2 ) then + printlog "center alignment is selected" + else + warnlog "center alignment is not selected" + endif + + '/// check if ShowNumberOnFirstPage checkboc is available. If not issue i78945 + printlog "check if ShowNumberOnFirstPage checkboc is available" + if ( ShowNumberOnFirstPage.isVisible() ) then + + '/// check if ShowNumberOnFirstPage is checked + printlog "check if PageAlignment is set to center" + if ( ShowNumberOnFirstPage.isChecked() ) then + printlog "ShowNumberOnFirstPage is checked" + else + warnlog "ShowNumberOnFirstPage is not checked" + endif + else + qaerrorlog "#i78945# ShowNumberOnFirstPage is not visible" + endif + '/// close dialog with OK + printlog "close dialog with OK" + ReportPageNumber.OK + else + warnlog "ReportPageNumber doesn't exists" + endif + + '/// close the report designer with WINDOW / CLOSE + printlog "close the report designer with WINDOW / CLOSE" + call fCloseReportDesign + + '/// close the database with FILE / CLOSE + printlog "close the database with FILE / CLOSE" + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tPageNumber + + '/// 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 + + sleep(1) + + '/// 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 + + 'close the Add Field dialog to get the focus back to the design + call fCloseAddFieldDialog + + '/// turn of the page header + call fSwitchPageHeader + '/// 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 ) + + Kontext "ReportDesign" + + '/// align the control to the left + ReportDesign.UseMenu + hMenuSelectNr(5) + hMenuSelectNr(5) + hMenuSelectNr(1) + + '/// align the control to the top + ReportDesign.UseMenu + hMenuSelectNr(5) + hMenuSelectNr(5) + hMenuSelectNr(4) + + sleep(1) + + Kontext "ReportPropertiesTabControl" + ReportPropertiesTabControl.setPage ReportDataProperties + + Kontext "ReportDataProperties" + DataField.select 1 + DataField.typeKeys("<RETURN>",true) ' important to leave the listbox + + ' select detail section with unselect the control + Kontext "ReportDesign" + ReportDesign.MouseDown(50, 10) + ReportDesign.MouseUp(50, 10) + + Kontext "ReportGeneralProperties" + Height.setText("0") + Height.typeKeys("<RETURN>",true) + + '/// INSERT / PAGE NUMBER + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(4) + hMenuSelectNr(1) + + sleep(1) + + Kontext "ReportPageNumber" + '/// check PageNofM + printlog "check PageNofM" + PageNOfM.Check() + '/// check BottomOfPage + printlog "check BottomOfPage" + BottomOfPage.check() + '/// select the 3 entry inPageNumberAlignment + printlog "select the 3 entry inPageNumberAlignment" + PageNumberAlignment.select(3) + + '/// close dialog with OK + printlog "close dialog with OK" + ReportPageNumber.OK + + 'sleep(5) + + + Kontext "ReportPropertiesTabControl" + ReportPropertiesTabControl.setPage ReportDataProperties + 'sleep(5) + Kontext "ReportDataProperties" + dim s as string + s = DataField.getSelText() + if ((instr(s," & PageNumber() & ") = 0) OR (instr(s," & PageCount()") = 0)) then + warnlog "The page number function is not correct.The function is " + s + else + printlog "The page number function is correct." + endif + 'sleep(5) + '/// execute the report + call fExecuteReport + + sleep(10) + + '/// check if the report is created + printlog "check if the report is created" + Kontext "DocumentWriter" + if (DocumentWriter.exists(10)) then + call fCloseReportView + else + warnlog "No report is created." + endif + + '/// close the report designer with WINDOW / CLOSE + printlog "close the report designer with WINDOW / CLOSE" + call fCloseReportDesign + + '/// close the database with FILE / CLOSE + printlog "close the database with FILE / CLOSE" + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- + diff --git a/testautomation/dbaccess/optional/includes/rpt_PropertyBrowser.inc b/testautomation/dbaccess/optional/includes/rpt_PropertyBrowser.inc new file mode 100644 index 000000000000..b3ee038a2f81 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/rpt_PropertyBrowser.inc @@ -0,0 +1,76 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Property Browser +'* +'\*********************************************************************************** +sub rpt_PropertyBrowser + + printlog "------------------ rpt_PropertyBrowser.inc ---------------------" + + call tDefaultStartup + +end sub +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +testcase tDefaultStartup + + dim iCount as Integer + + '/// 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 + + sleep(1) + + '/// check if the property browser is open with the data tabpage + printlog "check if the property browser is open with the content tab" + + Kontext "ReportDataProperties" + if ( ReportDataProperties.isVisible() = true ) then + printlog "The property browser start with the data tabpage." + else + warnlog "#i77774# The property browser does not start with the datatab page" + endif + + '/// close the report designer + printlog "close the report designer" + call fCloseReportDesign + + '/// close the database + printlog "close the database" + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- diff --git a/testautomation/dbaccess/optional/includes/wiz_CopyTableWizard.inc b/testautomation/dbaccess/optional/includes/wiz_CopyTableWizard.inc new file mode 100644 index 000000000000..34f6cb3e3ecf --- /dev/null +++ b/testautomation/dbaccess/optional/includes/wiz_CopyTableWizard.inc @@ -0,0 +1,833 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Copy Table Autopilot +'* +'\************************************************************************************** +Dim sDSName as string +Dim sTabName as string +dim i as integer + +sub wiz_CopyTableWizard + + printlog "------------------- wiz_CopyTableWizard.inc ------------------------" + + call tCopy_Table_Dialog_Definition_and_data + call tCopy_Table_Dialog_Definition + call tCopy_Table_Dialog_Attach_data + call tCopy_Table_from_Text_Document + call tCopy_Table_from_Calc_Document + ' because of issue 68334 I need to restart the office + call ExitRestartTheOffice + call tCopy_Table_from_hsql_to_dBase + ' test issue 81299 + call tCopy_Table_Paste_Special + +end sub +'-------------------------------------------------------------------- +testcase tCopy_Table_Dialog_Definition_and_data + + Dim sTableDimension as string + Dim iRowCount as integer + Dim iColumnCount as integer + + '/// open the bibliography database + printlog "open the bibliography database" + call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + '///Make sure that there isn't a biblio2 table + printlog "Make sure that there isn't a biblio2 table" + If fFindtable("biblio2") = true then + call fDeleteTable("biblio2") + EndIf + + '/// select the biblio table + printlog "select the biblio table" + call fFindtable("biblio") + + '/// press CTRL + C to copy the table and CTRL + V to paste the table again + printlog "press CTRL + C to copy the table and CTRL + V to paste the table again" + Kontext "DATABASE" + Database.typeKeys("<MOD1 C>",true) + sleep(1) + Database.typeKeys("<MOD1 V>",true) + sleep(1) + + '/// the copy table dialog appear + printlog "the copy table dialog appear" + Kontext "CopyDatabaseTable" + if not CopyDatabaseTable.Exists(3) then + warnlog "the Copy Table Autopilot doesn't appear" + goto endsub + endif + + '/// select the Definition and Data option + printlog "select the Definition and Data option" + Kontext "TabCopyDatabaseTable" + DefinitionAndData.Check + + '/// change the table name to biblio + printlog "change the table name to biblio" + Kontext "TabCopyDatabaseTable" + TableName.setText "biblio" + + '/// click next + printlog "click next" + Kontext "CopyDatabaseTable" + NextBt.Click + '/// there should be a message that the table name already exists. + printlog "there should be a message that the table name already exists." + Kontext "MessageBox" + If not MessageBox.Exists(1) then + warnlog "There have to be an error messages that the table name already exists" + else + MessageBox.OK + endif + + '/// change the table name to biblio2 + printlog "change the table name to biblio2" + Kontext "TabCopyDatabaseTable" + TableName.setText "biblio2" + DefinitionAndData.Check + + '/// click next + printlog "click next" + Kontext "CopyDatabaseTable" + NextBt.Click + + sleep(1) + + '/// add all columns + printlog "add all columns" + Kontext "TabColumnSelect" + AddAll.Click + sleep(1) + + '/// click next + printlog "click next" + Kontext "CopyDatabaseTable" + NextBt.Click + sleep(1) + + '/// click OK + printlog "click OK" + Kontext "CopyDatabaseTable" + CopyDatabaseTable.OK + sleep(1) + + qaerrorlog "because of issue 76051 this copied table is not checked" + '///Check if the table is copied correct + 'printlog "Check, if the table is copied correct" + 'sTableDimension = fCreateRefFile("Bibliography", "t" , "biblio2" , "#") + 'if (sTableDimension = "") then + ' printlog "Problem while creating Reference File" + 'else + ' 'printlog sTableDimension 'Debugcode + ' iColumnCount = CInt(Left(sTableDimension, instr(sTableDimension,",")))+1 + ' 'printlog "Number of Columns: " & iColumnCount 'Debugcode + ' iRowCount = CInt(Right(sTableDimension, (Len(sTableDimension) - instr(sTableDimension,","))))+1 + ' 'printlog "Number of Rows: " & iRowCount 'Debugcode + ' call tCompareMatrixValues("Bibliography", "user/work/biblio2.ttr", "t", "biblio", iRowCount, iColumnCount, "#") + 'endif + + + '/// delete the copy table + printlog "delete the copy table" + call fDeleteTable("biblio2") + + '/// close the database + printlog "close the database" + call fCloseDatabase() + +endcase +'-------------------------------------------------------------------- +testcase tCopy_Table_Dialog_Definition + + '/// open the bibliography database + printlog "open the bibliography database" + call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + '/// select the biblio table + printlog "select the biblio table" + call fFindtable("biblio") + + '/// press CTRL + C to copy the table and CTRL + V to paste the table again + printlog "press CTRL + C to copy the table and CTRL + V to paste the table again" + Kontext "DATABASE" + Database.typeKeys("<MOD1 C>",true) + sleep(1) + Database.typeKeys("<MOD1 V>",true) + sleep(1) + + + '/// the copy table dialog appear + printlog "the copy table dialog appear" + Kontext "CopyDatabaseTable" + if not CopyDatabaseTable.Exists(3) then + warnlog "the Copy Table Autopilot doesn't appear" + goto endsub + endif + '/// check definition + printlog "check definition" + Kontext "TabCopyDatabaseTable" + Definition.Check + + '/// change the table name to biblio2 + printlog "change the table name to biblio2" + Kontext "TabCopyDatabaseTable" + TableName.setText "biblio2" + DefinitionAndData.Check + '/// click next + printlog "click next" + Kontext "CopyDatabaseTable" + NextBt.Click + sleep(1) + + '/// add all columns + printlog "add all columns" + Kontext "TabColumnSelect" + AddAll.Click + sleep(1) + + '/// click next + printlog "click next" + Kontext "CopyDatabaseTable" + NextBt.Click + sleep(1) + + '/// click OK + printlog "click OK" + Kontext "CopyDatabaseTable" + CopyDatabaseTable.OK + sleep(1) + + 'TODO: check if the table is copied correct + + '/// delete the copy table + printlog "delete the copy table" + call fDeleteTable("biblio2") + + '/// close the database + printlog "close the database" + call fCloseDatabase() + +endcase +'-------------------------------------------------------------------- +testcase tCopy_Table_Dialog_Attach_data + + '/// open the bibliography database + printlog "open the bibliography database" + call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + '/// select the biblio table + printlog "select the biblio table" + call fFindtable("biblio") + + '/// press CTRL + C to copy the table and CTRL + V to paste the table again + printlog "press CTRL + C to copy the table and CTRL + V to paste the table again" + Kontext "DATABASE" + Database.typeKeys("<MOD1 C>",true) + sleep(1) + Database.typeKeys("<MOD1 V>",true) + sleep(1) + + '/// the copy table dialog appear + printlog "the copy table dialog appear" + Kontext "CopyDatabaseTable" + if not CopyDatabaseTable.Exists(3) then + warnlog "the Copy Table Autopilot doesn't appear" + goto endsub + endif + + '/// check definition + Kontext "TabCopyDatabaseTable" + Definition.Check + + '/// change the table name to biblio3 + printlog "change the table name to biblio3" + Kontext "TabCopyDatabaseTable" + TableName.setText "biblio3" + DefinitionAndData.Check + + '/// click next + printlog "click next" + Kontext "CopyDatabaseTable" + NextBt.Click + sleep(1) + + '/// add all columns + printlog "add all columns" + Kontext "TabColumnSelect" + AddAll.Click + sleep(1) + + '/// click next + printlog "click next" + Kontext "CopyDatabaseTable" + NextBt.Click + sleep(1) + + '/// click OK + printlog "click OK" + Kontext "CopyDatabaseTable" + CopyDatabaseTable.OK + sleep(1) + + '/// select the biblio table + printlog "select the biblio table" + call fFindtable("biblio") + + '/// press CTRL + C to copy the table and CTRL + V to paste the table again + printlog "press CTRL + C to copy the table and CTRL + V to paste the table again" + Kontext "DATABASE" + Database.typeKeys("<MOD1 C>",true) + sleep(1) + Database.typeKeys("<MOD1 V>",true) + sleep(1) + + '/// the copy table dialog appear + printlog "the copy table dialog appear" + Kontext "CopyDatabaseTable" + if not CopyDatabaseTable.Exists(3) then + warnlog "the Copy Table Autopilot doesn't appear" + goto endsub + endif + '/// change the table name to biblio3 and choose attach data + printlog "change the table name to biblio3" + Kontext "TabCopyDatabaseTable" + TableName.setText "biblio3" + AttachData.Check + + '/// click next + printlog "click next" + Kontext "CopyDatabaseTable" + NextBt.Click + sleep(1) + + '/// click OK + printlog "click OK" + Kontext "CopyDatabaseTable" + CopyDatabaseTable.OK + sleep(1) + + 'TODO: check if the table is copied correct + + '/// delete the copy table + call fDeleteTable("biblio3") + + '/// close the database + call fCloseDatabase() + +endcase +'-------------------------------------------------------------------- +testcase tCopy_Table_from_Text_Document + + '/// open a new document + printlog "open a new document" + call hNewDocument + + '/// insert a table and insert some data + printlog "insert a table and insert some data" + InsertTableWriter + Sleep 2 + Kontext "TabelleEinfuegenWriter" + wait 500 + TabelleEinfuegenWriter.OK + Sleep 1 + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "field1" , true + DocumentWriter.TypeKeys "<TAB>" , true + DocumentWriter.TypeKeys "field2" , true + DocumentWriter.TypeKeys "<TAB>" , true + DocumentWriter.TypeKeys "field3" , true + DocumentWriter.TypeKeys "<TAB>" , true + DocumentWriter.TypeKeys "field4" , true + DocumentWriter.TypeKeys "<TAB>" , true + DocumentWriter.TypeKeys "field5" , true + DocumentWriter.TypeKeys "<TAB>" , true + DocumentWriter.TypeKeys "1" , true + DocumentWriter.TypeKeys "<TAB>" , true + DocumentWriter.TypeKeys "value1" , true + DocumentWriter.TypeKeys "<TAB>" , true + DocumentWriter.TypeKeys "value2" , true + DocumentWriter.TypeKeys "<TAB>" , true + DocumentWriter.TypeKeys "31.7.2003" , true + DocumentWriter.TypeKeys "<TAB>" , true + EditSelectAll + sleep(1) + DocumentWriter.TypeKeys "<MOD1 C>" , true + sleep(2) + + '/// open database for past to + call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + '/// select the biblio table + call fFindtable("biblio") + + '/// press CTRL + V to paste the table + Kontext "DATABASE" + Database.typeKeys("<MOD1 V>",true) + sleep(1) + + '/// the copy table dialog appear + printlog "the copy table dialog appear" + Kontext "CopyDatabaseTable" + if not CopyDatabaseTable.Exists(3) then + warnlog "the Copy Table Autopilot doesn't appear" + goto endsub + endif + '/// change the table name to biblio2 + printlog "change the table name to biblio2" + Kontext "TabCopyDatabaseTable" + TableName.setText "biblio2" + + '/// select Definition and Data + printlog "select Definition and Data" + DefinitionAndData.Check + + '/// click next + printlog "click next" + Kontext "CopyDatabaseTable" + NextBt.Click + sleep(1) + + '/// add all columns + printlog "add all columns" + Kontext "TabColumnSelect" + AddAll.Click + sleep(1) + + '/// click next + printlog "click next" + Kontext "CopyDatabaseTable" + NextBt.Click + sleep(1) + + '/// click OK + printlog "click OK" + CopyDatabaseTable.OK + sleep(1) + + 'TODO: check if the table is copied correct + + '/// delete the copy table + printlog "delete the copy table" + call fDeleteTable("biblio2") + + '/// close the database + printlog "close the database" + call fCloseDatabase + + '/// close the document + printlog "close the document" + call hCloseDocument + +endcase +'-------------------------------------------------------------------- +testcase tCopy_Table_from_Calc_Document + + '/// open a new calc document + printlog "open a calc new document" + gApplication = "CALC" + call hNewDocument + + '/// insert some data + printlog "insert some data" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "Field1" , true + DocumentCalc.TypeKeys "<TAB>" , true + DocumentCalc.TypeKeys "Field2" , true + DocumentCalc.TypeKeys "<TAB>" , true + DocumentCalc.TypeKeys "Field3" , true + DocumentCalc.TypeKeys "<TAB>" , true + DocumentCalc.TypeKeys "Field4" , true + DocumentCalc.TypeKeys "<TAB>" , true + DocumentCalc.TypeKeys "Field5" , true + DocumentCalc.TypeKeys "<TAB>" , true + DocumentCalc.TypeKeys "<RETURN>" , true + DocumentCalc.TypeKeys "<HOME>" , true + DocumentCalc.TypeKeys "1" , true + DocumentCalc.TypeKeys "<TAB>" , true + DocumentCalc.TypeKeys "value1" , true + DocumentCalc.TypeKeys "<TAB>" , true + DocumentCalc.TypeKeys "value2" , true + DocumentCalc.TypeKeys "<TAB>" , true + DocumentCalc.TypeKeys "31.7.2003" , true + DocumentCalc.TypeKeys "<TAB>" , true + '/// select all and press CTRL + C to copy the data to the clipboard + printlog "select all and press CTRL + C to copy the data to the clipboard" + EditSelectALL + sleep(1) + DocumentCalc.TypeKeys "<MOD1 C>" , true + sleep(2) + + '/// open database for paste to + printlog "open database for paste to" + app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/hsql_datasource/TT_hsqldb.odb"),gOfficePath + ConvertPath("user/work/TT_hsqldb.odb") + call fOpendatabase(ConvertPath(gOfficePath + "user/work/TT_hsqldb.odb")) + + '/// open the tables container + printlog "open the tables container" + call fFindtable("biblio2") + + '/// press CTRL + V to paste the table again + Kontext "DATABASE" + Database.typeKeys("<MOD1 V>",true) + sleep(1) + + '/// the copy table dialog appear + printlog "the copy table dialog appear" + Kontext "CopyDatabaseTable" + if not CopyDatabaseTable.Exists(3) then + warnlog "the Copy Table Autopilot doesn't appear" + goto endsub + endif + '/// change the table name to biblio2 + printlog "change the table name to biblio2" + Kontext "TabCopyDatabaseTable" + TableName.setText "biblio2" + + '/// select Definition and Data + printlog "select Definition and Data" + DefinitionAndData.Check + + '/// let the wizard create a primary key + printlog "let the wizard create a primary key" + CreatePrimaryKey.Check + '/// check if the default text for the primary key is available + printlog "check if the default text for the primary key is available" + if ( PrimaryKeyName.getText = "" ) then + warnlog "the automatic default text for the primary key doesn't work" + endif + + '/// change the default text to ID111 + printlog "change the default text to ID111" + PrimaryKeyName.setText("ID1111") + + '/// click next + printlog "click next" + Kontext "CopyDatabaseTable" + NextBt.Click + sleep(1) + + '/// add all columns + printlog "add all columns" + Kontext "TabColumnSelect" + AddAll.Click + sleep(1) + + '/// click next + printlog "click next" + Kontext "CopyDatabaseTable" + NextBt.Click + sleep(1) + + '/// click OK + printlog "click OK" + CopyDatabaseTable.OK + sleep(1) + + '/// ceck if the table is copied correct + printlog "ceck if the table is copied correct" + call fOpenTableInDesign("biblio2") + + Kontext "TableDesignTable" + dim s as String + s = Fieldname.getText() + printlog s + if s <> "ID1111" then + warnlog "the first field is wrong. It should ID1111 but it is " + s + endif + TableDesignTable.TypeKeys("<DOWN>") + s = Fieldname.getText() + printlog s + if s <> "Field1" then + warnlog "the second field is wrong. It should Field1 but it is " + s + endif + TableDesignTable.TypeKeys("<DOWN>") + s = Fieldname.getText() + printlog s + if s <> "Field2" then + warnlog "the third field is wrong. It should Field2 but it is " + s + endif + TableDesignTable.TypeKeys("<DOWN>") + s = Fieldname.getText() + printlog s + if s <> "Field3" then + warnlog "the 4. field is wrong. It should Field3 but it is " + s + endif + TableDesignTable.TypeKeys("<DOWN>") + s = Fieldname.getText() + printlog s + if s <> "Field4" then + warnlog "the 5. field is wrong. It should Field4 but it is " + s + endif + TableDesignTable.TypeKeys("<DOWN>") + s = Fieldname.getText() + printlog s + if s <> "Field5" then + warnlog "the 6. field is wrong. It should Field5 but it is " + s + endif + TableDesignTable.TypeKeys("<DOWN>") + + '/// close the table design + printlog "close the table design" + call fCloseTableDesign + + '/// delete the copy table + printlog "delete the copy table" + call fDeleteTable("biblio2") + + '/// close the database + printlog "close the database" + call fCloseDatabase + + '/// close the spreadsheet document + printlog "close the spreadsheet document" + call hCloseDocument + + gApplication = "WRITER" + +endcase +'-------------------------------------------------------------------- +testcase tCopy_Table_from_hsql_to_dBase + + '/// copy the database file to a local path + printlog "copy the database file to a local path" + app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/hsql_datasource/TT_hsqldb.odb"),gOfficePath + ConvertPath("user/work/TT_hsqldb.odb") + + '/// open a hsql database + printlog "open a hsql database" + call fOpendatabase(ConvertPath(gOfficePath + "user/work/TT_hsqldb.odb")) + sleep(5) + + '/// select the tabel TT_CopyTest + printlog "select the tabel TT_CopyTest" + call fFindTable("TT_1") + + '/// press CTRL + C to copy the table + printlog "press CTRL + C to copy the table" + Kontext "DATABASE" + Database.typeKeys("<MOD1 C>",true) + + '/// open the bibliography database + printlog "open the bibliography database" + call fOpenDatabase(gOfficePath + "user/database/biblio.odb") + + call fDeleteTable("TT_1") ' delete the table TT_1 if the table exists. + + '/// select the biblio table + printlog "select the biblio table" + call fFindTable("biblio") + + '/// press CTRL + V to paste the table + Kontext "DATABASE" + Database.typeKeys("<MOD1 V>",true) + + '/// the copy table dialog appear + printlog "the copy table dialog appear" + Kontext "CopyDatabaseTable" + if not CopyDatabaseTable.Exists(3) then + warnlog "the Copy Table Autopilot doesn't appear" + goto endsub + endif + + '/// select Definition and Data + printlog "select Definition and Data" + Kontext "TabCopyDatabaseTable" + TableName.setText("TT_1") + DefinitionAndData.Check + + '/// click next + printlog "click next" + Kontext "CopyDatabaseTable" + NextBt.Click + + '/// add all columns + printlog "add all columns" + Kontext "TabColumnSelect" + AddAll.Click + + ' there is a messages box about missing compatible field type. + Kontext "MessageBox" + if MessageBox.exists(3) then + printlog "There is a messageBox. " + MessageBox.getText + MessageBox.OK + endif + + '/// click next + printlog "click next" + Kontext "CopyDatabaseTable" + NextBt.Click + + '/// click OK + printlog "click OK" + CopyDatabaseTable.OK + sleep(1) + + Kontext "MessageBox" + if MessageBox.exists(3) then + printlog "There is a messageBox. " + MessageBox.getText + MessageBox.Yes + endif + + if MessageBox.exists(3) then + printlog "There is a messageBox. " + MessageBox.getText + MessageBox.OK + endif + + '/// delete the copied table + printlog "delete the copied table" + call fDeleteTable("TT_1") + + '/// close the database + printlog "close the database" + call fCloseDatabase() + + '/// close the other database + printlog "close the other database" + call fCloseDatabase() + +endcase +'-------------------------------------------------------------------- +testcase tCopy_Table_Paste_Special + + Dim sTableDimension as string + Dim iRowCount as integer + Dim iColumnCount as integer + + '/// open the bibliography database + printlog "open the bibliography database" + call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + '///Make sure that there isn't a biblio2 table + printlog "Make sure that there isn't a biblio2 table" + If fFindtable("biblio2") = true then + call fDeleteTable("biblio2") + EndIf + + '/// select the biblio table + printlog "select the biblio table" + call fFindtable("biblio") + + '/// press CTRL + C to copy the table and CTRL + V to paste the table again + printlog "press CTRL + C to copy the table and CTRL + V to paste the table again" + Kontext "DATABASE" + Database.typeKeys("<MOD1 C>",true) + sleep(1) + Database.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(5) + sleep(1) + Kontext "InhaltEinfuegen" + InhaltEinfuegen.OK + + '/// the copy table dialog appear + printlog "the copy table dialog appear" + Kontext "CopyDatabaseTable" + if not CopyDatabaseTable.Exists(3) then + warnlog "the Copy Table Autopilot doesn't appear" + goto endsub + endif + + '/// change the table name to biblio + printlog "change the table name to biblio" + Kontext "TabCopyDatabaseTable" + TableName.setText "biblio" + + '/// click next + printlog "click next" + Kontext "CopyDatabaseTable" + NextBt.Click + '/// there should be a message that the table name already exists. + printlog "there should be a message that the table name already exists." + Kontext "MessageBox" + If not MessageBox.Exists(1) then + warnlog "There have to be an error messages that the table name already exists" + else + MessageBox.OK + endif + + '/// change the table name to biblio2 + printlog "change the table name to biblio2" + Kontext "TabCopyDatabaseTable" + TableName.setText "biblio2" + DefinitionAndData.Check + + '/// click next + printlog "click next" + Kontext "CopyDatabaseTable" + NextBt.Click + + sleep(1) + + '/// add all columns + printlog "add all columns" + Kontext "TabColumnSelect" + AddAll.Click + sleep(1) + + '/// click next + printlog "click next" + Kontext "CopyDatabaseTable" + NextBt.Click + sleep(1) + + '/// click OK + printlog "click OK" + Kontext "CopyDatabaseTable" + CopyDatabaseTable.OK + sleep(1) + + qaerrorlog "because of issue 76051 this copied table is not checked" + '///Check if the table is copied correct + 'printlog "Check, if the table is copied correct" + 'sTableDimension = fCreateRefFile("Bibliography", "t" , "biblio2" , "#") + 'if (sTableDimension = "") then + ' printlog "Problem while creating Reference File" + 'else + ' 'printlog sTableDimension 'Debugcode + ' iColumnCount = CInt(Left(sTableDimension, instr(sTableDimension,",")))+1 + ' 'printlog "Number of Columns: " & iColumnCount 'Debugcode + ' iRowCount = CInt(Right(sTableDimension, (Len(sTableDimension) - instr(sTableDimension,","))))+1 + ' 'printlog "Number of Rows: " & iRowCount 'Debugcode + ' call tCompareMatrixValues("Bibliography", "user/work/biblio2.ttr", "t", "biblio", iRowCount, iColumnCount, "#") + 'endif + + + '/// delete the copy table + printlog "delete the copy table" + call fDeleteTable("biblio2") + + '/// close the database + printlog "close the database" + call fCloseDatabase() + +endcase + diff --git a/testautomation/dbaccess/optional/includes/wiz_DatabaseWizard.inc b/testautomation/dbaccess/optional/includes/wiz_DatabaseWizard.inc new file mode 100644 index 000000000000..df9026ba2dd9 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/wiz_DatabaseWizard.inc @@ -0,0 +1,348 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Database Wizard +'* +'\*********************************************************************** +sub wiz_DatabaseWizard + call tNewDatabase + call tOpenDatabase + call tOpenNoneDatabaseDocument + call tStartTableWizardFromWizard + call tODBC + call tEvolution + call tMozilla + call tJDBC + call tAdabas + call tdBase + call tMySQLODBC + call tMySQLJDBC + call tSpreadsheet + call tText + call tOracleJDBC +end sub +'------------------------------------------------------------------------- +testcase tNewDatabase + + Kontext "DocumentWriter" + if (DocumentWriter.exists(1)) then + DocumentWriter.UseMenu + else + Kontext "DocumentBackground" + DocumentBackground.UseMenu + endif + hMenuSelectNr(1) + hMenuSelectNr(1) + hMenuSelectNr(5) + + sleep(10) + + Kontext "DatabaseWizard" + CreateNewDatabase.Check + sleep(1) + NextBtn.Click + sleep(1) + FinishBtn.Click + sleep(1) + + Kontext "SpeichernDlg" + if ( Dateiname.getSelText() = "" ) then + warnlog "#i58413# Default filename is missing" + Dim sFileName as String + sFileName = ConvertPath(gOfficePath + "user/work/TTDB1.odb") + if ( app.Dir( ConvertPath(sFileName) ) ) <> "" then + app.kill(ConvertPath(sFileName)) + endif + Dateiname.setText(sFileName) + endif + Speichern.click + sleep(10) + + Kontext "MessageBox" + if MessageBox.exists then + MessageBox.yes + end if + + sleep(5) + + Kontext "ContainerView" + + ViewTables + + sleep(1) + + call fCloseDatabase(true) + +endcase +'------------------------------------------------------------------------- +testcase tOpenDatabase + + Kontext "DocumentWriter" + if (DocumentWriter.exists(1)) then + DocumentWriter.UseMenu + else + Kontext "DocumentBackground" + DocumentBackground.UseMenu + endif + hMenuSelectNr(1) + hMenuSelectNr(1) + hMenuSelectNr(5) + + sleep(5) + + Kontext "DatabaseWizard" + OpenExistingDoc.Check + sleep(1) + OpenBtn.Click + sleep(1) + + Kontext "GeneralFileDialog" + printlog "open database from: " + Convertpath(gofficePath + "user/database/biblio.odb") + Dateiname.setText(Convertpath(gofficePath + "user/database/biblio.odb")) + Oeffnen.click + sleep(5) + + Kontext "ContainerView" + + ViewTables + + sleep(1) + + call fCloseDatabase(false) + +endcase +'------------------------------------------------------------------------- +testcase tOpenNoneDatabaseDocument + + Kontext "DocumentWriter" + if (DocumentWriter.exists(1)) then + DocumentWriter.UseMenu + else + Kontext "DocumentBackground" + DocumentBackground.UseMenu + endif + hMenuSelectNr(1) + hMenuSelectNr(1) + hMenuSelectNr(5) + + sleep(5) + + Kontext "DatabaseWizard" + OpenExistingDoc.Check + sleep(1) + OpenBtn.Click + sleep(1) + + Kontext "GeneralFileDialog" + printlog "open spreadsheet file from: " + Convertpath(gTesttoolPath + "dbaccess/optional/input/spreadsheet_datasource/TT_Query1.ods") + Dateiname.setText(Convertpath(gTesttoolPath + "dbaccess/optional/input/spreadsheet_datasource/TT_Query1.ods")) + Oeffnen.click + sleep(5) + + Kontext "DocumentCalc" + if (DocumentCalc.exists()) then + warnlog "the spreadsheet should not appear" + call hCloseDocument() + else + Kontext "MessageBox" + if(MessageBox.exists(1)) then + printlog "messagebox appear ->> OK" + MessageBox.OK + Kontext "DatabaseWizard" + DatabaseWizard.Cancel + else + warnlog "there should be a message box about the fact that this is no database" + Kontext "DatabaseWizard" + DatabaseWizard.Cancel + endif + endif + +endcase +'------------------------------------------------------------------------- +testcase tODBC +qaerrorlog "not yet implemented" +endcase +'------------------------------------------------------------------------- +testcase tEvolution + + if gPlatgroup <> "lin" then + printlog "Evolution does only exists under linux." + goto endsub + end if + + call fCreateEvolutionAddressbookDatasource(gOfficePath + "user/work/tt_evolution.odb") + call fOpendatabase(gOfficePath + "user/work/tt_evolution.odb") + + Kontext "ContainerView" + ViewTables + + call fCloseDatabase(true) + +endcase +'------------------------------------------------------------------------- +testcase tMozilla + + if ( fCreateMozillaAddressbookDatasource(gOfficePath + "user/work/tt_mozilla.odb") = true) then + if ( fOpendatabase(gOfficePath + "user/work/tt_mozilla.odb") = true) then + Kontext "ContainerView" + ViewTables + else + warnlog "mozilla database could not be open." + + endif + else + qaerrorlog "mozilla database could not be created. Maybe you have no mozilla installed." + Kontext "MessageBox" + if (MessageBox.exists(1)) then + MessageBox.OK + endif + endif + ' try to close the database + call fCloseDatabase(false) + +endcase +'------------------------------------------------------------------------- +testcase tJDBC +qaerrorlog "not yet implemented" +endcase +'------------------------------------------------------------------------- +testcase tAdabas + qaerrorlog "not yet implemented" +endcase +'------------------------------------------------------------------------- +testcase tdBase + + call fCreateDbaseDatasource(gOfficePath + "user/work/tt_dbase.odb",gOfficePath + "user/work/") + call fOpendatabase(gOfficePath + "user/work/tt_dbase.odb") + + Kontext "ContainerView" + ViewTables + + call fCloseDatabase(true) + +endcase +'------------------------------------------------------------------------- +testcase tMySQLODBC +qaerrorlog "not yet implemented" +endcase +'------------------------------------------------------------------------- +testcase tMySQLJDBC +qaerrorlog "not yet implemented" +endcase +'------------------------------------------------------------------------- +testcase tSpreadsheet +qaerrorlog "not yet implemented" +endcase +'------------------------------------------------------------------------- +testcase tText + + call fCreateTextDatasource(gOfficePath + "user/work/tt_text.odb",gOfficePath + "user/work/") + call fOpendatabase(gOfficePath + "user/work/tt_text.odb") + + Kontext "ContainerView" + ViewTables + + call fCloseDatabase(true) + +endcase +'------------------------------------------------------------------------- +testcase tOracleJDBC +qaerrorlog "not yet implemented" +endcase +'------------------------------------------------------------------------- +testcase tStartTableWizardFromWizard + + printlog "start database wizard via FILE / NEW / DATABASE" + Kontext "DocumentWriter" + if (DocumentWriter.exists(1)) then + DocumentWriter.UseMenu + else + Kontext "DocumentBackground" + DocumentBackground.UseMenu + endif + hMenuSelectNr(1) + hMenuSelectNr(1) + hMenuSelectNr(5) + + sleep(10) + + Kontext "DatabaseWizard" + printlog "check create new database" + CreateNewDatabase.Check + sleep(1) + printlog "click next button" + NextBtn.Click + sleep(1) + printlog "check the 'Create Table with wizard' option" + StartTableWizard.check() + printlog "click finished button" + FinishBtn.Click + sleep(1) + + Kontext "SpeichernDlg" + printlog "click save in the save as dialog" + if ( Dateiname.getSelText() = "" ) then + warnlog "#i58413# Default filename is missing" + Dim sFileName as String + sFileName = ConvertPath(gOfficePath + "user/work/TTDB1.odb") + if ( app.Dir( ConvertPath(sFileName) ) ) <> "" then + app.kill(ConvertPath(sFileName)) + endif + Dateiname.setText(sFileName) + endif + Speichern.click + sleep(10) + + Kontext "MessageBox" + if MessageBox.exists then + MessageBox.yes + end if + + sleep(5) + + Kontext "TableWizard" + printlog "check if the table wizard appear" + if( TableWizard.exists(10) ) then + printlog "the table wizard appear." + CancelBtn.click() + else + warnlog "the table wizard does not appear." + endif + + Kontext "ContainerView" + + ViewTables + + sleep(1) + + printlog "close the database" + call fCloseDatabase(true) + +endcase +'------------------------------------------------------------------------- diff --git a/testautomation/dbaccess/optional/includes/wiz_FormWizard.inc b/testautomation/dbaccess/optional/includes/wiz_FormWizard.inc new file mode 100644 index 000000000000..b3949b40ed49 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/wiz_FormWizard.inc @@ -0,0 +1,254 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Form Wizard Test +'* +'\*********************************************************************** +sub wiz_FormWizard + + call tNewForm + call tCheckTemplate + call tStartFromTableContextMenu + +end sub +'-------------------------------------------------------------------------------------- +testcase tNewForm + + call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + ViewForms + + Kontext "DATABASE" + + Database.MouseDown(50,50) + Database.MouseUp(50,50) + sleep(1) + + StartFormWizard + + sleep(5) + + Kontext "FormWizard" + 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) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + '/// click Finish + printlog "click Finish" + FinishBtn.Click + + sleep(10) + + call fCloseForm ' should be changed to a CloseReport + + call fCloseDatabase + +endcase +'-------------------------------------------------------------------------------------- +testcase tCheckTemplate + + call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + ViewForms + + Kontext "DATABASE" + + Database.MouseDown(50,50) + Database.MouseUp(50,50) + sleep(1) + + StartFormWizard + + sleep(5) + + Kontext "FormWizard" + TablesOrQueriesMaster.select 1 + '/// add the third field + printlog "add the third field" + AvailableMasterFields.select 5 + sleep(1) + MasterMoveSelected.click + sleep(1) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + '/// on the arrange tabpage + printlog "on the arrange tabpage" + + 'AlignLeft HID_DLGFORM_CMDALIGNLEFT + 'AlignRight HID_DLGFORM_CMDALIGNRIGHT + + '/// click on all arragements + printlog "click on all arragements" + + 'FormWizard.TypeKeys("<TAB>",true) + 'sleep(1) + 'FormWizard.TypeKeys("<LEFT>",true) + 'sleep(1) + 'FormWizard.TypeKeys("<LEFT>",true) + 'sleep(1) + 'FormWizard.TypeKeys("<SPACE>",true) + 'sleep(5) + 'FormWizard.TypeKeys("<RIGHT>",true) + 'sleep(1) + 'FormWizard.TypeKeys("<SPACE>",true) + 'sleep(5) + 'FormWizard.TypeKeys("<RIGHT>",true) + 'sleep(1) + 'FormWizard.TypeKeys("<SPACE>",true) + 'sleep(5) + 'FormWizard.TypeKeys("<RIGHT>",true) + 'sleep(1) + 'FormWizard.TypeKeys("<SPACE>",true) + 'sleep(5) + + 'ColumnarLabelsLeft.Click + 'ColumnarLabelsOnTop.Click + 'AsDataSheet.Click + 'InBlocksLabelsAbove.Click + + 'NoBorder HID_DLGFORM_CMDNOBORDER + 'ThreeDLook HID_DLGFORM_CMD3DBORDER + 'FlatLook HID_DLGFORM_CMDSIMPLEBORDER + + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + ' page styles + + dim iCount as integer + dim i as integer + + iCount = PageStyles.getItemCount + + if iCount <> 10 then + warnlog "there sould be 10 page styles but there are " + iCount + " page styles." + endif + + for i = 1 to iCount + PageStyles.select i + sleep(1) + '/// check all field border styles + NoBorder.Check + sleep(1) + ThreeDLook.Check + sleep(1) + FlatLook.Check + sleep(1) + next + + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + '/// click Finish + printlog "click Finish" + FinishBtn.Click + + sleep(10) + + call fCloseForm ' should be changed to a CloseReport + + call fCloseDatabase + +endcase +'-------------------------------------------------------------------------------------- +testcase tStartFromTableContextMenu + + call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + Kontext "DATABASE" + + Database.MouseDown(50,50) + Database.MouseUp(50,50) + sleep(1) + + '/// select the table biblio + printlog "select the table biblio" + call fFindTable("biblio") + + Kontext "ContainerView" + + '/// select FormWizard from the table contextmenu + printlog "select FormWizard from the table contextmenu" + ContainerView.TypeKeys("<SHIFT F10>",true) + hMenuSelectNr(6) + + '/// check if the formwizard appear + printlog "check if the formwizard appear" + Kontext "FormWizard" + 'wait until the FormWizard is started + if (FormWizard.exists(5)) then + '/// cancel the formwizard + printlog "cancel the formwizard" + CancelBtn.Click + else + warnlog "The formwizard doesn't appear" + endif + + sleep(1) + + call fCloseDatabase + +endcase +'-------------------------------------------------------------------------------------- + diff --git a/testautomation/dbaccess/optional/includes/wiz_QueryWizard.inc b/testautomation/dbaccess/optional/includes/wiz_QueryWizard.inc new file mode 100644 index 000000000000..19411fd4f105 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/wiz_QueryWizard.inc @@ -0,0 +1,233 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Query Autopilot Test +'* preconditions : Adabas has to be installed on the test machine +'* testdocuments : no +'* testpurpose : Test for the query wizard +'* +'\*********************************************************************** +sub wiz_QueryWizard + + + + if fCreateDbaseDatasource(gOfficePath + ConvertPath("user/work/tt_dbase-01.odb"),gOfficePath + ConvertPath("user/database/biblio")) then + call tQueryAutopilotMain + else + qaerrorlog "can't create dBase datasource. Stop Test" + endif + + app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/hsql_datasource/TT_hsqldb.odb"),gOfficePath + ConvertPath("user/work/TT_hsqldb.odb") + call tQueryAutopilotTest1 + call tQueryAutopilotTest2 + +end sub +'------------------------------------------------------------------------- +testcase tQueryAutopilotMain + + if not fOpendatabase(gOfficePath + ConvertPath("user/work/tt_dbase-01.odb")) then + warnlog "Database " +gOfficePath + ConvertPath("user/work/tt_dbase-01.odb") + " could not be open." + goto endsub + end if + + if not fStartQueryWizard() then + warnlog "The Query Wizard could not be start." + goto endsub + end if + + Kontext "QueryWizard" + '/// select the first table (biblio) + printlog "select the first table (biblio)" + 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) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + '/// click FINISH + printlog "click FINISH" + FinishBtn.click + sleep(2) + + Kontext "DatabaseBeamer" + DatabaseBeamer.UseMenu + call hMenuSelectnr(1) + call hMenuSelectnr(4) + 'FileClose + + call fCloseDatabase(true) + +endcase +'---------------------------------------------------------- +testcase tQueryAutopilotTest1 + + if not fOpendatabase(gOfficePath + ConvertPath("user/work/TT_hsqldb.odb")) then + warnlog "Database " + gOfficePath + ConvertPath("user/work/TT_hsqldb.odb") + " could not be open." + goto endsub + end if + + if not fStartQueryWizard() then + warnlog "The Query Wizard could not be start." + goto endsub + end if + + Kontext "QueryWizard" + '/// select the table TT_QueryAutopilot + printlog "select the table TT_QueryAutopilot" + Tables.select 7 + sleep(1) + '/// add the third field + printlog "add the 1. and 4. field" + AvailableFields.select 1 + sleep(1) + Add.click + sleep(1) + AvailableFields.select 4 + sleep(1) + Add.click + sleep(1) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + '/// click FINISH + printlog "click FINISH" + FinishBtn.click + sleep(2) + + Kontext "DatabaseBeamer" + FileClose + + call fClosedatabase(true) + +endcase +'---------------------------------------------------------- +testcase tQueryAutopilotTest2 + + if not fOpendatabase(gOfficePath + ConvertPath("user/work/TT_hsqldb.odb")) then + warnlog "Database " + gOfficePath + ConvertPath("user/work/TT_hsqldb.odb") + " could not be open." + goto endsub + end if + + if not fStartQueryWizard() then + warnlog "The Query Wizard could not be start." + goto endsub + end if + + Kontext "QueryWizard" + '/// select the table TT_QueryAutopilot + printlog "select the table TT_QueryAutopilot" + Tables.select 7 + sleep(1) + '/// add the third field + printlog "add the 1. field" + AvailableFields.select 1 + sleep(1) + Add.click + sleep(1) + '/// click NEXT to Sorting page + printlog "click NEXT to Sorting page" + NextBtn.click + sleep(1) + '/// click NEXT to Search page + printlog "click NEXT to Search page" + NextBtn.click + sleep(1) + '/// click NEXT to summary query page + printlog "click NEXT to summary query page" + NextBtn.click + sleep(1) + SummaryQuery.Check + sleep(3) + ' this doesn't work + 'AggregatFunction1.select 1 + 'sleep(1) + 'AggregatField1.select 1 + 'sleep(1) + ' do this instead + QueryWizard.TypeKeys "<SHIFT TAB>" , true + sleep(1) + QueryWizard.TypeKeys "<SHIFT TAB>" , true + sleep(1) + QueryWizard.TypeKeys "<DOWN>" , true + sleep(1) + QueryWizard.TypeKeys "<TAB>" , true + sleep(1) + QueryWizard.TypeKeys "<DOWN>" , true + sleep(1) + '---- + '/// click NEXT to alias page + printlog "click NEXT to group alias page" + NextBtn.click + sleep(1) + '/// click NEXT to final page + printlog "click NEXT to final page" + NextBtn.click + sleep(1) + '/// click FINISH + printlog "click FINISH" + FinishBtn.click + sleep(2) + + Kontext "DatabaseBeamer" + FileClose + + call fClosedatabase(true) + +endcase diff --git a/testautomation/dbaccess/optional/includes/wiz_ReportWizard.inc b/testautomation/dbaccess/optional/includes/wiz_ReportWizard.inc new file mode 100644 index 000000000000..67010e64fbfb --- /dev/null +++ b/testautomation/dbaccess/optional/includes/wiz_ReportWizard.inc @@ -0,0 +1,123 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Report Wizard Test +'* +'\*********************************************************************** +sub wiz_ReportWizard + + call tNewReport + +end sub +'------------------------------------------------------------------------- +testcase tNewReport + + qaerrorlog "#i92543# crash when closing report" + goto endsub + + call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + Kontext "DATABASE" + + ViewReports + + Database.MouseDown(50,50) + Database.MouseUp(50,50) + sleep(1) + + StartReportWizard + + sleep(5) + + Kontext "ReportWizard" + sleep(1) + Tables.select 1 + '/// add the third field + printlog "add the third field" + AvailableFields.select 1 + sleep(1) + Add.click + sleep(1) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + '/// click NEXT + printlog "click NEXT" + NextBtn.click + sleep(1) + '/// click Finish + printlog "click Finish" + FinishBtn.Click + sleep(10) + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<MOD1 SHIFT I>" , true ' EDIT / SELECT TEXT + DocumentWriter.TypeKeys "<DOWN>" ,2, true + DocumentWriter.TypeKeys "<SHIFT DOWN>" , true + DocumentWriter.TypeKeys "<MOD1 C>" , true + + dim s as String + s = getClipboard + + if left(s,10) = "Identifier" then + printlog "Report Table Header contains " + left(s,10) + ". -> OK" + else + warnlog "Report Table Header contains " + left(s,10) + " instead of IDENTIFIER" + endif + + 'for windows a "new Line" are two characters + 'so I need to start at char 13 and not on 12 + dim iFromCharacter as integer + if gPlatGroup = "w95" then + iFromCharacter = 13 + else + iFromCharacter = 12 + endif + + if mid(s,iFromCharacter,5) = "GUR00" OR mid(s,iFromCharacter,5) = "BOR04" then + printlog "1. record is " + mid(s,iFromCharacter,5) + ". -> OK" + else + warnlog "1. record is " + mid(s,iFromCharacter,5) + " instead of GUR00 OR BOR04" + endif + + call fCloseForm ' should be changed to a CloseReport + + call fCloseDatabase + +endcase + diff --git a/testautomation/dbaccess/optional/includes/wiz_TableWizard.inc b/testautomation/dbaccess/optional/includes/wiz_TableWizard.inc new file mode 100644 index 000000000000..cce02149942f --- /dev/null +++ b/testautomation/dbaccess/optional/includes/wiz_TableWizard.inc @@ -0,0 +1,499 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Table Wizard +'* +'\*********************************************************************** +sub wiz_TableWizard + + call tNewTable + call tStartFormWizardFromTableWizard + call tCreateAllTables + + call tCheckSampleTables + call tChangeFieldName + +end sub +'------------------------------------------------------------------------- +testcase tNewTable + + if bAsianLan = true then + qaerrorlog "#i62665# Table wizard doesn't work in CJK versions. So some test are left out." + goto endsub + endif + + if (iSprache = 7) then + qaerrorlog "due to issue i94730 this testcase does not work under russian." + goto endsub + endif + + 'hold a table name + Dim sTableName as String + + '/// open Bibliography database + printlog "open Bibliography database" + if not fOpenDataBase(gOfficePath + ConvertPath("user/database/biblio.odb")) then + warnlog "Database " + gOfficePath + ConvertPath("user/database/biblio.odb") + " could not be open." + goto endsub + end if + + '/// start the table wizard + printlog "start the table wizard" + if not fStartTableWizard() then + warnlog "The table wizard doesn't start. TEST STOPPED" + goto endsub + endif + + Kontext "TableWizard" + '/// add all fields from the displayed table + printlog "add all fields from the displayed table" + AddAll.click + '/// click NEXT + printlog "click NEXT" + NextBtn.click + + '/// click NEXT + printlog "click NEXT" + NextBtn.click + + 'remember the table, because we want to delete it later + sTableName = TableName.getText + '/// click Finish + printlog "click Finish" + FinishBtn.Click + + sleep(1) + + '/// close the open table + printlog "close the open table" + call fCloseTableView() + + '/// delete the created table + printlog "delete the created table" + call fDeleteTable sTableName + + '/// close the database + printlog "close the database" + call fClosedatabase() + +endcase +'------------------------------------------------------------------------- +testcase tCheckSampleTables + + dim iTablesCount as Integer + dim iFieldsCount as Integer + dim i as Integer + dim ii as Integer + + '/// open Bibliography database + printlog "open Bibliography database" + if not fOpenDataBase(gOfficePath + ConvertPath("user/database/biblio.odb")) then + warnlog "Database " + gOfficePath + ConvertPath("user/database/biblio.odb") + " could not be open." + goto endsub + end if + + '/// start the table wizard + printlog "start the table wizard" + if not fStartTableWizard() then + warnlog "The table wizard doesn't start. TEST STOPPED" + goto endsub + endif + + Kontext "TableWizard" + '/// check if there are 22 table in the business category + printlog "check if there are 22 table in the business category" + iTablesCount = Tables.GetItemCount() + if ( iTablesCount <> 22 ) then + warnlog "the number of tables in the business category should be 22 but it is : " + iTablesCount + endif + + '/// check the count of all fields in all table in the business category + printlog "check the count of all fields in all table in the business category" + for i = 1 to iTablesCount + Tables.select i + 'printlog Tables.getseltext + iFieldsCount = iFieldsCount + Fields.getItemCount + for ii = 1 to Fields.getItemCount + Fields.select ii + 'printlog " " + Fields.getSelText + next + next + + if ( iFieldsCount <> 318 AND iFieldsCount <> 290 ) then + warnlog "the number of all fields should be 318 or 290 but it is : " + iFieldsCount + endif + + Kontext "TableWizard" + '/// check the personal radio button + Personal.Check + '/// check if there are 15 table in the personal category + printlog "check if there are 15 table in the personal category" + iTablesCount = Tables.GetItemCount() + if ( iTablesCount <> 15 ) then + warnlog "the number of tables in the personal category should be 15 but it is : " + iTablesCount + endif + + '/// check the count of all fields in all table in the personal category + printlog "check the count of all fields in all table in the personal category" + for i = 1 to iTablesCount + Tables.select i + 'printlog Tables.getseltext + iFieldsCount = iFieldsCount + Fields.getItemCount + for ii = 1 to Fields.getItemCount + Fields.select ii + 'printlog " " + Fields.getSelText + next + next + + if ( iFieldsCount <> 480 AND iFieldsCount <> 508 ) then + warnlog "the number of all fields should be 480 or 508 but it is : " + iFieldsCount + endif + if (iFieldsCount = 480) then + qaerrorlog "There have to be 508 fields. Please contact msc." + endif + + '/// click CANCEL + printlog "click CANCEL" + CancelBtn.Click + + '///close the database + printlog "close the database" + call fClosedatabase() + +endcase +'------------------------------------------------------------------------- +testcase tChangeFieldName + + if (iSprache = 7) then + qaerrorlog "due to issue i94730 this testcase does not work under russian." + goto endsub + endif + + '/// open Bibliography database + printlog "open Bibliography database" + if not fOpenDataBase(gOfficePath + ConvertPath("user/database/biblio.odb")) then + warnlog "Database " + gOfficePath + ConvertPath("user/database/biblio.odb") + " could not be open." + goto endsub + end if + + '/// delete the table t_wizard if it's allready exists + printlog "delete the table t_wizard if it's allready exists" + call fDeleteTable ("t_wizard") + + '/// start the table wizard + printlog "start the table wizard" + if not fStartTableWizard() then + warnlog "The table wizard doesn't start. TEST STOPPED" + goto endsub + endif + + Kontext "TableWizard" + '/// select the first field + printlog "select the first field" + Fields.Select 1 + '/// click the add button + printlog "click the add button" + Add.click + '/// click NEXT + printlog "click NEXT" + NextBtn.click + + '/// select the first field + printlog "select the first field" + FieldNames.select 1 + '/// change the field name for the first field to field_test + FieldName.setText("field_test") + '/// click the add fields button (the + sign) + printlog "click the add fields button (the + sign)" + FieldsAdd.Click() + '/// select the second field + printlog "select the second field" + FieldNames.select 2 + '/// change the field name for the second field to field_2 + printlog "change the field name for the second field to field_2" + FieldName.setText("field_2") + '/// click on field move up button to move the second filed to the first position + printlog "click on field move up button to move the second filed to the first position" + FieldsUp.click() + '/// click NEXT + printlog "click NEXT" + NextBtn.click + + '/// change table name to t_wizard + printlog "change table name to t_wizard" + TableName.settext "t_wizard" + '/// click Finish + printlog "click Finish" + FinishBtn.Click + + sleep(1) + + '/// close the table view + printlog "close the table view" + call fCloseTableView() + + '/// open the table t_wizard in the design view + printlog "open the table t_wizard in the design view" + call fOpenTableInDesign("t_wizard") + + Kontext "TableDesignTable" + '/// check if the first field is field_2 + printlog "check if the first field is field_2" + Dim s as String + s = Fieldname.getText + if s <> "field_2" then + printlog "the field name of the first field is not 'field_2' it is '" + s + "'." + warnlog "the renaming or moving of a field in the wizard doesn't work" + else + printlog "==>> the first field name is field_2 => OK" + endif + '/// check the second field + TableDesignTable.typeKeys("<DOWN>") + s = Fieldname.getText + if s <> "field_test" then + printlog "the field name of the second field is not 'field_test' it is '" + s + "'." + warnlog "the renaming or moving of a field in the wizard doesn't work" + else + printlog "==>> the second field name is field_test => OK" + endif + + '/// close the table design + printlog "close the table design" + call fCloseTableDesign + + '/// delete the table t_wizard we dont't need it anymore + printlog "delete the table t_wizard we dont't need it anymore" + call fDeleteTable ("t_wizard") + + '/// close the database + printlog "close the database" + call fClosedatabase() + +endcase +'------------------------------------------------------------------------- +testcase tStartFormWizardFromTableWizard + + if bAsianLan = true then + qaerrorlog "#i62665# Table wizard doesn't work in CJK versions. So some test are left out." + goto endsub + endif + + if (iSprache = 7) then + qaerrorlog "due to issue i94730 this testcase does not work under russian." + goto endsub + endif + + 'hold a table name + Dim sTableName as String + + '/// open Bibliography database + printlog "open Bibliography database" + if not fOpenDataBase(gOfficePath + ConvertPath("user/database/biblio.odb")) then + warnlog "Database " + gOfficePath + ConvertPath("user/database/biblio.odb") + " could not be open." + goto endsub + end if + + '/// start the table wizard + printlog "start the table wizard" + if not fStartTableWizard() then + warnlog "The table wizard doesn't start. TEST STOPPED" + goto endsub + endif + + Kontext "TableWizard" + '/// add all fields from the displayed table + printlog "add all fields from the displayed table" + AddAll.click + '/// click NEXT + printlog "click NEXT" + NextBtn.click + + '/// click NEXT + printlog "click NEXT" + NextBtn.click + + 'remember the table, because we want to delete it later + sTableName = TableName.getText + + CreateForm.Check + + '/// click Finish + printlog "click Finish" + FinishBtn.Click + + sleep(10) + + '/// check if the form wizard appear + printlog "check if the form wizard appear" + Kontext "FormWizard" + if FormWizard.exists(1) then + printlog "The formwizard appear ==>> OK" + CancelBtn.Click + else + warnlog "The Form Wizard doesn't appear." + endif + + '/// delete the created table + printlog "delete the created table" + call fDeleteTable sTableName + + '/// close the database + printlog "close the database" + call fClosedatabase() + +endcase +'------------------------------------------------------------------------- +testcase tCreateAllTables + + if bAsianLan = true then + qaerrorlog "#i62665# Table wizard doesn't work in CJK versions. So some test are left out." + goto endsub + endif + + '/// create all tables form the business and personal category + printlog "create all tables form the business and personal category" + + Dim i as integer + + 'copy the hsqldb database file to a local path + app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/hsql_datasource/TT_hsqldb.odb"),gOfficePath + ConvertPath("user/work/TT_hsqldb.odb") + + '/// open a hsql database + printlog "open a hsql database" + call fOpendatabase(ConvertPath(gOfficePath + "user/work/TT_hsqldb.odb")) + sleep(5) + + '/// check if there are 22 items in the business categoriy + if not fStartTableWizard() then + warnlog "The table wizard doesn't start. TEST STOPPED" + goto endsub + endif + + Kontext "TableWizard" + dim iCount as integer + iCount = Tables.GetItemCount + if(iCount <> 22 ) then + warnlog "#102019# there are not 22 table in the category business. There are " + iCount + CancelBtn.Click + call fCloseDatabase() + goto endsub + endif + CancelBtn.Click + + for i = 1 to 22 + + '/// start the table wizard + printlog "start the table wizard" + if not fStartTableWizard() then + warnlog "The table wizard doesn't start. TEST STOPPED" + goto endsub + endif + + Kontext "TableWizard" + Tables.select i + dim sTableName as String + sTableName = Tables.getSelText + printlog "Create table " + sTableName + '/// add all fields + printlog " add all fields" + AddAll.click + '/// click Finish + printlog " click Finish" + FinishBtn.Click + + Kontext "MessageBox" + if ( MessageBox.exists(3) ) then + warnlog "error while creating table: " + sTableName + MessageBox.OK + Kontext "TableWizard" + CancelBtn.Click + else + '/// close the open table + printlog " close the open table" + call fCloseTableView() + endif + next + + '/// now create all tables from the personal tables + printlog "now create all tables from the personal tables" + + if not fStartTableWizard() then + warnlog "The table wizard doesn't start. TEST STOPPED" + goto endsub + endif + + Kontext "TableWizard" + Personal.Check + iCount = Tables.GetItemCount + if(iCount <> 15 ) then + warnlog "#102019# there are not 15 table in the category business. There are " + iCount + CancelBtn.Click + call fCloseDatabase() + goto endsub + endif + CancelBtn.Click + + for i = 1 to 15 + '/// start the table wizard + printlog "start the table wizard" + if not fStartTableWizard() then + warnlog "The table wizard doesn't start. TEST STOPPED" + goto endsub + endif + Kontext "TableWizard" + Personal.Check + Tables.select i + sTableName = Tables.getSelText + printlog "Create table " + sTableName + '/// add all fields + printlog " add all fields" + AddAll.click + '/// click Finish + printlog " click Finish" + FinishBtn.Click + + Kontext "MessageBox" + if ( MessageBox.exists(3) ) then + warnlog "error while creating table: " + sTableName + MessageBox.OK + Kontext "TableWizard" + CancelBtn.Click + else + '/// close the open table + printlog " close the open table" + call fCloseTableView() + endif + next + sleep(1) + + '/// close the database + printlog "close the database" + call fClosedatabase() + +endcase diff --git a/testautomation/dbaccess/optional/includes/xf_Submission.inc b/testautomation/dbaccess/optional/includes/xf_Submission.inc new file mode 100644 index 000000000000..05f0da768cdf --- /dev/null +++ b/testautomation/dbaccess/optional/includes/xf_Submission.inc @@ -0,0 +1,185 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : XForms submission Test +'* +'\*********************************************************************************** + +sub xf_Submission + + printlog "------------------ xf_Submission.inc ---------------------" + + call tDataNavigatorSubmission + +end sub +'------------------------------------------------------------------------- +testcase tDataNavigatorSubmission + + Dim sSubmitPath as string + + '/// 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 instance tabpage + printlog "select the instance tabpage" + + Kontext "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 + + '/// insert element1 as name and click OK + printlog "insert element1 as name and click OK" + Kontext "XFormAddItemDLG" + ElementName.setText "element1" + XFormAddItemDLG.OK + + '/// select the submisson tabpage + printlog "select the submisson tabpage" + + Kontext "XFormsDataNavigator" + while ( XFormsDataNavigatorTabControl.getPageID() <> 10 ) + XFormsDataNavigatorTabControl.TypeKeys("<RIGHT>") + wend + + '/// click the add submission icon + printlog "click the add submission icon" + + Kontext "XFormToolbar" + AddSubmission.Click + + '/// add a submission + Kontext "XFormAddSubmission" + SubmitName.setText("submission1") + sSubmitPath = "file:///" + gOfficePath + "user/work/test.xml" + SubmitAction.setText( hStringReplaceChar( sSubmitPath, "\", "/" ) ) + SubmitMethod.select 2 + + '/// close the add submission dialog + printlog "close the add submission dialog" + Kontext "XFormAddSubmission" + XFormAddSubmission.OK + + '/// close the xform data navigator + printlog "close the xform data navigator" + + Kontext "XFormsDataNavigator" + XFormsDataNavigator.Close + + '/// open the FormControl toolbar + call hToolbarSelect("FormControls",true) + + '/// insert a control + Kontext "FormControls" + Pushbutton.Click + + call hDrawingWithSelection(50,20,60,30) + + sleep(1) + + '/// open the FormControl Properties Dialog + printlog "open the FormControl Properties Dialog" + Kontext "FormControls" + ControlProperties.Click + + '/// select the first submission + printlog "select the first submission" + Kontext "TabGeneralControl" + ButtonType.select 2 + Submission.select 1 + TabGeneralControl.TypeKeys("<RETURN>", true) + + sleep(3) + '/// save the document + printlog "save the document" + call hFileSaveAsKill(gOfficePath + "user/work/test.odt") + + '/// close the document + printlog "close the document" + call hCloseDocument + + sleep(1) + '/// open the document + printlog "open the document" + call hFileOpen(gOfficePath + "user/work/test.odt") + + '/// click on the button in the document + printlog "click on the button in the document" + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<MOD1 F5>" , true + DocumentWriter.TypeKeys "<RETURN>" , true + + '/// close the document + printlog "close the document" + call hCloseDocument + + sleep(1) + + Open gOfficePath + "user/work/test.xml" For Input As 1 + + dim sLine as String + + Line Input #1, sLine + if sLine <> "<?xml version=""1.0""?>" then + warnlog "the first line in the xml document should <?xml version=""1.0""?> but it is " + sLine + endif + Line Input #1, sLine + if sLine <> "<instanceData><element1/></instanceData>" then + warnlog "the second line in the xml document should <instanceData><element1/></instanceData> but it is " + sLine + endif + +endcase +'------------------------------------------------------------------------- + diff --git a/testautomation/dbaccess/optional/input/TT_All_Controls.odt b/testautomation/dbaccess/optional/input/TT_All_Controls.odt Binary files differnew file mode 100755 index 000000000000..6c3fab616bfe --- /dev/null +++ b/testautomation/dbaccess/optional/input/TT_All_Controls.odt diff --git a/testautomation/dbaccess/optional/input/TT_Form_Filter.odt b/testautomation/dbaccess/optional/input/TT_Form_Filter.odt Binary files differnew file mode 100755 index 000000000000..aeca60778e04 --- /dev/null +++ b/testautomation/dbaccess/optional/input/TT_Form_Filter.odt diff --git a/testautomation/dbaccess/optional/input/ado_datasource/testdb.mdb b/testautomation/dbaccess/optional/input/ado_datasource/testdb.mdb Binary files differnew file mode 100755 index 000000000000..57e579141b83 --- /dev/null +++ b/testautomation/dbaccess/optional/input/ado_datasource/testdb.mdb diff --git a/testautomation/dbaccess/optional/input/dbase_datasource/TT_Forms.dbf b/testautomation/dbaccess/optional/input/dbase_datasource/TT_Forms.dbf Binary files differnew file mode 100755 index 000000000000..2d2374cf212f --- /dev/null +++ b/testautomation/dbaccess/optional/input/dbase_datasource/TT_Forms.dbf diff --git a/testautomation/dbaccess/optional/input/dbase_datasource/TT_Func1.dbf b/testautomation/dbaccess/optional/input/dbase_datasource/TT_Func1.dbf Binary files differnew file mode 100755 index 000000000000..d20913d7776e --- /dev/null +++ b/testautomation/dbaccess/optional/input/dbase_datasource/TT_Func1.dbf diff --git a/testautomation/dbaccess/optional/input/dbase_datasource/TT_Query1.dbf b/testautomation/dbaccess/optional/input/dbase_datasource/TT_Query1.dbf Binary files differnew file mode 100755 index 000000000000..b6f7008ac6cb --- /dev/null +++ b/testautomation/dbaccess/optional/input/dbase_datasource/TT_Query1.dbf diff --git a/testautomation/dbaccess/optional/input/dbase_datasource/TT_Query1.dbt b/testautomation/dbaccess/optional/input/dbase_datasource/TT_Query1.dbt Binary files differnew file mode 100755 index 000000000000..3cfcf975b2a3 --- /dev/null +++ b/testautomation/dbaccess/optional/input/dbase_datasource/TT_Query1.dbt diff --git a/testautomation/dbaccess/optional/input/hsql_datasource/TT_hsqldb.odb b/testautomation/dbaccess/optional/input/hsql_datasource/TT_hsqldb.odb Binary files differnew file mode 100755 index 000000000000..7b9908e8fdfe --- /dev/null +++ b/testautomation/dbaccess/optional/input/hsql_datasource/TT_hsqldb.odb diff --git a/testautomation/dbaccess/optional/input/hsql_datasource/TT_hsqldb_2.0.0.odb b/testautomation/dbaccess/optional/input/hsql_datasource/TT_hsqldb_2.0.0.odb Binary files differnew file mode 100755 index 000000000000..bb6a09f45fe0 --- /dev/null +++ b/testautomation/dbaccess/optional/input/hsql_datasource/TT_hsqldb_2.0.0.odb diff --git a/testautomation/dbaccess/optional/input/hsql_datasource/hsql_macros_in_subdocument.odb b/testautomation/dbaccess/optional/input/hsql_datasource/hsql_macros_in_subdocument.odb Binary files differnew file mode 100644 index 000000000000..6462263f8204 --- /dev/null +++ b/testautomation/dbaccess/optional/input/hsql_datasource/hsql_macros_in_subdocument.odb diff --git a/testautomation/dbaccess/optional/input/spreadsheet_datasource/TT_Query1.ods b/testautomation/dbaccess/optional/input/spreadsheet_datasource/TT_Query1.ods Binary files differnew file mode 100755 index 000000000000..50bb81de8f5a --- /dev/null +++ b/testautomation/dbaccess/optional/input/spreadsheet_datasource/TT_Query1.ods diff --git a/testautomation/dbaccess/optional/input/text_datasource/TT_Query1.txt b/testautomation/dbaccess/optional/input/text_datasource/TT_Query1.txt new file mode 100755 index 000000000000..c2328af71ff3 --- /dev/null +++ b/testautomation/dbaccess/optional/input/text_datasource/TT_Query1.txt @@ -0,0 +1,12 @@ +ID;Name1;Name2;Integer;Decimal;Bool;Date;Time +0;Heinz;Zeise;1;1;0;123;123 +2;Franz;Meise;4;6;1;123; +3;Lutz;Leise;475;3;1;123; +4;Butz;Freitag;256;2;0;123; +5;Fratz;Kain;2;5;1;123; +6;Blum;Feierabend;5;6;0;123; +7;Suse;Arm;4;6;0;123; +8;Zork;Luft;65;2;1;123; +9;Anna;Kasper;26;34;0;123;123; +10;Trude;Tag;2;6;1;123; +11;Freddi;Oskar;1;1;0;;
\ No newline at end of file diff --git a/testautomation/dbaccess/optional/input/text_datasource/text_database.txt b/testautomation/dbaccess/optional/input/text_datasource/text_database.txt new file mode 100755 index 000000000000..f7ac13e264cf --- /dev/null +++ b/testautomation/dbaccess/optional/input/text_datasource/text_database.txt @@ -0,0 +1,3 @@ +id;name +1;öäü +2;ĴЩ
\ No newline at end of file diff --git a/testautomation/dbaccess/required/dba_Main.bas b/testautomation/dbaccess/required/dba_Main.bas new file mode 100755 index 000000000000..0d07dde2f3fb --- /dev/null +++ b/testautomation/dbaccess/required/dba_Main.bas @@ -0,0 +1,77 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : DBAccess Main Test +'* +'\*********************************************************************** +sub main + + printlog "---------------------------------------------------------------------" + printlog "----- D B A C C E S S - M A I N T E S T -----" + printlog "---------------------------------------------------------------------" + + use "dbaccess/required/includes/Query.inc" + use "dbaccess/required/includes/MainApp.inc" + use "dbaccess/required/includes/TableDesign.inc" + use "dbaccess/required/includes/Table.inc" + use "dbaccess/required/includes/Forms.inc" + use "dbaccess/required/includes/DatabaseTypes.inc" + use "dbaccess/required/includes/Wizards.inc" + + Dim startes + startes = Now + + call hStatusIn ("dbaccess","dba_Main.bas" , "DBAccess Main Test") + + call MainApp + call Query + call TableDesign + call Table + call Forms + + call ExitRestartTheOffice + call DatabaseTypes + call ExitRestartTheOffice + call Wizards + + call hStatusOut + + printlog "---------------------------------------------------------------------" + printlog "End: " & Date & ", " & Time & ". (" & wielange(Startes) & ")" + printlog "---------------------------------------------------------------------" +end sub + + +sub LoadIncludeFiles + use "global/tools/includes/optional/t_extension_manager_tools.inc" + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/required/dba_ReportBuilder.bas b/testautomation/dbaccess/required/dba_ReportBuilder.bas new file mode 100755 index 000000000000..c57e31d2e45b --- /dev/null +++ b/testautomation/dbaccess/required/dba_ReportBuilder.bas @@ -0,0 +1,55 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Report Builder Main Test +'* +'\*********************************************************************** +sub main + + printlog "---------------------------------------------------------------------" + printlog "----- D B A C C E S S - R E P O R T B U I L D E R -----" + printlog "---------------------------------------------------------------------" + + use "dbaccess/required/includes/ReportBuilder01.inc" + + call hStatusIn ("dbaccess","dba_ReportBuilder.bas" , "Report Builder Main Test") + call rpt_Main + call hStatusOut + + printlog "---------------------------------------------------------------------" + +end sub + + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/required/dba_xforms_Main.bas b/testautomation/dbaccess/required/dba_xforms_Main.bas new file mode 100755 index 000000000000..52efa7af582f --- /dev/null +++ b/testautomation/dbaccess/required/dba_xforms_Main.bas @@ -0,0 +1,53 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : XForms Update Test +'* +'\*********************************************************************** +sub main + printlog "---------------------------------------------------------------------" + printlog "----- X F O R M S - M A I N T E S T -----" + printlog "---------------------------------------------------------------------" + + use "dbaccess/required/includes/Xforms01.inc" + + call hStatusIn ("dbaccess","dba_xforms_Main.bas" , "XForms Main Test") + + call xforms_01 + + call hStatusOut + +end sub + +sub LoadIncludeFiles + use "dbaccess/tools/dbinit.inc" + Call sDBInit + Call GetUseFiles + gApplication = "WRITER" +end sub diff --git a/testautomation/dbaccess/required/includes/DatabaseTypes.inc b/testautomation/dbaccess/required/includes/DatabaseTypes.inc new file mode 100644 index 000000000000..ae5688374c75 --- /dev/null +++ b/testautomation/dbaccess/required/includes/DatabaseTypes.inc @@ -0,0 +1,754 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.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 "DATABASE" + Database.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + DataBaseType.select(hGetDatabaseDisplayName("sdbc:mysql:odbc:*")) + + 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 "DATABASE" + Database.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + DataBaseType.select(hGetDatabaseDisplayName("sdbc:mysql:jdbc:*")) + + 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 "DATABASE" + Database.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + sleep(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + DataBaseType.select(hGetDatabaseDisplayName("sdbc:adabas:*")) + + 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 "DATABASE" + Database.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + DataBaseType.select(hGetDatabaseDisplayName("jdbc:oracle:thin:*")) + + 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 "DATABASE" + Database.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + DataBaseType.select(hGetDatabaseDisplayName("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 "DATABASE" + Database.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + DataBaseType.select(hGetDatabaseDisplayName("sdbc:address:ldap:*")) + + 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 "DATABASE" + Database.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + try + if ( isDriverInstalled("sdbc:address:evolution:ldap")) then + DataBaseType.select(hGetDatabaseDisplayName("sdbc:address:evolution:ldap")) + Kontext "ConnectionType" + ConnectionType.OK + else + qaerrorlog "Evolution does not appear to be available on this system" + Kontext "ConnectionType" + ConnectionType.Cancel + endif + catch + warnlog "failed to select DataBaseType Evolution - maybe not installed or activated in this build" + TabGeneral.Cancel + call fCloseDatabase + goto endsub + endcatch + + '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 "DATABASE" + Database.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + try + if ( isDriverInstalled("sdbc:address:mozilla:")) then + DataBaseType.select(hGetDatabaseDisplayName("sdbc:address:mozilla:")) + Kontext "ConnectionType" + ConnectionType.OK + else + qaerrorlog "Mozilla does not appear to be available on this system" + Kontext "ConnectionType" + ConnectionType.Cancel + endif + catch + warnlog "failed to select DataBaseType Mozilla - maybe not installed or activated in this build" + TabGeneral.Cancel + call fCloseDatabase + goto endsub + endcatch + + + 'add sleep to give OOo time to react + sleep(2) + + '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 "DATABASE" + Database.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + DataBaseType.select(hGetDatabaseDisplayName("sdbc:calc:*")) + + Kontext "ConnectionType" + NextBtn.Click + sleep(1) + call fCheckConnectionTabPage("CALC") + + Kontext "ConnectionType" + ConnectionType.Cancel + + 'call fCheckAdvancedDialog("CALC") + + call fCloseDatabase() + +endcase +'------------------------------------------------------------------------- +testcase tTextProperties + + call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) + + ViewForms + + Kontext "DATABASE" + Database.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + DataBaseType.select(hGetDatabaseDisplayName("sdbc:flat:*")) + + 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 "DATABASE" + Database.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + DataBaseType.select(hGetDatabaseDisplayName("sdbc: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 "DATABASE" + Database.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(15) + hMenuSelectNr(2) + + Kontext "TabGeneral" + call DialogTest(TabGeneral) + DataBaseType.select(hGetDatabaseDisplayName("sdbc: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 "DATABASE" + Database.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 = "CALC" 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 = "CALC" 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 100644 index 000000000000..45c308f2b1f7 --- /dev/null +++ b/testautomation/dbaccess/required/includes/Forms.inc @@ -0,0 +1,91 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.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" + hFileOpen( gOfficePath & "user/database/biblio.odb" ) + + Kontext "DATABASE" + + Database.MouseDown(50,50) + Database.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 100644 index 000000000000..fddb8d34667f --- /dev/null +++ b/testautomation/dbaccess/required/includes/MainApp.inc @@ -0,0 +1,620 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : test the Main Application Window +'* +'\****************************************************************************** + +sub MainApp + + printlog "------------------ MainApp.inc ---------------------" + + call tMainApp + call tMainMenuBar + call tDatabaseProperties + call tTableView + call tPreview + call tTableFilters + + call tRegisterDatabaseDialog + call tDatabaseBeamer + +end sub +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +testcase tTableFilters + + hFileOpen( gOfficePath & "user/database/biblio.odb" ) + + Kontext "DATABASE" + + Database.MouseDown(50,50) + Database.MouseUp(50,50) + sleep(1) + TableFilters + sleep(1) + Kontext "TablesFilter" + + TablesFilter.Cancel + sleep 1 + + call hCloseDocument + + +endcase +'------------------------------------------------------------------------- +testcase tTableView + + hFileOpen( gOfficePath & "user/database/biblio.odb" ) + + Kontext "DATABASE" + + Database.MouseDown(50,50) + Database.MouseUp(50,50) + + if not DatabaseSwapIconView.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. + + hFileOpen( gOfficePath & "user/database/biblio.odb" ) + + Kontext "DATABASE" + + Database.MouseDown(50,50) + Database.MouseUp(50,50) + + Kontext "DATABASE" + if Database.exists() then + printlog "Insight appear" + else + warnlog "Insight doesn't appear" + goto endsub + end if + + if DatabaseSwapView.exists() then + printlog "InsightSwapView appear" + else + warnlog "InsightSwapView doesn't appear" + goto endsub + end if + + '/// display Tables View + printlog "display Tables View" + ViewTables + if DatabaseTablesView.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 DatabaseQueriesView.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 "DATABASE" + '/// 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 DatabaseReportsView.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 ( gOOO ) then + iCheckCount = 1 + else + iCheckCount = 2 + 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 + + hFileOpen( gOfficePath & "user/database/biblio.odb" ) + + Kontext "DATABASE" + + Database.MouseDown(50,50) + Database.MouseUp(50,50) + + ViewTables + + sleep(1) + + Kontext "ContainerView" + TableTree.select 1 + + Kontext "DATABASE" + Database.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 "DATABASE" + Database.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. + + hFileOpen( gOfficePath & "user/database/biblio.odb" ) + + Kontext "DATABASE" + Database.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 ( lcase( gPlatform ) = "osx" ) then + if ( iCount <> 10 ) then + warnlog( "File menu: 10 items expected, found " & iCount ) + endif + else + if (iCount <> 11 ) then + warnlog "There should be 11 items in the file menu but there are " + iCount + " items." + end if + endif + + '/// 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 "#i112496# - 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" + Database.UseMenu + hMenuSelectNr(1) ' the file menu + hMenuSelectNr(4) ' the autopilots menu + iCount = hMenuItemGetCount() + if (iCount <> 8) then + warnlog "There should 8 items in the FILE/AUTOPILOTS menu but there are " + iCount + " items." + endif + call hMenuClose() + + '/// check if there are 15 items in the edit menu. + printlog "check if there are 15 items in the edit menu." + Database.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." + Database.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" + Database.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" + Database.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" + Database.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." + Database.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 10 items in the tools menu. + printlog "check if there are 10 items in the tools menu." + Database.UseMenu + hMenuSelectNr(5) + iCount = hMenuItemGetCount() + if ( lcase( gPlatform ) = "osx" ) then + if ( iCount <> 9 ) then + warnlog( "Tools menu: 9 items expected, found " & iCount ) + endif + else + if (iCount <> 10) then + warnlog "There should 10 items in the tools menu but there are " + iCount + " items." + end if + endif + 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." + Database.UseMenu + hMenuSelectNr(5) + hMenuSelectNr(6) + 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 + + hFileOpen( gOfficePath & "user/database/biblio.odb" ) + + Kontext "DATABASE" + Database.MouseDown(50,50) + Database.MouseUp(50,50) + + Kontext "DATABASE" + Database.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 +'-------------------------------------------------------------------- +testcase tDatabaseBeamer + + printlog "open new document" + call hNewDocument + + printlog "open the database beamer" + ViewCurrentDatabase + WaitSlot(1) + + printlog "select database Bibliography" + Kontext "DatabaseSelection" + DatabaseSelection.select 1 + + printlog "open the selected database" + DatabaseSelection.OpenContextmenu + hMenuSelectNr(1) + WaitSlot(1) + + Kontext "DATABASE" + If Database.exists(10) then + printlog "database open -> OK" + printlog "close the open database" + call fCloseDatabase + else + warnlog "database mot open" + endif + + printlog "close the open document" + call hCloseDocument + +endcase +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +function getMenuItemCount as Integer +'use this function becasue this doesn't count the pick list + Dim i as Integer + Dim j as Integer + Dim Ende as Integer + Dim 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 100644 index 000000000000..0fa9d6addb24 --- /dev/null +++ b/testautomation/dbaccess/required/includes/Query.inc @@ -0,0 +1,966 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.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 '" & sTableName & "' 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. + sleep( 1 ) + 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 ( lcase( gPlatform ) = "osx" ) then + if ( iCount <> 7 ) then + warnlog( "File menu: 7 items expected, found " & iCount ) + endif + else + if (iCount <> 8 ) then + warnlog "There should between 8 and 12 items in the file menu but there are " + iCount + " items." + end if + endif + + '/// 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 (iCount <> 8) then + warnlog "There should 8 items in the FILE/AUTOPILOTS menu but there are " + iCount + " items." + 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 ( lcase( gPlatform ) = "osx" ) then + if ( iCount <> 3 ) then + warnlog( "Tools menu: 3 items expected, found " & iCount ) + endif + else + if (iCount <> 4) then + warnlog "There should 4 items in the tools menu but there are " + iCount + " items." + end if + endif + 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 getMenuItemCount as Integer +'use this function becasue this doesn't count the pick list + Dim i as Integer + Dim j as Integer + Dim Ende as Integer + Dim 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 + + hFileOpen( gOfficePath & "user/database/biblio.odb" ) + + Kontext "DATABASE" + + Database.MouseDown(50,50) + Database.MouseUp(50,50) + + sleep(1) + + NewQueryDesign + + ' if not DatabaseSwapIconView.exists(1) then + ' warnlog "InsightSwapIconView doesn't exists" + ' exit sub + ' end if + ' + ' '/// display Queries View + ' printlog "display Queries View" + ' ViewQueries + ' if DatabaseQueriesView.exists(1) then + ' printlog "InsightQueriesView appear" + ' else + ' warnlog "InsightQueriesView doesn't appear" + ' exit sub + ' end if + ' + ' Kontext "DATABASE" + ' CreationList.select(1) + ' sleep(1) + ' Database.TypeKeys "<TAB>" , true + ' Database.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 100644 index 000000000000..d1cce59d4d3f --- /dev/null +++ b/testautomation/dbaccess/required/includes/ReportBuilder01.inc @@ -0,0 +1,876 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.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 tFormatPage + call tGroupingSorting + call tReportNavigator + call tReportHeaderFooter + call tPageHeaderFooter + call tFunctionWizard + else + warnlog "report extension could not installed" + endif + +end sub +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +'------------------------------------------------------------------------- +testcase tMainMenuBar + + dim iCount as Integer + + '/// open Bibliography database + + call hFileOpen(gOfficePath + ConvertPath("user/database/biblio.odb")) + + Kontext "DATABASE" + + Database.MouseDown(50,50) + Database.MouseUp(50,50) + sleep(1) + + '/// open the report designer + call fOpenNewReportDesign + + + + '/// check the menu for the right entries + + 'file menu + Kontext "ReportDesign" + if ( ReportDesign.exists( 20 ) ) then + 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 ( lcase( gPlatform ) = "osx" ) then + if ( iCount <> 9 ) then + warnlog( "File menu: 9 Items expected, found " & iCount ) + endif + else + if (iCount <> 10 ) then + warnlog "There should be 10 items in the file menu but there are " + iCount + " items." + end if + endif + + '/// 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 (iCount <> 8) then + warnlog "There should 8 items in the FILE/AUTOPILOTS menu but there are " + iCount + " items." + endif + call hMenuClose() + + 'edit menu + + '/// check if there are 11 items in the edit menu. + printlog "check if there are 11 items in the edit menu." + ReportDesign.UseMenu + hMenuSelectNr(2) + iCount = hMenuItemGetCount() + if (iCount <> 11) then + warnlog "There should 11 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 ( lcase( gPlatform ) = "osx" ) then + if ( iCount <> 3 ) then + warnlog( "Tools menu: 3 items expected, found " & iCount ) + endif + else + if (iCount <> 4) then + warnlog "There should 4 items in the tools menu but there are " + iCount + " items." + end if + endif + 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 ( lcase( gPlatform ) = "osx" ) then iCount = iCount + 1 ' dirty, but check is fuzzy anyway. + 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 + + else + warnlog "The Report Designer did not open within expected timeframe" + endif + '/// close the database + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tConditionalFormatingDialog + + '/// 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 + + '/// 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(11) + + 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 + + '/// 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 + + '/// 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 + + '/// 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(4) + + '/// 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 + + '/// 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(5) + + '/// 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 + + '/// 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 + + '/// 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 + + '/// 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 +'------------------------------------------------------------------------- +testcase tFormatPage + + printlog "open Bibliography database" + call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + printlog "open the report designer" + call fOpenNewReportDesign + + printlog "open format/page dialog via the menu" + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(5) + hMenuSelectNr(3) + + printlog "check if the format page dialog appear" + Kontext "TabSeite" + if ( not TabSeite.exists(3)) then + warnlog "format page dialog doesn't appear" + call fCloseReportDesign + call fCloseDatabase + goto endsub + else + printlog "format page dialog appear" + call DialogTest(TabSeite) + TabSeite.Cancel + endif + + '/// close the report designer + call fCloseReportDesign + '/// close the database + call fCloseDatabase + +endcase +'------------------------------------------------------------------------- +testcase tFunctionWizard + + printlog "open Bibliography database" + call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb")) + + printlog "open the report designer" + call fOpenNewReportDesign + + 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() + + 'press 2 time tab to select the edit field + Kontext "ReportDesign" + ReportDesign.TypeKeys("<TAB>",true) + ReportDesign.TypeKeys("<TAB>",true) + + sleep(1) + + printlog "click on the ... button behind the datafield property in the property browser" + Kontext "ReportDataProperties" + OpenFormularWizard.Click + + printlog "check if the function wizard appear" + Kontext "FunctionWizard" + if(FunctionWizard.exists(5)) then + printlog "The function wizard appear -> OK" + FunctionWizard.close + else + warnlog "The function wizard does not appear -> FAILED" + endif + + sleep(1) + + printlog "close the report designer" + call fCloseReportDesign + 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 100644 index 000000000000..6d478bd35540 --- /dev/null +++ b/testautomation/dbaccess/required/includes/Table.inc @@ -0,0 +1,632 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.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 ( lcase( gPlatform ) = "osx" ) then + if ( iCount <> 7 ) then + warnlog( "File menu: 8 items expected, found " & iCount ) + endif + else + if (iCount <> 8 ) then + warnlog "There should between 8 and 12 items in the file menu but there are " + iCount + " items." + end if + endif + + '/// 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 (iCount <> 8) then + warnlog "There should 8 items in the FILE/AUTOPILOTS menu but there are " + iCount + " items." + 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 ( lcase( gPlatform ) = "osx" ) then + if ( iCount <> 3 ) then + warnlog( "Tools menu: 3 items expected, found " & iCount ) + endif + else + if (iCount <> 4) then + warnlog "There should 4 items in the tools menu but there are " + iCount + " items." + end if + endif + 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 getMenuItemCount as Integer +'use this function becasue this doesn't count the pick list + Dim i as Integer + Dim j as Integer + Dim Ende as Integer + Dim 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 + + + hFileOpen( gOfficePath & "user/database/biblio.odb" ) + + Kontext "DATABASE" + + Database.MouseDown(50,50) + Database.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 100644 index 000000000000..9da4d602a6d9 --- /dev/null +++ b/testautomation/dbaccess/required/includes/TableDesign.inc @@ -0,0 +1,509 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.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 ( lcase( gPlatform ) = "osx" ) then + if ( iCount <> 7 ) then + warnlog( "File menu: 7 items expected, found " & iCount ) + endif + else + if (iCount <> 8 ) then + warnlog "There should between 8 and 12 items in the file menu but there are " + iCount + " items." + end if + endif + + '/// 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 (iCount <> 8) then + warnlog "There should 8 items in the FILE/AUTOPILOTS menu but there are " + iCount + " items." + 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 ( lcase( gPlatform ) = "osx" ) then + if ( iCount <> 4 ) then + warnlog( "Tools menu: 4 items expected, found " & iCount ) + endif + else + if (iCount <> 5) then + warnlog "There should 5 items in the tools menu but there are " + iCount + " items." + end if + endif + 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 getMenuItemCount as Integer +'use this function becasue this doesn't count the pick list + Dim i as Integer + Dim j as Integer + Dim Ende as Integer + Dim 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 + + hFileOpen( gOfficePath & "user/database/biblio.odb" ) + + Kontext "DATABASE" + + Database.MouseDown(50,50) + Database.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 100644 index 000000000000..4cde075d0e35 --- /dev/null +++ b/testautomation/dbaccess/required/includes/Wizards.inc @@ -0,0 +1,235 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.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 + + hFileOpen( gOfficePath & "user/database/biblio.odb" ) + + Kontext "DATABASE" + + Database.MouseDown(50,50) + Database.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 + + hFileOpen( gOfficePath & "user/database/biblio.odb" ) + + Kontext "DATABASE" + + Database.MouseDown(50,50) + Database.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 + + hFileOpen( gOfficePath & "user/database/biblio.odb" ) + + Kontext "DATABASE" + + Database.MouseDown(50,50) + Database.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 + + hFileOpen( gOfficePath & "user/database/biblio.odb" ) + + Kontext "DATABASE" + + Database.MouseDown(50,50) + Database.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 100644 index 000000000000..fcf3e03a98ea --- /dev/null +++ b/testautomation/dbaccess/required/includes/Xforms01.inc @@ -0,0 +1,485 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.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 + diff --git a/testautomation/dbaccess/required/input/oracle-report-builder.oxt b/testautomation/dbaccess/required/input/oracle-report-builder.oxt Binary files differnew file mode 100644 index 000000000000..e806ba70897f --- /dev/null +++ b/testautomation/dbaccess/required/input/oracle-report-builder.oxt diff --git a/testautomation/dbaccess/tools/controltools.inc b/testautomation/dbaccess/tools/controltools.inc new file mode 100644 index 000000000000..28b0583c0b42 --- /dev/null +++ b/testautomation/dbaccess/tools/controltools.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 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Helper Routines for Form and Control Tests +'* +'*************************************************************************************** +'* +' #1 fSwitchAutopilotOff +' #1 fSetControlProperty +' #1 fGetControlProperty +' #1 hDrawingWithSelection +' #1 fOpenControlPropertyBrowser +' #1 addControl +' #1 fSwitchControlDesignMode +' #1 closePropertyBrowserAndDocument +' #1 fOpenMoreControlsToolBar +'* +'\************************************************************************************** + + +function fSwitchAutopilotOff(SwitchAutoOff as boolean) + '/// turn the Control autopilots off or on + '/// <u>parameter:</u> + '/// <b>SwitchAutoOff:</b> If true the autopilot is turned off, if the parameter is false the autopilot is turned on + + '/// open a new document + printlog "open a new document" + gApplication = "WRITER" + call hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tt_doc" , true + sleep(1) + Kontext "Toolbar" + call hToolbarSelect("FormControls",true) + Kontext "FormControls" + '/// insert a group box to activate autopilot button + ListBox.Click + sleep(1) + call hDrawingWithSelection ( 50, 50, 60, 60 ) + sleep(2) + '/// check if auto pilot dialog is available + Kontext "AutoPilotListComboBox" + if AutoPilotListComboBox.Exists(3) then + Kontext "AutoPilotListComboBox" + AutoPilotListComboBox.Cancel + sleep(2) + if SwitchAutoOff = true then + Kontext "FormControls" + printlog "switch autopilot off" + UseWizards.Click + sleep(2) + else + printlog "let autopilot on" + endif + else + if SwitchAutoOff = false then + Kontext "FormControls" + printlog "switch autopilot on" + UseWizards.Click + sleep(2) + else + printlog "let autopilot off" + endif + endif + hCloseDocument +end function +'-------------------------------------------------------------------------------------- +function fSetControlProperty(sControlType, sPropertyName, sPropertyValue as string) + '/// set the property of a control via the control property browser + '/// <u>parameter:</u> + '/// <b>sControlType:</b> The name of the control type f.e. TextBox + '/// <b>sPropertyName:</b> The name of the control property f.e. DefaultValue + '/// <b>sPropertyValue:</b> The value of the control property + + ' switch to the General Page + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl + + Kontext "TabGeneralControl" + if TabGeneralControl.exists(3) then + printlog "Set Property '" + sPropertyName + "' to the value '" + sPropertyValue + "' for a '" + sControlType + "' control." + ' A - C + + if sPropertyName = "Accuracy" then + Accuracy.setText(sPropertyValue) + elseif sPropertyName = "Align" then + Align.select(Cint(sPropertyValue)) + elseif sPropertyName = "AdditionalInfo" then + Information.setText(sPropertyValue) + Information.TypeKeys("<RETURN>",true) + elseif sPropertyName = "AutoComplete" then + AutoComplete.select(Cint(sPropertyValue)) + elseif sPropertyName = "Background" then + Background.select(Cint(sPropertyValue)) + elseif sPropertyName = "Border" then + Border.select(Cint(sPropertyValue)) + elseif sPropertyName = "BorderColor" then + BorderColor.select(Cint(sPropertyValue)) + elseif sPropertyName = "ButtonType" then + ButtonType.select(Cint(sPropertyValue)) + elseif sPropertyName = "BlockIncrement" then + BlockIncrement.setText(sPropertyValue) + elseif sPropertyName = "CellBound" then + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabDataControl + Kontext "TabDataControl" + CellBound.setText(sPropertyValue) + CellBound.typeKeys("<RETURN>",true) + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl + elseif sPropertyName = "CellRange" then + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabDataControl + Kontext "TabDataControl" + CellRange.setText(sPropertyValue) + CellRange.typeKeys("<RETURN>",true) + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl + elseif sPropertyName = "CurrSymPosition" then + CurrSymPosition.select(Cint(sPropertyValue)) + elseif sPropertyName = "CurrencySymbol" then + CurrencySymbol.setText(sPropertyValue) + + 'D - F + + elseif sPropertyName = "DateMax" then + DateMax.setText(sPropertyValue) + elseif sPropertyName = "DateMin" then + DateMin.setText(sPropertyValue) + elseif sPropertyName = "DateFormat" then + DateFormat.select(Cint(sPropertyValue)) + elseif sPropertyName = "DefaultButton" then + DefaultButton.select(Cint(sPropertyValue)) + elseif sPropertyName = "DefaultSelection2" then + DefaultSelection2.setText(sPropertyValue) + elseif sPropertyName = "DefaultState" then + DefaultState.select(Cint(sPropertyValue)) + elseif sPropertyName = "DefaultValue" then + TabGeneralControl.MouseDown 1,1,1,true + TabGeneralControl.MouseUp 1,1,1,true + sleep(1) + TabGeneralControl.TypeKeys "<TAB>" , 16 , true + sleep(1) + TabGeneralControl.TypeKeys sPropertyValue , true + sleep(1) + TabGeneralControl.TypeKeys "<RETURN>" , true + sleep(1) + elseif sPropertyName = "Delay" then + Delay.setText(sPropertyValue) + elseif sPropertyName = "DropDown" then + DropDown.select(Cint(sPropertyValue)) + elseif sPropertyName = "Enabled" then + Enabled.select(Cint(sPropertyValue)) + elseif sPropertyName = "EditMask" then + EditMask.setText(sPropertyValue) + elseif sPropertyName = "FilteringSorting" then + FilteringSorting.select(Cint(sPropertyValue)) + elseif sPropertyName = "Frame" then + Frame.select(Cint(sPropertyValue)) + + 'G - L + + elseif sPropertyName = "Graphics" then + Graphics.setText(sPropertyValue) + elseif sPropertyName = "GraphicsAlignment" then + GraphicsAlignment.select(Cint(sPropertyValue)) + elseif sPropertyName = "HelpText" then + HelpText.setText(sPropertyValue) + elseif sPropertyName = "HelpURL" then + HelpURL.setText(sPropertyValue) + HelpURL.TypeKeys "<RETURN>",true + elseif sPropertyName = "HiddenValue" then + HiddenValue.setText(sPropertyValue) + elseif sPropertyName = "HideSelection" then + HideSelection.select(Cint(sPropertyValue)) + elseif sPropertyName = "IconSize" then + IconSize.select(Cint(sPropertyValue)) + elseif sPropertyName = "LineCount" then + LineCount.setText(sPropertyValue) + elseif sPropertyName = "LineIncrement" then + LineIncrement.setText(sPropertyValue) + elseif sPropertyName = "LiteralMask" then + LiteralMask.setText(sPropertyValue) + elseif sPropertyName = "ListEntries" then + ListEntries.setText(sPropertyValue) + + 'M - O + + elseif sPropertyName = "MaxTextLen" then + MaxTextLen.setText(sPropertyValue) + elseif sPropertyName = "MultiLine" then + qaerrorlog "The Property MultiLine doesn't exists anymore." + qaerrorlog "Please use TextType instead. This property will be removed soon." + TextType.select(Cint(sPropertyValue)) + elseif sPropertyName = "MultiLine2" then + MultiLine.select(Cint(sPropertyValue)) + elseif sPropertyName = "Multiselection" then + Multiselection.select(Cint(sPropertyValue)) + elseif sPropertyName = "NameText" then + NameText.setText(sPropertyValue) + NameText.typeKeys("<RETURN>",true) + elseif sPropertyName = "Navigation" then + Navigation.select(Cint(sPropertyValue)) + elseif sPropertyName = "NavigationBar" then + NavigationBar.select(Cint(sPropertyValue)) + elseif sPropertyName = "Orientation" then + Orientation.select(Cint(sPropertyValue)) + elseif sPropertyName = "Order" then + Order.setText(sPropertyValue) + + 'P - R + + elseif sPropertyName = "Password" then + Password.setText(sPropertyValue) + elseif sPropertyName = "ReferenceValue" then + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabDataControl + Kontext "TabDataControl" + ReferenceValue.setText(sPropertyValue) + ReferenceValue.TypeKeys("<RETURN>",true) + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl + elseif sPropertyName = "Repeat" then + Repeat.select(Cint(sPropertyValue)) + elseif sPropertyName = "Printable" then + Printable.select(Cint(sPropertyValue)) + elseif sPropertyName = "Positioning" then + Positioning.select(Cint(sPropertyValue)) + elseif sPropertyName = "RecordActions" then + RecordActions.select(Cint(sPropertyValue)) + elseif sPropertyName = "RecordMarker" then + RecordMarker.select(Cint(sPropertyValue)) + elseif sPropertyName = "ReferenceValueOff" then + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabDataControl + Kontext "TabDataControl" + ReferenceValueOff.setText(sPropertyValue) + ReferenceValueOff.TypeKeys("<RETURN>",true) + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl + elseif sPropertyName = "Readonly" then + Readonly.select(Cint(sPropertyValue)) + elseif sPropertyName = "RowHeight" then + RowHeight.setText(sPropertyValue) + + 'S + + elseif sPropertyName = "Scale" then + Scale.select(Cint(sPropertyValue)) + elseif sPropertyName = "Spin" then + Spin.select(CInt(sPropertyValue)) + elseif sPropertyName = "StrictFormat" then + StrictFormat.select(CInt(sPropertyValue)) + elseif sPropertyName = "Scrollbars" then + Scrollbars.select(Cint(sPropertyValue)) + elseif sPropertyName = "SymbolColor" then + SymbolColor.select(Cint(sPropertyValue)) + elseif sPropertyName = "TextType" then + TextType.select(Cint(sPropertyValue)) + elseif sPropertyName = "ScrollValueMin" then + ScrollValueMin.setText(sPropertyValue) + elseif sPropertyName = "ScrollValueMax" then + ScrollValueMax.setText(sPropertyValue) + elseif sPropertyName = "ScrollValueDefault" then + ScrollValueDefault.setText(sPropertyValue) + + 'T - U + + elseif sPropertyName = "TabOrder" then + Order.setText(sPropertyValue) + TabGeneralControl.TypeKeys "<RETURN>",true + elseif sPropertyName = "TabStop" then + TabStop.select(Cint(sPropertyValue)) + elseif sPropertyName = "TakeFocus" then + TakeFocus.select(Cint(sPropertyValue)) + elseif sPropertyName = "TextType" then + TextType.select(Cint(sPropertyValue)) + elseif sPropertyName = "ThousandSeperator" then + ThousandSeperator.select(CInt(sPropertyValue)) + elseif sPropertyName = "TimeFormat" then + TimeFormat.select(Cint(sPropertyValue)) + elseif sPropertyName = "TimeMax" then + TimeMax.setText(sPropertyValue) + elseif sPropertyName = "TimeMin" then + TimeMin.setText(sPropertyValue) + elseif sPropertyName = "ToggleProp" then + ToggleProp.select(Cint(sPropertyValue)) + elseif sPropertyName = "TriState" then + TriState.select(Cint(sPropertyValue)) + elseif sPropertyName = "URL" then + URL.setText(sPropertyValue) + + 'V - Z + + elseif sPropertyName = "VisibleSize" then + VisibleSize.setText(sPropertyValue) + elseif sPropertyName = "ValueMin" then + if sControlType = "FormattedField" then + EffectiveMin.setText(sPropertyValue) + else + ValueMin.setText(sPropertyValue) + endif + elseif sPropertyName = "ValueMax" then + if sControltype = "FormattedField" then + EffectiveMax.setText(sPropertyValue) + else + ValueMax.setText(sPropertyValue) + endif + elseif sPropertyName = "ValueStep" then + ValueStep.setText(sPropertyValue) + ' + else + warnlog "The property " + sPropertyName + " doesn't exists in the function fSetControlProperty." + warnlog "Please add it to the function in dbaccess/tools/controltools.inc." + endif + + 'need additional return + sleep(1) + TabGeneralControl.TypeKeys "<RETURN>",true + else + warnlog "The control property browser doesn't exists." + endif + sleep(1) +end function +'-------------------------------------------------------------------------------------- +function fGetControlProperty(sControlType,sPropertyName) + '/// get the property of a control from the control property browser + '/// <u>parameter:</u> + '/// <b>sControlType:</b> The name of the control type f.e. TextBox + '/// <b>sPropertyName:</b> The name of the control property f.e. DefaultValue + + Dim sReturn as String + + ' switch to the General Page + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl + + Kontext "TabGeneralControl" + if TabGeneralControl.exists(3) then + + ' A - C + + if sPropertyName = "Accuracy" then + sReturn = Accuracy.getSelIndex + elseif sPropertyName = "AdditionalInfo" then + sReturn = Information.getText + elseif sPropertyName = "Align" then + sReturn = Align.getSelIndex + elseif sPropertyName = "AutoComplete" then + sReturn = AutoComplete.getSelIndex + elseif sPropertyName = "Background" then + sReturn = Background.getSelIndex + elseif sPropertyName = "BlockIncrement" then + sReturn = BlockIncrement.getText + elseif sPropertyName = "Border" then + sReturn = Border.getSelIndex + elseif sPropertyName = "BorderColor" then + sReturn = BorderColor.getSelIndex + elseif sPropertyName = "ButtonType" then + sReturn = ButtonType.getSelIndex + elseif sPropertyName = "CellBound" then + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabDataControl + Kontext "TabDataControl" + sReturn = CellBound.getText() + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl + elseif sPropertyName = "CellRange" then + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabDataControl + Kontext "TabDataControl" + sReturn = CellRange.getText() + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl + elseif sPropertyName = "CurrSymPosition" then + sReturn = CurrSymPosition.getSelIndex + elseif sPropertyName = "CurrencySymbol" then + sReturn = CurrencySymbol.getText + + 'D - F + + elseif sPropertyName = "DateMax" then + sReturn = DateMax.getText + elseif sPropertyName = "DateMin" then + sReturn = DateMin.getText + elseif sPropertyName = "DateFormat" then + sReturn = DateFormat.getSelIndex + elseif sPropertyName = "DefaultButton" then + sReturn = DefaultButton.getSelIndex + elseif sPropertyName = "Delay" then + sReturn = Delay.getText + elseif sPropertyName = "DefaultState" then + sReturn = DefaultState.getSelIndex + elseif sPropertyName = "DefaultSelection2" then + sReturn = DefaultSelection2.getText + elseif sPropertyName = "DefaultValue" then + sReturn = DefaultValue.getText + elseif sPropertyName = "DropDown" then + sReturn = DropDown.getSelIndex + elseif sPropertyName = "EditMask" then + sReturn = EditMask.getText + elseif sPropertyName = "Enabled" then + sReturn = Enabled.getSelIndex + elseif sPropertyName = "FilteringSorting" then + sReturn = FilteringSorting.getSelIndex + elseif sPropertyName = "Formatkey" then + sReturn = Formatkey.getText + elseif sPropertyName = "Frame" then + sReturn = Frame.getSelIndex + + 'G - L + + elseif sPropertyName = "Graphics" then + sReturn = Graphics.getSelText + elseif sPropertyName = "GraphicsAlignment" then + sReturn = GraphicsAlignment.getSelIndex + elseif sPropertyName = "HelpText" then + sReturn = HelpText.getText + elseif sPropertyName = "HelpURL" then + sReturn = HelpURL.getText + elseif sPropertyName = "HiddenValue" then + sReturn = HiddenValue.getText + elseif sPropertyName = "HideSelection" then + sReturn = HideSelection.getSelIndex + elseif sPropertyName = "IconSize" then + sReturn = IconSize.getSelIndex + elseif sPropertyName = "LineCount" then + sReturn = LineCount.getText + elseif sPropertyName = "LineIncrement" then + sReturn = LineIncrement.getText + elseif sPropertyName = "LiteralMask" then + sReturn = LiteralMask.getText + elseif sPropertyName = "ListEntries" then + sReturn = ListEntries.getText + + 'M - O + + elseif sPropertyName = "MaxTextLen" then + sReturn = MaxTextLen.getText + elseif sPropertyName = "MultiLine" then + sReturn = MultiLine.getSelIndex + elseif sPropertyName = "MultiLine2" then + sReturn = MultiLine.getSelIndex + elseif sPropertyName = "Multiselection" then + sReturn = Multiselection.getSelIndex + elseif sPropertyName = "NameText" then + sReturn = NameText.getText + elseif sPropertyName = "Navigation" then + sReturn = Navigation.getSelIndex + elseif sPropertyName = "NavigationBar" then + sReturn = NavigationBar.getSelIndex + elseif sPropertyName = "Order" then + sReturn = Order.getText + elseif sPropertyName = "Orientation" then + sReturn = Orientation.getSelIndex + + 'P - R + + elseif sPropertyName = "Password" then + sReturn = Password.getText + elseif sPropertyName = "Positioning" then + sReturn = Positioning.getSelIndex + elseif sPropertyName = "Printable" then + sReturn = Printable.getSelIndex + elseif sPropertyName = "Readonly" then + sReturn = Readonly.getSelIndex + elseif sPropertyName = "RecordActions" then + sReturn = RecordActions.getSelIndex + elseif sPropertyName = "RecordMarker" then + sReturn = RecordMarker.getSelIndex + elseif sPropertyName = "ReferenceValue" then + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabDataControl + Kontext "TabDataControl" + sReturn = ReferenceValue.getText + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.setPage TabGeneralControl + elseif sPropertyName = "Repeat" then + sReturn = Repeat.getSelIndex + elseif sPropertyName = "RowHeight" then + sReturn = RowHeight.getText + + 'S + + elseif sPropertyName = "Scale" then + sReturn = Scale.getSelIndex + elseif sPropertyName = "Scrollbars" then + sReturn = Scrollbars.getSelIndex + elseif sPropertyName = "ScrollValueDefault" then + sReturn = ScrollValueDefault.getText + elseif sPropertyName = "ScrollValueMax" then + sReturn = ScrollValueMax.getText + elseif sPropertyName = "ScrollValueMin" then + sReturn = ScrollValueMin.getText + elseif sPropertyName = "Spin" then + sReturn = Spin.getSelIndex + elseif sPropertyName = "StrictFormat" then + sReturn = StrictFormat.getSelIndex + elseif sPropertyName = "SymbolColor" then + sReturn = SymbolColor.getSelIndex + + 'T - U + + elseif sPropertyName = "TabStop" then + sReturn = TabStop.getSelIndex + elseif sPropertyName = "TakeFocus" then + sReturn = TakeFocus.getSelIndex + elseif sPropertyName = "TextType" then + sReturn = TextType.getSelIndex + elseif sPropertyName = "ThousandSeperator" then + sReturn = ThousandSeperator.getSelIndex + elseif sPropertyName = "TimeFormat" then + sReturn = TimeFormat.getSelIndex + elseif sPropertyName = "TimeMax" then + sReturn = TimeMax.getText + elseif sPropertyName = "TimeMin" then + sReturn = TimeMin.getText + elseif sPropertyName = "ToggleProp" then + sReturn = ToggleProp.getSelIndex + elseif sPropertyName = "TriState" then + sReturn = TriState.getSelIndex + + 'V - Z + + elseif sPropertyName = "ValueMin" then + if sControlType = "FormattedField" then + sReturn = EffectiveMin.getText + else + sReturn = ValueMin.getText + endif + elseif sPropertyName = "ValueMax" then + if sControltype = "FormattedField" then + sReturn = EffectiveMax.getText + else + sReturn = ValueMax.getText + endif + elseif sPropertyName = "VisibleSize" then + sReturn = VisibleSize.getText + elseif sPropertyName = "ValueStep" then + sReturn = ValueStep.getText + + endif + else + warnlog "The control property browser doesn't exists." + endif + fGetControlProperty = sReturn +end function +'-------------------------------------------------------------------------------------- +sub hDrawingWithSelection ( iStartX, iStartY, iEndX, iEndY ) + '/// move the mouse with pressed mouse button + '/// <u>parameter:</u> + '/// <b>iStartX:</b> The x start coordinate + '/// <b>iStartY:</b> The y start coordinate + '/// <b>iEndX:</b> The x end coordinate + '/// <b>iEndY:</b> The x end coordinate + + select case gApplication + + case "CALC" : Kontext "DocumentCalc" + DocumentCalc.MouseDown ( iStartX, iStartY ) + DocumentCalc.MouseMove ( iEndX, iEndY ) + DocumentCalc.MouseUp ( iEndX, iEndY ) + + case "WRITER" : Kontext "DocumentWriter" + DocumentWriter.MouseDown ( iStartX, iStartY ) + DocumentWriter.MouseMove ( iEndX, iEndY ) + DocumentWriter.MouseUp ( iEndX, iEndY ) + + case "HTML": Kontext "DocumentWriterWeb" + DocumentWriterWeb.MouseDown ( iStartX, iStartY ) + DocumentWriterWeb.MouseMove ( iEndX, iEndY ) + DocumentWriterWeb.MouseUp ( iEndX, iEndY ) + + case "MASTERDOCUMENT" : Kontext "DocumentMasterDoc" + DocumentMasterDoc.MouseDown ( iStartX, iStartY ) + DocumentMasterDoc.MouseMove ( iEndX, iEndY ) + DocumentMasterDoc.MouseUp ( iEndX, iEndY ) + + case "IMPRESS" : Kontext "DocumentImpress" + DocumentImpress.MouseDown ( iStartX, iStartY ) + DocumentImpress.MouseMove ( iEndX, iEndY ) + DocumentImpress.MouseUp ( iEndX, iEndY ) + + case "DRAW" : Kontext "DocumentDraw" + DocumentDraw.MouseDown ( iStartX, iStartY ) + DocumentDraw.MouseMove ( iEndX, iEndY ) + DocumentDraw.MouseUp ( iEndX, iEndY ) + + end select +end sub +'-------------------------------------------------------------------------------------- +function fOpenControlPropertyBrowser + '/// open the Control Properties Dialog + '/// <u>parameter:</u> + '/// <u>return:</u> + sleep(2) + + call hToolbarSelect("FormControls",true) + + Kontext "FormControls" + ControlProperties.Click + Kontext "ControlPropertiesDialog" + + if ControlPropertiesDialog.exists(3) then + 'nothing + else + Kontext "FormControls" + ControlProperties.Click + endif + + sleep(2) + fOpenControlPropertyBrowser=true + +end function +'-------------------------------------------------------------------------------------- +function addControl(sControl as String, isx as integer , isy as integer , iex as integer , iey as integer) + '/// add the specified control and the specified position + '/// <u>parameter:</u> + '/// <b>sControl</b> the control name + '/// <b>isx</b> the start x coordinate + '/// <b>isy</b> the start y coordinate + '/// <b>iex</b> the end x coordinate + '/// <b>iey</b> the end y coordinate + '/// <u>return:</u> + + dim oControl as Object + + if sControl = "SpinButton" then + + call hToolbarSelect("MoreControls",true) + Kontext "MoreControls" + SpinButton.Click + + elseif sControl = "ScrollBar" then + + call hToolbarSelect("MoreControls",true) + Kontext "MoreControls" + Scrollbar.Click + + elseif sControl = "ImageButton" then + + call hToolbarSelect("MoreControls",true) + Kontext "MoreControls" + ImageButton.Click + + elseif sControl = "ImageControl" then + + call hToolbarSelect("MoreControls",true) + Kontext "MoreControls" + ImageControl.Click + + elseif sControl = "FileControl" then + + call hToolbarSelect("MoreControls",true) + Kontext "MoreControls" + FileControl.Click + + elseif sControl = "DateField" then + + call hToolbarSelect("MoreControls",true) + Kontext "MoreControls" + DateField.Click + + elseif sControl = "TimeField" then + + call hToolbarSelect("MoreControls",true) + Kontext "MoreControls" + TimeField.Click + + elseif sControl = "NumericField" then + + call hToolbarSelect("MoreControls",true) + Kontext "MoreControls" + Numericfield.Click + + elseif sControl = "CurrencyField" then + + call hToolbarSelect("MoreControls",true) + Kontext "MoreControls" + CurrencyField.Click + + elseif sControl = "PatternField" then + + call hToolbarSelect("MoreControls",true) + Kontext "MoreControls" + PatternField.Click + + elseif sControl = "GroupBox" then + + call hToolbarSelect("MoreControls",true) + Kontext "MoreControls" + GroupBox.Click + + elseif sControl = "Grid" then + + call hToolbarSelect("MoreControls",true) + Kontext "MoreControls" + Grid.Click + + elseif sControl = "NavigationBar" then + + call hToolbarSelect("MoreControls",true) + Kontext "MoreControls" + NavigationBar.Click + + elseif sControl = "Edit" then + + call hToolbarSelect("FormControls",true) + Kontext "FormControls" + Edit.Click + + elseif sControl = "Label" then + + call hToolbarSelect("FormControls",true) + Kontext "FormControls" + Label.Click + + elseif sControl = "CheckBox" then + + call hToolbarSelect("FormControls",true) + Kontext "FormControls" + CheckBox.Click + + elseif sControl = "FormattedField" then + + call hToolbarSelect("FormControls",true) + Kontext "FormControls" + FormattedField.Click + + elseif sControl = "PushButton" then + + call hToolbarSelect("FormControls",true) + Kontext "FormControls" + PushButton.Click + + elseif sControl = "ListBox" then + + call hToolbarSelect("FormControls",true) + Kontext "FormControls" + ListBox.Click + + elseif sControl = "ComboBox" then + + call hToolbarSelect("FormControls",true) + Kontext "FormControls" + ComboBox.Click + + elseif sControl = "RadioButton" then + + call hToolbarSelect("FormControls",true) + Kontext "FormControls" + RadioButton.Click + + else + warnlog "control " + sControl + " not found. add to addControl in control tools." + endif + sleep(1) + + call hDrawingWithSelection ( isx, isy, iex, iey ) + + sleep(2) + + Kontext "FormControls" + +end Function +'-------------------------------------------------------------------------------------- +function fSwitchControlDesignMode() + '/// switch the control design on or off + '/// <u>parameter:</u> + '/// <u>return:</u> + + Kontext "Toolbar" + call hToolbarSelect("FormControls",true) + sleep(1) + Kontext "FormControls" + SwitchControlDesignMode.Click + +end function +'-------------------------------------------------------------------------------------- +function closePropertyBrowserAndDocument + '/// close control property browser and the document + '/// only used in the Control_Serveral tests + '/// <u>parameter:</u> + '/// <u>return:</u> + + printlog "close control property browser" + Kontext "ControlPropertiesDialog" + ControlPropertiesDialog.close + '/// close document + printlog "close document" + hCloseDocument + +end function +'-------------------------------------------------------------------------------------- +function fOpenMoreControlsToolBar + '/// open the More Controls toolbar + '/// <u>parameter:</u> + '/// <u>return:</u> + Kontext "MoreControls" + if not MoreControls.exists(1) then + Kontext "FormControls" + MoreControls.Click + Kontext "MoreControls" + endif +End function diff --git a/testautomation/dbaccess/tools/dbcreatetools.inc b/testautomation/dbaccess/tools/dbcreatetools.inc new file mode 100644 index 000000000000..034b1d18fef1 --- /dev/null +++ b/testautomation/dbaccess/tools/dbcreatetools.inc @@ -0,0 +1,1633 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Library with function for creating all possible databases +'* +'*************************************************************************************** +'* +' #1 fCreateMySQL_ODBC_Datasource +' #1 fCreateMySQL_JDBC_Datasource +' #1 fCreateAdabasDatasource +' #1 fCreateLocalAdabasDatasource +' #1 fCreateJDBCDatasource +' #1 fCreateODBCDatasource +' #1 fCreateDbaseDatasource +' #1 fCreateADODatasource +' #1 fCreateTextDatasource +' #1 fCreateSpreadsheetDatasource +' #1 fCreateLDAPAddressbookDatasource +' #1 fCreateEvolutionAddressbookDatasource +' #1 fCreateWindowsAddressbookDatasource +' #1 fCreateOutlookAddressbookDatasource +' #1 fCreateMozillaAddressbookDatasource +' #1 fRegisterDatabaseFile +' #1 fDeRegisterDatabaseFile +' #1 fSetJDBCDriverFiles +' #1 getIdForDatabaseType +'* +'\*********************************************************************************** + +private const VERBOSE = true + +function fCreateMySQL_ODBC_Datasource(sFileName, sOdbcDSN, sUser,optional sRegister) as boolean + '/// create a new MySQL database via ODBC file with the given filename + '///+ and the given URL + '/// <u>parameter:</u> + '/// <b>sFileName:</b> the file name for the database file + '/// <b>sOdbcDSN:</b> the name of the odbc datasource + '/// <b>sUser:</b> the user for the connection + '/// <b>sPassword:</b> the password for the connection + '/// <b><i>optional</i> sRegister:</b> the name under which the database is be registered + dim bOK as boolean + bOK = FALSE + +' delete the file + if ( app.Dir( ConvertPath(sFileName) ) ) <> "" then + app.kill(ConvertPath(sFileName)) + endif + + Kontext "DocumentWriter" + if (DocumentWriter.exists(1)) then + DocumentWriter.UseMenu + else + Kontext "DocumentBackground" + DocumentBackground.UseMenu + endif + hMenuSelectNr(1) + hMenuSelectNr(1) + hMenuSelectNr(5) + + sleep(4) + + Kontext "DatabaseWizard" + ConnectToDatabase.Check + sleep(1) + DatabaseType.select( hGetDatabaseDisplayName( "sdbc:mysql:odbc:*" ) ) + sleep(1) + NextBtn.Click + sleep(1) + MySQLODBC.Check + NextBtn.Click + + Kontext "DatabaseWizard" + + '/// add the URL + printlog "add the URL" + MySQLODBCDSName.setText "sdbc:mysql:odbc:" + sOdbcDSN + + Kontext "DatabaseWizard" + NextBtn.Click + + Kontext "DatabaseWizard" + '/// add the user name + printlog "add the user name" + UserName.setText sUser + + '/// check the password required checkbox + printlog "check the password required checkbox" + PasswordRequired.Check + + Kontext "DatabaseWizard" + NextBtn.Click + + Kontext "DatabaseWizard" + FinishBtn.Click + + Kontext "SpeichernDlg" + Dateiname.setText ConvertPath(sFileName) + Speichern.click + + sleep(5) + + if ( IsMissing(sRegister) ) then + printlog "don't register datasource" + else + printlog "register datasource with name " + sRegister + call fRegisterDatabaseFile(ConvertPath(sFilename),sRegister) + end if + + bOK = true + if bOK = true then + printlog "--- End of function - *** Succeed ***" + else + warnlog "--- End of function - *** Failed *** Data source was not created" + endif + + call fCloseDatabase(true) + + fCreateMySQL_ODBC_Datasource = bOK + +end function +'------------------------------------------------------------------------- +function fCreateMySQL_JDBC_Datasource(sFileName,sDatabaseName,sHost,sPort,sUser,optional sRegister) as boolean + '/// create a new MySQL database via JDBC file with the given filename + '///+ and the given URL + '/// <u>parameter:</u> + '/// <b>sFielName:</b> the file name for the database file + '/// <b>sDatabaseName:</b> the name of the mysql database + '/// <b>sHost:</b> the host where the mysql database is running + '/// <b>sPort:</b> the port where the mysql database is running + '/// <b>sUser:</b> the user for the connection + '/// <b><i>optional</i> sRegister:</b> the name under which the database is be registered + dim bOK as boolean + bOK = FALSE + + dim sEntry as string + + ' delete the file + if ( app.Dir( ConvertPath(sFileName) ) ) <> "" then + app.kill(ConvertPath(sFileName)) + endif + + Kontext "DocumentWriter" + if (DocumentWriter.exists(1)) then + DocumentWriter.UseMenu + else + Kontext "DocumentBackground" + DocumentBackground.UseMenu + endif + hMenuSelectNr(1) + hMenuSelectNr(1) + hMenuSelectNr(5) + + sleep(4) + + Kontext "DatabaseWizard" + ConnectToDatabase.Check + sleep(1) + sEntry = hGetDatabaseDisplayName( "sdbc:mysql:jdbc:*" ) + 'cut off the (JDBC) string + sEntry = Mid( sEntry , 1, len(sEntry) - Instr(sEntry,"(") ) + printlog "entry = " + sEntry + DatabaseType.select( sEntry ) + sleep(1) + NextBtn.Click + sleep(1) + MySQLJDBC.Check + NextBtn.Click + sleep(1) + MySQLDatabaseName.setText(sDatabaseName) + MySQLHostName.setText(sHost) + MySQLPort.setText(sPort) + + NextBtn.Click + sleep(1) + + '/// add the user name + printlog "add the user name" + UserName.setText sUser + + '/// check the password required checkbox + printlog "check the password required checkbox" + PasswordRequired.Check + + NextBtn.Click + FinishBtn.Click + + Kontext "SpeichernDlg" + Dateiname.setText ConvertPath(sFileName) + Speichern.click + + sleep(5) + + if ( IsMissing(sRegister) ) then + printlog "don't register datasource" + else + printlog "register datasource with name " + sRegister + call fRegisterDatabaseFile(ConvertPath(sFilename),sRegister) + end if + + bOK = true + if bOK = true then + printlog "--- End of function - *** Succeed ***" + else + warnlog "--- End of function - *** Failed *** Data source was not created" + endif + + fCreateMySQL_JDBC_Datasource = bOK + + sleep(1) + + call fCloseDatabase(true) + +end function +'------------------------------------------------------------------------- +function fCreateAdabasDatasource(sFileName,sURL,sUser, optional sRegister) as boolean + '/// create a new adabas database file with the given filename + '///+ and the given URL + '/// <u>parameter:</u> + '/// <b>sFielName:</b> the file name for the database file + '/// <b>sURL:</b> the URL for the adabas database + '/// <b>sUser:</b> the user for connect + '/// <b><i>optional</i> sRegister:</b> the name under which the database is registered + dim bOK as boolean + bOK = FALSE + + try + + ' delete the file + if ( app.Dir( ConvertPath(sFileName) ) ) <> "" then + app.kill(ConvertPath(sFileName)) + endif + + + + Kontext "DocumentWriter" + if (DocumentWriter.exists(1)) then + DocumentWriter.UseMenu + else + Kontext "DocumentBackground" + DocumentBackground.UseMenu + endif + hMenuSelectNr(1) + hMenuSelectNr(1) + hMenuSelectNr(5) + + sleep(4) + + Kontext "DatabaseWizard" + ConnectToDatabase.Check + sleep(1) + DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:adabas:*" ) ) + sleep(1) + NextBtn.Click + sleep(1) + '/// insert the adabas database name + printlog "insert the adabas database name" + AdabasDBName.setText("sdbc:adabas:" + sURL) + sleep(1) + '/// click Next + printlog "click Next" + NextBtn.Click + sleep(1) + '/// insert the user + printlog "insert the user" + UserName.setText sUser + PasswordRequired.Check + sleep(1) + '/// click Next + printlog "click Next" + NextBtn.Click + sleep(1) + '/// click finish + printlog "click finish" + FinishBtn.Click + sleep(1) + Kontext "SpeichernDlg" + Dateiname.setText ConvertPath(sFileName) + Speichern.click + sleep(1) + + Kontext "MessageBox" + if MessageBox.exists then + MessageBox.yes + end if + + sleep(2) + + ' register the database + if ( IsMissing(sRegister) ) then + printlog "don't register datasource" + else + printlog "register datasource with name " + sRegister + call fRegisterDatabaseFile(ConvertPath(sFilename),sRegister) + end if + + bOK = true + printlog "*** Succeed *** Data source was created" + + fCreateAdabasDatasource = bOK + + sleep(1) + call fCloseDatabase(true) + + catch + bOk = false + warnlog "*** Failed *** Data source was not created" + + endcatch + +end function +'------------------------------------------------------------------------- +function fCreateLocalAdabasDatasource(sFileName,sDatabaseName,sSuperUser,sSuperPassword, optional sRegister) as boolean + '/// create a new adabas database file with the given filename + '///+ and the given URL + '/// <u>parameter:</u> + '/// <b>sFielName:</b> the file name for the database file + '/// <b>sURL:</b> the URL for the adabas database + '/// <b>sUser:</b> the user for connect + '/// <b>sPassword:</b> the password for connect + '/// <b><i>optional</i> sRegister:</b> the name under which the database is registered + dim bOK as boolean + bOK = FALSE + + ' delete the file + if ( app.Dir( ConvertPath(sFileName) ) ) <> "" then + app.kill(ConvertPath(sFileName)) + endif + + 'try + + '/// --- Create new Adabas data source --- + printlog "--- Create new adabas data source ---" + Kontext "DocumentWriter" + if (DocumentWriter.exists(1)) then + DocumentWriter.UseMenu + else + Kontext "DocumentBackground" + DocumentBackground.UseMenu + endif + hMenuSelectNr(1) + hMenuSelectNr(1) + hMenuSelectNr(5) + + sleep(4) + + Kontext "DatabaseWizard" + ConnectToDatabase.Check + sleep(1) + DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:adabas:*" ) ) + sleep(1) + NextBtn.Click + sleep(1) + + + Kontext "DatabaseWizard" + AdabasBrowse.Click + sleep(1) + + Kontext "DataSourceSelection" + Create.Click + sleep(1) + + Kontext "CreateNewAdabasDatabase" + DatabaseName.setText sDatabaseName + Administrator.setText sSuperUser + AdminPasswordBtn.Click + sleep(1) + + + Kontext "PasswordDLG" + Password.setText sSuperPassword + PasswordConfirm.setText sSuperPassword + PasswordDLG.OK + + Kontext "CreateNewAdabasDatabase" + CreateNewAdabasDatabase.OK + sleep(10) + + Kontext "DataSourceSelection" + DataSourceSelection.OK + + Kontext "DatabaseWizard" + '/// click Next + printlog "click Next" + NextBtn.Click + sleep(1) + '/// click Next + printlog "click Next" + NextBtn.Click + sleep(1) + '/// click finish + printlog "click finish" + FinishBtn.Click + sleep(1) + Kontext "SpeichernDlg" + Dateiname.setText ConvertPath(sFileName) + Speichern.click + + sleep(2) + + ' register the database + if ( IsMissing(sRegister) ) then + printlog "don't register datasource" + else + printlog "register datasource with name " + sRegister + call fRegisterDatabaseFile(ConvertPath(sFilename),sRegister) + end if + + bOK = true + printlog "*** Succeed *** Data source was created" + + 'catch + bOk = false + warnlog "*** Failed *** Data source was not created" + + 'endcatch + + fCreateLocalAdabasDatasource = bOK + + sleep(1) + call fCloseDatabase(true) + +end function +'------------------------------------------------------------------------- +function fCreateHSQLDatasource(sFileName, optional sRegister) as boolean + '/// create a new hsql database file with the given filename + '/// <u>parameter:</u> + '/// <b>sFielName:</b> the file name for the database file + '/// <b><i>optional</i> sRegister:</b> the name under which the database is registered + dim bOK as boolean + bOK = FALSE + + ' delete the file + if ( app.Dir( ConvertPath(sFileName) ) ) <> "" then + app.kill(ConvertPath(sFileName)) + endif + + + try + Kontext "DocumentWriter" + if (DocumentWriter.exists(1)) then + DocumentWriter.UseMenu + else + Kontext "DocumentBackground" + DocumentBackground.UseMenu + endif + hMenuSelectNr(1) + hMenuSelectNr(1) + hMenuSelectNr(5) + + sleep(10) + + Kontext "DatabaseWizard" + CreateNewDatabase.Check + sleep(1) + NextBtn.Click + sleep(1) + FinishBtn.Click + sleep(1) + + Kontext "SpeichernDlg" + Dateiname.setText ConvertPath(sFileName) + Speichern.click + sleep(10) + + Kontext "MessageBox" + if MessageBox.exists then + MessageBox.yes + end if + + sleep(5) + + + if ( IsMissing(sRegister) ) then + printlog "don't register datasource" + else + printlog "register datasource with name " + sRegister + call fRegisterDatabaseFile(ConvertPath(sFilename),sRegister) + end if + + call fCloseDatabase(true) + + bOK = true + catch + bOK = false + endcatch + + if bOK = true then + printlog "--- End of function - *** Succeed ***" + else + warnlog "--- End of function - *** Failed *** Data source was not created" + endif + + fCreateHSQLDatasource = bOK + + sleep(1) + +end function +'------------------------------------------------------------------------- +function fCreateJDBCDatasource(sFileName,sDriverClass,sURL,sClassPath,sUserName, optional sRegister) as boolean + 'TODO: + + 'ExitRestartTheOffice ' because the change the classpath wich is only used after a restart + 'Printlog "restart the office to make the classpath work" + + '/// create a new JDBC database file with the given filename + '///+ and the given URL + '/// <u>parameter:</u> + '/// <b>sFileName:</b> the file name for the database file + '/// <b>sDatabaseName:</b> the name of the mysql database + '/// <b>sHost:</b> the host where the mysql database is running + '/// <b>sPort:</b> the port where the mysql database is running + '/// <b>sUser:</b> the user for the connection + '/// <b><i>optional</i> sRegister:</b> the name under which the database is be registered + dim bOK as boolean + bOK = FALSE + + call fSetJDBCDriverFiles(sClassPath) + + ' delete the file + if ( app.Dir( ConvertPath(sFileName) ) ) <> "" then + app.kill(ConvertPath(sFileName)) + endif + + FileOpen "FileName", "private:factory/sdatabase?Interactive" , "FrameName", "_blank" , "SynchronMode" ,True + + Kontext "SpeichernDlg" + Dateiname.setText ConvertPath(sFileName) + Speichern.click + sleep(1) + + Kontext "MessageBox" + if MessageBox.exists then + MessageBox.yes + end if + + sleep(5) + + Kontext "TabGeneral" + DatabaseType.Select "JDBC" + sleep(1) + + Kontext "ConnectionType" + NextBtn.Click + + Kontext "TabConnection" + + '/// add the URL + printlog "add the URL" + ConnectURL.setText "jdbc:" + sURL + + '/// add the user name + printlog "add the user name" + UserName.setText sUserName + + '/// check the password required checkbox + printlog "check the password required checkbox" + PasswordRequired.Check + + JDBCDriverClass.setText sDriverClass + + + Kontext "ConnectionType" + CreateBtn.Click + sleep(5) + + if ( IsMissing(sRegister) ) then + printlog "don't register datasource" + else + printlog "register datasource with name " + sRegister + call fRegisterDatabaseFile(ConvertPath(sFilename),sRegister) + end if + + bOK = true + if bOK = true then + printlog "--- End of function - *** Succeed ***" + else + warnlog "--- End of function - *** Failed *** Data source was not created" + endif + + fCreateJDBCDatasource = bOK + + sleep(1) + + call fCloseDatabase(true) + +end function +'------------------------------------------------------------------------- +function fCreateODBCDatasource(sDSName,sUser,sPassword) as boolean + + qaerrorlog "not implemented yet" + fCreateODBCDatasource = false + +end function +'------------------------------------------------------------------------- +function fCreateDbaseDatasource(sFileName,sURL, optional sRegister) as boolean + '/// create a new dbase database file with the given filename + '///+ and the given URL as dbase path + '/// <u>parameter:</u> + '/// <b>sFielName:</b> the file name for the database file + '/// <b>sURL:</b> the dbase path for the database + '/// <b><i>optional</i> bRegister:</b> if true the register the database with the name tt_dBase + dim bOK as boolean + bOK = FALSE + + ' delete the file + if ( app.Dir( ConvertPath(sFileName) ) ) <> "" then + app.kill(ConvertPath(sFileName)) + endif + + Kontext "DocumentWriter" + if (DocumentWriter.exists(1)) then + DocumentWriter.UseMenu + else + Kontext "DocumentBackground" + DocumentBackground.UseMenu + endif + hMenuSelectNr(1) + hMenuSelectNr(1) + hMenuSelectNr(5) + + sleep(4) + + Kontext "DatabaseWizard" + ConnectToDatabase.Check + sleep(1) + DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:dbase:*" ) ) + sleep(1) + NextBtn.Click + sleep(1) + dBasePath.setText "sdbc:dbase:" + ConvertPath(sURL) + sleep(1) + FinishBtn.Click + + sleep(1) + + Kontext "SpeichernDlg" + Dateiname.setText ConvertPath(sFileName) + Speichern.click + + sleep(2) + + if ( IsMissing(sRegister) ) then + printlog "don't register datasource" + else + printlog "register datasource with name " + sRegister + call fRegisterDatabaseFile(sFileName,sRegister) + end if + + bOK = true + 'if bOK = true then + ' printlog "--- End of function - *** Succeed ***"' + 'else + ' warnlog "--- End of function - *** Failed *** Data source was not created" + 'endif + + fCreatedBaseDatasource = bOK + + sleep(1) + + call fClosedatabase(true) + +end function +'------------------------------------------------------------------------- +function fCreateADODatasource(sFileName,sURL,optional sRegister) as boolean + '/// create a new ADO database file with the given filename + '///+ and the given URL as dbase path + '/// <u>parameter:</u> + '/// <b>sFielName:</b> the file name for the database file + '/// <b>sURL:</b> the ADO url + '/// <b><i>optional</i> sRegister:</b> if set, the database is registed under the given name + dim bOK as boolean + bOK = FALSE + + ' delete the file + if ( app.Dir( ConvertPath(sFileName) ) ) <> "" then + app.kill(ConvertPath(sFileName)) + endif + + Kontext "DocumentWriter" + if (DocumentWriter.exists(1)) then + DocumentWriter.UseMenu + else + Kontext "DocumentBackground" + DocumentBackground.UseMenu + endif + hMenuSelectNr(1) + hMenuSelectNr(1) + hMenuSelectNr(5) + + sleep(4) + Kontext "DatabaseWizard" + ConnectToDatabase.Check + sleep(1) + DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:ado:*" ) ) + sleep(1) + NextBtn.Click + sleep(1) + '/// add the URL + printlog "add the URL " + sURL + AdoURL.setText "sdbc:ado:" + sURL + sleep(1) + FinishBtn.Click + sleep(1) + + Kontext "SpeichernDlg" + Dateiname.setText ConvertPath(sFileName) + Speichern.click + + sleep(5) + + if ( IsMissing(sRegister) ) then + printlog "don't register datasource" + else + printlog "register datasource with name " + sRegister + call fRegisterDatabaseFile(sFileName,sRegister) + end if + + bOK = true + if bOK = true then + printlog "--- End of function - *** Succeed ***" + else + warnlog "--- End of function - *** Failed *** Data source was not created" + endif + + fCreateADODatasource = bOK + + sleep(1) + + call fClosedatabase(true) + +end function +'------------------------------------------------------------------------- +function fCreateTextDatasource(sFileName,sURL, optional sRegister) as boolean + '/// create a new text database file with the given filename + '///+ and the given URL as dbase path + '/// <u>parameter:</u> + '/// <b>sFielName:</b> the file name for the database file + '/// <b>sURL:</b> the Text url + '/// <b><i>optional</i> sRegister:</b> if set, the database is registed under the given name + Dim bOK as boolean + bOK = false + + '/// --- Create new Text data source --- + printlog "--- Create new " + sFileName + " data source ---" + printlog "--- with the URL " + sURL + " ---" + + Kontext "DocumentWriter" + if (DocumentWriter.exists(1)) then + DocumentWriter.UseMenu + else + Kontext "DocumentBackground" + DocumentBackground.UseMenu + endif + hMenuSelectNr(1) + hMenuSelectNr(1) + hMenuSelectNr(5) + + sleep(4) + + Kontext "DatabaseWizard" + ConnectToDatabase.Check + sleep(1) + DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:flat:*" ) ) + sleep(1) + NextBtn.Click + sleep(1) + TextPath.setText "sdbc:flat:" + ConvertPath(sURL) + sleep(1) + FinishBtn.Click + sleep(1) + + Kontext "SpeichernDlg" + Dateiname.setText ConvertPath(sFileName) + Speichern.click + sleep(1) + + Kontext "MessageBox" + if MessageBox.exists then + MessageBox.yes + end if + + sleep(5) + + if ( IsMissing(sRegister) ) then + printlog "don't register datasource" + else + printlog "register datasource with name " + sRegister + call fRegisterDatabaseFile(sFileName,sRegister) + end if + + + bOK = true + if bOK = true then + printlog "--- End of function - *** Succeed ***" + else + warnlog "--- End of function - *** Failed *** Data source was not created" + endif + + fCreateTextDatasource = bOK + + sleep(1) + + call fClosedatabase(true) + +end function +'------------------------------------------------------------------------- +function fCreateSpreadsheetDatasource(sFileName,sURL, optional sRegister) as boolean + '/// create a new spreadsheet database file with the given filename + '///+ and the given URL as dbase path + '/// <u>parameter:</u> + '/// <b>sFielName:</b> the file name for the database file + '/// <b>sURL:</b> the spreadsheet file name + '/// <b><i>optional</i> bRegister:</b> if true the register the database with the given name + dim bOK as boolean + bOK = FALSE + + ' delete the file + if ( app.Dir( ConvertPath(sFileName) ) ) <> "" then + app.kill(ConvertPath(sFileName)) + endif + + Kontext "DocumentWriter" + if (DocumentWriter.exists(1)) then + DocumentWriter.UseMenu + else + Kontext "DocumentBackground" + DocumentBackground.UseMenu + endif + hMenuSelectNr(1) + hMenuSelectNr(1) + hMenuSelectNr(5) + + sleep(4) + + Kontext "DatabaseWizard" + ConnectToDatabase.Check + sleep(1) + DatabaseType.Select (hGetDatabaseDisplayName( "sdbc:calc:*" )) + sleep(1) + NextBtn.Click + sleep(1) + '/// add the URL + printlog "add the URL" + SpreadsheetPath.setText "sdbc:calc:" + ConvertPath(sURL) + sleep(1) + '/// click finish + printlog "click finish" + FinishBtn.Click + sleep(1) + Kontext "SpeichernDlg" + Dateiname.setText ConvertPath(sFileName) + Speichern.click + sleep(1) + + Kontext "MessageBox" + if MessageBox.exists then + MessageBox.yes + end if + + sleep(2) + + if ( IsMissing(sRegister) ) then + printlog "don't register datasource" + else + printlog "register datasource with name " + sRegister + call fRegisterDatabaseFile(sFileName,sRegister) + end if + + bOK = true + if bOK = true then + printlog "--- End of function - *** Succeed ***" + else + warnlog "--- End of function - *** Failed *** Data source was not created" + endif + + fCreateSpreadsheetDatasource = bOK + + sleep(1) + + call fClosedatabase(true) + +end function +'------------------------------------------------------------------------- +function fCreateLDAPAddressbookDatasource(sFileName,sHostName,sBaseDN,sPortNr,optional sRegister) as boolean + '/// create a new LDAP Addressbook database with the given filename + '/// <u>parameter:</u> + '/// <b>sFileName:</b> the file name for the database file + '/// <b><i>optional</i> sRegister:</b> if true then register the database + dim bOK as boolean + bOK = FALSE +' try + + ' delete the file + if ( app.Dir( ConvertPath(sFileName) ) ) <> "" then + app.kill(ConvertPath(sFileName)) + endif + + + Kontext "DocumentWriter" + if (DocumentWriter.exists(1)) then + DocumentWriter.UseMenu + else + Kontext "DocumentBackground" + DocumentBackground.UseMenu + endif + hMenuSelectNr(1) + hMenuSelectNr(1) + hMenuSelectNr(5) + + sleep(4) + + Kontext "DatabaseWizard" + ConnectToDatabase.Check + sleep(1) + DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:address:ldap:*" ) ) + sleep(1) + NextBtn.Click + sleep(1) + LDAPHostName.setText sHostName + sleep(1) + BaseDN.setText(sBaseDN) + sleep(1) + FinishBtn.Click + sleep(1) + + Kontext "SpeichernDlg" + Dateiname.setText ConvertPath(sFileName) + Speichern.click + sleep(1) + + Kontext "MessageBox" + if MessageBox.exists then + MessageBox.yes + end if + + + sleep(5) + + if ( IsMissing(sRegister) ) then + printlog "don't register datasource" + else + printlog "register datasource with name " + sRegister + call fRegisterDatabaseFile(sFileName,sRegister) + end if + printlog "*** Succeed *** Data source was created" + bOK = true +' catch +' warnlog "*** Failed *** Data source was not created" +' bOK = false +' endcatch + + fCreateLDAPAddressbookDatasource = bOK + + sleep(1) + + call fClosedatabase(true) + +end function +'------------------------------------------------------------------------- +function fCreateEvolutionAddressbookDatasource(sFileName, optional sRegister) as boolean + '/// create a new Evolution Addressbook database with the given filename + '/// <u>parameter:</u> + '/// <b>sFielName:</b> the file name for the database file + '/// <b><i>optional</i> sRegister:</b> if true then register the database + dim bOK as boolean + bOK = FALSE + try + + ' delete the file + if ( app.Dir( ConvertPath(sFileName) ) ) <> "" then + app.kill(ConvertPath(sFileName)) + endif + + Kontext "DocumentWriter" + if (DocumentWriter.exists(1)) then + DocumentWriter.UseMenu + else + Kontext "DocumentBackground" + DocumentBackground.UseMenu + endif + hMenuSelectNr(1) + hMenuSelectNr(1) + hMenuSelectNr(5) + + sleep(4) + + Kontext "DatabaseWizard" + ConnectToDatabase.Check + sleep(1) + DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:address:evolution:ldap" ) ) + sleep(1) + NextBtn.Click + sleep(1) + '/// click finish + printlog "click finish" + FinishBtn.Click + sleep(1) + Kontext "SpeichernDlg" + Dateiname.setText ConvertPath(sFileName) + Speichern.click + sleep(1) + + Kontext "MessageBox" + if MessageBox.exists then + MessageBox.yes + end if + + sleep(2) + + if ( IsMissing(sRegister) ) then + printlog "don't register datasource" + else + printlog "register datasource with name " + sRegister + call fRegisterDatabaseFile(sFileName,sRegister) + end if + + call fClosedatabase(true) + + printlog "*** Succeed *** Data source was created" + bOK = true + catch + warnlog "*** Failed *** Data source was not created" + bOK = false + endcatch + + fCreateEvolutionAddressbookDatasource = bOK + + sleep(1) + +end function +'------------------------------------------------------------------------- +function fCreateKDEAddressbookDatasource(sFileName , optional sRegister) as boolean + '/// create a new KDE Addressbook database with the given filename + '/// <u>parameter:</u> + '/// <b>sFileName:</b> the file name for the database file + '/// <b><i>optional</i> sRegister:</b> if true then register the database + dim bOK as boolean + bOK = FALSE + try + + ' delete the file + if ( app.Dir( ConvertPath(sFileName) ) ) <> "" then + app.kill(ConvertPath(sFileName)) + endif + + Kontext "DocumentWriter" + if (DocumentWriter.exists(1)) then + DocumentWriter.UseMenu + else + Kontext "DocumentBackground" + DocumentBackground.UseMenu + endif + hMenuSelectNr(1) + hMenuSelectNr(1) + hMenuSelectNr(5) + + sleep(4) + + Kontext "DatabaseWizard" + ConnectToDatabase.Check + sleep(1) + DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:address:kab" ) ) + sleep(1) + NextBtn.Click + sleep(1) + '/// click finish + printlog "click finish" + FinishBtn.Click + sleep(1) + Kontext "SpeichernDlg" + Dateiname.setText ConvertPath(sFileName) + Speichern.click + sleep(1) + + Kontext "MessageBox" + if MessageBox.exists then + MessageBox.yes + end if + + sleep(2) + + if ( IsMissing(sRegister) ) then + printlog "don't register datasource" + else + printlog "register datasource with name " + sRegister + call fRegisterDatabaseFile(sFileName,sRegister) + end if + + call fClosedatabase(true) + + printlog "*** Succeed *** Data source was created" + bOK = true + catch + warnlog "*** Failed *** Data source was not created" + bOK = false + endcatch + + fCreateKDEAddressbookDatasource = bOK + + sleep(1) + +end function +'------------------------------------------------------------------------- +function fCreateWindowsAddressbookDatasource(sFileName , optional sRegister) as boolean + '/// create a new Windows Addressbook database with the given filename + '/// <u>parameter:</u> + '/// <b>sFileName:</b> the file name for the database file + '/// <b><i>optional</i> sRegister:</b> if true then register the database + dim bOK as boolean + bOK = FALSE + try + + ' delete the file + if ( app.Dir( ConvertPath(sFileName) ) ) <> "" then + app.kill(ConvertPath(sFileName)) + endif + + Kontext "DocumentWriter" + if (DocumentWriter.exists(1)) then + DocumentWriter.UseMenu + else + Kontext "DocumentBackground" + DocumentBackground.UseMenu + endif + hMenuSelectNr(1) + hMenuSelectNr(1) + hMenuSelectNr(5) + + sleep(4) + + Kontext "DatabaseWizard" + ConnectToDatabase.Check + sleep(1) + DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:address:outlookexp" ) ) + sleep(1) + NextBtn.Click + sleep(1) + '/// click finish + printlog "click finish" + FinishBtn.Click + sleep(1) + Kontext "SpeichernDlg" + Dateiname.setText ConvertPath(sFileName) + Speichern.click + sleep(1) + + Kontext "MessageBox" + if MessageBox.exists then + MessageBox.yes + end if + + sleep(2) + + if ( IsMissing(sRegister) ) then + printlog "don't register datasource" + else + printlog "register datasource with name " + sRegister + call fRegisterDatabaseFile(sFileName,sRegister) + end if + + call fClosedatabase(true) + + printlog "*** Succeed *** Data source was created" + bOK = true + catch + warnlog "*** Failed *** Data source was not created" + bOK = false + endcatch + + fCreateWindowsAddressbookDatasource = bOK + + sleep(1) + +end function +'------------------------------------------------------------------------- +function fCreateOutlookAddressbookDatasource(sFileName, optional sRegister) as boolean + '/// create a new Outlook Addressbook database with the given filename + '/// <u>parameter:</u> + '/// <b>sFileName:</b> the file name for the database file + '/// <b><i>optional</i> sRegister:</b> if true then register the database + dim bOK as boolean + bOK = FALSE + try + + ' delete the file + if ( app.Dir( ConvertPath(sFileName) ) ) <> "" then + app.kill(ConvertPath(sFileName)) + endif + + Kontext "DocumentWriter" + if (DocumentWriter.exists(1)) then + DocumentWriter.UseMenu + else + Kontext "DocumentBackground" + DocumentBackground.UseMenu + endif + hMenuSelectNr(1) + hMenuSelectNr(1) + hMenuSelectNr(5) + + sleep(4) + + Kontext "DatabaseWizard" + ConnectToDatabase.Check + sleep(1) + DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:address:outlook" ) ) + sleep(1) + NextBtn.Click + sleep(1) + '/// click finish + printlog "click finish" + FinishBtn.Click + sleep(1) + Kontext "SpeichernDlg" + Dateiname.setText ConvertPath(sFileName) + Speichern.click + sleep(1) + + Kontext "MessageBox" + if MessageBox.exists then + MessageBox.yes + end if + + sleep(2) + + if ( IsMissing(sRegister) ) then + printlog "don't register datasource" + else + printlog "register datasource with name " + sRegister + call fRegisterDatabaseFile(sFileName,sRegister) + end if + + call fClosedatabase(true) + + printlog "*** Succeed *** Data source was created" + bOK = true + catch + warnlog "*** Failed *** Data source was not created" + bOK = false + endcatch + + fCreateOutlookAddressbookDatasource = bOK + + sleep(1) + +end function +'------------------------------------------------------------------------- +function fCreateMozillaAddressbookDatasource(sFileName, optional sRegister) as boolean + '/// create a new mozilla addressbook database file with the given filename + '/// <u>parameter:</u> + '/// <b>sFielName:</b> the file name for the database file + '/// <b><i>optional</i> sRegister:</b> the name under which the database is registered + + dim bOK as boolean + bOK = FALSE + try + ' delete the file + if ( app.Dir( ConvertPath(sFileName) ) ) <> "" then + app.kill(ConvertPath(sFileName)) + endif + + Kontext "DocumentWriter" + if (DocumentWriter.exists(1)) then + DocumentWriter.UseMenu + else + Kontext "DocumentBackground" + DocumentBackground.UseMenu + endif + hMenuSelectNr(1) + hMenuSelectNr(1) + hMenuSelectNr(5) + + sleep(4) + + Kontext "DatabaseWizard" + ConnectToDatabase.Check + sleep(1) + DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:address:mozilla:" ) ) + sleep(1) + NextBtn.Click + sleep(1) + '/// click finish + printlog "click finish" + FinishBtn.Click + sleep(1) + Kontext "SpeichernDlg" + Dateiname.setText ConvertPath(sFileName) + Speichern.click + sleep(1) + + Kontext "MessageBox" + if MessageBox.exists then + MessageBox.yes + end if + + sleep(2) + + if ( IsMissing(sRegister) ) then + printlog "don't register datasource" + else + printlog "register datasource with name " + sRegister + call fRegisterDatabaseFile(sFileName,sRegister) + end if + printlog "*** Succeed *** Data source was created" + bOK = true + + call fClosedatabase(true) + + catch + qaerrorlog "*** Failed *** Data source was not created" + bOK = false + endcatch + + fCreateMozillaAddressbookDatasource = bOK + + sleep(1) + +end function +'-------------------------------------------------------------------- +function fRegisterDatabaseFile( sFileName, sName) + '/// register a database + '/// <u>parameter:</u> + '/// <b>sFielName:</b> the file name for the database file + '/// <b>sName:</b> The name under which the database is registered + + dim i as integer + + ToolsOptions + + call hToolsOptions ( "Datasources", "Databases" ) + + '/// remove registration if exists + + Kontext "TabRegisteredDatabase" + for i = 1 to RegisteredDatabases.GetItemCount + RegisteredDatabases.select i + if RegisteredDatabases.getSeltext() = sName then + DeleteBtn.Click + Kontext "Active" + Active.yes + exit for + endif + next + + + + Kontext "TabRegisteredDatabase" + NewBtn.Click + sleep(1) + Kontext "CreateDatabaseLink" + + RegisteredName.setText(sName) + DatabaseFile.setText(sFileName) + + CreateDatabaseLink.OK + + sleep(1) + Kontext "OptionenDlg" + OptionenDlg.OK + +end function +'-------------------------------------------------------------------- +function fDeRegisterDatabaseFile( sName) + '/// deregister a database + '/// <u>parameter:</u> + '/// <b>sName:</b> The registered name which should be deregistered + dim i as integer + + ToolsOptions + + call hToolsOptions ( "Datasources", "Databases" ) + + '/// remove registration for the database + printlog "remove registration for the database " + sName + + Kontext "TabRegisteredDatabase" + for i = 1 to RegisteredDatabases.GetItemCount + RegisteredDatabases.select i + if RegisteredDatabases.getSeltext() = sName then + DeleteBtn.Click + exit for + endif + next + + try + Kontext "Active" + Active.yes + catch + + endcatch + sleep(1) + Kontext "OptionenDlg" + OptionenDlg.OK + +end function +'------------------------------------------------------------------------- +function fSetJDBCDriverFiles(sClassPath) as boolean + '/// set the java classpath + '/// <u>parameter:</u> + '/// <b>sClassPath:</b> The Classpath + + Dim x_DriverInstall as boolean + x_DriverInstall = FALSE + + call hNewDocument + printlog "insert classpath: " + sClassPath + ToolsOptions + call hToolsOptions ( "StarOffice", "JAVA" ) + + Kontext "TabJava" + ClassPath.Click + sleep(1) + Kontext "JavaClassPath" + AddArchive.Click + sleep(1) + Kontext "GeneralFileDialog" + Dateiname.setText ConvertPath(sClassPath) + Auswaehlen.Click + sleep(1) + '/// if the class file allready exists a messages box pops up + Kontext "MessageBox" + if ( MessageBox.exists(3) ) then + MessageBox.OK + end if + + Kontext "JavaClassPath" + JavaClassPath.OK + + Kontext "MessageBox" + if ( MessageBox.exists(3) ) then + MessageBox.OK + end if + + Kontext "OptionenDlg" + OptionenDlg.OK + + call hCloseDocument + +end function + +'------------------------------------------------------------------------- + +function hGetInstalledDatabaseDrivers( dbDriverList() as string ) as integer + + ' This function returns the number of currently installed database drivers. + ' Additionally it fills a given list (which should be large enough to hold + ' the names of all installed drivers) with the url and makes the list + ' compatible to the listfunctions (which places the list size in element 0) + ' The list is platform dependent and might be locale dependent + ' Note that some drivers (like e.g. HSQL Database Engine) do *not* show up + ' in the Database Wizards listbox! + + dim oUnoOfficeConnection as object + dim oUnoConfigurationAccess as object + dim aPropertyValue(1) as new com.sun.star.beans.PropertyValue + dim xViewRoot as object + dim aElements() as string + dim iCurrentDriver as integer + dim iDriverCount as integer + + const CFN = "dbaccess::tools::dbcreatetools.inc::hGetInstalledDatabaseDrivers(): " + + ' Path to the node, searches all files below "Drivers" for "Installed" + aPropertyValue( 0 ).Name = "nodepath" + aPropertyValue( 0 ).Value = "org.openoffice.Office.DataAccess.Drivers/Installed" + + ' Connect to remote UNO + oUnoOfficeConnection = hGetUnoService( TRUE ) + + if ( isNull( oUnoOfficeConnection )) then + warnlog( CFN & "Failed to establish UNO connection, hGetUnoService failed" ) + hGetInstalledDatabaseDrivers() = 0 + else + ' Get a configuration provider + oUnoConfigurationAccess = oUnoOfficeConnection.createInstance( "com.sun.star.configuration.ConfigurationProvider" ) + + ' Get access + xViewRoot = oUnoConfigurationAccess.createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", aPropertyValue() ) + aElements() = xViewRoot.getElementNames() + + iDriverCount = ubound( aElements() ) + dbDriverList( 0 ) = iDriverCount + for iCurrentDriver = 1 to iDriverCount + dbDriverList( iCurrentDriver ) = aElements( iCurrentDriver ) + next iCurrentDriver + + endif + + if ( GVERBOSE ) then + printlog( CFN & "Returning " & iDriverCount & " drivers" ) + endif + + hGetInstalledDatabaseDrivers() = iDriverCount + +end function + +'------------------------------------------------------------------------- + +function hGetDatabaseDisplayName( dbDriverURL as string ) as string + + ' The xcu files (based on dev300m47) hold following driver definitions + ' which are used as parameter to this function. You get a plain text + ' localized driver name as returnvalue which can be used directly to select + ' a driver in the Database Wizard. + + ' adabas.xcu: "sdbc:adabas:*" + ' calc.xcu: "sdbc:calc:*" + ' dbase.xcu: "sdbc:dbase:*" + ' evoab.xcu: "sdbc:address:evolution:ldap" + ' evoab.xcu: "sdbc:address:evolution:groupwise" + ' flat.xcu: "sdbc:flat:*" + ' ado.xcu: "sdbc:ado:*" + ' hsqldb.xcu: "sdbc:embedded:hsqldb" + ' kab.xcu: "sdbc:address:kab" + ' mozab.xcu: "sdbc:address:outlook" + ' mozab.xcu: "sdbc:address:outlookexp" + ' mozab.xcu: "sdbc:address:mozilla:" + ' mozab.xcu: "sdbc:address:thunderbird:" + ' mozab.xcu: "sdbc:address:ldap:*" + ' mysql.xcu: "sdbc:mysql:jdbc:*" + ' mysql.xcu: "sdbc:mysql:odbc:*" + ' odbc.xcu: "sdbc:odbc:*" + ' jdbc.xcu: "jdbc:*" + ' jdbc.xcu: "jdbc:oracle:thin:*" + ' mysql.xcu: "sdbc:mysql:jdbc:*" + + + ' Note that some drivers (like e.g. HSQL Database Engine) do *not* show up + ' in the Database Wizards listbox! + + + dim oUnoOfficeConnection as object + dim oUnoConfigurationAccess as object + dim aPropertyValue(1) as new com.sun.star.beans.PropertyValue + dim oConfig as object + dim oDriver as object + dim sDatabaseName as string + + const CFN = "dbaccess::tools::dbcreatetools.inc::hGetDatabaseDisplayName(): " + + ' Path to the node, searches all files below "Drivers" for "Installed" + aPropertyValue( 0 ).Name = "nodepath" + aPropertyValue( 0 ).Value = "org.openoffice.Office.DataAccess.Drivers/Installed/" + + ' Connect to remote UNO + oUnoOfficeConnection = hGetUnoService( TRUE ) + + if ( isNull( oUnoOfficeConnection )) then + warnlog( CFN & "Failed to establish UNO connection, hGetUnoService failed" ) + sDatabaseName = "" + else + ' Get a configuration provider + oUnoConfigurationAccess = oUnoOfficeConnection.createInstance( "com.sun.star.configuration.ConfigurationProvider" ) + + ' Get access + oConfig = oUnoConfigurationAccess.createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", aPropertyValue() ) + try + oDriver = oConfig.getByName( dbDriverURL ) + sDatabaseName = oDriver.getByName( "DriverTypeDisplayName" ) + catch + warnlog( CFN & "Invalid driver or driver unsupported on this platform" ) + sDatabaseName "" + endcatch + + endif + + if ( GVERBOSE ) then + printlog( CFN & "Database display string: " & sDatabaseName ) + endif + hGetDataBaseDisplayName() = sDatabaseName + +end function +'------------------------------------------------------------------------- +function isDriverInstalled( dbDriverURL as string ) as string + + ' This function return true or false if a driver for a given URL is installed + + Dim myDriverList(20) as string + Dim i as integer + Dim sDriver as string + Dim breturn as boolean + breturn = false + + const CFN = "dbaccess::tools::dbcreatetools.inc::isDriverInstalled(): " + + if VERBOSE then + printlog CFN + printlog "url to search for : " + dbDriverURL + endif + + hGetInstalledDatabaseDrivers( myDriverList() ) + + for i = 1 to ubound(myDriverList) + sDriver = myDriverList(i) + if VERBOSE then + printlog "found url : " + sDriver + endif + if sDriver = dbDriverURL then + breturn = true + endif + next + + isDriverInstalled = breturn + +end function + diff --git a/testautomation/dbaccess/tools/dbinit.inc b/testautomation/dbaccess/tools/dbinit.inc new file mode 100644 index 000000000000..53f192747926 --- /dev/null +++ b/testautomation/dbaccess/tools/dbinit.inc @@ -0,0 +1,56 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Helper Routines for Base tests. +'* +'*************************************************************************************** +'* +' #1 null +'* +'\*********************************************************************************** + +Global gDatasourceName as String +Global gTableName as String +'-------------------------------------------------------------------- +sub sDBInit + + 'global + use "global\system\includes\master.inc" + use "global\system\includes\gvariabl.inc" + + 'base + use "dbaccess\tools\formtools.inc" + use "dbaccess\tools\reporttools.inc" + use "dbaccess\tools\tabletools.inc" + use "dbaccess\tools\dbcreatetools.inc" + use "dbaccess\tools\querytools.inc" + use "dbaccess\tools\dbtools.inc" + use "dbaccess\tools\controltools.inc" + +end sub diff --git a/testautomation/dbaccess/tools/dbtools.inc b/testautomation/dbaccess/tools/dbtools.inc new file mode 100644 index 000000000000..2e40a3f25726 --- /dev/null +++ b/testautomation/dbaccess/tools/dbtools.inc @@ -0,0 +1,373 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Helper Routines for Base tests. +'* +'*************************************************************************************** +'* +' #1 fSelectDatasourceInBeamer +' #1 fConnectToDatasourceInBeamer +' #1 fSelectSchemaInTableFilter +' #1 fOpenNewDataBase +' #1 fOpenDataBase +' #1 fCloseDatabase +' #1 tools_dbtools_fgetMySQLDatabaseProperties +'* +'\*********************************************************************************** + +private const VERBOSE = true + +'-------------------------------------------------------------------- +function fSelectDatasourceInBeamer(sDSName1) + '/// select a datasource in the beamer with the given name + '/// <u>parameter:</u> + '/// <b>sDSName1:</b> the name of the datasource which shall be seleced + + dim i as integer + dim bfindDS as boolean + dim iNoDS as integer + + bfindDS = false + Kontext "DatabaseBeamer" + Kontext "DatabaseSelection" + + iNoDS = DatabaseSelection.getItemCount + for i = 1 to iNoDS + DatabaseSelection.Select i + if DatabaseSelection.getText = sDSName1 then + i = iNoDS + bfindDS = TRUE + endif + next i + + fSelectDatasourceInBeamer = bfindDS + + sleep(1) + +end function +'-------------------------------------------------------------------- +function fConnectToDatasourceInBeamer(sDSName , sPWD, optional bNewDoc) + + if ( isMissing (bNewDoc) )then + bNewDoc = false + endif + + if (bNewDoc) then + call hNewDocument() + ViewCurrentDatabase + endif + + sleep(1) + dim bConnect as boolean + bConnect = false + if fFindDatasource(sDSName) = true then + DatabaseSelection.TypeKeys "<ADD>" + DatabaseSelection.TypeKeys "<DOWN>" + DatabaseSelection.TypeKeys "<DOWN>" + DatabaseSelection.TypeKeys "<DOWN>" + DatabaseSelection.TypeKeys "<ADD>" + Kontext "LoginDialog" + if LoginDialog.Exists(3) then + LoginPassword.SetText sPWD + LoginDialog.OK + end if + bConnect = true + else + warnlog "Could not found the datasource " + sDSName + endif + + if (bNewDoc) then + call hCloseDocument + endif + + fConnectToDatasource = bConnect + +end function +'-------------------------------------------------------------------- +function fSelectSchemaInTableFilter(sSchema as String) + '/// select the given schema in the table filter dialog in an open database + '/// <u>parameter:</u> + '/// <b>sSchema:</b> the name of the schema + dim bOK as boolean + bOK = false + + dim iRem as integer + iRem = 0 + Kontext "DATABASE" + Database.useMenu + hMenuSelectNr 5 + hMenuSelectNr 3 + + + Kontext "TablesFilter" + printlog Tables.getItemCount + TablesFilter.OK + + fSelectSchemaInTableFilter = true + +end function +'------------------------------------------------------------------------- +function fOpenNewDataBase ( sSaveFileName ) + '/// open a database window and sabe it to the given name + '/// <u>parameter:</u> + '/// <b>sSaveFileName:</b> the file name for the database file + FileOpen "FileName", "private:factory/sdatabase" , "FrameName", "_blank" , "SynchronMode" ,True + + sleep(2) + + Kontext "SpeichernDlg" + Dateiname.setText Convertpath(gOfficePath + "/user/work/" + sSaveFileName) + Speichern.click + sleep(1) + + Kontext "MessageBox" + if MessageBox.exists then + MessageBox.yes + end if + + sleep(5) + +end function +'------------------------------------------------------------------------- +function fOpenDataBase ( sFileName , optional sPassword) + '/// open a database file with the given name and try to connect + '/// <u>parameter:</u> + '/// <b>sFileName:</b> the file name which shall be open + '/// <b><i>optional</i>sFileName:</b> the password for connecting + + Dim bOK as boolean + bOK = true + + Dim DieDatei as String + DieDatei = ConvertPath ( sFileName ) + + if(VERBOSE) then + printlog "Filename : " + sFileName + if(NOT isMissing(sPassword)) then + printlog "Password : " + sPassword + endif + endif + + '/// open the File Open dialog + printlog "open the File Open dialog" + FileOpen + sleep (1) + Kontext "OeffnenDlg" + '/// open the given file + Dateiname.SetText DieDatei + sleep (3) + Oeffnen.Click + sleep (3) + + 'click on the main window to get the focus + Kontext "DATABASE" + Database.MouseDown(50,50) + Database.MouseUp(50,50) + + ViewTables + sleep(1) + + Kontext "DATABASE" + '/// if the password is given add the password + if ( Not IsMissing(sPassword) ) then + printlog "set password : " + sPassword + Kontext "LoginDialog" + if LoginDialog.Exists then + LoginPassword.setText sPassword + LoginDialog.OK + sleep(1) + endif + endif + Kontext "MessageBox" + if (MessageBox.exists(2)) then + 'an error occurr + bOK = false + dim iNrTexts as integer + Dim i as integer + iNrtexts = MessageBox.getFixedtextCount + for i = 1 to iNrtexts + qaerrorlog MessageBox.getFixedtext(i) + next + MessageBox.OK + ' try again to close the dialog if exists + if (MessageBox.exists(2)) then + MessageBox.OK + endif + call fCloseDatabase + endif + + fOpenDataBase = bOK + +end function +'------------------------------------------------------------------------- +function fCloseDatabase(optional bSave) + '/// close the database + '/// <u>parameter:</u> + '/// <b><i>optional</i>bSave:</b> if true the the database is saved if false then the changes are lost + sleep(1) + Kontext "DATABASE" + Database.MouseDown(50,50) + Database.MouseUp(50,50) + Database.useMenu + hMenuSelectNr 1 + hMenuSelectNr 5 + + Kontext "Messagebox" + if Messagebox.Exists(3) then + if ( IsMissing( bSave ) ) then + Messagebox.No + else + if bSave then + Messagebox.Yes + else + Messagebox.No + endif + endif + end if + + sleep(1) + +end function +'------------------------------------------------------------------------- +sub sCloseAllToolbars + + Kontext "FormControls" + if FormControls.exists(1) then + FormControls.close() + endif + + Kontext "MoreControls" + if MoreControls.exists(1) then + MoreControls.close() + endif + + Kontext "FormDesignTools" + if FormDesignTools.exists(1) then + FormDesignTools.close() + endif + +end sub +'------------------------------------------------------------------------- +function tools_dbtools_fgetMySQLJDBCDatabaseProperties(sDBConfigFileName as string) + '/// return the databaseserver properties from the environment directory + '/// <u>parameter:</u> + '/// <br> + '/// <u>return:</u> + '/// the properties as an array + '/// entry 1 defined (yes or no) + '/// entry 2 server name + '/// entry 3 database name + '/// entry 4 database port + '/// entry 5 database user name + '/// entry 6 database user password + '/// entry 7 jdbc driver file path + + tools_dbtools_fgetMySQLJDBCDatabaseProperties = fgetGenericDatabaseProperties( sDBConfigFileName, "mysql_jdbc" ) + +end function +'------------------------------------------------------------------------- +function tools_dbtools_fgetMySQLODBCDatabaseProperties() + '/// return the databaseserver properties from the environment directory + '/// <u>parameter:</u> + '/// <br> + '/// <u>return:</u> + '/// the properties as an array + '/// entry 1 defined (yes or no) + '/// entry 2 odbc dsn name + '/// entry 3 database user name + '/// entry 4 database user password + + dim i as integer + dim b(10000) as String + dim c + c = hGetDataFileSection( gTesttoolPath + gPrivateEnvironmentLocation + "input/base.txt", b(), "mysql_odbc" , "" , "" ) + + ' split the string at = and return the right part + for i = 1 to 4 + 'printlog b(i) + b(i) = Right(b(i),len(b(i))-Instr(b(i),"=")) + 'printlog b(i) + next + + tools_dbtools_fgetMySQLODBCDatabaseProperties = b() + +end function +'------------------------------------------------------------------------- +function tools_dbtools_fgetAdabasDatabaseProperties() + '/// return the databaseserver properties from the environment directory + '/// <u>parameter:</u> + '/// <br> + '/// <u>return:</u> + '/// the properties as an array + '/// entry 1 defined (yes or no) + '/// entry 2 server name + '/// entry 3 database name + '/// entry 4 database user name + '/// entry 5 database user password + + dim i as integer + dim b(10000) as String + dim c + c = hGetDataFileSection( gTesttoolPath + gPrivateEnvironmentLocation + "input/base.txt", b(), "adabas" , "" , "" ) + + ' split the string at = and return the right part + for i = 1 to 5 + 'printlog b(i) + b(i) = Right(b(i),len(b(i))-Instr(b(i),"=")) + 'printlog b(i) + next + + tools_dbtools_fgetAdabasDatabaseProperties = b() + +end function +'------------------------------------------------------------------------------- +function fgetGenericDatabaseProperties(sDBConfigFileName as string, sType as String) + + dim i as integer + dim b(10000) as String + dim c + c = hGetDataFileSection( sDBConfigFileName, b(), sType , "" , "" ) + + ' split the string at = and return the right part + for i = 1 to 7 + if(VERBOSE) then + printlog "orig. string : " + b(i) + endif + b(i) = Right(b(i),len(b(i))-Instr(b(i),"=")) + if(VERBOSE) then + printlog "string after the '=' : " + b(i) + endif + next + + + + + fgetGenericDatabaseProperties = b() + +end function diff --git a/testautomation/dbaccess/tools/formtools.inc b/testautomation/dbaccess/tools/formtools.inc new file mode 100644 index 000000000000..ef7105ccef22 --- /dev/null +++ b/testautomation/dbaccess/tools/formtools.inc @@ -0,0 +1,193 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Helper Routines for Base tests. +'* +'*************************************************************************************** +'* +'* #1 fOpenNewFormDesign +'* #1 fCloseForm +'* #1 fSaveForm +'* #1 fOpenForm +'* #1 fFindForm +'* +'\*********************************************************************************** +'------------------------------------------------------------------------- +function fOpenNewFormDesign() + '/// open a a new form design from an open database + '/// <u>parameter:</u> + + Kontext "DATABASE" + if ( Database.NotExists(3) ) then + fOpenNewFormDesign = false + exit function + end if + + Database.MouseDown(50,50) + Database.MouseUp(50,50) + + sleep(1) + + ViewForms + NewFormDesign + + sleep(2) + + fOpenNewFormDesign = true + +end function +'-------------------------------------------------------------------- +function fCloseForm( optional bSave ) + '/// close an open form + '/// <u>parameter:</u> + '/// <b><i>optional</i> bSave:</b> if true the form shall be saved, if false the changes are lost + + sleep(1) + + Kontext "DocumentWriter" + DocumentWriter.UseMenu + hMenuSelectNr(1) ' the file menu + hMenuSelectNr(5) ' the Close Window + + 'when issue 30401 is fixed this has to be changed + Kontext "Messagebox" + if Messagebox.Exists(3) then + if ( IsMissing( bSave ) ) then + Messagebox.No + else + if bSave then + Messagebox.Yes + else + Messagebox.No + endif + endif + end if + + sleep(1) + + fCloseForm = true + +end function +'-------------------------------------------------------------------- +function fSaveForm( sFormName as string, optional bCloseForm as boolean ) + '/// save an open form with the given name + '/// <u>parameter:</u> + '/// <b>sFormName:</b> the name under which the form shall be saved. If the file allready exists, then the file will be overwritten + '/// <b><i>optional</i> bCloseForm:</b> if true the form shall be closed after saving, if false form stay open + sleep(1) + + Kontext "DocumentWriter" + DocumentWriter.UseMenu + hMenuSelectNr(1) ' the file menu + hMenuSelectNr(6) ' the Save + + Kontext "FormSaveDialog" + if FormSaveDialog.exists(3) then + FormName.setText(sFormName) + SaveBtn.Click + 'click yes in the overwrite messages box + Kontext "MessageBox" + if MessageBox.exists(1) then + MessageBox.Yes + endif + fSaveForm = true + else + fSaveForm = false + end if + + if ( IsMissing( bCloseForm ) ) then + ' nothing + else + call fCloseForm() + end if + +end function +'-------------------------------------------------------------------- +function fOpenForm(sFormName as string) + '/// open a form with the given name + '/// <u>parameter:</u> + '/// <b>sFormName:</b> the name of the form which shall be open + + if ( fFindForm(sFormName) = true ) then + printlog "Form found -> open" + Kontext "ContainerView" + OpenForm ' uno-Slot .uno:DB/Open + sleep(1) + fOpenForm = true + else + printlog "Form not found." + fOpenForm = false + end if + +end function +'-------------------------------------------------------------------- +function fFindForm(sFormName as string) + '/// select a form with the given name + '/// <u>parameter:</u> + '/// <b>sFormName:</b> the name of the form which shall be selected + + Dim iNumbersOfForms as integer + Dim i as integer + + Kontext "ContainerView" + + ViewForms + + fFindForm = false + + if ( Not FormTree.exists(1) ) then + warnlog "The form tree doesn't exists" + exit function + end if + + iNumbersOfForms = FormTree.getItemCount() + + ' this select the first entry + FormTree.TypeKeys "<HOME>" + FormTree.TypeKeys "<UP>" + + + for i = 1 to iNumbersOfForms + + FormTree.TypeKeys "<ADD>" + 'printlog "i = " + i + 'printlog "FormName.getItemCount = " + FormTree.getItemCount + if FormTree.getItemCount > iNumbersOfForms then + iNumbersOfForms = FormTree.getItemCount() + endif + 'printlog "FormName.getSeltext = " + FormTree.getSeltext + if FormTree.getSeltext = sFormName then + fFindForm = true + exit for + endif + FormTree.TypeKeys "<DOWN>" + next + sleep(1) + +end function diff --git a/testautomation/dbaccess/tools/querytools.inc b/testautomation/dbaccess/tools/querytools.inc new file mode 100644 index 000000000000..29416dac7bf3 --- /dev/null +++ b/testautomation/dbaccess/tools/querytools.inc @@ -0,0 +1,439 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Helper Routines for Base tests. +'* +'*************************************************************************************** +'* +' #1 fFindQuery +' #1 fOpenNewQueryDesign +' #1 fStartQueryWizard +' #1 fCloseQueryDesign +'* +'\*********************************************************************************** +'------------------------------------------------------------------------- +function fFindQueryInBeamer(sDSName1,sQueryName1) + '/// select a query with the given name in the beamer + '/// <u>parameter:</u> + '/// <b>sDSName1:</b> the name of the datasource + '/// <b>sQueryName1:</b> the name of the query + + dim i as integer + dim bfindQuery as boolean + dim iNoDS as integer + dim iNoQuery as integer + + bfindQuery = false + Kontext "DatabaseBeamer" + Kontext "DatabaseSelection" + + iNoDS = DatabaseSelection.getItemCount + for i = 1 to iNoDS + DatabaseSelection.Select i + if DatabaseSelection.getText = sDSName1 then + i = iNoDS + endif + next i + + wait 500 + DatabaseSelection.TypeKeys "<ADD>" , true + wait 500 + DatabaseSelection.TypeKeys "<DOWN>" , true + wait 500 + DatabaseSelection.TypeKeys "<DOWN>" , true + wait 500 + DatabaseSelection.TypeKeys "<ADD>" , true + wait 500 + DatabaseSelection.TypeKeys "<DOWN>" , true + wait 500 + + + iNoQuery = DatabaseSelection.getItemCount + dim ii as integer + ii = DatabaseSelection.GetSelIndex + for i = ii to iNoQuery + DatabaseSelection.Select i + if DatabaseSelection.getText = sQueryName1 then + i = iNoQuery + sleep 1 + bfindQuery = true + endif + next i + + fFindQuery = bfindQuery + +end function +'-------------------------------------------------------------------- +function fOpenNewQueryDesign() as boolean + '/// open a new query design + '/// <u>parameter:</u> + + Kontext "DATABASE" + Database.MouseDown(50,50) + Database.MouseUp(50,50) + + if ( Database.NotExists(3) ) then + fOpenNewQueryDesign = false + warnlog "The database windows doesn't exists" + exit function + end if + + sleep(1) + + printlog "open new query design" + + NewQueryDesign + + fOpenNewQueryDesign = true + +end function +'-------------------------------------------------------------------- +function fOpenNewSQLQueryDesign() as boolean + '/// open a new query design in SQL mode + '/// <u>parameter:</u> + + Kontext "DATABASE" + Database.MouseDown(50,50) + Database.MouseUp(50,50) + + if ( Database.NotExists(3) ) then + fOpenNewSQLQueryDesign = false + warnlog "The database windows doesn't exists" + exit function + end if + + sleep(1) + + printlog "open new sql query design" + + NewSQLQueryDesign + + fOpenNewSQLQueryDesign = true + +end function +'------------------------------------------------------------------------- +function fStartQueryWizard() + '/// start the query wizard + '/// <u>parameter:</u> + + Kontext "DATABASE" + if ( Database.NotExists(3) ) then + fStartQueryWizard = false + exit function + end if + + Database.MouseDown(50,50) + Database.MouseUp(50,50) + + sleep(1) + + ViewQueries + StartQueryWizard + + sleep(2) + + fStartQueryWizard = true + +end function +'------------------------------------------------------------------------- +function fCloseQueryDesign(optional bSave) + '/// close the query design + '/// <u>parameter:</u> + '/// <b><i>optional</i>bSave:</b> if true the query is saved if false then the changes are lost + + sleep(1) + + Kontext "QueryDesignTable" + QueryDesignTable.UseMenu + ' bug file / close close the whole database + 'hMenuSelectNr(1) ' the file menu + 'hMenuSelectNr(4) ' the Close Window + + hMenuSelectNr(6) ' the window menu + hMenuSelectNr(1) ' the Close Window + + Kontext "Messagebox" + if Messagebox.Exists(3) then + if ( IsMissing( bSave ) ) then + Messagebox.No + else + if bSave then + Messagebox.Yes + else + Messagebox.No + endif + endif + end if + + sleep(1) + +end function +'------------------------------------------------------------------------- +function fOpenQueryInSQLDesign(sQueryName as String) + '/// open a query in sql design + '/// <u>parameter:</u> + '/// <b>bQueryName:</b> the name of the query which should be open + + if ( fFindQuery(sQueryName) = true ) then + printlog "Query " + sQueryName + " found -> open in sql design" + + Kontext "DATABASE" + Database.UseMenu + + hMenuSelectNr(2) + hMenuSelectNr(9) + + sleep(1) + fOpenQueryInSQLDesign= true + else + fOpenQueryInSQLDesign = false + end if + + sleep(1) + +end function +'------------------------------------------------------------------------- +function fCloseSQLQueryDesign(optional bSave) + '/// close the query design + '/// <u>parameter:</u> + '/// <b><i>optional</i>bSave:</b> if true the query is saved if false then the changes are lost + + sleep(1) + + Kontext "QueryEditWindow" + QueryEditWindow.UseMenu + ' bug file / close close the whole database + 'hMenuSelectNr(1) ' the file menu + 'hMenuSelectNr(4) ' the Close Window + + hMenuSelectNr(6) ' the window menu + hMenuSelectNr(1) ' the Close Window + + Kontext "Messagebox" + if Messagebox.Exists(3) then + if ( IsMissing( bSave ) ) then + Messagebox.No + else + if bSave then + Messagebox.Yes + else + Messagebox.No + endif + endif + end if + + sleep(1) + +end function +'------------------------------------------------------------------------- +function fSaveQueryDesign(sName as String) + '/// save an open Query Design + '/// <u>parameter:</u> the name of query + + sleep(1) + Kontext "QueryDesignTable" + QueryDesignTable.UseMenu + + hMenuSelectNr(1) ' the file menu + hMenuSelectNr(6) ' the save + + Kontext "DatabaseTableSaveAs" + TableName.setText(sName) + DatabaseTableSaveAs.OK + + sleep(1) + + fSaveQueryDesign = true + +end function +'------------------------------------------------------------------------- +function fSaveSQLQueryDesign(sName as String) + '/// save an open SQL Query Design + '/// <u>parameter:</u> the name of query + + sleep(1) + Kontext "QueryEditWindow" + QueryEditWindow.UseMenu + + hMenuSelectNr(1) ' the file menu + hMenuSelectNr(6) ' the save + + Kontext "DatabaseTableSaveAs" + TableName.setText(sName) + DatabaseTableSaveAs.OK + + sleep(1) + + fSaveSQLQueryDesign = true + +end function + +'------------------------------------------------------------------------- +function fChooseTableInAddTableDialog(sTableName as string) as boolean + Kontext "AddTables" + if ( not AddTables.exists(1) ) then + fChooseTableInQueryAddTableDialog = false + exit function + endif + + 'TODO: add a test to click on the execute button, before the add table dialog is closed. + dim ix as integer + dim i as integer + ix = TableName.getItemCount + for i = 1 to ix + TableName.Select i + TableName.TypeKeys "<ADD>" + 'printlog "ix = " + ix + 'printlog "TableName.getItemCount = " + TableName.getItemCount + if TableName.getItemCount > ix then + ix = TableName.getItemCount + 'printlog "TableName.getItemCount > ix" + endif + 'printlog "TableName.getSeltext = " + TableName.getSeltext + if TableName.getSeltext = sTableName then + i = ix + endif + next + if TableName.getSeltext <> sTableName then + warnlog "Can find the table " + sTableName + "." + _ + "Make sure that the table exists when starting this test." + DatabaseClose + sleep(5) + Kontext "Messagebox" + if Messagebox.Exists(3) then + if Messagebox.getRT = 304 then + Messagebox.No + end if + end if + call hCloseDocument + exit function + endif + printlog "- Add " + sTableName +" table to query design" + '/// Add database table to Query. + AddTable.Click + sleep(2) + if AddTables.exists(2) then + CloseDlg.Click ' When the AddTables dialog still exists then close him + endif + sleep(1) + fChooseTableInAddTableDialog = true + +end function +'-------------------------------------------------------------------- +function fOpenQuery(sQueryName as string) + '/// open the query with the given name + '/// <u>parameter:</u> + '/// <b>squeryName:</b> the query which shall be opened + if ( fFindQuery(sQueryName) = true ) then + printlog "Query " + sQueryName + " found -> open" + Kontext "ContainerView" + OpenTable ' uno-Slot .uno:DB/Open + sleep(1) + fOpenQuery = true + else + fOpenQuery = false + end if + +end function +'-------------------------------------------------------------------- +function fFindQuery(sQueryName as string) + '/// select the Query with the given name in the Query container + '/// <u>parameter:</u> + '/// <b>sQueryName:</b> the Query which shall be selected + + Dim iNumbersOfQuerys as integer + Dim i as integer + + Kontext "ContainerView" + + ViewQueries + + fFindQuery = false + + if ( Not QueriesTree.exists(1) ) then + qaerrorlog "The Query tree doesn't exists" + ' May be a messagebox appear click OK to close it + Kontext "MessageBox" + if MessageBox.exists(1) then + qaerrorlog MessageBox.getText() + while MessageBox.exists() ' sometimes there are more then 1 message boxe + MessageBox.OK + wend + endif + exit function + end if + + iNumbersOfQuerys = QueriesTree.getItemCount() + + ' this select the first entry + QueriesTree.TypeKeys "<HOME>" + QueriesTree.TypeKeys "<UP>" + + + for i = 1 to iNumbersOfQuerys + + QueriesTree.TypeKeys "<ADD>" + 'printlog "i = " + i + 'printlog "QueryName.getItemCount = " + QueriesTree.getItemCount + if QueriesTree.getItemCount > iNumbersOfQuerys then + iNumbersOfQuerys = QueriesTree.getItemCount() + endif + 'printlog "QueryName.getSeltext = " + QueriesTree.getSeltext + if QueriesTree.getSeltext = sQueryName then + fFindQuery = true + exit for + endif + QueriesTree.TypeKeys "<DOWN>" + next + sleep(1) + +end function +'------------------------------------------------------------------------- +function fCloseQueryView() + '/// close an open Query view + '/// <u>parameter:</u> + + sleep(1) + + Kontext "TableView" + TableView.UseMenu + ' bug file / close close the whole database + 'hMenuSelectNr(1) ' the file menu + 'hMenuSelectNr(4) ' the Close Window + + hMenuSelectNr(5) ' the window menu + hMenuSelectNr(1) ' 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 + + fCloseQueryView = true +end function diff --git a/testautomation/dbaccess/tools/reporttools.inc b/testautomation/dbaccess/tools/reporttools.inc new file mode 100644 index 000000000000..70b9ff129bd5 --- /dev/null +++ b/testautomation/dbaccess/tools/reporttools.inc @@ -0,0 +1,387 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Report Helper Routines for Base tests. +'* +'*************************************************************************************** +'* +'* #1 fOpenNewReoprtDesign +'* #1 fCloseReportDesign +'* #1 fCloseReportView +'* #1 fSaveReport +'* #1 fOpenReport +'* #1 fFindREport +'* #1 fOpenReportNavigator +'* #1 fCloseReportNavigator +'* #1 fSwitchPageheader +'* #1 fExecutereport +'* #1 fCloseAddFieldDialog +'* #1 tools_reporttools_InstallExtension +'* +'\*********************************************************************************** +'------------------------------------------------------------------------- +function fOpenNewReportDesign() + '/// open a a new report design from an open database + '/// <u>parameter:</u> + + Kontext "DATABASE" + if ( Database.NotExists(3) ) then + fOpenNewReportDesign = false + exit function + end if + + Database.MouseDown(50,50) + Database.MouseUp(50,50) + + sleep(1) + + ViewReports + NewReportDesign + + sleep(5) + + ' Kontext "ReportDesign" + ' ReportDesign.MouseDown(50,50) + ' ReportDesign.MouseUp(50,50) + + ' sleep(1) + + fOpenNewReportDesign = true + +end function +'-------------------------------------------------------------------- +function fCloseReportDesign( optional bSave ) + '/// close an open Report + '/// <u>parameter:</u> + '/// <b><i>optional</i> bSave:</b> if true the Report shall be saved, if false the changes are lost + + sleep(1) + + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(1) ' the file menu + hMenuSelectNr(5) ' the Close Window + + 'when issue 30401 is fixed this has to be changed + Kontext "Messagebox" + if Messagebox.Exists(3) then + if ( IsMissing( bSave ) ) then + Messagebox.No + else + if bSave then + Messagebox.Yes + else + Messagebox.No + endif + endif + end if + + sleep(1) + + fCloseReportDesign = true + +end function +'-------------------------------------------------------------------- +function fCloseReportView() + '/// close an open Report View + '/// <u>parameter:</u> + + sleep(1) + + Kontext "DocumentWriter" + DocumentWriter.UseMenu + hMenuSelectNr(1) ' the file menu + hMenuSelectNr(5) ' the Close Window + + sleep(1) + + fCloseReportView = true + +end function +'-------------------------------------------------------------------- +function fSaveReport( sReportName as string, optional bCloseReport as boolean ) + '/// save an open Report with the given name + '/// <u>parameter:</u> + '/// <b>sReportName:</b> the name under which the Report shall be saved. If the file allready exists, then the file will be overwritten + '/// <b><i>optional</i> bCloseReport:</b> if true the Report shall be closed after saving, if false Report stay open + sleep(1) + + Kontext "DocumentWriter" + DocumentWriter.UseMenu + hMenuSelectNr(1) ' the file menu + hMenuSelectNr(6) ' the Save + + Kontext "ReportSaveDialog" + if FormSaveDialog.exists(3) then + FormName.setText(sReportName) + SaveBtn.Click + 'click yes in the overwrite messages box + Kontext "MessageBox" + if MessageBox.exists(1) then + MessageBox.Yes + endif + fSaveReport = true + else + fSaveReport = false + end if + + if ( IsMissing( bCloseReport ) ) then + ' nothing + else + call fCloseReportDesign() + end if + +end function +'-------------------------------------------------------------------- +function fOpenReport(sReportName as string) + '/// open a Report with the given name + '/// <u>parameter:</u> + '/// <b>sReportName:</b> the name of the Report which shall be open + + if ( fFindReport(sReportName) = true ) then + printlog "Report found -> open" + Kontext "ContainerView" + OpenForm ' uno-Slot .uno:DB/Open + sleep(1) + fOpenReport = true + else + printlog "Report not found." + fOpenReport = false + end if + +end function +'-------------------------------------------------------------------- +function fOpenReportInDesign(sReportName as string) + '/// open a Report with the given name in the design mode + '/// <u>parameter:</u> + '/// <b>sReportName:</b> the name of the Report which shall be open + + if ( fFindReport(sReportName) = true ) then + printlog "Report found -> open" + Kontext "ContainerView" + EditReport ' uno-Slot .uno:DB/Edit + sleep(1) + fOpenReportInDesign = true + else + printlog "Report not found." + fOpenReportInDesign = false + end if + +end function +'-------------------------------------------------------------------- +function fFindReport(sReportName as string) + '/// select a Report with the given name + '/// <u>parameter:</u> + '/// <b>sReportName:</b> the name of the Report which shall be selected + + Dim iNumbersOfReports as integer + Dim i as integer + + Kontext "DATABASE" + + ViewReports + + fFindReport = false + + if ( Not DatabaseReportsView.exists(1) ) then + warnlog "The Report tree doesn't exists" + exit function + end if + + iNumbersOfReports = DatabaseReportsView.getItemCount() + + ' this select the first entry + DatabaseReportsView.TypeKeys "<HOME>" + DatabaseReportsView.TypeKeys "<UP>" + + + for i = 1 to iNumbersOfReports + + DatabaseReportsView.TypeKeys "<ADD>" + 'printlog "i = " + i + 'printlog "ReportName.getItemCount = " + ReportTree.getItemCount + if DatabaseReportsView.getItemCount > iNumbersOfReports then + iNumbersOfReports = DatabaseReportsView.getItemCount() + endif + 'printlog "ReportName.getSeltext = " + ReportTree.getSeltext + if DatabaseReportsView.getSeltext = sReportName then + fFindReport = true + exit for + endif + DatabaseReportsView.TypeKeys "<DOWN>" + next + sleep(1) + +end function +'-------------------------------------------------------------------- +function fOpenReportNavigator + '/// open the report navigator + '/// <u>parameter:</u> + printlog "open report navigator" + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(3) + if (hMenuItemIsChecked(5) = false) then + hMenuSelectNr(5) + else + 'nothing + endif + + sleep(1) + +end function +'-------------------------------------------------------------------- +function fCloseReportNavigator + '/// open the report navigator + '/// <u>parameter:</u> + printlog "open report navigator" + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(3) + if (hMenuItemIsChecked(5) = true) then + hMenuSelectNr(5) + else + 'nothing + endif + + sleep(1) + +end function +'-------------------------------------------------------------------- +function fExecuteReport + '/// execute the report via the menu + '/// <u>parameter:</u> + + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(14) + +end function +'-------------------------------------------------------------------- +function fSwitchPageHeader + '/// delete or insert the Page Header via the menu + '/// <u>parameter:</u> + + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(2) + hMenuSelectNr(8) + +end function +'-------------------------------------------------------------------- +function fCloseAddFieldDialog + '/// close the Add Field Dialog via the slot or menu + '/// <u>parameter:</u> + + Kontext "ReportAddField" + if (ReportAddField.exists(3)) then + ReportAddField.close + else + ' check if the dialog is really not there + ' sometimes the focus is wrong. So I try a second way to disable the dialog + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(3) + if (hMenuItemIsChecked(3)) then + hMenuSelectNr(3) + else + warnlog "there should be the Add field dialog. But there is none." + endif + endif +end function +'-------------------------------------------------------------------- +function fOpenAddFieldDialog + '/// open the Add Field Dialog via the slot or menu + '/// <u>parameter:</u> + + Kontext "ReportAddField" + if (ReportAddField.exists(3)) then + ' do nothing + else + Kontext "ReportDesign" + ReportDesign.UseMenu + hMenuSelectNr(3) + if (hMenuItemIsChecked(3)) then + hMenuSelectNr(3) + ReportDesign.UseMenu + hMenuSelectNr(3) + hMenuSelectNr(3) + printlog "1" + else + hMenuSelectNr(4) + printlog "2" + endif + Kontext "ReportAddField" + ReportAddField + if (ReportAddField.exists(3)) then + ' do nothing + else + warnlog "there should be the Add field dialog. But there is none." + endif + endif + +end function +'-------------------------------------------------------------------- +function tools_reporttools_InstallExtension + '/// install the report designer extension + '/// <u>parameter:</u> + '/// <u>Return Value:</u><br> + + '/// <ol> + '/// +<li>Errorcode (Integer)</li> + '/// <ul> + '/// <li>0 = No errors, extension was added correctly</li> + '/// <li> not 0 = an error occure see hExtensionAddGUI for more info </li> + '/// </ul> + '/// </ol> + + dim i as integer + use "global/tools/includes/optional/t_extension_manager_tools.inc" + if (not hIsExtensionAlreadyInstalled("Report Builder")) then + i = hExtensionAddGUI( gTesttoolPath + "dbaccess/required/input/oracle-report-builder.oxt", "AcceptLicense,InstallForUser" ) + if (i > 0) then + tools_reporttools_InstallExtension = 0 + else + if (i = -5) then + warnlog "Report extension was not installed due to unsatisfied dependencies." + tools_reporttools_InstallExtension = 5 + else + warnlog "Report extension was not installed. Error Code = " + i + tools_reporttools_InstallExtension = i + endif + endif + else + tools_reporttools_InstallExtension = 0 + endif + + ' restart the office + call ExitRestartTheOffice + +end function diff --git a/testautomation/dbaccess/tools/tabletools.inc b/testautomation/dbaccess/tools/tabletools.inc new file mode 100644 index 000000000000..461ef8ff2da3 --- /dev/null +++ b/testautomation/dbaccess/tools/tabletools.inc @@ -0,0 +1,773 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : marc.neumann@oracle.com +'* +'* short description : Tools for Tables +'* +'************************************************************************ +'* +' #1 fCloseRelationDesign +' #1 fCloseTableDesign +' #1 fCloseTableView +' #1 fCompareMatrixValues +' #1 fCreateRefFile +' #1 fCreateTable +' #1 fDeleteTable +' #1 fFindTable +' #1 fInsertIntoTable +' #1 fOpenRelationDesign +' #1 fOpenNew TableDesign +' #1 fOpenTable +' #1 fReadFile +'* +'\*********************************************************************** +'------------------------------------------------------------------------------ +function tCompareMatrixValues(sDSName as string, sRefFileUrl as string, cTable_or_Query as string, sTableName as string, iRowPos as integer, iColPos as integer, sWordSeperator as string) as integer + 'sDSName = data source name f.e. Bibliography + 'sRefFileUrl = URL to your reference file (os indipendent - extension .ttr) f.e. base\optional\input\reference_tables\test.ttr + 'cTable_or_Query = differ between comparing reference file with a table (t) or a query-table (q) + 'sTableName = name of table or query-table to compare with f.e. Table1 + 'iRowPos,iColPos = row and column amount of reference and comparing table (must have the same size ; begin with 1 ; 0 is leftout, but has to be added) + + dim i as integer + dim j as integer 'counter' + dim aMatrix(iRowPos, iColPos) as string + + printlog "" + if cTable_or_Query = "t" then printlog "--- Compare Table with Reference Table ---" + if cTable_or_Query = "q" then printlog "--- Compare Query with Reference Table ---" + + call fReadFile(sRefFileUrl, aMatrix(), sWordSeperator) + + call hNewDocument + + '/// open Beamer and open datasource + ViewCurrentDatabase + sleep(1) + printlog "open database beamer" + + '/// switch between table and querie search + dim bfind_ok as boolean 'placeholder + if cTable_or_Query = "t" then + bfind_ok = ffindTableInBeamer(sDSName,sTableName) + printlog "found proper Table: " & sTableName + endif + if cTable_or_Query = "q" then + bfind_ok = ffindQuery(sDSName, sTableName) + printlog "found proper Query: " & sTableName + endif + + if bfind_ok then + '/// Choosing for the right table + sleep(1) + Kontext "DatabaseSelection" + DatabaseSelection.TypeKeys "<MOD1 SHIFT E>",TRUE ' # type CTRL + SHIFT + E to go from the DatabaseSelection to the TableView' + sleep(1) + printlog "found and opened proper table" + '/// comparing data in table with reference table + printlog "start comparing data in table with reference table" + Kontext "TableView" + dim ivalue_ok as integer + ivalue_ok = 0 + TableView.TypeKeys "<TAB>",TRUE + TableView.TypeKeys "<HOME>",TRUE + TableView.TypeKeys "<HOME>",TRUE + for i = 1 to iRowPos -1 + for j = 1 to iColPos -1 + setclipboard("") + 'here the values are read out and put in clipboard for comparing + TableView.TypeKeys "<MOD1 C>",TRUE + TableView.TypeKeys "<TAB>",TRUE + 'printlog "i: " & i + 'printlog "j: " & j + 'printlog "getClipboard: " & getclipboard() + 'printlog "matrix: " & aMatrix(i,j) + + 'here the values are compared + if getclipboard() <> aMatrix(i,j) then + ivalue_ok = ivalue_ok + 1 + warnlog ivalue_ok & ". fault in pos(row/col): " & i & "/" & j & " - should be: " & aMatrix(i,j) & " but is: " & getclipboard() + endif + 'printlog ivalue_ok & ". No !!! foult but TEST - should be: " & aMatrix(i,j) & " but is: " & getclipboard() + next j + next i + + '/// Result part + if ivalue_ok = 0 then + printlog "** Comparing procedure without faults" + tCompareMatrixValues = ivalue_ok + else + warnlog "Comparing procedure went wrong: " + ivalue_ok + " differences found!" + tCompareMatrixValues = 1 + endif + else + if cTable_or_Query = "t" then warnlog "Table: " + sTableName + " not found - Test aborted" + if cTable_or_Query = "q" then warnlog "Query: " + sTableName + " not found - Test aborted" + endif + printlog "*** End Testcase" + sleep 1 + ViewCurrentDatabase + hCloseDocument + +end function +'------------------------------------------------------------------------------ +function fCreateRefFile(sDSName as string, cTable_or_Query as string, sTableName as string, sWordSeperator as string) as string + dim bfind_ok as boolean 'check if right table found + dim iNumber as Integer 'needed for open reference file + dim iColAmount as integer + dim iRowAmount as integer 'counter + dim sReadContCol as string + dim sContColMem as string 'read out content string and its memo for getting table column ammount + dim sCellValue as string + dim sCellValueMem as string 'read out content string and its memo for writing in reference table + + dim sRefTableName as string + sRefTableName = ConvertPath("user\work\" & sTableName & ".ttr") + dim sRefFileUrl as string + sRefFileUrl = gOfficePath & sRefTableName + printlog "path for reference table: " & sRefFileUrl + + + call hNewDocument + + '/// open Beamer and open datasource + ViewCurrentDatabase + sleep(1) + printlog "open database beamer" + + '/// switch between table and querie search + if cTable_or_Query = "t" then + printlog "search for proper Table: " & sTableName + bfind_ok = ffindTableInBeamer(sDSName,sTableName) + endif + if cTable_or_Query = "q" then + printlog "search for proper Query: " & sTableName + bfind_ok = ffindQuery(sDSName, sTableName) + endif + + if bfind_ok then + '/// jumping to the right table + sleep(1) + Kontext "DatabaseSelection" + DatabaseSelection.TypeKeys "<MOD1 SHIFT E>",TRUE ' # type CTRL + SHIFT + E to go from the DatabaseSelection to the TableView' + sleep(1) + + '/// check the row and column amount + printlog "check the row and column amount" + Kontext "TableView" + sReadContCol = 1 'init + sContColMem = 1 'init + iColAmount = 0 'init + iRowAmount = AllRecords.caption() + while sReadContCol = sContColMem + sContColMem = sReadContCol + sReadContCol = CurrentRecord.getText() + TableView.TypeKeys "<TAB>",TRUE + TableView.TypeKeys "<TAB>",TRUE + iColAmount = iColAmount +1 + wend + iColAmount = iColAmount -1 + 'printlog "sReadContCol: " & sReadContCol + printlog "size of table (columns/rows): " & iColAmount & "/" & iRowAmount + fCreateRefFile = iColAmount & "," & iRowAmount + TableView.TypeKeys "<UP>",TRUE + TableView.TypeKeys "<HOME>",TRUE + TableView.TypeKeys "<HOME>",TRUE + sleep(1) + + '/// reading out values from table, create a reference table and input values in + printlog "start reading out values from table and writing in ref table" + iNumber = Freefile + dim i as integer 'counter + dim j as integer 'counter + Open sRefFileUrl for Output as iNumber + for i = 1 to iRowAmount + for j = 1 to iColAmount + Kontext "TableView" + TableView.TypeKeys "<MOD1 C>" + sCellValue = getclipboard() + TableView.TypeKeys "<TAB>" + if j <> 1 then + sCellValueMem = sCellValueMem & sWordSeperator + endif + sCellValueMem = sCellValueMem & sCellValue + 'printlog i & j & " inhalt: " & sCellValue + setclipboard("") + next j + print #iNumber, sCellValueMem + sCellValueMem = "" + next i + Close #iNumber + sleep(1) + + '/// warning if table not found - without proper table the test make no sense + else + warnlog "Table: " + sTableName + " not found." + fCreateRefFile = "" + endif + + sleep 1 + ViewCurrentDatabase + hCloseDocument + +end function +'------------------------------------------------------------------------------ +function fReadFile(sRefFileUrl as string, aMatrix() as string, sWordSep as string) + 'connecting and opening file + dim iNumber as Integer + iNumber = Freefile + 'position and content variables + dim sColumn As String + dim iRowPos as integer + dim iColPos as integer + dim iPos as integer + dim iPos1 as integer 'pointer for searching position + + 'init position in matrix + iRowPos = 1 + iColPos = 1 + + '/// open reference file and store it into an array (matrix) + printlog "search for the reference file, open it and store content in an array" + sRefFileUrl = gOfficePath + ConvertPath(sRefFileUrl) + Open sRefFileUrl for Input as iNumber + while not eof(iNumber) + Line Input #iNumber, sColumn + iPos1 = 1 'startposition + iPos = 1 'startposition + while iPos <> 0 'if iPos = 0 then no more sWordSeperator found -> end of column reached + iPos = Instr(iPos +1,sColumn,sWordSep) 'check column for sWordSeperator + 'printlog "iPos: " & iPos + 'printlog "iPos1: " & iPos1 + if iPos <> 1 then '<> 1 -> no content found + aMatrix(iRowPos,iColPos) = Mid(sColumn,iPos1,iPos - iPos1) 'cut content and put into array + 'printlog "iRow: " & iRowPos + 'printlog "iCol: " & iColPos + 'printlog "aMatrix: " & aMatrix(iRowPos,iColPos) + iPos1 = iPos +1 + iColPos = iColPos +1 + else warnlog "reference file is empty" + endif + wend + iRowPos = iRowPos +1 + iColPos = 1 + wend + printlog "**end of reading out reference table" +end function +'-------------------------------------------------------------------- +function fCreateTable(aFieldTypeContent(),sTableName,optional sCatalog,optional sSchema) + '/// create a table with the given FieldTypes + '/// sSchema and sCatalog are optional. + '/// If the optional parameter is not given then it's set to "" + '/// <u>parameter:</u> + '/// <b>aFieldTypeContent:</b> an arry with the table field data + '/// the array have to look like the following + '/// array(1,1) = first_field_name + '/// array(1,2) = first_field_type + '/// array(2,1) = second_field_name + '/// array(2,2) = second_field_type + '/// ... + '/// <b>sTableName:</b> the name of the table + '/// <b><i>optional</i> sCatalog:</b> the name of the table catalog + '/// <b><i>optional</i> sSchema:</b> the name of the table schema + + Dim i as integer 'counter + Dim iFieldNumber as integer 'counter + dim iNoDS as integer 'number of data source in listbox + Dim iNumberOfFieldTypes as integer 'field type memory + Dim iFieldTypesCounter as integer 'counter + Dim iIndex as integer 'counter + Dim sFieldType as string 'help var for fieldtypes + Dim sTypeName as String 'help var for fieldtypes + + if ( IsMissing(sCatalog) ) then + sCatalog = "" + endif + + if ( IsMissing(sSchema) ) then + sSchema = "" + endif + + call fDeleteTable(sTableName) ' delete the table if exists + + call fOpenNewTableDesign + + Kontext "TableDesignTable" + + for iFieldNumber = 1 to ubound(aFieldTypeContent) - 1 + + printlog "create field : " + aFieldTypeContent(iFieldNumber,1) + Fieldname.TypeKeys aFieldTypeContent(iFieldNumber,1) , TRUE + Fieldname.TypeKeys "<RETURN>" , TRUE + sleep 1 + sTypeName = "[ " + aFieldTypeContent(iFieldNumber,2) + " ]" + iNumberOfFieldTypes = FieldType.getitemCount() + for iFieldTypesCounter = 1 to iNumberOfFieldTypes + sFieldType = FieldType.getitemText(iFieldTypesCounter) + iIndex = Instr(sFieldType,sTypeName) + if iIndex <> 0 then + printlog "FieldType : " + sFieldType + iFieldTypesCounter = iNumberOfFieldTypes ' stops the for loop if proper fieldtype found' + endif + next + '/// choose proper field type + FieldType.Select(sFieldType) 'listbox entry nr' + sleep 1 + FieldType.TypeKeys "<RETURN>" , TRUE + Description.TypeKeys "<RETURN>" , TRUE + CellDescription.TypeKeys "<RETURN>" , TRUE + printlog "-------------------------------" + next + sleep(1) + Kontext "TableDesignTable" + TableDesignTable.usemenu + MenuSelect MenuGetItemId (1) + sleep(1) + menuselect MenuGetItemId (7) + sleep(1) + Kontext "DatabaseTableSaveAs" + printlog "save table as "+ sTableName + TableName.setText sTableName + sleep(1) + '/// catalog handling + if sCatalog <> "" then + if Catalog.IsVisible then + Catalog.SetText sCatalog + printlog "inserting catalog name: " + sCatalog + else + warnlog "The Catalog-Name could not be inserted" + endif + endif + '/// schema handling + if sSchema <> "" then + if Schema.IsVisible then + Schema.SetText sSchema + printlog "inserting schema name: " + sSchema + else + warnlog "The Schema-Name could not be inserted" + endif + endif + DatabaseTableSaveAs.OK + sleep 1 + Kontext "Messagebox" + if Messagebox.Exists(1) then + Messagebox.Yes + printlog "create a primary key " + end if + sleep 1 + + ' a sql exception appear. Try to get the error text + Kontext "Messagebox" + if Messagebox.Exists(1) then + MessageBox.Click 5 ' click the more button + Kontext "SQLException" + if SQLException.exists() then + warnlog Errortext.getText() + SQlException.OK + end if + Kontext "MessageBox" + MessageBox.OK + end if + + call fCloseTableDesign + +end function +'-------------------------------------------------------------------- +function fDeleteTable(sTableName as string) + '/// delete the table with the given name + '/// <u>parameter:</u> + '/// <b>sTableName:</b> the table which shall be deleted + if ( fFindTable(sTableName) = true ) then + printlog "Table found press delete" + Kontext "ContainerView" + 'TableTree.TypeKeys "<DELETE>" , true + Delete ' uno-Slot .uno:DB/Delete + sleep(1) + Kontext "Active" + Active.Yes + fDeleteTable = true + else + fDeleteTable = false + end if + +end function +'-------------------------------------------------------------------- +function fOpenTable(sTableName as string) + '/// open the table with the given name + '/// <u>parameter:</u> + '/// <b>sTableName:</b> the table which shall be opened + if ( fFindTable(sTableName) = true ) then + printlog "Table found -> open" + Kontext "ContainerView" + OpenTable ' uno-Slot .uno:DB/Open + sleep(1) + fOpenTable = true + else + fOpenTable = false + end if + +end function +'-------------------------------------------------------------------- +function fFindTable(sTableName as string) + '/// select the table with the given name in the table container + '/// <u>parameter:</u> + '/// <b>sTableName:</b> the table which shall be selected + + Dim iNumbersOfTables as integer + Dim i as integer + + Kontext "ContainerView" + + ViewTables + + fFindTable = false + + if ( Not TableTree.exists(1) ) then + qaerrorlog "The table tree doesn't exists" + ' May be a messagebox appear click OK to close it + Kontext "MessageBox" + if MessageBox.exists(1) then + qaerrorlog MessageBox.getText() + while MessageBox.exists() ' sometimes there are more then 1 message boxe + MessageBox.OK + wend + endif + exit function + end if + + iNumbersOfTables = TableTree.getItemCount() + + ' this select the first entry + TableTree.TypeKeys "<HOME>" + TableTree.TypeKeys "<UP>" + + + for i = 1 to iNumbersOfTables + + TableTree.TypeKeys "<ADD>" + 'printlog "i = " + i + 'printlog "TableName.getItemCount = " + TableTree.getItemCount + if TableTree.getItemCount > iNumbersOfTables then + iNumbersOfTables = TableTree.getItemCount() + endif + 'printlog "TableName.getSeltext = " + TableTree.getSeltext + if TableTree.getSeltext = sTableName then + fFindTable = true + exit for + endif + TableTree.TypeKeys "<DOWN>" + next + sleep(1) + +end function +'-------------------------------------------------------------------- +function fInsertIntoTable( aFieldContent(), sTableName) + '/// insert data into a table + '/// <u>parameter:</u> + '/// <b>aFieldContent:</b> an arry with the table data + '/// the array have to look like the following + '/// array(1,1) = first_value_for_first_record + '/// array(1,2) = second_value_for_first_record + '/// array(2,1) = first_value_for_second_record + '/// array(2,2) = second_value_for_second_record + '/// ... + '/// <b>sTableName:</b> the name of the table + + Dim iCounterOfRecords as integer + Dim iCounterOfFields as integer + + Dim iNumberOfRecords as integer + Dim iNumberOfFields as integer + + iNumberOfRecords = ubound(aFieldContent) + iNumberOfFields = ubound(aFieldContent,2) + + call fOpenTable(sTableName) + + Kontext "TableView" + for iCounterOfRecords = 1 to iNumberOfRecords + for iCounterOfFields = 1 to iNumberOfFields + TableView.TypeKeys aFieldContent(iCounterOfRecords,iCounterOfFields),TRUE + TableView.TypeKeys "<TAB>",TRUE + next + next + + + sleep 1 + + call fCloseTableView + +end function +'------------------------------------------------------------------------- +function fCloseTableDesign(optional bSave) + '/// close an open table design + '/// <u>parameter:</u> + '/// <b><i>optional</i> bSave:</b> if true then the table design is saved + + sleep(1) + + Kontext "TableDesignTable" + TableDesignTable.UseMenu + ' bug file / close close the whole database + hMenuSelectNr(1) ' the file menu + hMenuSelectNr(4) ' the Close Window + + 'hMenuSelectNr(6) ' the window menu + 'hMenuSelectNr(1) ' the Close Window + + Kontext "Messagebox" + if Messagebox.Exists(3) then + Messagebox.No + end if + + fCloseTableDesign = true +end function +'------------------------------------------------------------------------- +function fCloseTableView() + '/// close an open table view + '/// <u>parameter:</u> + + sleep(1) + + Kontext "TableView" + TableView.UseMenu + ' bug file / close close the whole database + 'hMenuSelectNr(1) ' the file menu + 'hMenuSelectNr(4) ' the Close Window + + hMenuSelectNr(6) ' the window menu + hMenuSelectNr(1) ' 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 + + fCloseTableView = true +end function +'------------------------------------------------------------------------- +function fOpenRelationDesign() + '/// open a new relation design + '/// <u>parameter:</u> + + Kontext "DATABASE" + if ( Database.NotExists(3) ) then + fOpenRelationDesign = false + exit function + end if + + Database.MouseDown(50,50) + Database.MouseUp(50,50) + + sleep(1) + + Database.UseMenu + hMenuSelectNr(5) + hMenuSelectNr(1) + + fOpenRelationDesign = true +end function +'------------------------------------------------------------------------- +function fCloseRelationDesign(optional bSave) + '/// close an open relation design + '/// <u>parameter:</u> + '/// <b><i>optional</i> bSave:</b> if true then the relation design is saved + + + Kontext "RelationDesign" + RelationDesign.UseMenu + ' bug file / close close the whole database + hMenuSelectNr(1) ' the file menu + hMenuSelectNr(4) ' the Close Window + + 'hMenuSelectNr(6) ' the window menu + 'hMenuSelectNr(1) ' the Close Window + + Kontext "Messagebox" + if Messagebox.Exists(3) then + if ( IsMissing( bSave ) ) then + Messagebox.No + else + if bSave then + Messagebox.Yes + else + Messagebox.No + endif + endif + end if + + fCloseRelationDesign = true +end function +'------------------------------------------------------------------------- +function fOpenNewTableDesign + printlog "fOpenNewTableDesign called" + + printlog "check if Database exists" + + Kontext "DATABASE" + Database.MouseDown(50,50) + Database.MouseUp(50,50) + + if ( Database.NotExists(3) ) then + fOpenNewTableDesign = false + warnlog "The Database windows doesn't exists" + exit function + end if + + sleep(1) + + printlog "open new table design" + + NewTableDesign + + sleep(2) + + fOpenNewTableDesign = true + +end function +'------------------------------------------------------------------------- +function fOpenTableInDesign(sTableName as String) + printlog "fOpenTableInDesign called" + + printlog "check if Database exists" + + Kontext "DATABASE" + Database.MouseDown(50,50) + Database.MouseUp(50,50) + + if ( Database.NotExists(3) ) then + fOpenTableInDesign = false + warnlog "The Database windows doesn't exists" + exit function + end if + + sleep(1) + + printlog "open new table design" + + call fFindTable(sTableName) + + EditTable + + Kontext "TableDesignTable" + if ( not TableDesignTable.exists(3) ) then + warnlog "The Table design doesn't open" + fOpenTableInDesign = false + exit function + end if + + fOpenTableInDesign = true + +end function +'------------------------------------------------------------------------- +function fFindTableInBeamer(sDSName1,sTableName1) + '/// select a table with the given name in the beamer + '/// <u>parameter:</u> + '/// <b>sDSName1:</b> the name of the datasource + '/// <b>sTableName1:</b> the name of the table + + dim i as integer + dim bfindTable as boolean + dim iNoDS as integer + dim iNoTable as integer + + bfindTable = false + Kontext "DatabaseBeamer" + Kontext "DatabaseSelection" + + iNoDS = DatabaseSelection.getItemCount + for i = 1 to iNoDS + DatabaseSelection.Select i + if DatabaseSelection.getText = sDSName1 then + i = iNoDS + bfindTable = true + endif + next i + + if (bfindTable = false) then + warnlog "Datasource " + sDSName1 + " not found!" + exit function + else + printlog "Datasource " + sDSName1 + " found!" + ' I set the bfindTable flag again back to false + ' for the next test of the table + bfindTable = false + endif + + wait 500 + DatabaseSelection.TypeKeys "<ADD>" , true + wait 500 + DatabaseSelection.TypeKeys "<DOWN>" , true + wait 500 + DatabaseSelection.TypeKeys "<DOWN>" , true + wait 500 + DatabaseSelection.TypeKeys "<ADD>" , true + wait 500 + DatabaseSelection.TypeKeys "<DOWN>" , true + wait 500 + + + iNoTable = DatabaseSelection.getItemCount + dim ii as integer + ii = DatabaseSelection.GetSelIndex + for i = ii to iNoTable + DatabaseSelection.Select i + if DatabaseSelection.getText = sTableName1 then + i = iNoTable + sleep 1 + bfindTable = true + endif + next i + + fFindTableInBeamer = bfindTable + +end function +'------------------------------------------------------------------------- +function fStartTableWizard() + '/// start the table wizard + '/// <u>parameter:</u> + + Kontext "DATABASE" + if ( Database.NotExists(3) ) then + fStartTableWizard = false + exit function + end if + + Database.MouseDown(50,50) + Database.MouseUp(50,50) + + sleep(1) + + ViewTables + StartTableWizard + + sleep(2) + + fStartTableWizard = true + +end function |