diff options
author | Joerg Sievers <jsi@openoffice.org> | 2008-06-16 11:19:07 +0000 |
---|---|---|
committer | Joerg Sievers <jsi@openoffice.org> | 2008-06-16 11:19:07 +0000 |
commit | 5c94a8213a881a66aa00c059aa29caf8de0808bc (patch) | |
tree | 9dabf5fcc79a54c3875c0b4826270ab59d54ecb6 /testautomation/framework/optional/includes | |
parent | 3d9ef5bb71315c27f78e41b3ef7eb2c4507ac978 (diff) |
Creating clean testautomation modul with changed structure which will be included into the CWS process.
Diffstat (limited to 'testautomation/framework/optional/includes')
108 files changed, 25914 insertions, 0 deletions
diff --git a/testautomation/framework/optional/includes/CJK_CollationDialogue_1.inc b/testautomation/framework/optional/includes/CJK_CollationDialogue_1.inc new file mode 100755 index 000000000000..1250b87d6d3d --- /dev/null +++ b/testautomation/framework/optional/includes/CJK_CollationDialogue_1.inc @@ -0,0 +1,735 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: CJK_CollationDialogue_1.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : CJK Collation Dialogue Design Draft +'* +'\*********************************************************************** + +testcase tLanguageTest_1 + + Dim sLanguageIDEnglishUSA ,sLanguageIDSChinese, sLanguageIDTChinese , sLanguageIDJapanese , sLanguageIDKoren as String + Dim sKeyTypeEnglishUSA ,sKeyTypeSChinese , sKeyTypeTChinese , sKeyTypeJapanese , sKeyTypeKoren as String + Dim i as Integer + + '/// Check if the default setting for "key type" is right for CJK when alphanumeric is chosen in English + + select case iSprache + case 01 :' English (USA) + sKeyTypeEnglishUSA = "Alphanumeric" + sKeyTypeSChinese = "Character set" + sKeyTypeTChinese = "Numeric" + sKeyTypeJapanese = "Character set" + sKeyTypeKoren = "Character set" + case 49 :' German + sKeyTypeEnglishUSA = "Alphanumerisch" + sKeyTypeSChinese = "Numerisch" + sKeyTypeTChinese = "Numerisch" + sKeyTypeJapanese = "Numerisch" + sKeyTypeKoren = "Numerisch" + case 55 :' Brazilian + sKeyTypeEnglishUSA = "Alfanumérico" + sKeyTypeSChinese = "Conjunto de caracteres" + sKeyTypeTChinese = "numérico" + sKeyTypeJapanese = "Conjunto de caracteres" + sKeyTypeKoren = "Conjunto de caracteres" + case 81 :' Japanese + sKeyTypeEnglishUSA = "英数字" + sKeyTypeSChinese = "ピンイン(中国語のローマ字表記法)" + sKeyTypeTChinese = "ピンイン(中国語のローマ字表記法)" + sKeyTypeJapanese = "数字" + sKeyTypeKoren = "数字" +' case 82 : ' Korean +' sKeyTypeEnglishUSA = 1 'alphanumeric +' sKeyTypeSChinese = 1 'Character set +' sKeyTypeTChinese = 3 'Pin yin +' sKeyTypeJapanese = 2 'Character set +' sKeyTypeKoren = 3 'Character set + case 86 :' Chinese (simplified) + sKeyTypeEnglishUSA = "字母数字式" + sKeyTypeSChinese = "字符集" + sKeyTypeTChinese = "拼音" + sKeyTypeJapanese = "字符集" + sKeyTypeKoren = "字典" + case 88 :' Chinese (traditional) + sKeyTypeEnglishUSA = "字母數字式" + sKeyTypeSChinese = "字型" + sKeyTypeTChinese = "拼音" + sKeyTypeJapanese = "字型" + sKeyTypeKoren = "字典" + case else :' Fallback + PrintLog "The test does not support the language " + iSprache + Goto endsub + end select + + sLanguageIDEnglishUSA = fGetCountryName(01) + sLanguageIDSChinese = fGetCountryName(86) + sLanguageIDTChinese = fGetCountryName(88) + sLanguageIDJapanese = fGetCountryName(81) + sLanguageIDKoren = fGetCountryName(82) + + call hNewDocument + + DocumentWriter.TypeKeys "test" + DocumentWriter.TypeKeys "<Shift Home>" + Sleep 1 + +'/// Open Tools/Sort + ToolsSort + Kontext "Sortieren" + +'/// Choose language: English and key type: alphanumeric + try + Sprache.Select (sLanguageIDEnglishUSA) + catch + qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'" + ' try fallback to 'English (USA)' + try + Sprache.Select ("English (USA)") + catch + qaErrorLog "Can't select even tha fallback: 'English (USA)'" + endcatch + endcatch + try + Schluesseltyp1.Select sKeyTypeEnglishUSA + catch + qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'" + ' try fallback to 'English (USA)' + for i = 1 to Schluesseltyp1.getItemCount + printlog "" + i + ": '" + Schluesseltyp1.getItemText(i) + "'" + next i + endcatch + +'/// Check to simplified Chinese + try + Sprache.Select (sLanguageIDSChinese) + catch + qaErrorLog "Can't select: '" + sLanguageIDSChinese + "'" + ' try fallback to 'Chinese (simplyfied)' + try + Sprache.Select ("Chinese (simplyfied)") + catch + qaErrorLog "Can't select even tha fallback: 'Chinese (simplyfied)'" + endcatch + endcatch + Sleep 2 + + try + Sprache.Select (sLanguageIDEnglishUSA) + catch + qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'" + ' try fallback to 'English (USA)' + try + Sprache.Select ("English (USA)") + catch + qaErrorLog "Can't select even tha fallback: 'English (USA)'" + endcatch + endcatch + try + Schluesseltyp1.Select sKeyTypeEnglishUSA + catch + qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'" + endcatch + +'/// Check to traditional Chinese + try + Sprache.Select (sLanguageIDTChinese) + catch + qaErrorLog "Can't select: '" + sLanguageIDTChinese + "'" + ' try fallback to 'Chinese (traditional)' + try + Sprache.Select ("Chinese (traditional)") + catch + qaErrorLog "Can't select even tha fallback: 'Chinese (traditional)'" + for i = 1 to Sprache.getItemCount + printlog "("+i+"/"+ Sprache.getItemCount + "): '"+Sprache.getItemText(i)+"'" + next i + endcatch + endcatch + Sleep 2 + + try + Sprache.Select (sLanguageIDEnglishUSA) + catch + qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'" + ' try fallback to 'English (USA)' + try + Sprache.Select ("English (USA)") + catch + qaErrorLog "Can't select even tha fallback: 'English (USA)'" + endcatch + endcatch + try + Schluesseltyp1.Select sKeyTypeEnglishUSA + catch + qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'" + endcatch + +'/// Check to Japanese + try + Sprache.Select (sLanguageIDJapanese) + catch + qaErrorLog "Can't select: '" + sLanguageIDJapanese + "'" + ' try fallback to 'Japanese' + try + Sprache.Select ("Japanese") + catch + qaErrorLog "Can't select even tha fallback: 'Japanese'" + endcatch + endcatch + Sleep 2 + if Schluesseltyp1.GetSelText <> sKeyTypeJapanese then + warnlog "The default key type for Japanese should be: '" + sKeyTypeJapanese + "' but is: '" + Schluesseltyp1.GetSelText + "'" + end if + + try + Sprache.Select (sLanguageIDEnglishUSA) + catch + qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'" + ' try fallback to 'English (USA)' + try + Sprache.Select ("English (USA)") + catch + qaErrorLog "Can't select even tha fallback: 'English (USA)'" + endcatch + endcatch + try + Schluesseltyp1.Select sKeyTypeEnglishUSA + catch + qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'" + endcatch + +'/// Check to Korean + try + Sprache.Select (sLanguageIDKoren) + catch + qaErrorLog "Can't select: '" + sLanguageIDKoren + "'" + ' try fallback to 'Korean (RoK)' + try + Sprache.Select ("Korean (RoK)") + catch + qaErrorLog "Can't select even tha fallback: 'Korean (RoK)'" + for i = 1 to Sprache.getItemCount + printlog "("+i+"/"+ Sprache.getItemCount + "): '"+Sprache.getItemText(i)+"'" + next i + endcatch + endcatch + Sleep 2 + if Schluesseltyp1.GetSelText <> sKeyTypeKoren then + warnlog "The default key type for Korean should be " + sKeyTypeKoren + " but get " + Schluesseltyp1.GetSelText + end if + + Sortieren.Cancel + + Call hCloseDocument + +endcase + +'------------------------------------------------------------------------- + +testcase tLanguageTest_2 + + Dim sLanguageIDEnglishUSA ,sLanguageIDSChinese, sLanguageIDTChinese , sLanguageIDJapanese , sLanguageIDKoren as String + Dim sKeyTypeEnglishUSA ,sKeyTypeSChinese , sKeyTypeTChinese , sKeyTypeJapanese , sKeyTypeKoren as String + Dim i as Integer + + '/// Check if the default setting for "key type" is right for CJK when numeric is chosen in English + + select case iSprache + case 01 :' English (USA) + sKeyTypeEnglishUSA = "Numeric" + sKeyTypeSChinese = "Numeric" + sKeyTypeTChinese = "Numeric" + sKeyTypeJapanese = "Numeric" + sKeyTypeKoren = "Numeric" + case 49 :' German + sKeyTypeEnglishUSA = "Numerisch" + sKeyTypeSChinese = "Numerisch" + sKeyTypeTChinese = "Numerisch" + sKeyTypeJapanese = "Numerisch" + sKeyTypeKoren = "Numerisch" + case 55 :' Brazilian + sKeyTypeEnglishUSA = "numérico" + sKeyTypeSChinese = "numérico" + sKeyTypeTChinese = "numérico" + sKeyTypeJapanese = "numérico" + sKeyTypeKoren = "numérico" + case 81 :' Japanese + sKeyTypeEnglishUSA = "数字" + sKeyTypeSChinese = "数字" + sKeyTypeTChinese = "数字" + sKeyTypeJapanese = "数字" + sKeyTypeKoren = "数字" +' case 82 ' Korean +' sKeyTypeEnglishUSA = 2 'numeric +' sKeyTypeSChinese = 4 'numeric +' sKeyTypeTChinese = 4 'numeric +' sKeyTypeJapanese = 4 'numeric +' sKeyTypeKoren = 4 'numeric + case 86 :' Chinese (simplified) + sKeyTypeEnglishUSA = "数字" + sKeyTypeSChinese = "数字" + sKeyTypeTChinese = "数字" + sKeyTypeJapanese = "数字" + sKeyTypeKoren = "数字" + case 88 :' Chinese (traditional) + sKeyTypeEnglishUSA = "數字" + sKeyTypeSChinese = "數字" + sKeyTypeTChinese = "數字" + sKeyTypeJapanese = "數字" + sKeyTypeKoren = "數字" + case else :' Fallback + printLog "The test does not support the language " + iSprache + Goto endsub + end select + + sLanguageIDEnglishUSA = fGetCountryName(01) + sLanguageIDSChinese = fGetCountryName(86) + sLanguageIDTChinese = fGetCountryName(88) + sLanguageIDJapanese = fGetCountryName(81) + sLanguageIDKoren = fGetCountryName(82) + + call hNewDocument + + DocumentWriter.TypeKeys "123" + DocumentWriter.TypeKeys "<Shift Home>" + Sleep 1 + +'/// Open Tools/Sort + ToolsSort + Kontext "Sortieren" + +'/// Choose language: English and key type: Numeric + try + Sprache.Select (sLanguageIDEnglishUSA) + catch + qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'" + ' try fallback to 'English (USA)' + try + Sprache.Select ("English (USA)") + catch + qaErrorLog "Can't select even tha fallback: 'English (USA)'" + for i = 1 to Sprache.getItemCount + printlog "" + i + ": '" + Sprache.getItemText(i) + "'" + next i + endcatch + endcatch + try + Schluesseltyp1.Select sKeyTypeEnglishUSA + catch + qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'" + ' try fallback to 'English (USA)' + for i = 1 to Schluesseltyp1.getItemCount + printlog "" + i + ": '" + Schluesseltyp1.getItemText(i) + "'" + next i + endcatch + +'/// Check to simplified Chinese + try + Sprache.Select (sLanguageIDSChinese) + catch + qaErrorLog "Can't select: '" + sLanguageIDSChinese + "'" + ' try fallback to 'Chinese (simplyfied)' + try + Sprache.Select ("Chinese (simplyfied)") + catch + qaErrorLog "Can't select even tha fallback: 'Chinese (simplyfied)'" + endcatch + endcatch + Sleep 2 + if Schluesseltyp1.GetSelText <> sKeyTypeSChinese then + warnlog "The default key type for Simplified Chinese should be: '" + sKeyTypeSChinese + "' but is '" + Schluesseltyp1.GetSelText + "'" + end if + + try + Sprache.Select (sLanguageIDEnglishUSA) + catch + qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'" + ' try fallback to 'English (USA)' + try + Sprache.Select ("English (USA)") + catch + qaErrorLog "Can't select even tha fallback: 'English (USA)'" + endcatch + endcatch + try + Schluesseltyp1.Select sKeyTypeEnglishUSA + catch + qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'" + endcatch + +'/// Check to traditional Chinese + try + Sprache.Select (sLanguageIDTChinese) + catch + qaErrorLog "Can't select: '" + sLanguageIDTChinese + "'" + ' try fallback to 'Chinese (traditional)' + try + Sprache.Select ("Chinese (traditional)") + catch + qaErrorLog "Can't select even tha fallback: 'Chinese (traditional)'" + endcatch + endcatch + Sleep 2 + if Schluesseltyp1.GetSelText <> sKeyTypeTChinese then + warnlog "The default key type for traditional Chinese should be " + sKeyTypeTChinese + " but get " + Schluesseltyp1.GetSelText + end if + + try + Sprache.Select (sLanguageIDEnglishUSA) + catch + qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'" + ' try fallback to 'English (USA)' + try + Sprache.Select ("English (USA)") + catch + qaErrorLog "Can't select even tha fallback: 'English (USA)'" + endcatch + endcatch + try + Schluesseltyp1.Select sKeyTypeEnglishUSA + catch + qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'" + endcatch + +'/// Check to Japanese + try + Sprache.Select (sLanguageIDJapanese) + catch + qaErrorLog "Can't select: '" + sLanguageIDJapanese + "'" + ' try fallback to 'Japanese' + try + Sprache.Select ("Japanese") + catch + qaErrorLog "Can't select even tha fallback: 'Japanese'" + endcatch + endcatch + Sleep 2 + if Schluesseltyp1.GetSelText <> sKeyTypeJapanese then + warnlog "The default key type for Japanese should be: '" + sKeyTypeJapanese + "' but is: '" + Schluesseltyp1.GetSelText + "'" + end if + + try + Sprache.Select (sLanguageIDEnglishUSA) + catch + qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'" + ' try fallback to 'English (USA)' + try + Sprache.Select ("English (USA)") + catch + qaErrorLog "Can't select even tha fallback: 'English (USA)'" + endcatch + endcatch + try + Schluesseltyp1.Select sKeyTypeEnglishUSA + catch + qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'" + endcatch + +'/// Check to Korean + try + Sprache.Select (sLanguageIDKoren) + catch + qaErrorLog "Can't select: '" + sLanguageIDKoren + "'" + ' try fallback to 'Korean (RoK)' + try + Sprache.Select ("Korean (RoK)") + catch + qaErrorLog "Can't select even tha fallback: 'Korean (RoK)'" + endcatch + endcatch + Sleep 2 + if Schluesseltyp1.GetSelText <> sKeyTypeKoren then + warnlog "The default key type for Korean should be " + sKeyTypeKoren + " but get " + Schluesseltyp1.GetSelText + end if + + Sortieren.Cancel + + Call hCloseDocument +endcase + +'------------------------------------------------------------------------- + +testcase tStrokeSort + + Dim testFile as String + Dim sLanguageIDSChinese as String + Dim sKeyTypeSChinese as String + Dim aCorrectSequence() as String + + Dim i , j as Integer + + testFile = "sortTest.sxw" + aCorrectSequence = Array( "1" , "2" , "3" , "4" ,"5" ) + + j = UBound(aCorrectSequence) + + select case iSprache + case 01 : ' English (USA) + sKeyTypeSChinese = "Stroke" + case 49 : ' German + sKeyTypeSChinese = "Stroke" + case 55 : ' Brazilian + sKeyTypeSChinese = "Traço" + case 81 : ' Japanese + sKeyTypeSChinese = "総画数" + case 86 : ' Chinese (simplified) + sKeyTypeSChinese = "笔画" + case 88 : ' Chinese (simplified) + sKeyTypeSChinese = "筆畫" + case else : ' Fallback + printLog "Now, the test does not support for the language " +iSprache + Goto endsub + end select + + sLanguageIDSChinese = fGetCountryName(86) + + '/// Check Stroke sort for Simplified Chinese + + Call hNewDocument + '/// Open a test file and check <i>No Grid</i> checkbox + Call hFileOpen ( gTesttoolPath + "framework\optional\input\CJK\" + testFile ) + + EditSelectAll + + '/// Open <i>Tools/Sort</i> + ToolsSort + Kontext "Sortieren" + + '/// Choose language: Simplified Chinese and key type <i>Stroke</i> + try + Sprache.Select (sLanguageIDSChinese) + catch + qaErrorLog "Can't select: '" + sLanguageIDSChinese + "'" + ' try fallback to 'Chinese (simplyfied)' + try + Sprache.Select ("Chinese (simplyfied)") + catch + qaErrorLog "Can't select even tha fallback: 'Chinese (simplyfied)'" + endcatch + endcatch + try + Schluesseltyp1.Select sKeyTypeSChinese + catch + qaErrorLog "Can't select: '" + sKeyTypeSChinese + "'" + for i = 1 to Schluesseltyp1.getItemCount + printlog "" + i + ": '" + Schluesseltyp1.getItemText(i) + "'" + next i + endcatch + + Sortieren.OK + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<MOD1 Home>" + + For i = 0 to j + DocumentWriter.TypeKeys "<End>" + DocumentWriter.TypeKeys "<Shift Left>" + + EditCopy + if GetClipboardText <> aCorrectSequence(i) then Warnlog "The Stroke sort is wrong , should be " + aCorrectSequence(i) + " ,but get " +GetClipboardText + + DocumentWriter.TypeKeys "<Down>" + next i + + Call hCloseDocument + +endcase + +'------------------------------------------------------------------------- + +testcase tPinyinSort + + Dim testFile as String + Dim sLanguageIDSChinese as String + Dim sKeyTypeSChinese as String + Dim aCorrectSequence() as String + + Dim i , j as Integer + + testFile = "sortTest.sxw" + aCorrectSequence = Array( "2" , "3" , "4" , "1" , "5" ) + + j = UBound(aCorrectSequence) + + select case iSprache + case 01 : ' English (USA) + sKeyTypeSChinese = "Pinyin" + case 49 : ' German + sKeyTypeSChinese = "Pinyin" + case 55 : ' Brazilian + sKeyTypeSChinese = "Pinyin" + case 81 : ' Japanese + sKeyTypeSChinese = "ピンイン(中国語のローマ字表記法)" + case 86 : ' Chinese (simplified) + sKeyTypeSChinese = "拼音" + case 88 : ' Chinese (simplified) + sKeyTypeSChinese = "拼音" + case else : ' Fallback + printLog "Now, the test does not support for the language " +iSprache + Goto endsub + end select + + sLanguageIDSChinese = fGetCountryName(86) + + '/// Check <i>Pinyin</i> sort for Simplified Chinese + + Call hNewDocument + '/// Open a test file and check <i>No Grid</i> checkbox + Call hFileOpen ( gTesttoolPath + "framework\optional\input\CJK\" + testFile ) + + EditSelectAll + + '/// Open <i>Tools/Sort</i> + ToolsSort + Kontext "Sortieren" + + '/// Choose language: Simplified Chinese and key type <i>Pin yin</i> + try + Sprache.Select (sLanguageIDSChinese) + catch + qaErrorLog "Can't select: '" + sLanguageIDSChinese + "'" + ' try fallback to 'Chinese (simplyfied)' + try + Sprache.Select ("Chinese (simplyfied)") + catch + qaErrorLog "Can't select even tha fallback: 'Chinese (simplyfied)'" + endcatch + endcatch + try + Schluesseltyp1.Select sKeyTypeSChinese + catch + qaErrorLog "Can't select: '" + sKeyTypeSChinese + "'" + for i = 1 to Schluesseltyp1.getItemCount + printlog "" + i + ": '" + Schluesseltyp1.getItemText(i) + "'" + next i + endcatch + + Sortieren.OK + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<MOD1 Home>" + + For i = 0 to j + DocumentWriter.TypeKeys "<End>" + DocumentWriter.TypeKeys "<Shift Left>" + + EditCopy + if GetClipboardText <> aCorrectSequence(i) then + Warnlog "The Pin yin sort is wrong, should be: '" + aCorrectSequence(i) + "' ,but is: '" +GetClipboardText + "'" + endif + + DocumentWriter.TypeKeys "<Down>" + next i + + Call hCloseDocument + +endcase + +'------------------------------------------------------------------------- + +testcase tSortOptionTest_1 + +Dim i , j as Integer +Dim asList() as String + +select case iSprache + case 81 :' Japanese + if iSystemSprache <> 81 then goto NOTest + asList = Array( _ + "Sun,Mon,Tue,Wed,Thu,Fri,Sat" , _ + "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday" , _ + "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec" , _ + "January,February,March,April,May,June,July,August,September,October,November,December" , _ + "日,月,火,水,木,金,土" , _ + "日曜日,月曜日,火曜日,水曜日,木曜日,金曜日,土曜日" , _ + ) + case 82 :' Korean + if iSystemSprache <> 82 then goto NOTest + asList = Array( _ + "일,월,화,수,목,금,토" ,_ + "일요일,월요일,화요일,수요일,목요일,금요일,토요일" ,_ + "1,2,3,4,5,6,7,8,9,10,11,12" , _ + "日,月,火,水,木,金,土" , _ + "日曜日,月曜日,火曜日,水曜日,木曜日,金曜日,土曜日" , _ + ) + case 86 :' Chinese (simplified) + if iSystemSprache <> 86 then goto NOTest + asList = Array( _ + "日,一,二,三,四,五,六" , _ + "星期日,星期一,星期二,星期三,星期四,星期五,星期六" , _ + "一,二,三,四,五,六,七,八,九,十,十一,十二" , _ + "一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月" , _ + ) + case 88 :' Chinese (traditional) + if iSystemSprache <> 88 then goto NOTest + asList = Array( _ + "日,一,二,三,四,五,六" , _ + "星期日,星期一,星期二,星期三,星期四,星期五,星期六" , _ + "一,二,三,四,五,六,七,八,九,十,十一,十二" , _ + "一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月" , _ + ) + case else :' Fallback +NOTest: + printLog "The test does not support for the language " +iSprache + " System language " + iSystemSprache + Goto endsub +end select + +'/// Check if the entries in custom sort order is right in CJK version + + call hNewDocument + +'/// Open <i>Data/Sort</i> -> tabpage <i>option</i> + + DataSort + + Kontext + active.SetPage TabSortierenOptionen + Kontext "TabSortierenOptionen" + + BenutzerdefinierteSortierreihenfolge.Check + + For i = 1 to SortierreihenfolgeListe.GetItemCount + if SortierreihenfolgeListe.GetItemText(i) <> asList(i-1) then + warnlog "Should get " +asList(i) + " but get " +SortierreihenfolgeListe.GetItemText(i) + end if + next i + + TabSortierenOptionen.Cancel + + Call hCloseDocument + +endcase + +'---------------------------------------------------------------- diff --git a/testautomation/framework/optional/includes/CJK_FeatureSwitchTest_1.inc b/testautomation/framework/optional/includes/CJK_FeatureSwitchTest_1.inc new file mode 100755 index 000000000000..b7880a060d6c --- /dev/null +++ b/testautomation/framework/optional/includes/CJK_FeatureSwitchTest_1.inc @@ -0,0 +1,715 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: CJK_FeatureSwitchTest_1.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* 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 : hercule.li@sun.com +'* +'* short description : CJK Feature Switch test +'* +'\*********************************************************************** + +testcase tSwitchLocation +'/// Check if the switch "Asian Language support" exist -- tools/options/language settings/language + ToolsOptions + + Call hToolsOptions("LANGUAGESETTINGS" , "LANGUAGES") + + try + if Aktivieren.IsChecked = TRUE then + printLog "CJK language is checked" + else + printLog "CJK language isn't checked" + end if + catch + warnlog "Something wrong in checkbox 'Asian Language Support'" + endcatch + + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK +endcase + +'------------------------------------------------------------------------- + +testcase tWriterUIChangesTest1 +'/// Check if checkbox "Snap to text grid" is enable or not -- Format/Paragraph tabpage "Alignment" + call hNewDocument + + '/// turn on "Asian Language support" , check if checkbox "Snap to text grid" is enable + Call CheckAsianLanguageSupport("On") + + Kontext + FormatParagraph + Active.SetPage TabAusrichtungAbsatz + Kontext "TabAusrichtungAbsatz" + + try + if TextrasterFangen.IsChecked = TRUE then + printLog "snap to text grid is checked" + else + printLog "snap to text grid isn't checked" + end if + catch + warnlog "Something wrong in checkbox 'snap to text grid'" + endcatch + + TabAusrichtungAbsatz.Cancel + + '/// turn off "Asian Language support" , check if checkbox "Snap to text grid" isn't enable + if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then + Call CheckAsianLanguageSupport("Off") + + Kontext + FormatParagraph + Active.SetPage TabAusrichtungAbsatz + Kontext "TabAusrichtungAbsatz" + + try + if TextrasterFangen.IsChecked = TRUE Or TextrasterFangen.IsChecked <> TRUE then + warnlog "Something wrong in checkbox 'snap to text grid'" + end if + catch + endcatch + + TabAusrichtungAbsatz.Cancel + end if + + Call hCloseDocument +endcase + +'------------------------------------------------------------------------- + +testcase tWriterUIChangesTest2 +'/// Check if tabpage "Asian Typography" appear or not -- Format/Paragraph + call hNewDocument + + '/// turn on "Asian Language support" , check if tabpage "Asian Typography" appears + Call CheckAsianLanguageSupport("On") + + Kontext + FormatParagraph + + try + Active.SetPage TabAsianTypography + Kontext "TabAsianTypography" + TabAsianTypography.Cancel + catch + Active.SetPage TabAusrichtungAbsatz + Kontext "TabAusrichtungAbsatz" + TabAusrichtungAbsatz.Cancel + warnlog "Something wring in tabpage - Asian Typography!" + endcatch + + '/// turn off "Asian Language support" , check if tabpage "Asian Typography" disappear + if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then + Call CheckAsianLanguageSupport("Off") + + Kontext + FormatParagraph + + try + Active.SetPage TabAsianTypography + Kontext "TabAsianTypography" + TabAsianTypography.Cancel + warnlog "tabpage - Asian Typography should NOT appear!" + catch + Active.SetPage TabAusrichtungAbsatz + Kontext "TabAusrichtungAbsatz" + TabAusrichtungAbsatz.Cancel + endcatch + end if + + Call hCloseDocument +endcase + +'------------------------------------------------------------------------- + +testcase tWriterUIChangesTest3 +'/// Check if list box "Asian text font" appear or not -- Format/Character + call hNewDocument + + '/// turn on "Asian Language support" , Check if list box "Asian text font" appear + Call CheckAsianLanguageSupport("On") + + Kontext + FormatCharacter + Kontext + active.SetPage TabFont + kontext "TabFont" + try + FontEast.Select 1 + catch + warnlog "Something wrong in list box Asian text font when Asian Language support is on" + endcatch + TabFont.Cancel + + '/// turn off "Asian Language support" , Check if list box "Asian text font" disappear + if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then + Call CheckAsianLanguageSupport("Off") + + Kontext + FormatCharacter + Kontext + active.SetPage TabFont + kontext "TabFont" + try + FontEast.Select 1 + warnlog "Something wrong in list box Asian text font when Asian Language support is off" + catch + endcatch + TabFont.Cancel + end if + + Call hCloseDocument +endcase + +'------------------------------------------------------------------------- + +testcase tWriterUIChangesTest4 +'/// Check if list box "Emphasis mark" appear or not -- Format/Character + call hNewDocument + + '/// turn on "Asian Language support" , Check if list box "Emphasis mark" appear + Call CheckAsianLanguageSupport("On") + + Kontext + FormatCharacter + Kontext + active.SetPage TabFontEffects + kontext "TabFontEffects" + try + Emphasis.Select 1 + catch + warnlog "Something wrong in list box Emphasis mark when Asian Language support is on" + endcatch + TabFontEffects.Cancel + + '/// turn off "Asian Language support" , Check if list box "Emphasis mark" disappear + if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then + Call CheckAsianLanguageSupport("Off") + + Kontext + FormatCharacter + Kontext + active.SetPage TabFontEffects + kontext "TabFontEffects" + try + Emphasis.Select 1 + warnlog "Something wrong in list box Emphasis mark when Asian Language support is off" + catch + endcatch + TabFontEffects.Cancel + end if + + Call hCloseDocument +endcase + +'------------------------------------------------------------------------- + +testcase tWriterUIChangesTest5 +'/// Check if tabpage "Searching in Japanese" appear or not -- tools/options/language settings/ + call hNewDocument + + '/// turn on "Asian Language support" , Check if tabpage "Searching in Japanese" appear + Call CheckAsianLanguageSupport("On") + + ToolsOptions + if hToolsOptions("LANGUAGESETTINGS","SEARCHINGINJAPANESE") <> TRUE then + warnlog "Something wrong in tabpage Searching in Japanese when Asian Language support is on" + end if + + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.Cancel + + '/// turn on "Asian Language support" , Check if tabpage "Searching in Japanese" disappear + if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then + Call CheckAsianLanguageSupport("Off") + ToolsOptions + + if hToolsOptions("LANGUAGESETTINGS","SEARCHINGINJAPANESE" , TRUE) = FALSE then + printLog Chr(13) + "Yes, 'Searching Japanese'-page has been disabled after switching Asian Language Support 'off'." + else + warnlog "Something wrong in tabpage Searching in Japanese when Asian Language support is off" + end if + + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.Cancel + end if + + Call hCloseDocument +endcase + +'------------------------------------------------------------------------- + +testcase tWriterUIChangesTest6 +'/// Check if tabpage "Asian Layout" appear or not -- tools/options/language settings/ + call hNewDocument + + '/// turn on "Asian Language support" , Check if tabpage "Asian Layout" appear + Call CheckAsianLanguageSupport("On") + + ToolsOptions + if hToolsOptions("LANGUAGESETTINGS","ASIANLAYOUT") <> TRUE then + warnlog "Something wrong in tabpage Asian Layout when Asian Language support is on" + end if + + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.Cancel + + '/// turn off "Asian Language support" , Check if tabpage "Asian Layout" disappear + if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then + Call CheckAsianLanguageSupport("Off") + ToolsOptions + + if hToolsOptions("LANGUAGESETTINGS","ASIANLAYOUT", TRUE) = FALSE then + printLog Chr(13) + "Yes, 'Asian Layout'-page has been disabled after switching 'Asian Language Support' off." + else + warnlog "Something wrong in tabpage Asian Layout when Asian Language support is off" + end if + + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.Cancel + end if + + Call hCloseDocument +endcase + +'------------------------------------------------------------------------- + +testcase tWriterUIChangesTest7 +'/// Check if menu format/Ruby is active or not + call hNewDocument + + '/// turn on "Asian Language support" , Check if menu format/Ruby is actived + Call CheckAsianLanguageSupport("On") + + try + formatRuby + Kontext "RubyDialog" + DialogClose.Click + Sleep 2 + catch + warnlog "Something wrong in menu format/Ruby when Asian Language support is on" + endcatch + + '/// turn off "Asian Language support" , Check if menu format/Ruby is inactived + if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then + Call CheckAsianLanguageSupport("Off") + + try + formatRuby + Kontext "RubyDialog" + DialogClose.Click + Sleep 2 + QAErrorlog "#i40913# Something wrong in menu format/Ruby when Asian Language support is off" + catch + endcatch + end if + + Call hCloseDocument +endcase + +'------------------------------------------------------------------------- + +testcase tWriterUIChangesTest8 +'/// Check if the following submenus in format/change case is active or not +'/// - Half width +'/// - Full width +'/// - Hiragana +'/// - Katagana + + call hNewDocument + + '/// turn on "Asian Language support" , Check if submenus in format/change case is actived + Call CheckAsianLanguageSupport("On") + + try + FormatChangeCaseHalfWidth + catch + warnlog "Something wrong in submenu format/change case -> Half width when Asian Language support is on" + endcatch + + try + FormatChangeCaseFullWidth + catch + warnlog "Something wrong in submenu format/change case -> Full width when Asian Language support is on" + endcatch + + try + FormatChangeCaseHiragana + catch + warnlog "Something wrong in submenu format/change case -> Hiragana when Asian Language support is on" + endcatch + + try + FormatChangeCaseKatagana + catch + warnlog "Something wrong in submenu format/change case -> Katagana when Asian Language support is on" + endcatch + + '/// turn off "Asian Language support" , Check if submenus in format/change case is inactived + if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then + Call CheckAsianLanguageSupport("Off") + + try + FormatChangeCaseHalfWidth + QAErrorlog "#i43434# Something wrong in submenu format/change case -> Half width when Asian Language support is off" + catch + endcatch + + try + FormatChangeCaseFullWidth + QAErrorlog "#i43434# Something wrong in submenu format/change case -> Full width when Asian Language support is off" + catch + endcatch + + try + FormatChangeCaseHiragana + QAErrorlog "#i43434# Something wrong in submenu format/change case -> Hiragana when Asian Language support is off" + catch + endcatch + + try + FormatChangeCaseKatagana + QAErrorlog "#i43434# Something wrong in submenu format/change case -> Katagana when Asian Language support is off" + catch + endcatch + end if + + Call hCloseDocument +endcase + +'------------------------------------------------------------------------- + +testcase tWriterUIChangesTest9 +'/// Check if list box text direction appear or not + call hNewDocument + + '/// turn on "Asian Language support" , Check if list box text direction appear + Call CheckAsianLanguageSupport("On") + + FormatPageWriter + Kontext + Active.SetPage TabSeite + Kontext "TabSeite" + + try + Textfluss.select 1 + catch + warnlog "Something wrong in list box text direction when Asian Language support is on" + endcatch + TabSeite.Cancel + + '/// turn off "Asian Language support" , Check if list box text direction disappear + if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then + Call CheckAsianLanguageSupport("Off") + + FormatPageWriter + Kontext + Active.SetPage TabSeite + Kontext "TabSeite" + + try + Textfluss.select 1 + warnlog "Something wrong in list box text direction when Asian Language support is off" + catch + endcatch + TabSeite.Cancel + end if + + Call hCloseDocument +endcase + +'------------------------------------------------------------------------- + +testcase tWriterUIChangesTest10 + + '/// Check if vertical text box and callout appear or not + call hNewDocument + + '/// turn on "Asian Language support" , Check if vertical text box and callout appear + Call CheckAsianLanguageSupport("On") + sleep(1) + + Call hToolbarSelect("DRAWING", true) + try + VerticalText.Click + catch + warnlog "Something wrong in vertical text box when Asian Language support is on" + endcatch + try + VerticalCallout.Click + catch + warnlog "Something wrong in vertical text callout when Asian Language support is on" + endcatch + + '/// turn off "Asian Language support" , Check if vertical text box and callout disappear + if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then + Call CheckAsianLanguageSupport("Off") + Kontext "Drawbar" + try + VerticalText.Click + warnlog "Something wrong in vertical text box when Asian Language support is off" + catch + endcatch + try + VerticalCallout.Click + warnlog "Something wrong in vertical text callout when Asian Language support is off" + catch + endcatch + end if + + Call hCloseDocument + +endcase + +'------------------------------------------------------------------------- + +testcase tWriterUIChangesTest11 + + Dim iHopeNumber1 , iHopeNumber2 as Integer + dim i as integer + dim iCount as integer + + iHopeNumber1 = 38 + iHopeNumber2 = 19 + +'/// Check if the number in listbox numbering is right or not. +'/// [if the number of the listbox numbering is changed, this case should be modified according] + + call hNewDocument + + '/// turn on "Asian Language support" , Check if the number in listbox numbering is right + Call CheckAsianLanguageSupport("On") + + FormatNumberingBullets + Kontext + Active.SetPage TabOptionenNumerierung + Kontext "TabOptionenNumerierung" + + iCount = Numerierung.GetItemCount + if iCount = iHopeNumber1 then + Numerierung.Select 15 + TabOptionenNumerierung.OK + + printLog Chr(13) + "Pls. go to the printer to find if you can get a paper" + printLog Chr(13) + "which is printed like '-'.Otherwise , something wrong!" + '/// --Pls. go to the printer to find if you can get a paper which is printed like '-'. Otherwise , something is wrong! + + FilePrint + Kontext "Active" + if Active.Exists then + if Active.GetRT = 304 then + Active.Ok + QAErrorLog "No Default-Printer!" + Kontext "DruckenDlg" + Sleep 1 + DruckenDlg.Cancel + end if + else + Kontext "DruckenDlg" + Sleep 1 + DruckenDlg.OK + Sleep 5 + end if + else + for i =1 to iCount + printlog "("+i+"/"+iCount+"): "+Numerierung.getItemText(i) + next i + 'Referenze: + TabOptionenNumerierung.Cancel + warnlog "the number of list box numbering is wrong when Asian Language support is on; expected: " + iHopeNumber1 + "; is: " + iCount + end if + + 'print warning if no printer is available + kontext + if active.exists(5) then + qaErrorlog "print warning: '" + active.getText + "'" + active.ok + endif + + '/// turn off "Asian Language support" , Check if the number in listbox numbering is right + if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then + Call CheckAsianLanguageSupport("Off") + + FormatNumberingBullets + Kontext + Active.SetPage TabOptionenNumerierung + Kontext "TabOptionenNumerierung" + + iCount = Numerierung.GetItemCount + if iCount <> iHopeNumber2 then + for i =1 to iCount + printlog "("+i+"/"+iCount+"): "+Numerierung.getItemText(i) + next i + 'Referenze: + warnlog "the number of list box numbering is wrong when Asian Language support is off; expected: " + iHopeNumber2 + "; is: " + iCount + end if + TabOptionenNumerierung.Cancel + end if + + Call hCloseDocument +endcase + +'------------------------------------------------------------------------- + +testcase tProlongedVowelsTest1 +'/// Check if the default setting of "Prolonged vowels (ka-/kaa) will be ACTIVATED. + + call hNewDocument + + '/// turn on "Asian Language support" , Check if the default setting of "Prolonged vowels (ka-/kaa) is ACTIVATED. + Call CheckAsianLanguageSupport("On") + + ToolsOptions + Call hToolsOptions("LANGUAGESETTINGS","SEARCHINGINJAPANESE") + + if ProlongedSoundmarks.IsChecked <> TRUE then + warnlog "The default setting of 'Prolonged vowels (ka-/kaa)' isn't ACTIVATED." + end if + + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.Cancel + + Call hCloseDocument + +endcase + +'------------------------------------------------------------------------- + +testcase tCalcUIChangesTest_10 + +'/// Check if vertical text box and callout appear or not + + call hNewDocument + + '/// turn on "Asian Language support" , Check if vertical text box and callout appear + Call CheckAsianLanguageSupport("On") + sleep(1) + Call hToolbarSelect("DRAWING", true) + try + VerticalText.Click + catch + warnlog "Something wrong in vertical text box when Asian Language support is on" + endcatch + try + VerticalCallout.Click + catch + warnlog "Something wrong in vertical text callout when Asian Language support is on" + endcatch + + '/// turn off "Asian Language support" , Check if vertical text box and callout disappear + if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then + Call CheckAsianLanguageSupport("Off") + Kontext "Drawbar" + try + VerticalText.Click + warnlog "Something wrong in vertical text box when Asian Language support is off" + catch + endcatch + try + VerticalCallout.Click + warnlog "Something wrong in vertical text callout when Asian Language support is off" + catch + endcatch + end if + + Call hCloseDocument + +endcase + +'------------------------------------------------------------------------- + +testcase tImpressUIChangesTest_10 + + '/// Check if vertical text box and callout and fit vertical text to frame appear or not + call hNewDocument + + '/// turn on "Asian Language support" , Check if vertical text box appear + Call CheckAsianLanguageSupport("On") + sleep(1) + Kontext "Drawbar" + sleep(1) + try + VerticalText.Click + catch + warnlog "Something wrong in vertical text box when Asian Language support is on" + endcatch + + '/// turn off "Asian Language support" , Check if vertical text box disappear + if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then + Call CheckAsianLanguageSupport("Off") + sleep(1) + Kontext "Drawbar" + try + VerticalText.Click + warnlog "Something wrong in vertical text box when Asian Language support is off" + catch + endcatch + end if + + Call hCloseDocument + +endcase + +'------------------------------------------------------------------------- + +testcase tDrawUIChangesTest_10 + + '/// Check if vertical text box and callout and fit vertical text to frame appear or not + call hNewDocument + + '/// turn on "Asian Language support" , Check if vertical text box appear + Call CheckAsianLanguageSupport("On") + Kontext "Drawbar" + sleep(1) + try + VerticalText.Click + catch + warnlog "Something wrong in vertical text box when Asian Language support is on" + endcatch + + '/// turn off "Asian Language support" , Check if vertical text box disappear + if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then + Call CheckAsianLanguageSupport("Off") + Kontext "Drawbar" + try + VerticalText.Click + warnlog "Something wrong in vertical text box when Asian Language support is off" + catch + endcatch + end if + + Call hCloseDocument + +endcase + +'------------------------------------------------------------------------- diff --git a/testautomation/framework/optional/includes/CJK_RubyDialogueProposal_1.inc b/testautomation/framework/optional/includes/CJK_RubyDialogueProposal_1.inc new file mode 100755 index 000000000000..aef2fdaa07da --- /dev/null +++ b/testautomation/framework/optional/includes/CJK_RubyDialogueProposal_1.inc @@ -0,0 +1,396 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: CJK_RubyDialogueProposal_1.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : CJK Ruby Dialogue Proposal Test +'* +'\*********************************************************************** + +testcase tRubyDialog_1 + + Dim sBaseText , sRubyText as String + Dim sBaseText1 , sRubyText1 as String + + sBaseText = "BaseText" + sRubyText = "RubyText" + + sBaseText1 = "BaseText1" + sRubyText1 = "RubyText1" + +'/// Check Apply and Close button in Ruby dialogue + Call hNewDocument + +'/// Check close button. +'/// open ruby dialogue , input base text and ruby text , then press close button +'/// 1) check if the ruby dialogue is closed +'/// 2) check if the base text and ruby text is recorded + FormatRuby + Kontext "RubyDialog" + Sleep 3 + BasisText1.SetText sBaseText + Sleep 1 + RubyText1.SetText sRubyText + Sleep 1 + + DialogClose.Click + Sleep 1 + + if RubyDialog.Exists then + Warnlog "The Ruby dialogue is NOT closed !" + end if + + FormatRuby + Kontext "RubyDialog" + Sleep 3 + if Len(BasisText1.GetText) <> 0 then Warnlog "The base text should not been inputed" + if Len(RubyText1.SetText) <> 0 then Warnlog "The ruby text should not been inputed" + +'/// Check Apply button -- Normally , we think it is RubyDialog.OK +'/// open ruby dialogue , input base text and ruby text , then press close button +'/// Press Apply button , then press close button +'/// check if the base text and ruby text is recorded + + BasisText1.SetText sBaseText1 + Sleep 1 + RubyText1.SetText sRubyText1 + Sleep 1 + + RubyDialog.OK + Sleep 2 + + DialogClose.Click + Sleep 1 + + EditSelectAll + Sleep 1 + + FormatRuby + Kontext "RubyDialog" + Sleep 3 + if BasisText1.GetText <> sBaseText1 then Warnlog "The base text should be "+sBaseText1 + " but get " + BasisText1.GetText + if RubyText1.GetText <> sRubyText1 then Warnlog "The ruby text should be "+sRubyText1 + " but get " + RubyText1.GetText + + DialogClose.Click + Sleep 1 + + Call hCloseDocument + +endcase + +'------------------------------------------------------------------------- + +testcase tRubyDialog_2 + + Dim sBaseText as String + + sBaseText = "test1 test2 test3 test4 test5 test6 test7 test8 test9" +'/// Test scrollbar in Ruby dialog + + Call hNewDocument + +'/// when there is less basetext, the scrollbar should appear + FormatRuby + Kontext "RubyDialog" + if RubyDialog.HasScrollbar <> TRUE then warnlog "The Scrollbar should appear when less basetext!" + DialogClose.Click + Sleep 1 + +'/// when there is more basetext(here is >4), the scrollbar should appear + Kontext "DocumentWriter" + DocumentWriter.TypeKeys sBaseText + DocumentWriter.TypeKeys "<Shift Home>" + + FormatRuby + Kontext "RubyDialog" + if RubyDialog.HasScrollbar <> TRUE then warnlog "The Scrollbar should appear when more basetext!" + DialogClose.Click + Sleep 1 + + Call hCloseDocument + +endcase + +'------------------------------------------------------------------------- +testcase tRubyDialog_3 + + Dim sTestText as String + Dim sBaseText1, sBaseText2 as String + + sTestText = "Test1 Test2" + sBaseText1 = "Test1" + sBaseText2 = "Test2" + +'/// The list in ruby dialogure will be updated as soon as the uses +'/// selects new or further words of his text. +'/// The update will be done once the user changes his focus +'/// back to the Ruby-Dialogue from the text + + Call hNewDocument + +'/// input 2 test words, and mark the second + DocumentWriter.TypeKeys sTestText + DocumentWriter.TypeKeys "<Shift Left>" , 5 + +'/// There should be only the second test word in basetext1 in ruby dialogue + FormatRuby + Kontext "RubyDialog" + Sleep 2 + if BasisText1.GetText <> sBaseText2 then warnlog "The BaseText1 should be:" +sBaseText2 + " but get "+BasisText1.GetText + +'/// Mark 2 test words + Kontext "DocumentWriter" + try + DocumentWriter.TypeKeys "<Shift Home>" + Sleep 2 + catch + warnlog "The ruby dialogue is MODE less dialogue , the document can be edited!" + endcatch + +'/// Check if the 2 test words are all in the ruby dialogue when set forcus back to the dialogue + Kontext "RubyDialog" + Sleep 1 + 'this step is meaningless, just let the focus back to ruby dialogue + Adjust.Select 1 + Sleep 8 + if BasisText1.GetText <> sBaseText1 then warnlog "The BaseText1 should be:" +sBaseText1 + " but get "+BasisText1.GetText + Sleep 1 + if BasisText2.GetText <> sBaseText2 then warnlog "The BaseText2 should be:" +sBaseText2 + " but get "+BasisText2.GetText + + DialogClose.Click + Sleep 1 + + Call hCloseDocument + +endcase + +'------------------------------------------------------------------------- + +testcase tRubyDialog_4 + + Dim sCharacterStyle as String + dim i as integer + +'/// Check default setting for Character Style of Ruby Text + + select case iSprache + case 01 : sCharacterStyle = "Rubies" + case 33 : sCharacterStyle = "Rubys" + case 34 : sCharacterStyle = "Rubys" + case 39 : sCharacterStyle = "Testo Ruby" + case 46 : sCharacterStyle = "Rubytext" + case 49 : sCharacterStyle = "Rubys" + case 55 : sCharacterStyle = "Rubys" + case 81 : sCharacterStyle = "ふりがな" + case 82 : sCharacterStyle = "윗주 달기" ' not sure TBO + case 86 : sCharacterStyle = "拼音和注音符号" + case 88 : sCharacterStyle = "注音符號" + case else :' QAErrorLog "Now, the test does not support for the language " +iSprache + Goto endsub + end select + + Call hNewDocument + + FormatRuby + Kontext "RubyDialog" + Sleep 3 + if CharacterStyle.GetSelText <> sCharacterStyle then + warnlog "Default setting for Character Style of Ruby Text isn't right, should be "+sCharacterStyle + " but get "+CharacterStyle.GetSelText + for i = 1 to CharacterStyle.getItemCount + printlog "("+i+"/"+CharacterStyle.getItemCount+"): '"+CharacterStyle.getItemText(i)+"'" + next i + endif + DialogClose.Click + Sleep 1 + + Call hCloseDocument + +endcase + +'------------------------------------------------------------------------- + +testcase tRubyDialog_5 + + Dim sCharacterStyle as String + Dim sStyleName as String + Dim i as Integer + dim iCount as integer + dim bError as boolean + dim bWileExit as boolean + +'/// Check stylist + + select case iSprache + case 01 : sCharacterStyle = "Rubies" + case 33 : sCharacterStyle = "Rubys" + case 34 : sCharacterStyle = "Rubys" + case 39 : sCharacterStyle = "Testo Ruby" + case 46 : sCharacterStyle = "Rubytext" + case 49 : sCharacterStyle = "Rubys" + case 55 : sCharacterStyle = "Rubys" + case 81 : sCharacterStyle = "ふりがな" + case 82 : sCharacterStyle = "윗주 달기" ' not sure TBO was "덧말" + case 86 : sCharacterStyle = "拼音和注音符号" + case 88 : sCharacterStyle = "注音符號" + case else :' QAErrorLog "Now, the test does not support for the language " +iSprache + Goto endsub + end select + + sStyleName = "ZZZ-Test-ZZZ" + + Call hNewDocument + + '/// Open ruby dialogue + FormatRuby + Kontext "RubyDialog" + + '/// Click stylist button + CallStylist.Click + Sleep 2 + + Kontext "Stylist" + if Stylist.NotExists then + Warnlog "No Stylist with clicking Stylist button!" + end if + + '/// click Character Style + Zeichenvorlagen.Click + + ' needed to update the listbox count :-( + Vorlagenliste.typeKeys ("<end><up><down>") + iCount = Vorlagenliste.getItemCount + printlog iCount + i=1 + bWileExit = Vorlagenliste.getItemText (i) <> sCharacterStyle + while ((i<iCount+1) AND (bWileExit)) + printlog "" + (i) + ": " + Vorlagenliste.getItemText (i) + bWileExit = Vorlagenliste.getItemText (i) <> sCharacterStyle + inc (i) + wEnd + if (i = iCount+1) then + warnlog "Style (Rubies) not found: '" + sCharacterStyle + "' inside of entries: " + iCount + bError = true + else + printlog "Style (Rubies) found: '" + sCharacterStyle + "' @ position: ("+(i)+"/"+icount+")" + Vorlagenliste.select (i) + bError = false + endif + + if (NOT bError) then + '/// find entry ruby and add a new entry + AusSelektion.OpenMenu + Sleep 1 + printlog "hMenuSelect 1" + hMenuSelectNr(1) + printlog "hMenuSelect 1 survived" + Sleep 1 + + Kontext "VorlageErzeugen" + Sleep 1 + Vorlagenname.SetText sStyleName + Sleep 1 + VorlageErzeugen.OK + Sleep 2 + + '/// check if the new entry is in the Character Style list box in ruby dialogue + Kontext "RubyDialog" + + ' needed to update the listbox count :-( + CharacterStyle.typeKeys ("<end><up><down>") + iCount = CharacterStyle.GetItemCount + i=0 + bWileExit = true + while ((i<(iCount+1)) AND (bWileExit)) + bWileExit = CharacterStyle.getItemText (i+1) <> sStyleName + inc (i) + printlog "" + (i) + ": " + CharacterStyle.getItemText (i) + wEnd + printlog CharacterStyle.GetItemCount + if ((i = iCount) AND bWileExit) then + warnlog "New created entry not found: '" + sStyleName + "' inside of entries: " + iCount + bError = true + else + printlog "New created entry found: '" + sStyleName + "' @ position: ("+(i)+"/"+icount+")" + CharacterStyle.select (i) + bError = false + endif + + if (NOT bError) then + '/// delete the new entry and recover to the default. + Kontext "Stylist" + iCount = Vorlagenliste.getItemCount + i=0 + while ((i<iCount) AND (Vorlagenliste.getItemText (i+1) <> sStyleName)) + inc (i) + printlog "" + (i) + ": " + Vorlagenliste.getItemText (i) + wEnd + if (i = iCount) then + warnlog "Style (Rubies) not found for deleting: '" + sStyleName + "' inside of entries: " + iCount + bError = true + else + printlog "Style (Rubies) found, will delete it now: '" + sStyleName + "' @ position: ("+i+"/"+icount+")" + Vorlagenliste.select (i+1) + bError = false + iCount = Vorlagenliste.getItemCount + Vorlagenliste.TypeKeys "<Delete>" + sleep(1) + Kontext "Active" + if active.exists(5) then + printlog "active about deleting; say yes to: '" + active.getText + "'" + Active.Yes + else + warnlog "No warning, before deleting style." + endif + sleep 1 + Kontext "Stylist" + i = Vorlagenliste.getItemCount + if ( (iCount-1) <> i) then + warnlog "Style wasn't deleted; count is still the same: " + i + "/" + iCount + else + printlog "Style was deleted; Count is OK: " + i + "/" + iCount + endif + endif + endif + endif + + Kontext "Stylist" + Stylist.Close + Sleep 1 + Kontext "RubyDialog" + DialogClose.Click + Sleep 1 + + Call hCloseDocument +endcase + + diff --git a/testautomation/framework/optional/includes/NewSortingAlgorithmForJapanese_1.inc b/testautomation/framework/optional/includes/NewSortingAlgorithmForJapanese_1.inc new file mode 100755 index 000000000000..041793898633 --- /dev/null +++ b/testautomation/framework/optional/includes/NewSortingAlgorithmForJapanese_1.inc @@ -0,0 +1,249 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: NewSortingAlgorithmForJapanese_1.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* 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 : hercule.li@sun.com +'* +'* short description : New Sorting Algorithm For Japanese Test +'* +'\*********************************************************************** + +testcase NewSortingForJapanese_1 + +'///Check if editbox "Entry Phonetic Reading " appear or not -- insert/index and tables /entry + call hNewDocument + + '/// turn off "Asian Language support" , check if editbox "Entry Phonetic Reading " appear is invisible + if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then + Call CheckAsianLanguageSupport("Off") + Sleep 1 + + Kontext + Sleep 3 + InsertIndexesEntry + Sleep 2 + Kontext "VerzeichniseintragEinfuegen" + Sleep 1 + Verzeichniseintrag.SetText "test" + if EntryPhoneticReading.IsVisible = TRUE then warnlog "The Entry Phonetic Reading editbox should NOT be visible!" + VerzeichniseintragEinfuegen.Close + end if + + '/// turn on "Asian Language support" , check if editbox "Entry Phonetic Reading " appear is visible + Call CheckAsianLanguageSupport("On") + + Kontext + Sleep 3 + InsertIndexesEntry + Sleep 2 + Kontext "VerzeichniseintragEinfuegen" + Sleep 1 + Verzeichniseintrag.SetText "test" + if EntryPhoneticReading.IsVisible <> TRUE then warnlog "The Entry Phonetic Reading editbox should be visible!" + VerzeichniseintragEinfuegen.Close + + Call hCloseDocument + +endcase + +'------------------------------------------------------------------------- + +testcase NewSortingForJapanese_2 + +'/// Check if editbox "Entry Phonetic Reading " is enabled or not -- insert/index and tables /entry + call hNewDocument + + InsertIndexesEntry + Sleep 3 + Kontext "VerzeichniseintragEinfuegen" + Sleep 2 + if EntryPhoneticReading.IsEnabled = TRUE then warnlog "The Entry Phonetic Reading editbox should NOT be enabled!" + + Verzeichniseintrag.SetText "test" + + if EntryPhoneticReading.IsEnabled <> TRUE then warnlog "The Entry Phonetic Reading editbox should be enabled!" + VerzeichniseintragEinfuegen.Close + + Call hCloseDocument + +endcase + +'------------------------------------------------------------------------- + +testcase NewSortingForJapanese_3 + + Dim iTypeList , iNumberOfKeyType as Integer + Dim sJapaneseLocation as String + Dim i as integer + + iTypeList = 2 + iNumberOfKeyType = 4 + sJapaneseLocation = fGetCountryName(81) + + if Len(sJapaneseLocation) = 0 then Goto endsub + +'/// Check the number of key type in sort area when choose japanese language + call hNewDocument + +'/// Open with Insert/Index and tables/Index and tables / tabpage index/table + InsertIndexes + Kontext + Active.SetPage TabVerzeichnisseVerzeichnis + Kontext "TabVerzeichnisseVerzeichnis" + +'/// choose Alphabetical index in type and choose Japanese Language + VerzeichnisTyp.Select iTypeList + try + SortLanguage.Select (sJapaneseLocation) + catch + qaErrorLog "Entry not found: '" + sJapaneseLocation + "' trying english entry: 'Japanese'" + try + SortLanguage.Select ("Japanese") + catch + warnlog "'Japanese' isn't available either" + for i = 1 to SortLanguage.getItemCount + printlog "" + i + ": '" + SortLanguage.getItemText(i) + "'" + next i + endcatch + endcatch + Sleep 1 + +'/// Check the number of key type in sort area + if SortKeyType.GetItemCount <> iNumberOfKeyType then + warnlog "The number of key type is wrong, hope :" +iNumberOfKeyType + " but get:" +SortKeyType.GetItemCount + end if +try + TabVerzeichnisseVerzeichnis.Cancel +catch +warnlog "#135631# crash on canceling Insert Indexes and Tables" +endcatch + Call hCloseDocument + +endcase + +'------------------------------------------------------------------------- + +testcase NewSortingForJapanese_4 + + Dim iNumberOfKeyType as Integer + Dim sJapaneseLocation as String + + iNumberOfKeyType = 4 + sJapaneseLocation = fGetCountryName(81) + + if Len(sJapaneseLocation) = 0 then Goto endsub + +'/// Check the number of key type in data/sort + call hNewDocument + DocumentWriter.TypeKeys "test" + DocumentWriter.TypeKeys "<Shift Home>" + +'/// Open Tools/Sort + ToolsSort + Kontext "Sortieren" + +'/// choose Alphabetical index in type and choose Japanese Language + try + Sprache.Select sJapaneseLocation + catch + qaErrorLog "Entry not found: '" + sJapaneseLocation + "' trying english entry: 'Japanese'" + try + Sprache.Select ("Japanese") + catch + warnlog "'Japanese' isn't available either" + for i = 1 to Sprache.getItemCount + printlog "" + i + ": '" + Sprache.getItemText(i) + "'" + next i + endcatch + endcatch + Sleep 1 + +'/// Check the number of key type in sort area + if Schluesseltyp1.GetItemCount <> iNumberOfKeyType then + warnlog "The number of key type is wrong, hope :" +iNumberOfKeyType + " but get:" +Schluesseltyp1.GetItemCount + end if + + Sortieren.Cancel + + Call hCloseDocument + +endcase + +'------------------------------------------------------------------------- + +testcase NewSortingForJapanese_5 + + Dim iNumberOfOption as Integer + Dim sJapaneseLocation as String + + iNumberOfOption = 3 + sJapaneseLocation = fGetCountryName(81) + + if Len(sJapaneseLocation) = 0 then Goto endsub + +'/// Check the number of key type in data/sort -- Calc + call hNewDocument + +'/// Open Data/Sort ,tabpage option + DataSort + Kontext + active.SetPage TabSortierenOptionen + Kontext "TabSortierenOptionen" + +'/// choose Alphabetical index in type and choose Japanese Language + try + Sprache.Select sJapaneseLocation + catch + qaErrorLog "Entry not found: '" + sJapaneseLocation + "' trying english entry: 'Japanese'" + try + Sprache.Select ("Japanese") + catch + warnlog "'Japanese' isn't available either" + for i = 1 to Sprache.getItemCount + printlog "" + i + ": '" + Sprache.getItemText(i) + "'" + next i + endcatch + endcatch + Sleep 1 + +'/// Check the number of key type in sort area + if Optionen.GetItemCount <> iNumberOfOption then + warnlog "The number of option is wrong, hope :" +iNumberOfOption + " but get:" +Optionen.GetItemCount + end if + + TabSortierenOptionen.Cancel + + Call hCloseDocument + +endcase + +'------------------------------------------------------------------------- diff --git a/testautomation/framework/optional/includes/basic_delete_modules.inc b/testautomation/framework/optional/includes/basic_delete_modules.inc new file mode 100755 index 000000000000..c5720c232adf --- /dev/null +++ b/testautomation/framework/optional/includes/basic_delete_modules.inc @@ -0,0 +1,113 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_delete_modules.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Delete modules while BASIC is running +'* +'\****************************************************************************** + +testcase tDeleteModulesAtRunningBasic + + Dim i as Integer + Dim iSel as Integer + dim brc as boolean + + '///<h1>Work with macros - delete Modules while BASIC-IDE is running</h1> + + '///<ul> + '///<li>open a new writer-doc</li> + printlog "open a new writer-doc" + gApplication = "Writer" + + Call hNewDocument() + + '///<li>create a new module for the new document (named TTModule)</li> + printlog "create a new module " + brc = hOpenBasicOrganizerFromDoc() + brc = hCreateModuleForDoc() + + '///<li>insert a short script (1. page)</li> + printlog "insert a short script (1. page)" + + brc = hInsertMacro( 1 ) + + kontext "macrobar" + printlog "- Click button: Step Procedure" + '///<li>activate "Step Procedure" on Toolbar</li> + ProcedureStep.Click + if ( WaitSlot( 3000 ) <> WSFinished ) then + warnlog( "Slot not finished within 1 second" ) + endif + + '///<li>check if disabled menu-items are shown and delete is not shown</li> + + kontext "basicide" + printlog "check if disabled menu items are shown in context menu and 'delete' is not shown" + Tabbar.OpenContextMenu + + try + + if hMenuItemGetCount = 5 then + warnlog "Disabled entries are shown in context menu on tab bar => bugID 101972" + end if + + + if hMenuItemGetCount = 3 then + warnlog "Delete is active in context menu for a running macro => BUG!" + end if + + catch + warnlog "Unable to retrieve the number of menuitems" + endcatch + + hMenuClose + '///<li>stop the running script</li> + printlog "Stop the running script" + + kontext "macrobar" + BasicStop.Click + if ( WaitSlot <> WSFinished ) then + warnlog( "Slot not finished within 1 second" ) + endif + + + '///<li>close the BasicIDE and the document</li> + printlog "close the documents" + Call hCloseDocument() + Call hCloseDocument() + + '///</ul> + +endcase + diff --git a/testautomation/framework/optional/includes/basic_dialog_i18n_copy_control.inc b/testautomation/framework/optional/includes/basic_dialog_i18n_copy_control.inc new file mode 100755 index 000000000000..afa3aea54b91 --- /dev/null +++ b/testautomation/framework/optional/includes/basic_dialog_i18n_copy_control.inc @@ -0,0 +1,241 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_dialog_i18n_copy_control.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : Joerg.Skottke@Sun.Com +'* +'* short description : Copy a control with i18n data +'* +'\****************************************************************************** + +testcase tBasicDialogI18nCopyControl + + '///<h1>Copy a formcontrol with i18n data within BASIC IDE</h1> + '///<u><pre>Synopsis</pre></u>Apply localization to a form control and copy + '///+ it within the BASIC IDE. Verify that the localized data is preserved<br> + '///<u><pre>Specification document</pre></u><a href="http://specs.openoffice.org/appwide/dialog_ide/GUI_Translation_in_Dialog_IDE.odt"> + '///+ GUI translation in Dialog IDE</a><br> + '///<u><pre>Files used</pre></u>None<br> + '///<u><pre>Test case specification</pre></u> + + const COMMAND_BUTTON = 1 ' id of the command button (formcontrols.inc) + const DIALOG_NAME = "DialogExport" ' Name of the first module + const LANGUAGES_TO_COPY = 5 ' Only copy n languages + const TARGET_DIALOG = "Target" ' The name of the dialog the control is pasted to + + dim cLanguageList( LANGUAGES_TO_COPY ) as string ' Note: Index 0 is used + dim iCurrentLanguage as integer + + ' These are the strings used to simulate localized text + dim cIDStrings( 5 ) as string + cIDStrings( 0 ) = "language_a" + cIDStrings( 1 ) = "language_b" + cIDStrings( 2 ) = "language_c" + cIDStrings( 3 ) = "language_d" + cIDStrings( 4 ) = "language_e" + cIDStrings( 5 ) = "language_f" + + dim cTempString as string + + ' These are the IDE internal coordinates of the control, used to restore + ' identical coordinates in the source and target dialogs + dim iOriginalCoordinates( 4 ) as integer + + ' Some multi purpose returncode + dim brc as boolean + + '///<ul> + '///+<li>Create a new document</li> + hCreateDocument() + + '///+<li>Open the Macro Organizer</li> + '///+<li>Create a new module for the document</li> + '///+<li>Open the BASIC IDE</li> + '///+<li>Create a new Dialog via the tabbar at the bottom of the IDE</li> + printlog( "Test init: Setting up environment" ) + brc = hInitFormControls( DIALOG_NAME ) + if ( not brc ) then + warnlog( "Failed to initialize BASIC IDE/Dialog editor, aborting" ) + goto endsub + endif + + '///+<li>Draw a Command Button</li> + hDrawControlOnDialog( COMMAND_BUTTON ) + + '///+<li>Retrieve the current BASIC IDE internal coordinates of the control for + '///+ later usage</li> + hOpenPropertyBrowser() + kontext "TabGeneralControl" + printlog( "Get internal coordinates for the control" ) + iOriginalCoordinates( 1 ) = height.getText() + iOriginalCoordinates( 2 ) = width.getText() + iOriginalCoordinates( 3 ) = PosX.getText() + iOriginalCoordinates( 4 ) = PosY.getText() + printlog( "Height: " & iOriginalCoordinates( 1 ) ) + printlog( "Width.: " & iOriginalCoordinates( 2 ) ) + printlog( "Pos X.: " & iOriginalCoordinates( 3 ) ) + printlog( "Pos Y.: " & iOriginalCoordinates( 4 ) ) + hClosePropertyBrowser() + + qaerrorlog( "#i80456# properties button not enabled when a formcontrol is inserted via keyboard" ) + + '///+<li>Click Manage Language button on ToolsCollection Bar</li> + kontext "ToolsCollectionBar" + ManageLanguage.click() + + '///+<li>Add a default language</li> + kontext "ManageUILanguages" + if ( ManageUILanguages.exists( 2 ) ) then + + add.click() + + kontext "SetDefaultLanguage" + if ( SetDefaultLanguage.exists( 1 ) ) then + SetDefaultLanguage.ok() + else + warnlog( "Set Default Language dialog is missing" ) + endif + else + warnlog( "Unable to open Manage UI Languages dialog" ) + endif + + '///+<li>Add a number of additional languages</li> + kontext "ManageUILanguages" + if ( ManageUILanguages.exists( 1 ) ) then + + add.click() + + kontext "AddUserInterface" + if ( AddUserInterface.exists( 1 ) ) then + for iCurrentLanguage = 1 to LANGUAGES_TO_COPY + AddNewControl.select( iCurrentLanguage ) + AddNewControl.check() + next iCurrentLanguage + AddUserInterface.ok() + else + warnlog( "Add User Interface Language dialog is missing" ) + endif + else + warnlog( "Unable to open Manage UI Languages dialog" ) + endif + + '///+<li>Store the installed languages for further usage</li> + kontext "ManageUILanguages" + for iCurrentLanguage = 0 to LANGUAGES_TO_COPY + PresentLanguages.select( iCurrentLanguage + 1 ) + cLanguageList( iCurrentLanguage ) = PresentLanguages.getSelText() + printlog( iCurrentLanguage & ": " & cLanguageList( iCurrentLanguage ) ) + next iCurrentLanguage + + '///+<li>Close the Manage UI Languages dialog</li> + kontext "ManageUILanguages" + ManageUILanguages.close() + + '///+<li>Change the property "NameText" for all languages</li> + printlog( "Localizing control" ) + for iCurrentLanguage = 0 to LANGUAGES_TO_COPY + kontext "TranslationBar" + CurrentLanguage.select( iCurrentLanguage + 1 ) + kontext "BasicIde" + hSelectControl( COMMAND_BUTTON ) + hOpenPropertyBrowser() + printlog( "Setting string: " & cIDStrings( iCurrentLanguage ) ) + kontext "TabGeneralControl" + NameText.typeKeys( cIDStrings( iCurrentLanguage ) & "<RETURN>" ) + hClosePropertyBrowser() + next iCurrentLanguage + + '///+<li>Execute edit/copy on the currently selected command button</li> + printlog( "Copy control" ) + EditCopy + + '///+<li>Create a second dialog</li> + printlog( "New dialog" ) + Call hNewDialog() + + '///+<li>Paste the content of the clipboard (the control) to the dialog window</li> + printlog( "Paste control" ) + EditPaste + + '///+<li>Apply the coordinates from the source control (the control is placed + '///+ at random within the dialog pane, now we move it to the same coordinates + '///+ as its source control). We wouldn't be able to handle it otherwise</li> + hOpenPropertyBrowser() + kontext "TabGeneralControl" + printlog( "Set coordinates to be identical with those from the source control" ) + PosX.typeKeys ( ) + PosX.typeKeys ( "<HOME><SHIFT END>" & iOriginalCoordinates( 3 ) & "<RETURN>" ) + PosY.typeKeys ( "<HOME><SHIFT END>" & iOriginalCoordinates( 4 ) & "<RETURN>" ) + Height.typeKeys( "<HOME><SHIFT END>" & iOriginalCoordinates( 1 ) & "<RETURN>" ) + Width.typeKeys ( "<HOME><SHIFT END>" & iOriginalCoordinates( 2 ) & "<RETURN>" ) + hClosePropertyBrowser + + + '///+<li>Retrieve the current BASIC IDE internal coordinates of the control for + '///+ later usage</li> + hOpenPropertyBrowser() + kontext "TabGeneralControl" + printlog( "Get internal coordinates for the control" ) + iOriginalCoordinates( 1 ) = height.getText() + iOriginalCoordinates( 2 ) = width.getText() + iOriginalCoordinates( 3 ) = PosX.getText() + iOriginalCoordinates( 4 ) = PosY.getText() + printlog( "Height: " & iOriginalCoordinates( 1 ) ) + printlog( "Width.: " & iOriginalCoordinates( 2 ) ) + printlog( "Pos X.: " & iOriginalCoordinates( 3 ) ) + printlog( "Pos Y.: " & iOriginalCoordinates( 4 ) ) + hClosePropertyBrowser() + + + '///+<li>Get the list of transferred languages from the translation bar</li> + kontext "TranslationBar" + for iCurrentLanguage = 0 to LANGUAGES_TO_COPY + CurrentLanguage.select( iCurrentLanguage + 1 ) + cTempString = CurrentLanguage.getSelText() + if ( cTempString = cLanguageList( iCurrentLanguage ) ) then + printlog( "Language <" & cTempString & "> was successfully copied" ) + else + warnlog( "Either a language was lost or the sort order changed" ) + printlog( "Expected: " & cLanguageList( iCurrentLanguage ) ) + printlog( "Found...: " & cTempString ) + endif + next iCurrentLanguage + + '///+<li> + '///</ul> + + kontext "BasicIde" + hDestroyDocument() + hDestroyDocument() + +endcase + diff --git a/testautomation/framework/optional/includes/basic_dialog_i18n_defaults.inc b/testautomation/framework/optional/includes/basic_dialog_i18n_defaults.inc new file mode 100755 index 000000000000..e635aae38e2c --- /dev/null +++ b/testautomation/framework/optional/includes/basic_dialog_i18n_defaults.inc @@ -0,0 +1,487 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_dialog_i18n_defaults.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Test correct handling of the default language +'* +'\****************************************************************************** + +testcase tBasicDialogI18nDefaults + + '///<h1>Test correct handling of the default language</h1> + '///<i>This test verifies that - if the user adds localization to the dialogs - + '///+ these are handled in a sensible way. This means that a) the first + '///+ language automatically becomes default, b) the languages really make it + '///+ from the language selection to the Manage UI Languages dialog and the + '///+ the listbox of the translation toolbar in the BASIC IDE. Switching + '///+ languages is tested, as well as the states of the three action buttons on + '///+ the Manage UI Languages dialog.</i><br> + + const MODULE_NAME = "defmod" + const FILE_NAME = "basic_defaults.odt" + + dim cWorkPath as string + cWorkPath = hGetWorkPath() & FILE_NAME + + dim brc as boolean + dim cMsg as string + + dim cDefLangSelect as string ' Default language from Select Default Language Dialog + dim cDefLangDialog as string ' Default language from Manage UI Languages dialog + dim cDefLangToolbar as string ' Default language from Translation Toolbar + dim cTmpLangString as string ' Temporary language string for comparision + dim cAdditionalLanguage as string + + dim iLangCount as integer + + '///<ul> + printlog( "Preparing testenvironment" ) + printlog( "Workfile is: " & cWorkPath ) + + '///+<li>Create a new document</li> + brc = hCreateDocument() + if ( not brc ) then + warnlog( "Failed to create a new document, aborting" ) + goto endsub + endif + + '///+<li>Save the file, overwrite existing if found</li> + brc = hFileSaveAsWithFilterKill( cWorkPath , "writer8" ) + + '///+<li>Open the basic organizer</li> + '///+<li>Create a new module for the current document</li> + '///+<li>Click to edit the module</li> + '///+<li>Create a dialog, switch to it and ensure that the ToolsCollectionBar is open</li> + brc = hInitFormControls( MODULE_NAME ) + if ( not brc ) then + warnlog( "Ups, bad again..." ) + endif + + printlog( "Dialog Editor is open, ToolsCollectionBar is visible. Good." ) + + printlog( "" ) + printlog( "Starting test (check control states, add default language)" ) + + '///+<li>Verify that the Translation Bar is hidden by default"</li> + kontext "TranslationBar" + if ( TranslationBar.exists( 1 ) ) then + warnlog( "The TranslationBar should not be exist/visible by default" ) + else + printlog( "The TranslationBar is hidden. Good." ) + endif + + Kontext "ToolsCollectionBar" + ManageLanguage.click() + + '///+<li>On the now open Language dialog test the default states of the controls</li> + kontext "ManageUILanguages" + if ( not ManageUILanguages.exists( 2 ) ) then + warnlog( "ManageUILanguages Dialog is not open, aborting test" ) + goto TestExit + endif + + printlog( "ManageUILanguages Dialog is open" ) + + '///<ul> + '///+<li>There should be no languages listed yet but a hint on how to continue</li> + iLangCount = PresentLanguages.getItemCount() + if ( iLangCount <> 1 ) then + warnlog( "There should only be one single entry in the languages listbox" ) + printlog( "Currently " & iLangCount & " entries are listed" ) + endif + + '///+<li>"Add..." should be enabled</li> + if ( not add.isEnabled() ) then + warnlog( "Add button should be enabled" ) + endif + + '///+<li>"Delete" should be disabled</li> + if ( delete.isEnabled() ) then + warnlog( "Delete button should be disabled" ) + endif + + + '///+<li>"Default" should be disabled</li> + if ( Default.isEnabled() ) then + warnlog( "Default button should be disabled" ) + endif + + '///</ul> + + '///+<li>Select the first and only entry in the list, it should not change the button states</li> + printlog( "Select the first/only entry to see whether the button states change" ) + PresentLanguages.select( 1 ) + printlog( "Entry is: " & PresentLanguages.getSelText() ) + '///<ul> + + '///+<li>"Add..." should be enabled</li> + if ( not add.isEnabled() ) then + warnlog( "Add button should be enabled" ) + endif + + '///+<li>"Delete" should be disabled</li> + if ( Delete.isEnabled() ) then + warnlog( "Delete button should be disabled" ) + endif + + '///+<li>"Default" should be disabled</li> + if ( Default.isEnabled() ) then + warnlog( "Default button should be disabled" ) + endif + '///</ul> + + '///+<li>Click "Add..." to add a default language</li> + printlog( "Add default language" ) + kontext "ManageUILanguage" + Add.click() + + kontext "SetDefaultLanguage" + if ( not SetDefaultLanguage.exists( 2 ) ) then + warnlog( "Default language selection dialog did not open" ) + kontext "ManageUILanguages" + ManageUILanguages.close() + goto TestExit + endif + + kontext "SetDefaultLanguage" + cDeflangSelect = DefaultLanguageListbox.getSelText() + iLangCount = DefaultLanguageListbox.getItemCount() + printlog( "Default language is: " & cDeflangSelect ) + printlog( "Total languages listed: " & iLangCount ) + SetDefaultLanguage.ok() + + + '///+<li>Test the language string and the states of the buttons on the dialog</li> + kontext "ManageUILanguages" + '///<ul> + '///+<li>There should be exactly one language listed</li> + iLangCount = PresentLanguages.getItemCount() + if ( iLangCount <> 1 ) then + warnlog( "There should only be one single entry in the languages listbox" ) + printlog( "Currently " & iLangCount & " entries are listed" ) + endif + + PresentLanguages.select( 1 ) + cDefLangDialog = PresentLanguages.getSelText() + if ( instr( cDefLangSelect, cDefLangDialog ) <> 0 ) then + warnlog( "The default language was not transported to the languages list" ) + else + printlog( "Ok, the string was copied correctly" ) + endif + printlog( "Select.: " & cDefLangSelect ) + printlog( "Dialog.: " & cDefLangDialog ) + + + '///+<li>"Add..." should be enabled</li> + if ( not add.isEnabled() ) then + warnlog( "Add button should be enabled" ) + endif + + '///+<li>"Delete" should be enabled</li> + if ( not Delete.isEnabled() ) then + warnlog( "Delete button should be enabled" ) + Delete.click() + kontext "active" + if ( active.exists( 1 ) ) then + printlog( "Removal warning is displayed. Good." ) + active.cancel() + else + warnlog( "Removal warning not displayed" ) + endif + endif + + '///+<li>"Default" should be disabled</li> + if ( Default.isEnabled() ) then + warnlog( "Default button should be disabled" ) + endif + '///</ul> + + '///+<li>Close the Manage UI Languages Dialog</li> + kontext "ManageUILanguages" + ManageUILanguages.close() + + + + '///+<li>Test the Translation Bar</li> + '///<ul> + kontext "TranslationBar" + printlog( "Testing the TranslationBar ..." ) + if ( TranslationBar.exists() ) then + printlog( "TranslationBar exists." ) + + '///+<li>Verify that the translation bar is visible</li> + if ( TranslationBar.isVisible() ) then + printlog( "TranslationBar is visible." ) + + '///+<li>Verify that the languages listbox is enabled</li> + if ( currentLanguage.isEnabled() ) then + printlog( "Languages list is enabled." ) + + '///+<li>Verify that the default language is the only item in the listbox</li> + if ( CurrentLanguage.getItemCount() = 1 ) then + printlog( "Exactly one item in listed in the listbox, good." ) + + ' Note that we need to test for a substring as the [default] marker + ' is not copied from the Select Default languages dialog + cDefLangToolbar = CurrentLanguage.getSelText() + if ( instr( cDefLangToolbar, cDefLangSelect ) <> 0 ) then + printlog( "The correct entry is in the languages list. Good." ) + else + warnlog( "The default language should be listed and selected." ) + endif + printlog( "Select.: " & cDefLangSelect ) + printlog( "Toolbar: " & cDefLangToolbar ) + + if ( cDefLangToolbar <> cDefLangDialog ) then + warnlog( "The default language did not copy to the toolbar" ) + else + printlog( "The default language was copied ok." ) + endif + printlog( "Dialog.: " & cDefLangDialog ) + printlog( "Toolbar: " & cDefLangToolbar ) + + else + warnlog( "There are too many entries in the languages list." ) + endif + else + warnlog( "The languages listbox is disabled." ) + endif + else + warnlog( "The Translation Bar is not visible." ) + endif + else + warnlog( "The Translation Bar does not exist." ) + endif + '///</ul> + + + '///+<li>Reopen ManageUILanguages dialog - this time by clicking the icon on the TranslationBar</li> + printlog( "Click ManageLanguages-button on the TranslationBar" ) + kontext "TranslationBar" + wait( 100 ) + ManageLanguage.click() + + '///+<li>The Manage UI Languages dialog should pop open</li> + kontext "ManageUILanguages" + if ( not ManageUILanguages.exists( 2 ) ) then + warnlog( "Failed to open Manage Languages dialog" ) + endif + + '///+<li>Verify that exactly one language is listed</li> + iLangCount = PresentLanguages.getItemCount() + if ( iLangCount <> 1 ) then + warnlog( "There should only be one single entry in the languages listbox" ) + printlog( "Currently " & iLangCount & " entries are listed" ) + endif + + '///+<li>Verify that it is marked as the default language</li> + PresentLanguages.select( 1 ) + cTmpLangString = Presentlanguages.getSeltext() + if ( cTmpLangString <> cDefLangDialog ) then + warnlog( "The dialog forgot the default language" ) + else + printlog( "The dialog remembers the default language. Good." ) + endif + printlog( "Expected: " & cDefLangDialog ) + printlog( "Found...: " & cTmpLangString ) + + '///+<li>Add another language, click on "Add..."</li> + kontext "ManageUILanguages" + Add.click() + + kontext "AddUserInterface" + if ( not AddUserInterface.exists( 1 ) ) then + warnlog( "Cannot add another language, the dialog is not open" ) + kontext "ManageUILanguages" + ManageUILanguages.close() + goto TestExit + endif + + '///+<li>Select the first language from the list (Check the Checkbox)</li> + AddNewControl.select( 1 ) + cAdditionalLanguage = AddNewControl.getSelText() + printlog( "Adding language: " & cAdditionalLanguage ) + AddNewControl.check() + + '///+<li>Click OK to add the language</li> + AddUserInterface.ok() + + kontext "ManageUILanguages" + if ( not ManageUILanguages.exists( 1 ) ) then + warnlog( "Could not return to Manage UI Languages dialog" ) + goto TestExit + endif + + '///+<li>Verify that the language shows up in the Manage UI Languages dialog" ) + kontext "ManageUILanguages" + iLangCount = PresentLanguages.getItemCount() + if ( iLangCount <> 2 ) then + warnlog( "There should be exactly two languages listed in the listbox" ) + printlog( "Currently " & iLangCount & " entries are listed" ) + goto TestExit + else + printlog( "Two languages listed in Manage UI Languages dialog. Good." ) + endif + + '///+<li>Verify that additional language is at position 2 (default is first)</li> + printlog( "Verify language in Manage UI Language dialog" ) + PresentLanguages.select( 2 ) + cTmpLangString = Presentlanguages.getSelText() + if ( cTmpLangString = cAdditionalLanguage ) then + printlog( "Found correct language at pos 2. Good" ) + else + warnlog( "The language is not listed at the expected position" ) + endif + printlog( "Expected: " & cAdditionalLanguage ) + printlog( "Found...: " & cTmpLangString ) + + '///+<li>Switch the default to the newly added language</li> + printlog( "Select second language and make it default" ) + PresentLanguages.select( 2 ) + Default.click() + cAdditionalLanguage = PresentLanguages.getSelText() + + '///+<li>Close the Manage UI Languages dialog</li> + printlog( "Close the Manage UI Languages dialog" ) + kontext "ManageUILanguages" + ManageUILanguages.close() + + '///+<li>Verify that the change in default makes it to the translation bar</li> + printlog( "Verify that the new default is on pos 2 in the TranslationBar list" ) + kontext "TranslationBar" + CurrentLanguage.select( 2 ) + cDefLangToolbar = CurrentLanguage.getSelText() + if ( cDefLangToolbar = cAdditionalLanguage ) then + printlog( "Found correct language at pos 2. Good." ) + else + warnlog( "The language is not listed at the expected position" ) + endif + printlog( "Expected: " & cAdditionalLanguage ) + printlog( "Found...: " & cDefLangToolbar ) + + '///+<li>The new default should be at pos 2 of the Manage UI Language dialog</li> + printlog( "Verify that the list on the Manage UI Language is still unsorted" ) + printlog( "The dafault language should be at pos 2" ) + ManageLanguage.click() + kontext "ManageUILanguages" + PresentLanguages.select( 2 ) + cTmpLangString = Presentlanguages.getSelText() + if ( cTmpLangString = cAdditionalLanguage ) then + printlog( "Found correct language at pos 2. Good" ) + else + warnlog( "The language is not listed at the expected position" ) + endif + printlog( "Expected: " & cAdditionalLanguage ) + printlog( "Found...: " & cTmpLangString ) + + '///+<li>Delete the default language</li> + printlog( "Delte the current default language" ) + Delete.click() + + '///+<li>Handle the warning</li> + printlog( "There should be a deletion warning" ) + kontext "Active" + if ( Active.exists( 2 ) ) then + cMsg = active.getText() + cMsg = hRemoveLineBreaks( cMsg ) + printlog( "Message: " & cMsg ) + Active.ok() + else + warnlog( "Deletion Warning missing" ) + endif + + '///+<li>Verify that there is only one item left</li> + printlog( "Verify deletion, the remaining language must be default now" ) + kontext "ManageUILanguages" + iLangCount = PresentLanguages.getItemCount() + if ( iLangCount <> 1 ) then + warnlog( "Only the default language should be listed" ) + printlog( "Currently " & iLangCount & " entries are listed" ) + endif + + '///+<li>Verify that this is the first language and that it is default</li> + PresentLanguages.select( 1 ) + cTmpLangString = Presentlanguages.getSeltext() + if ( cTmpLangString <> cDefLangDialog ) then + warnlog( "The dialog forgot the default language" ) + else + printlog( "The dialog sets the default language. Good." ) + endif + printlog( "Expected: " & cDefLangDialog ) + printlog( "Found...: " & cTmpLangString ) + + '///+<li>Select the first and only entry in the list, it should not change the button states</li> + printlog( "verify button states" ) + '///<ul> + + '///+<li>"Add..." should be enabled</li> + if ( not add.isEnabled() ) then + warnlog( "Add button should be enabled" ) + endif + + '///+<li>"Delete" should be disabled</li> + if ( not Delete.isEnabled() ) then + warnlog( "Delete button should be enabled" ) + endif + + '///+<li>"Default" should be disabled</li> + if ( Default.isEnabled() ) then + warnlog( "Default button should be disabled" ) + endif + '///</ul> + + '///+<li>Test exit, cleanup</li> + '///<ul> + TestExit: + printlog( "" ) + printlog( "Test exit, cleanup" ) + + '///+<li>Close Manage UI Languages dialog" ) + kontext "ManageUILanguages" + if ( ManageUILanguages.exists() ) then + ManageUILanguages.close() + endif + + '///+<li>Close the BASIC IDE</li> + hCloseBasicIde() + '///+<li>Close the document</li> + hCloseDocument() + '///+<li>Delete the workfile</li> + hDeleteFile( cWorkPath ) + '///</ul> + '///</ul> + +endcase + + diff --git a/testautomation/framework/optional/includes/basic_documents.inc b/testautomation/framework/optional/includes/basic_documents.inc new file mode 100755 index 000000000000..fa23c5147cad --- /dev/null +++ b/testautomation/framework/optional/includes/basic_documents.inc @@ -0,0 +1,243 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_documents.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : BASIC organizers and documents +'* +'\****************************************************************************** + +private const IDOCS = 5 + +testcase tBasicDocuments + + warnlog( "#i90435# Untitled documents unnumbered in BASIC organizer" ) + goto endsub + + const CFN = "tBasicDocuments::" + + '///<H1>Documents in BASIC organizers</H1> + '///<i>Compare the names of the documents listed in various treelists + '///+ in Basic Organizer and Basic Object Organizer (Manage...)</i> + '///<ul> + + dim brc as boolean + dim sFileWriter as string + dim sFileCalc as string + dim iDocumentCount as integer + dim cNodeListA( 10 ) as string + dim cNodeListB( 10 ) as string + dim iSecLevel as integer + dim iHitCount as integer + + ' NOTE: hCreateBasicWorkFiles() creates files of the naming scheme + ' basic.odt, ...odc etc. All these files will show up with just "basic" + ' in the Macro Organizer + const DOC_NAME = "basic" + + '///+<li>Set the Macro Security Level to "Medium"</li> + printlog( "" ) + iSecLevel = hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_MEDIUM ) + + '///+<li>Create one initial document</li> + hInitSingleDoc() + + '///+<li>Write identifier string to the document</li> + kontext "DocumentWriter" + DocumentWriter.typeKeys( "tBasicDocuments - initial document - discard after test" ) + + '///+<li>Create a writer document containing a macro, name it basic.odt</li> + gApplication = "WRITER" + printlog( "" ) + brc = hCreateBasicWorkFiles() + sFileWriter = hGetBasicWorkFile( "current" ) + + '///+<li>Create a calc document containing a macro, name it basic.ods</li> + gApplication = "CALC" + printlog( "" ) + brc = hCreateBasicWorkFiles() + sFileCalc = hGetBasicWorkFile( "current" ) + + '///+<li>Reload the files we just created</li> + printlog( "" ) + brc = hFileOpen( sFileWriter ) + brc = hAllowMacroExecution() + if ( not brc ) then + warnlog( "Missing Macro execution dialog. Please check the file/security settings" ) + endif + brc = hFileOpen( sFileCalc ) + brc = hAllowMacroExecution() + if ( not brc ) then + warnlog( "Missing Macro execution dialog. Please check the file/security settings" ) + endif + + '///+<li>Go to Tools/Macro->Basic Macros</li> + printlog( "" ) + brc = hOpenBasicOrganizerFromDoc() + + '///+<li>Verify that the treelist contains five items</li> + hGetVisibleNodeNames( MakroAus , cNodeListA() ) + + '///+<li>Verify the names of the docs: Untitled, basic(odt), basic(ods)</li> + printlog( "" ) + iHitCount = hCountMatchesInList( cNodeListA() , DOC_NAME ) + if ( iHitCount <> 2 ) then + warnlog( "There should be two documents with the name " & DOC_NAME & "listed." ) + endif + + '///+<li>Click the <Manage...> button</li> + verwalten.click() + + '///+<li>Switch to the modules-Tab (should be open by default)</li> + printlog( "" ) + brc = hSelectBasicObjectOrganizerTab( 1 ) + ListAllDelete( cNodeListB() ) + hGetVisibleNodeNames( ModulListe , cNodeListB() ) + + '///+<li>Verify that we have two files with the same name in the list</li> + printlog( "" ) + iHitCount = hCountMatchesInList( cNodeListA() , DOC_NAME ) + if ( iHitCount <> 2 ) then + warnlog( "There should be two documents with the name " & DOC_NAME & "listed." ) + endif + + '///+<li>Switch to the Dialogs-Tab (the second one)</li> + '///+<li>Verify that the treelist contains five items</li> + printlog( "" ) + brc = hSelectBasicObjectOrganizerTab( 2 ) + ListAllDelete( cNodeListB() ) + hGetVisibleNodeNames( ModuleList , cNodeListB() ) + if ( listcount( cNodeListB() ) <> 5 ) then + warnlog( CFN & "#i49239# Incorrect object count in treelist" ) + hListPrint( cNodeListB() , "List of objects found in treelist" ) + endif + + '///+<li>Verify that we have two files with the same name in the list</li> + printlog( "" ) + iHitCount = hCountMatchesInList( cNodeListB() , DOC_NAME ) + if ( iHitCount <> 2 ) then + warnlog( "There should be two documents with the name " & DOC_NAME & "listed." ) + endif + + '///+<li>Switch to Libraries Tab and look at the entries in the listbox</li> + '///+<li>Verify that we have two files with the same name in the list</li> + printlog( "" ) + brc = hSelectBasicObjectOrganizerTab( 3 ) + brc = hTestLibraryListBox( cNodeListA() ) + + '///+<li>Close the Basic Object Organizer</li> + printlog( "" ) + printlog( CFN & "Closing dialogs..." ) + TabBibliotheken.cancel() + + '///+<li>Close the Macro Organizer</li> + Kontext "Makro" + Makro.cancel() + + '///+<li>Close the two documents we worked with</li> + brc = hDestroyDocument() + brc = hDestroyDocument() + + '///+<li>Delete the two workfiles</li> + brc = hDeleteFile( sFileWriter ) + brc = hDeleteFile( sFileCalc ) + + '///+<li>Reset the Macro security level</li> + hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT ) + + '///+<li>Close the initial document</li> + hDestroyDocument() + + '///</ul> + +endcase + +'******************************************************************************* + +function hTestLibraryListBox( cNodeList() ) as boolean + + const CFN = "hTestLibraryListBox::" + + '///<h3>Compare library-Listbox with Macro-Organizer listbox</h3> + '///<i>Part of: tBasicDocuments</i><br> + '///<u>Input</u>: + '///<ol> + '///+<li>List of items found in Basic Macro Organizer Treelist (MakroAus)</li> + '///</ol> + '///<u>Returns</u>: + '///<ol> + '///+<li>Errorstatus (boolean)</li> + '///<ul> + '///+<li>TRUE if all items are identical</li> + '///+<li>FALSE on any other error</li> + '///</ul> + '///</ol> + '///<u>Description</u>: + '///<ul> + + + dim iEntry as integer + dim cEntry as string + dim brc as boolean + dim irc as integer + + brc = true + + '///+<li>Check that the number of objects is ok</li> + if ( bibliothek.getItemCount() <> IDOCS ) then + warnlog( CFN & "Incorrect number of items in listbox" ) + printlog( CFN & "Expected: " & bibliothek.getItemCount() ) + printlog( CFN & "Found...: " & listcount( cNodeList() ) ) + brc = false + endif + + '///+<li>Compare objects 3 -5 (1+2 always differ)</li> + for iEntry = 3 to IDOCS + + Bibliothek.select( iEntry ) + cEntry = Bibliothek.getSelText() + + irc = hCompareSubStrings( cNodeList( iEntry ) , cEntry ) + if ( irc <> 1 ) then + warnlog( CFN & "Comparision failed" ) + printlog( CFN & "Expected: " & cNodeList( iEntry ) & "<>" & cEntry ) + brc = false + else + printlog( CFN & "Comparision succeeded:" & cEntry ) + endif + + next iEntry + + '///</ul> + +end function diff --git a/testautomation/framework/optional/includes/basic_eventbinding.inc b/testautomation/framework/optional/includes/basic_eventbinding.inc new file mode 100755 index 000000000000..0764d66e506b --- /dev/null +++ b/testautomation/framework/optional/includes/basic_eventbinding.inc @@ -0,0 +1,314 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_eventbinding.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : Function test of Basic IDE Assign Componenet +'* +'\************************************************************************ + + +testcase tAssignComponent + dim j,b,i,a,x,y as integer + dim sTemp as string + dim sTemp2 as string + dim sDialogName as string + + ' make sure we start from backingwindow + b = getDocumentCount + for j = 1 to b + printlog "closing: " + j + hCloseDocument() + next j + ' make sure we only have one document window + hNewDocument() + sleep (5) + + '/// Call Tools - Macros - Organize Dialogs... ///' + ToolsMacrosOrganizeDialogs + Kontext "TabDialogs" + '/// Dialog 'OOo Basic Macro Organizer' is open ///' + if TabDialogs.exists(5) then + '/// go to top in list 'Dialog' ///' + ModuleList.typeKeys("<home>") + sTemp = ModuleList.getSelText + sTemp2 = "" + '/// go down in list with <cursor down>, until the button 'New...' is enabled ///' + while (NOT newDialog.isEnabled) AND (sTemp <> sTemp2) + ModuleList.typeKeys("<down>") + sTemp2 = sTemp + sTemp = ModuleList.getSelText + wend + if sTemp = sTemp2 then + warnlog "Couldn't find a way to enable the 'New...' button - aborting" + goto endsub + endif + printlog ModuleList.getSelText + '/// click the button 'New...' ///' + newDialog.click + kontext "NeuerDialog" + '/// dialog 'New Dialog' is open ///' + if NeuerDialog.exists(5) then + ' save dialog name, for deleting it later + sDialogName = Dialogname.getText + printlog sDialogName + '/// remember suggested dialog name, for deleting it later ///' + '/// accept the name and close dialog by pressing button 'OK' ///' + NeuerDialog.OK + '/// dialog 'New Dialog' is up again ///' + Kontext "TabDialogs" + if TabDialogs.exists(5) then + '/// New created dialog name is highlited in list 'Dialog' ///' + printlog ModuleList.getSelText + '/// click button 'Edit' ///' + edit.click + Kontext "BasicIDE" + '/// Basic IDE Dialog editor is up 'My Macros & Dialogs.Standard - OpenOffice.org Basic' ///' + if DialogWindow.exists(5) then ' you can't use exists on BasicIDE; check for a control + '/// type key <Tab> to select the dialog in the editor ///' + DialogWindow.TypeKeys("tab") + DialogWindow.TypeKeys("tab",true) + '/// open context menu and select entry 'Properties...' ///' + try + ContextProperties + catch + qaErrorLog "#i70901# .typeKeys doesn't work in DialogWindow" + ' works better, but also not always + DialogWindow.mouseDown( 10 , 10 ) + DialogWindow.mouseMove( 90 , 90 ) + DialogWindow.mouseUp( 90 , 90 ) + try + ContextProperties + catch + qaErrorLog "Even Workaround doesn't work! - exiting" + goto endsub + endcatch + endcatch + kontext "ControlPropertiesDialog" + '/// flyer is open 'Properties: Dialog' ///' + 'printlog TabEventsControl.exists(5) + if NOT ControlPropertiesDialog.exists(5) then + qaErrorLog "#i70901# can't use exists on tabpage parent" + endif + 'printlog TabGeneralControl.exists(5) + ' doesn't work... +' if ControlPropertiesDialog.exists(5) then + kontext "TabGeneralControl" + if TabGeneralControl.exists(5) then + kontext "ControlPropertiesTabControl" + ControlPropertiesTabcontrol.setPage (TabEventsControl) + '/// switch to tabpage 'Events' ///' + Kontext "TabEventsControl" + if TabEventsControl.exists(5) then + '/// press button '...' beside 'Key pressed'///' + PBKeyTyped.click + Kontext "AssignMacro" + '/// dialog comes up 'Assing Macro' ///' + if AssignMacro.exists(5) then + '/// click button 'Component' ///' + Component.click + Kontext "AssingComponent" + '/// dialog is open 'Assign component' ///' + if AssingComponent.exists(5) then + DialogTest(AssingComponent) + '/// set Component Method Name to 'compost' ///' + ComponentMethodName.setText ("vnd.sun.star.script:Library1.Module1.TestDialogComponent?language=Basic&location=document") + '/// press button 'OK' to close dialog///' + AssingComponent.OK + Kontext "AssignMacro" + if AssignMacro.exists(5) then + ' doesn't work, because featureset is not implemted on component EditListBox... expected for xmas 2006 + 'printlog eventListBox.getItemText + '/// close dialog 'Assign Macro' with button 'OK' ///' + AssignMacro.OK + Kontext "TabEventsControl" + printlog evtKeyTyped.getText + Kontext "ControlPropertiesDialog" + '/// close flyer 'Properties: Dialog' by openening context menu and selecting 'Properties'///' + ContextProperties + endif + else + warnlog "couldn't open dialog 'Assign Component'" + endif + else + warnlog "couldn't open dialog 'Assign Macro'" + endif + else + warnlog "couldn't switch to tab page 'Events''" + endif + else + warnlog "couldn't open flyer 'Properties: Dialog'" + endif + else + warnlog "couldn't open Basic IDE Dialog editor" + endif + else + warnlog "couldn't open dialog 'New Dialog'" + endif + else + warnlog "couldn't open dialog 'New Dialog'" + endif + else + warnlog "couldn't open dialog 'OOo Basic Macro Organizer'" + endif + + 'delete dialog! + '/// Call Tools - Macros - Organize Dialogs... ///' + ToolsMacrosOrganizeDialogs + Kontext "TabDialogs" + '/// Dialog 'OOo Basic Macro Organizer' is open ///' + if TabDialogs.exists(5) then + '/// go to top in list 'Dialog' ///' + ModuleList.typeKeys("<home>") + sTemp = ModuleList.getSelText + sTemp2 = "" + '/// go down in list with <cursor down>, until the created dialog name is found ///' + while (sTemp <> sDialogName) AND (sTemp <> sTemp2) + ModuleList.typeKeys("<down>") + sTemp2 = sTemp + sTemp = ModuleList.getSelText + wend + if sTemp = sTemp2 then + warnlog "Couldn't find the created dialog - aborting" + goto endsub + endif + printlog ModuleList.getSelText + '/// click the button 'Delete...' ///' + delete.click + kontext + '/// active 'Do you want to delete...' is open ///' + if active.exists(5) then + printlog active.getText + '/// delete dialog by pressing button 'YES' ///' + active.yes + else + warnlog "couldn't delete dialog '"+sDialogName+"'" + endif + Kontext "TabDialogs" + TabDialogs.cancel + else + warnlog "couldn't open dialog 'OOo Basic Macro Organizer'" + endif + +'Sub Main +' oSimpleComponent = CreateUnoService( "my_module.MyService1" ) +' oActiveFrame = StarDesktop.getActiveFrame() +' oSimpleComponent.createDialog("vnd.sun.star.script:Standard.Dialog1?location=application", oActiveFrame ) +'End Sub + '/// close Basic IDE by calling File->Close///' + hCloseDocument() +endcase + +testcase tAssignComponentFunction + dim x,i,a as integer + dim sTemp as string + + sExtensionCLI("list","") + sExtensionCLI("add","DialogComponent.oxt",convertPath(gTestToolPath + "framework\optional\input/eventbinding/") ) + hFileOpen(convertPath(gTestToolPath + "framework\optional\input/eventbinding/DialogComponent.odt")) + kontext "SecurityWarning" + if SecurityWarning.exists(5) then + SecurityWarning.ok + endif + ToolsMacrosRunMacro + Kontext "ScriptSelector" + if ScriptSelector.exists(10) then + x = LibraryTreeList.getItemCount + 'There have to show up 3 libraries, else the document isn't loaded + if x <> 3 then + printlog "Try again..." + ScriptSelector.cancel + sleep 10 + ToolsMacrosRunMacro + Kontext "ScriptSelector" + x = LibraryTreeList.getItemCount + endif + 'Look for library 'DialogComponent' and 'DIALOGCOMPONENT' + for i = 1 to x + sTemp = LibraryTreeList.getItemText(i) + 'printlog "("+i+"/"+x+"): '" + sTemp + "'" + if (("DialogComponent"=sTemp) OR ("DIALOGCOMPONENT"=sTemp)) then + a = i + printlog "Found library ("+i+"/"+x+"): '" + sTemp + "'" + endif + next i + if 0 <> a then + 'Select the library and unfold it + LibraryTreeList.select(a) + LibraryTreeList.typeKeys("+") + 'Go to 'Standard' and unfold + LibraryTreeList.typeKeys("<down>") + LibraryTreeList.typeKeys("+") + 'Go to 'Global' + LibraryTreeList.typeKeys("<down>") + + 'Select macro name 'TestDialogComponent' + x = ScriptList.getItemCount + for i = 1 to x + sTemp = ScriptList.getItemText(i) + 'printlog "("+i+"/"+x+"): '" + sTemp + "'" + if "TestDialogComponent" = sTemp then + a = i + printlog "Found macro ("+i+"/"+x+"): '" + sTemp + "'" + endif + next i + if (0 <> a) then + 'Select the macro + ScriptList.select(a) + 'Start the macro by pressing the button 'run' + qaErrorLog ("The test can't go on, because resetapplication fails and no help ids are useable in BASIC right now. issues: i54266 and i68892") + ScriptSelector.cancel + 'ScriptSelector.ok + ' sleep... at least 60 seconds + call sleep(10) + else + warnlog sLocation + "Macro not found: 'TestDialogComponent'" + endif + else + warnlog sLocation + "Library not found: 'DialogComponent' or 'DIALOGCOMPONENT'" + endif + else + warnlog sLocation + "'Run macro dialog' didn't came up" + endif + 'printlog resetapplication + + ' vnd.sun.star.UNO:doit1 + ' vnd.sun.star.UNO:doit2 + ' vnd.sun.star.UNO:doit3 + ' vnd.sun.star.UNO:handleEventWithArguments + ' vnd.sun.star.UNO:handleEvent + ' vnd.sun.star.UNO:copyText + + sExtensionCLI("remove","DialogComponent.oxt" ) + hCloseDocument() +endcase diff --git a/testautomation/framework/optional/includes/basic_formcontrols.inc b/testautomation/framework/optional/includes/basic_formcontrols.inc new file mode 100755 index 000000000000..5d7ae8b7045c --- /dev/null +++ b/testautomation/framework/optional/includes/basic_formcontrols.inc @@ -0,0 +1,225 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_formcontrols.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Basic form-controls +'* +'\****************************************************************************** + +testcase tAllControlsOnDialog( cMajor as string ) + + '///<h1>Basic test for macro controls</h1> + '///<i>This test opens the applications and creates a basic dialog. + '///+On this dialog all control are inserted, the document is saved and reloaded + '///+to see if the dialog and the controls still exist.</i><br><br> + + dim iApplication as Integer ' numeric expression for gApplication + dim cApplication as string ' Name of the current application + + dim lsControlNames( 30 ) as string ' list containing the names of the controls + + ' number of controls and the name of the current control + dim iCurrentControl as integer + dim sCurrentControl as string + + ' the workfile and the filter (Tested for 569, 645, 680) + dim sFile as string + + ' errorstatus: if false, something went wrong and the test cancels + ' trying to recover somehow + dim bOpen as boolean + dim brc as boolean + dim irc as integer + + const CMODULE = "tacod" ' abbreviation for tAllControlsOnDialog + + + '///<b>save/load-test for controls on a basic-dialog in all applications</b> + '///<ul> + '///+<li>open a new doc (for Writer only)</li> + + ' If you want to test all applications, make iApplication = 1 to 6 + for iApplication = 1 to 1 + + ' switch documenttype (writer, calc, impress, draw ...) + cApplication = hNumericDoctype( iApplication ) + + ' get the name of the workfile dependent on gApplication + '///+<li>Build a path and a filename (path from UNO, Suffix from global-module)</li> + sFile = hGetWorkPath() & "basic" & hGetSuffix( cMajor ) + sFile = ConvertPath( sFile ) + printlog( "Using file: " & sFile ) + + ' delete the file if it exists, the outcome has no influence on the test + ' so the returnvalue is ignored + hDeleteFile( sFile ) + + ' open a new document to work with (2 open AFTER this) + '///+<li>Open a new document to work with</li> + printlog( "" ) + printlog( cApplication ) + brc = hCreateDocument() + if ( not brc ) then + warnlog( "Failed to create a new document, aborting" ) + goto endsub + endif + + '///+<li>Create a new module for the new document</li> + '///+<li>Create a new dialog in BasicIDE</li> + '///+<li>Open the macro controls float</li> + bOpen = hInitFormControls( CMODULE ) + if ( not bOpen ) then + printlog( "Aborting due to previous errors" ) + call hCloseDocument() + goto endsub + endif + + printlog( "Insert all controls into the dialog" ) + for iCurrentControl = 1 to ICONTROLCOUNT + + sCurrentControl = hDrawControlOnDialog( iCurrentControl ) + listappend( lsControlNames() , sCurrentControl ) + hOpenPropertyBrowser() + hPBSetControlName( sCurrentControl ) + hClosePropertyBrowser() + + next iCurrentControl + + + Kontext "BASICIDE" + '///+<li>close the BASIC-IDE</li> + hCloseBasicIde() + + if ( getDocumentCount <> 1 ) then + warnlog( "Number of open documents is incorrect, expected one only" ) + endif + + printlog "Save the document" + '///+<li>save the document</li> + Call hFileSaveAsKill( sFile ) + + printlog "Close it" + '///+<li>close the document</li> + '///</ul> + brc = hDestroyDocument() + + '///<b>check all controls in the saved document</b> + printlog "Open the file again" + '///<ul> + '///+<li>open the document</li> + hFileOpen( sFile ) + + printlog "Open tools/macro and select the last module for the current document" + '///+<li>open the basic-IDE of this document, open controls, activate 'Select-mode' and open the properties</li> + ToolsMacro_uno + kontext "Makro" + irc = hSelectNodeByName( MakroAus , CMODULE ) + if ( irc = 0 ) then + qaerrorlog( "Searching node by name failed. Using fallback" ) + hSelectTheLastnode( MakroAus ) + else + printlog( "The node was found. Good." ) + endif + + brc = hIsMacroEditButtonEnabled() + if ( not brc ) then + warnlog( "Edit-Button is not enabled, the test cannot continue" ) + kontext "Makro" + Makro.cancel() + brc = hDestroyDocument() + goto endsub + endif + + '///+<li>Click 'Edit' to edit the module</li> + printlog( "Edit the module" ) + Bearbeiten.Click() + if ( WaitSlot <> WSFinished ) then + warnlog( "Slot not finished after 1 second" ) + endif + + kontext "BasicIDE" + '///+<li>Find the dialog we created before</li> + ' try to find our dialog again by stepping through the tabbar + bOpen = hFindFirstDialog() + if ( not bOpen ) then + warnlog( "Could access dialog, aborting test" ) + hCloseBasicIde() + brc = hDestroyDocument() + goto endsub + endif + + '///+<li>Open the macro controls float</li> + ' if the dialog is open, open the macro controls toolbar as well, + ' we need access to the "properties" button + bOpen = hShowMacroControls() + if ( not bOpen ) then + warnlog( "Could not open macro controls, aborting" ) + hCloseBasicIde() + brc = hDestroyDocument() + goto endsub + endif + + '///+<li>Select every control, open its properties and verify its name, close properties</li> + for iCurrentControl = 1 to ICONTROLCOUNT + + hSelectControl( iCurrentControl ) + hOpenPropertyBrowser() + sCurrentControl = lsControlNames( iCurrentControl ) + hPBGetControlName( sCurrentControl ) + hClosePropertyBrowser() + + next iCurrentControl + + ' we need to delete the list-content otherwise we run into index-problems + ListAllDelete( lsControlNames() ) + + '///+<li>Cleanup: Close the BASIC-IDE</li> + printlog( "Close the BASIC IDE" ) + hCloseBasicIde() + + '///+<li>Cleanup: Close the document</li> + printlog( "Close the document" ) + brc = hDestroyDocument() + + '///+<li>Cleanup: Delete the file we created</li> + hDeleteFile( sFile ) + + '///+<li>Repeat this for every application</li> + '///</ul> + + next iApplication + +endcase + + diff --git a/testautomation/framework/optional/includes/basic_ide.inc b/testautomation/framework/optional/includes/basic_ide.inc new file mode 100755 index 000000000000..1b23f58b5514 --- /dev/null +++ b/testautomation/framework/optional/includes/basic_ide.inc @@ -0,0 +1,392 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_ide.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Macro Dialogs opened from Basic-IDE +'* +'\****************************************************************************** + +testcase tBasic_IDE_Toolbar_Module + + qaerrorlog( "Replace this test asap, the approach is unusable" ) + + dim brc as boolean + dim cSourceFile as string + cSourceFile = gTesttoolpath & "framework\optional\input\resetregistration.txt" + cSourceFile = convertpath( cSourceFile ) + + + '///<h1>Work with Toolbar on Basic-IDE part 1</h1> + + '///<ul> + + '///+<li>Open a new writer-doc</li> + printlog "open a new writer-doc" + gApplication = "Writer" + hCreateDocument() + + '///+<li>Create a new module for the new document (named TTModule)</li> + brc = hOpenBasicOrganizerFromDoc() + brc = hCreateModuleForDoc() + + '///+<li>Click "Compile" on Toolbar</li> + + kontext "macrobar" + printlog "- compile" + Compile.Click + if ( WaitSlot <> WSFinished ) then + warnlog( "Slot not finished within 1 second" ) + endif + + '///+<li>Click "Run Basic" on Toolbar</li> + printlog "- Run Basic" + BasicRun.Click + if ( WaitSlot <> WSFinished ) then + warnlog( "Slot not finished within 1 second" ) + endif + + + '///+<li>Click "Step Procedure" on Toolbar</li> + printlog "- Step Procedure" + ProcedureStep.Click + if ( WaitSlot <> WSFinished ) then + warnlog( "Slot not finished within 1 second" ) + endif + + + '///+<li>Click "Stop Basic" on Toolbar</li> + printlog "- Stop Basic" + BasicStop.Click + if ( WaitSlot <> WSFinished ) then + warnlog( "Slot not finished within 1 second" ) + endif + + + '///+<li>Click "Single Step" on Toolbar</li> + printlog "- Single Step" + SingleStep.Click + if ( WaitSlot <> WSFinished ) then + warnlog( "Slot not finished within 1 second" ) + endif + + + '///+<li>Click "Step Back" on Toolbar</li> + printlog "- Step Back" + StepBack.Click() + if ( WaitSlot <> WSFinished ) then + warnlog( "Slot not finished within 1 second" ) + endif + + + '///+<li>Click "Breakpoint" on Toolbar</li> + printlog "- Breakpoint => activate" + Breakpoint.Click + if ( WaitSlot <> WSFinished ) then + warnlog( "Slot not finished within 1 second" ) + endif + + + '///+<li>Deactivate "Breakpoint" on Toolbar</li> + printlog "- Breakpoint => deactivate" + Breakpoint.Click + if ( WaitSlot <> WSFinished ) then + warnlog( "Slot not finished within 1 second" ) + endif + + + '///+<li>Click "Add Watch" on Toolbar</li> + printlog "- Add Watch => deactivate" + AddWatch.Click + if ( WaitSlot <> WSFinished ) then + warnlog( "Slot not finished within 1 second" ) + endif + + + '///+<li>Click "Find Paranthese" on Toolbar</li> + printlog "- Find Paranthese" + + kontext "macrobar" + FindParanthese.Click() + if ( WaitSlot <> WSFinished ) then + warnlog( "Slot not finished within 1 second" ) + endif + + + '///+<li>"Controls"</li> + try + Controls.TearOff() + warnlog "Controls are active in a module window => bug!" + catch + printlog( "Controls are not active->OK" ) + endcatch + if ( WaitSlot <> WSFinished ) then + warnlog( "Slot not finished within 1 second" ) + endif + + printlog( "- Insert Source Text (" & cSourceFile & ")" ) + + '///+<li>"Insert Source Text"<br> + '///+Insert external file "ResetRegistration.txt"</li> + + InsertSourceText.Click() + kontext "oeffnendlg" + if ( OeffnenDlg.exists( 1 ) ) then + Dateiname.SetText( cSourceFile ) + Oeffnen.click() + else + warnlog( "File Open dialog did not open" ) + endif + + ' possible 'could not read from file' error-message -> this is a bug + kontext "Active" + if ( Active.exists( 1 ) ) then + warnlog( "Unexpected active: " & active.gettext() ) + active.ok() + endif + + kontext "macrobar" + printlog "- Save Source Test " + + '///+<li>Click "Save Source Test" on Toolbar, save the file</li> + SaveSourceTest.Click + if ( WaitSlot <> WSFinished ) then + warnlog( "Slot not finished within 1 second" ) + endif + + + kontext "speicherndlg" + if ( SpeichernDlg.exists( 1 ) ) then + Dateiname.SetText ConvertPath (gOfficepath + "user\work\global_test.bas") + Speichern.click() + else + warnlog( "File Save dialog is missing" ) + endif + + kontext "active" + if ( Active.Exists( 1 ) ) then + Active.Yes() + endif + + '///+<li>File/Close for Basic-IDE and Document</li></ul> + hDestroyDocument() ' for Basic-IDE + hDestroyDocument() ' the new writer-doc + +endcase + +'******************************************************************************* + +testcase tBasic_IDE_Toolbar_Dialogs + + qaerrorlog( "Replace this test asap, the approach is unusable" ) + + dim bIsOpen as boolean + dim brc as boolean + + dim sBasfile1 as string + sBasFile1 = gTesttoolpath & "framework\optional\input\resetregistration.txt" + sBasFile1 = convertpath( sBasFile1 ) + + dim sBasFile2 as string + sBasFile2 = convertpath( gOfficepath & "user\work\global_test.bas" ) + + '///<h1>Work with Toolbar on Basic-IDE part 2</h1> + '///<ul> + + '///+<li>Open a new writer-doc</li> + printlog "open a new writer-doc" + gApplication = "WRITER" + hCreateDocument() + + '///+<li>Create a new module for the new document (named TTModule)</li> + printlog "create a new module " + brc = hOpenBasicOrganizerFromDoc() + brc = hCreateModuleForDoc() + + '///+<li>Create a new dialog in BasicIDE</li> + kontext "basicide" + Tabbar.OpenContextMenu + hMenuSelectNr ( 1 ) + hMenuSelectNr ( 2 ) + if ( DialogWindow.Exists ( 2 ) ) then + printlog( "Dialog Editor window is open. Good." ) + else + warnlog "No dialog window is shown!" + end if + + '///+<li>Macro execution buttons should be disabled</li> + '///<ul> + '///+<li>Compile</li> + try + kontext "MacroBar" + Compile.Click() + warnlog( """Compile"" is enabled" ) + catch + printlog( """Compile"" is disabled" ) + endcatch + + '///+<li>Run Basic</li> + try + kontext "MacroBar" + BasicRun.Click() + warnlog( """Run Basic"" is enabled" ) + catch + printlog( """Run Basic"" is disabled" ) + endcatch + + '///+<li>Step Procedure</li> + printlog "- Step Procedure (disabled)" + try + kontext "MacroBar" + ProcedureStep.Click() + warnlog( """Step Procedure"" is enabled" ) + catch + printlog( """Step Procedure"" is disabled" ) + endcatch + + '///+<li>Stop Basic</li> + try + kontext "MacroBar" + BasicStop.Click() + warnlog( """Stop Basic"" is enabled" ) + catch + printlog( """Stop Basic"" is disabled" ) + endcatch + + '///+<li>Single Step</li> + try + kontext "MacroBar" + SingleStep.Click() + warnlog( """Single Step"" is enabled" ) + catch + printlog( """Single Step"" is enabled" ) + endcatch + + '///+<li>Single Step Back</li> + try + kontext "MacroBar" + StepBack.Click() + warnlog( """Single Step Back"" is enabled" ) + catch + printlog( """Single Step Back"" is enabled" ) + endcatch + + '///+<li>Breakpoint</li> + try + kontext "MacroBar" + Breakpoint.Click() + warnlog( """Breakpoint"" is enabled" ) + catch + printlog( """Breakpoint"" is disabled" ) + endcatch + + + '///+<li>Add Watch</li> + try + kontext "MacroBar" + AddWatch.Click() + warnlog( """Add Watch"" is enabled" ) + catch + printlog( """Add Watch"" is disabled" ) + endcatch + + + '///+<li>Find Paranthese</li> + try + kontext "MacroBar" + FindParanthese.Click() + warnlog( """Find Paranthese"" is enabled" ) + catch + printlog( """Find Paranthese"" is disabled" ) + endcatch + + + '///+<li>Insert Source Text</li> + try + kontext "macrobar" + InsertSourceText.Click() + warnlog( """Insert Source Text"" is enabled" ) + + kontext "oeffnendlg" + if ( OeffnenDlg.exists( 2 ) ) then + Dateiname.SetText( sBasFile1 ) + Oeffnen.Click() + else + warnlog( "File Open dialog missing" ) + endif + catch + printlog( """Insert Source Text"" is disabled" ) + endcatch + + + printlog "- Save Source Test (disabled)" + + '///+<li>Click "Save Source Text" (disabled)<br> + '///+Save it as bas-file</li> + try + kontext "macrobar" + SaveSourceTest.Click() + warnlog( """Save Source Text"" is enabled" ) + + kontext "speicherndlg" + if ( SpeichernDlg.exists( 2 ) ) then + Dateiname.SetText( sBasFile2 ) + Speichern.Click() + else + warnlog( "File Save dialog is missing" ) + endif + + kontext "active" + if ( Active.Exists( 1 ) ) then + Active.Yes() + endif + catch + printlog( """Save Source Text"" is disabled" ) + endcatch + + '///</ul> + + '///+<li>Tear off controls</li> + bIsOpen = hShowMacroControls() + if ( bIsOpen ) then + ToolsCollectionBar.Close() + end if + + '///+<li>File/Close on Basic-IDE and Document</li></ul> + Call hDestroyDocument() ' for Basic-IDE + Call hDestroyDocument() ' the new writer-doc + '///</ul> + +endcase + + diff --git a/testautomation/framework/optional/includes/basic_issues.inc b/testautomation/framework/optional/includes/basic_issues.inc new file mode 100755 index 000000000000..7a0b4ccecaed --- /dev/null +++ b/testautomation/framework/optional/includes/basic_issues.inc @@ -0,0 +1,174 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_issues.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : Joerg.Skottke@Sun.Com +'* +'* short description : Regression tests for especially annoying BASIC issues +'* +'\****************************************************************************** + +function hIDERunMacro() + + kontext "MacroBar" + if ( MacroBar.exists() ) then + BasicRun.click() + else + warnlog( "MacroBar not accessible" ) + endif + +end function + +'******************************************************************************* + +function hTestActive( cString as string , iMethod as integer ) as integer + + dim cMsg as string + + kontext "Active" + if ( Active.exists( 2 ) ) then + + cMsg = Active.getText() + + if ( cString <> "" ) then + if ( instr( active.getText(), cString ) <> 0 ) then + printlog( "Correct message found: " & cMsg ) + else + warnlog( "Messagebox has wrong content: " & cMsg ) + endif + else + printlog( "Messagebox: " & cMsg ) + endif + + hTestActive() = Active.getButtonCount() + select case( iMethod ) + case 1 : Active.OK() + case 2 : Active.Cancel() + case 3 : Acitve.Yes() + case 4 : Active.No() + end select + else + warnlog( "Messagebox is missing" ) + endif + +end function + +'******************************************************************************* + +testcase t_macros() + + gApplication = "WRITER" + call hNewDocument() + hInitBasicIDE( "TestIssues" ) + + dim cLocalMacrosFile as string + cLocalMacrosFile = gTesttoolPath & "framework\optional\input\vba-compat\vba-compat-macros.txt" + + printlog( "" ) + printlog( " ---------- i41695 ------------ " ) + hInsertMacroFromFile( "i41695" ) + hIDERunMacro() + hTestActive( "i41695-1", 1 ) + hTestActive( "i41695-2", 1 ) + + printlog( "" ) + printlog( " ---------- i83978 ------------ " ) + warnlog( "#i90645# - crash on BasicLibraries.LoadLibrary" ) + 'hInsertMacroFromFile( "i83978" ) + 'hIDERunMacro() + 'hTestActive( "com.sun.star.container.NoSuchElementException", 1 ) + + printlog( "" ) + printlog( " ---------- i82830 ------------ " ) + hInsertMacroFromFile( "i82830" ) + hIDERunMacro() + hTestActive( "12D687", 1 ) + hTestActive( "4553207", 1 ) + + printlog( "" ) + printlog( " ---------- i81674 ------------ " ) + hInsertMacroFromFile( "i81674" ) + hIDERunMacro() + hTestActive( "250", 1 ) + hTestActive( "Yes", 1 ) + hTestActive( "True", 1 ) + hTestActive( "On", 1 ) + + printlog( "" ) + printlog( " ---------- i80532 ------------ " ) + warnlog( "#i80532# negative values as parameters without parentheses fail" ) + 'hInsertMacroFromFile( "i80532" ) + 'hIDERunMacro() + 'hTestActive( "-10", 1 ) + 'hTestActive( "1", 1 ) + 'hTestActive( "-10", 1 ) + + printlog( "" ) + printlog( " ---------- i84040 ------------ " ) + hInsertMacroFromFile( "i84040" ) + hIDERunMacro() + hTestActive( "false", 1 ) + hTestActive( "false", 1 ) + + printlog( "" ) + printlog( " ---------- i86265 ------------ " ) + hInsertMacroFromFile( "i86265" ) + hIDERunMacro() + hTestActive( "i86265-1", 1 ) + hTestActive( "i86265-2", 1 ) + + printlog( "" ) + printlog( " ---------- MessageBoxes ------------ " ) + hInsertMacroFromFile( "MessageBoxes" ) + hIDERunMacro() + if ( hTestActive( "0x" , 1 ) <> 1 ) then warnlog( "Wrong ressource type" ) + if ( hTestActive( "1x" , 1 ) <> 2 ) then warnlog( "Wrong ressource type" ) + if ( hTestActive( "2x" , 2 ) <> 3 ) then warnlog( "Wrong ressource type" ) + if ( hTestActive( "3x" , 2 ) <> 3 ) then warnlog( "Wrong ressource type" ) + if ( hTestActive( "4x" , 4 ) <> 2 ) then warnlog( "Wrong ressource type" ) + if ( hTestActive( "5x" , 2 ) <> 2 ) then warnlog( "Wrong ressource type" ) + if ( hTestActive( "16" , 2 ) <> 3 ) then warnlog( "Wrong ressource type" ) + if ( hTestActive( "32" , 2 ) <> 3 ) then warnlog( "Wrong ressource type" ) + if ( hTestActive( "48" , 2 ) <> 3 ) then warnlog( "Wrong ressource type" ) + if ( hTestActive( "64" , 1 ) <> 1 ) then warnlog( "Wrong ressource type" ) + if ( hTestActive( "128", 2 ) <> 3 ) then warnlog( "Wrong ressource type" ) + if ( hTestActive( "256", 2 ) <> 3 ) then warnlog( "Wrong ressource type" ) + if ( hTestActive( "512", 2 ) <> 3 ) then warnlog( "Wrong ressource type" ) + + + + printlog( "" ) + hCloseBasicIDE() + hCloseDocument() + +endcase + diff --git a/testautomation/framework/optional/includes/basic_library_export.inc b/testautomation/framework/optional/includes/basic_library_export.inc new file mode 100755 index 000000000000..f68c99c637e5 --- /dev/null +++ b/testautomation/framework/optional/includes/basic_library_export.inc @@ -0,0 +1,200 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_library_export.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Export BASIC library (flat) +'* +'\****************************************************************************** + +testcase tBasicLibraryExport + + '///<h1>Export a BASIC library (flat)</h1> + ' Assumption: All actions take place in the user/work directory + ' macro taken from framework/tools/input/macros.txt::tBasicLibraryExport + + ' For constants (UPPERCASE) see .BAS-file + + dim cDocumentName as string + dim cLibraryName as string + + dim iNodeCount as integer + + dim cFile as string + cFile = hGetWorkPath() & LIBRARY_NAME + + dim cMsg as string + + dim iCurrentLib as integer + + ' cleanup + hDeleteFile( cFile ) + + '///<ul> + '///+<li>Make sure we have exactly one open document (changed) to start with</li> + hInitSingleDoc() + hChangeDoc() + + '///+<li>Create a new writer document</li> + gApplication = "WRITER" + hCreateDocument() + + '///+<li>Go to Tools/Macros/Organize Macros/OpenOffice.org Basic</li> + ToolsMacro_uno + + '///+<li>Select the last node (number 4, document untitled2)</li> + kontext "Makro" + iNodeCount = hGetNodeCount( MakroAus ) + cDocumentName = hSelectNode( MakroAus, iNodeCount ) + + '///+<li>Click to open the organizer</li> + Verwalten.click() + + '///+<li>Switch to the libraries-tab</li> + hSelectBasicObjectOrganizerTab( 3 ) + + '///+<li>Select the document (untitled2 at pos. 4)</li> + printlog( "Select document Untitled2" ) + kontext "TabBibliotheken" + Bibliothek.select( DOCUMENT_POSITION ) + + ' verify that the correct document is selected + if ( Bibliothek.getSelText() <> cDocumentName ) then + warnlog( "Incorrect document selected on libraries tab, aborting" ) + goto endsub + endif + + '///+<li>Click to create a new library</li> + Neu.click() + + '///+<li>Name the library "tBasicLibraryExport", confirm with ok</li> + kontext "NeueBibliothek" + BibliotheksName.setText( LIBRARY_NAME ) + NeueBibliothek.ok() + + '///+<li>Verify that the correct library is selected</li> + kontext "TabBibliotheken" + cLibraryName = BibliotheksListe.getSelText() + + '///+<li>Click to edit the library</li> + Bearbeiten.click() + + '///+<li>Insert a macro (e.g. to print a messagebox)</li> + hInsertMacroFromFile( LIBRARY_NAME ) + + '///+<li>Close the Basic IDE</li> + hCloseBasicIDE() + + '///+<li>Go to Tools/Macros/Organize Macros/OpenOffice.org Basic</li> + ToolsMacro_uno + + '///+<li>Select the last node (untitled2)</li> + kontext "Makro" + iNodeCount = hGetNodeCount( MakroAus ) + hSelectNode( MakroAus, iNodeCount ) + + '///+<li>Click to open the organizer</li> + Verwalten.click() + + '///+<li>Switch to the libraries-tab</li> + hSelectBasicObjectOrganizerTab( 3 ) + + '///+<li>Select the document (untitled2 at pos. 4)</li> + kontext "TabBibliotheken" + Bibliothek.select( DOCUMENT_POSITION ) + + ' verify that the correct document is selected + if ( Bibliothek.getSelText() <> cDocumentName ) then + warnlog( "Incorrect document selected on libraries tab, aborting" ) + goto endsub + endif + + '///+<li>Find the new library, select it</li> + printlog( "Select the new library" ) + kontext "TabBibliotheken" + for iCurrentLib = 1 to Bibliotheksliste.getItemCount() + Bibliotheksliste.select( iCurrentLib ) + if ( Bibliotheksliste.getSelText = LIBRARY_NAME ) then + exit for + endif + next iCurrentLib + + '///+<li>Click Export</li> + printlog( "Click export" ) + Export.click() + + '///+<li>Select to export as Library, click ok</li> + printlog( "Export as library" ) + kontext "ExportBasicLibraryDlg" + if ( ExportBasicLibraryDlg.exists( 2 ) ) then + + ExportAsLibrary.check() + ExportBasicLibraryDlg.ok() + + '///+<li>Name the package "tBasicLibraryExportAsPackage", save it</li> + printlog( "Use default path (=workdir)" ) + Kontext "OeffnenDlg" + if ( Oeffnendlg.exists( 2 ) ) then + Oeffnen.click() + else + kontext "active" + if ( active.exists() ) then + cMsg = active.getText() + cMsg = hRemoveLineBreaks( cMsg ) + warnlog( "Unexpected messagebox: " & cMsg ) + active.ok() + endif + endif + + else + warnlog( "The ""Export Library"" dialog was not displayed" ) + endif + + + '///+<li>Close the macro organizer</li> + printlog( "Close the macro/libraries organizer" ) + kontext "TabBibliotheken" + TabBibliotheken.cancel() + + '///+<li>Close OpenOffice.org Basic Macros dialog</li> + printlog( "Cancel macro organizer" ) + kontext "Makro" + Makro.cancel() + + '///+<li>Close the document</li> + hDestroyDocument() + + '///</ul> + +endcase + diff --git a/testautomation/framework/optional/includes/basic_library_import.inc b/testautomation/framework/optional/includes/basic_library_import.inc new file mode 100755 index 000000000000..30422e31b34f --- /dev/null +++ b/testautomation/framework/optional/includes/basic_library_import.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 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_library_import.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Import BASIC library (flat) +'* +'\****************************************************************************** + +testcase tBasicLibraryImport + + '///<h1>Import a basic library (flat)</h1> + '///<ul> + + dim cMsg as string + dim iCurrentLib as integer + + '///+<li>Open Basic Organizer</li> + ToolsMacro_uno + + '///+<li>Select My Macros</li> + kontext "Makro" + MakroAus.Select( 1 ) + + '///+<li>Open the library Organizer</li> + Verwalten.click() + + '///+<li>Switch to the libraries-tab</li> + hSelectBasicObjectOrganizerTab( 3 ) + + '///+<li>Make sure My Macros is selected</li> + printlog( "Select My macros" ) + kontext "TabBibliotheken" + Bibliothek.select( 1 ) + + '///+<li>Click to import a library</li> + printlog( "Click to add a library" ) + Hinzufuegen.click() + + '///+<li>Enter the name of the library</li> + printlog( "Enter the name of the library: " & LIBRARY_NAME ) + kontext "OeffnenDlg" + DateiName.setText( LIBRARY_NAME ) + + printlog( "Step into the directory" ) + OeffnenDlg.typeKeys( "<RETURN>" ) + + '///+<li>Enter "dialog.xlb"</li> + printlog( "Enter "dialog.xlb"" ) + DateiName.setText( "dialog.xlb" ) + + '///+<li>Open the file</li> + printlog( "Open dialog.xlb" ) + Oeffnen.click() + + '///+<li>Handle failing autocompletion</li> + kontext "active" + if ( active.exists( 1 ) ) then + if ( active.getRT() <> 373 ) then + cMSG = Active.getText() + cMsg = hRemoveLineBreaks( cMsg ) + warnlog( "Autocompletion failed: " & cMsg ) + Active.ok() + Kontext "OeffnenDlg" + DateiName.setText( "dialog.xlb" ) + Oeffnen.click() + endif + endif + + '///+<li>Confirm to append libraries, accept defaults</li> + printlog( "Confirm to append the library" ) + Kontext "AppendLibraries" + AppendLibraries.ok() + + '///+<li>Find the new library, select it</li> + printlog( "Select the new library" ) + kontext "TabBibliotheken" + for iCurrentLib = 1 to Bibliotheksliste.getItemCount() + Bibliotheksliste.select( iCurrentLib ) + if ( Bibliotheksliste.getSelText = LIBRARY_NAME ) then + exit for + endif + next iCurrentLib + + '///+<li>On libraries-tab click delete-button (correct lib must be selected)</li> + printlog( "Delete the library, confirm with YES" ) + Kontext "TabBibliotheken" + Loeschen.click() + + '///+<li>Confirm deletion with YES</li> + Kontext "Active" + if ( Active.exists( 1 ) ) then + active.yes() + else + warnlog( "Deletion warning for libraries is missing" ) + endif + + '///+<li>Close the macro organizer (Libraries Tab)</li> + printlog( "Close macro/library organizer" ) + kontext "TabBibliotheken" + TabBibliotheken.cancel() + + '///+<li>Close OpenOffice.org Basic Macros dialog</li> + printlog( "Close macro organizer" ) + kontext "Makro" + Makro.cancel() + + '///+<li>Cleanup: Close the document</li> + hDestroyDocument() + + '///+<li>Cleanup: Delete the library (directory)</li> + hDeleteFile( hGetWorkPath() & LIBRARY_NAME ) + + '///</ul> + + +endcase + diff --git a/testautomation/framework/optional/includes/basic_macros.inc b/testautomation/framework/optional/includes/basic_macros.inc new file mode 100755 index 000000000000..86b266ffda85 --- /dev/null +++ b/testautomation/framework/optional/includes/basic_macros.inc @@ -0,0 +1,473 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_macros.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +' ** +' ** owner : joerg.skottke@sun.com +' ** +' ** short description : check macro-dialogs / BASIC-IDE ( 1. part ) +' ** +'\****************************************************************************** + + +testcase tMakro_In_All_Apps + + '///<h1>Create a module for all applications, open and close Basic-IDE</h1> + + dim brc as boolean + dim cApp as string + dim iApp as Integer + dim bBug as Boolean + dim cMsg as string + bBug = FALSE + + const CMACRO = "AppMakro" + + '///<ul> + + for iApp = 1 to 7 + + cApp = hNumericDoctype( iApp ) + printlog( cApp ) + + '///+<li>Open a new document</li> + printlog( "Open a new document" ) + brc = hCreateDocument() + + '///+<li>Open the BASIC Macro Organizer</li> + '///+<li>Create a new library for the current document</li> + '///+<li>Create a new module for the current document<br> + '///+ -> The Basic IDE opens</li> + brc = hInitBasicIde( CMACRO ) + if ( not brc ) then + warnlog( "Could not open the BASIC Macro Organizer, aborting" ) + call hDestroyDocument() + goto endsub + endif + + '///+<li>Close the BASIC-IDE</li> + printlog "Close the BASIC-IDE" + brc = hCloseBasicIde() + + '///+<li>Close the navigator (Master-Doc)</li> + printlog( "Close the navigator (Master-doc)" ) + brc = hCloseNavigator() + + '///+<li>Close the document</li> + printlog( "Close the document" ) + FileClose + + '///+<li>Close the messagebox (document changed)</li> + printlog( "Close the messagebox (document changed)" ) + kontext "messagebox" + if ( MessageBox.Exists( 1 ) ) then + cMsg = MessageBox.getText() + cMsg = hRemoveLineBreaks( cMsg ) + printlog( "MessageBox: " & cMsg ) + MessageBox.No() + else + warnlog( "No warning for changed document" ) + end if + + next iApp + '///</ul> + +endcase + +'******************************************************************************* + +testcase tMakro_Dialog + + if ( gBuild < 9305 ) then + warnlog( "#i87457# - Application macros assigned to userlayer" ) + goto endsub + endif + + '///<h1>Dialogs: Macro Object Organizer, Tools/Customize</h1> + '///<ul> + + dim brc as boolean + dim cMsg as string + + dim iPos as integer + dim iLibraryItemCount as integer + + dim iCurrentLibrary as Integer + dim XLBFILE as String + XLBFILE = gTesttoolPath & "framework\optional\input\AppLibrary1\script.xlb" + const CFN = "tMakro_Dialog::" + const CMACRO = "MacroDlg" + + + gApplication = "Writer" + '///+<li>Open a new document</li> + printlog( "Open a new document" ) + brc = hCreateDocument() + + '///+<li>Open the basic organizer</li> + '///+<li>Create a new library for the current document</li> + '///+<li>Create a new module for the current document<br> + '///+ -> The Basic-Ide opens</li> + printlog( "Create a new library, a new module, open Basic-Ide" ) + brc = hInitBasicIde( CMACRO ) + if ( not brc ) then + warnlog( CFN & "Could not open BASIC-IDE, aborting" ) + goto endsub + endif + + '///+<li>Close the Basic IDE</li> + printlog( "Close the Basic-Ide" ) + kontext "BasicIDE" + hCloseBasicIde() + + '///+<li>Open the Basic Organizer</li> + printlog( "Open the Basic Macro Organizer" ) + brc = hOpenBasicOrganizerFromDoc() + + '///+<li>Select the module we created before</li> + printlog( "Select the last Module for the current document" ) + iPos = hSelectTheLastNode( MakroAus ) + + '///+<li>Open the Macro Obkect Organizer (Click Organize...)</li> + printlog( "Click Organize..." ) + Verwalten.Click() + + '///+<li>Select the Modules-tab</li> + printlog( "Select Modules-tab" ) + brc = hSelectBasicObjectOrganizerTab( 1 ) + + + '///+<li>Create a new module</li> + printlog( "Press 'new module'" ) + kontext "tabmodule" + NeuesModul.Click() + + kontext "neuesmodul" + '///+<li>Cancel the 'New Module' dialog</li> + printlog( "Cancel the dialog" ) + NeuesModul.Cancel() + + '///+<li>Create a 'New Dialog'</li> + brc = hSelectBasicObjectOrganizerTab( 2 ) + + kontext "tabdialogs" + printlog( "Press 'new dialog'" ) + NewDialog.Click() + + '///+<li>Cancel the dialog</li> + printlog( "Cancel the dialog" ) + kontext "neuerdialog" + NeuerDialog.Cancel() + + kontext + '///+<li>Activate TabLibrary on it 'New' / 'Password' / 'Delete' / 'Append' / 'Edit'</li> + printlog( "Select the libraries Tab" ) + brc = hSelectBasicObjectOrganizerTab( 3 ) + + + '///+<li>Press 'New' on the libraries tab</li> + printlog( "Press 'New' on the libraries tab" ) + kontext "tabbibliotheken" + Neu.Click() + + kontext "neuebibliothek" + '///+<li>Close the dialog with 'OK'</li> + printlog( "Close the dialog with 'OK'" ) + Call DialogTest( NeueBibliothek ) + NeueBibliothek.OK() + + '///+<li>Delete the new default library</li> + printlog( "Delete 'Library1'" ) + kontext "tabbibliotheken" + Loeschen.Click() + + '///+<li>Close the deletion warning</li> + printlog( "Close the warning" ) + kontext "active" + if ( Active.Exists() ) then + cMsg = active.getText() + cMsg = hRemoveLineBreaks( cMsg ) + printlog( "MessageBox: " & cMsg ) + Active.Yes() + else + warnlog( "Deletion warning is missing" ) + endif + + '///+<li>Check the number of entries in the Libraries-List, one expected</li> + printlog( "Check the number of libraries in list" ) + kontext "tabbibliotheken" + iLibraryItemCount = Bibliotheksliste.getItemCount() + if ( iLibraryItemCount <> 1 ) then + if ( iLibraryItemCount = 11 ) then + warnlog( "#i87457# Macros moved from 'OpenOffice.org Macros' to 'My Macros'" ) + else + warnlog( "Incorrect item count. Should be 1, is: " & iLibraryItemCount ) + endif + endif + + '///+<li>Append a library by pressing 'Append'</li> + printlog( "Append a xlb-file" ) + kontext "tabbibliotheken" + Hinzufuegen.Click() + + '///+<li>Select a valid library and open it</li> + printlog( "Select 'AppLibrary1/script.xlb' from the files list" + kontext "oeffnendlg" + Dateiname.SetText( ConvertPath ( XLBFILE ) ) + Oeffnen.Click() + + ' If the .xlb file cannot be found the test cannot continue. Warn and cleanup. + kontext "Active" + if ( Active.exists( 1 ) ) then + + try + Active.getButtonCount() + + warnlog( "Script does not exist warning displayed. Aborting test" ) + printlog( Active.getText() ) + active.ok() + + kontext "OeffnenDlg" + if ( OeffnenDlg.exists( 1 ) ) then + printlog( "Closing File Open dialog" ) + OeffnenDlg.cancel() + endif + + kontext "tabbibliotheken" + if ( TabBibliotheken.exists( 1 ) ) then + printlog( "Closing Libaries tab" ) + TabBibliotheken.close() + endif + + kontext "Makro" + if ( Makro.exists( 1 ) ) then + printlog( "Closing Macro organizer" ) + Makro.close() + endif + + printlog( "Exiting test" ) + goto endsub + catch + printlog( "Script found and loaded. Good." ) + endcatch + + endif + + '///+<li>Make sure 'Insert as Reference' is unchecked</li> + printlog( "Ensure 'Insert as Reference' is unchecked" ) + kontext "appendlibraries" + InsertAsReference.UnCheck() + + '///+<li>Check 'Replace Existing Library'</li> + printlog( "Check 'Replace existing library'" ) + ReplaceExistingLibraries.Check() + + '///+<li>Press 'OK' to append the library</li> + printlog( "Press 'OK' to append the library" ) + kontext "appendlibraries" + try + AppendLibraries.OK() + catch + warnlog( "#i85254# Appending libraries leads to crash" ) + endcatch + + '///+<li>Check the number of entries in the Libraries-List, two expected</li> + printlog( "Check the number of libraries in list (should be two)" ) + kontext "tabbibliotheken" + iLibraryItemCount = Bibliotheksliste.getItemCount() + if ( iLibraryItemCount <> 2 ) then + qaerrorlog( "#i87457# Two entries in list expected, found " & iLibraryItemCount ) + endif + + '///+<li>Select 'AppLibrary1' and click 'Password'</li> + printlog( "Select the first item" ) + Bibliotheksliste.TypeKeys( "<HOME>" ) + for iCurrentLibrary = 1 to iLibraryItemCount + if ( Bibliotheksliste.getSelText() = "AppLibrary1" ) then + printlog( "Found AppLibrary1" ) + exit for + endif + printlog( "This was not AppLibrary1, trying again" ) + Bibliotheksliste.Typekeys( "<DOWN>" ) + next iCurrentLibrary + + '///+<li>Click to set a password for AppLibrary1, cancel dialog</li> + printlog( "Set a password for AppLibrary1" ) + kontext "tabbibliotheken" + if ( Passwort.IsEnabled() ) then + Passwort.Click() + kontext "passwddlg" + PasswdDLG.Cancel() + else + warnlog( "Password is disabled for 'AppLibrary1'" ) + endif + + '///+<li>Delete the inserted library (AppLibrary1)</li> + printlog( "Delete 'AppLibrary1'" ) + kontext "tabbibliotheken" + Loeschen.Click() + + '///+<li>Close the warning with YES</li> + printlog( "Close the warning with YES" ) + kontext "active" + if ( Active.Exists() ) then + cMsg = active.getText() + cMsg = hRemoveLineBreaks( cMsg ) + printlog( "MessageBox: " & cMsg ) + Active.Yes() + else + warnlog( "Expected confirmation dialog for delete" ) + endif + + '///+<li>Click on the Edit-button -> The Basic-Ide opens</li> + kontext "tabbibliotheken" + printlog( "Press 'edit' on 'Libraries'-tab" ) + Bearbeiten.Click() + + '///+<li>Close the Basic-Ide</li> + kontext "BasicIDE" + if ( BasicIDE.Exists( 5 ) ) then + + hInsertMacro( 3 ) + + printlog( "Close the basic-document" ) + brc = hCloseBasicIde() + + kontext "active" + if ( Active.Exists ( 2 ) ) then + cMsg = active.getText() + cMsg = hRemoveLineBreaks( cMsg ) + warnlog( "Unexpected MessageBox: " & cMsg ) + Active.NO() + endif + + else + warnlog("#i38978# The Macro-Document is not open, aborting test") + call hDestroyDocument() + goto endsub + endif + + '///+<li>Open the BASIC Macro Organizer from the current document</li> + printlog( "Open the BASIC Macro Organizer" ) + brc = hOpenBasicOrganizerFromDoc() + + '///+<li>Go to the last macro in the list</li> + printlog( "Select the last macro from the list" ) + kontext "makro" + iPos = hSelectTheLastNode( MakroAus ) + + try + '///+<li>Assign the macro by pressing 'Assign' -> Tools/customize opens</li> + printlog( "Assign the macro, Tools/customize dialog should open" ) + Zuordnen.Click () + catch + warnlog( "#i106853# Assign-Button is disabled or macro is missing" ) + endcatch + + '///+<li>Activate all tapages and cancel the Tools/Customize dialog</li> + printlog( "Activate all tapages and cancel the Tools/Customize dialog" ) + + brc = hToolsCustomizeSelectTab( "menu" ) + brc = hToolsCustomizeSelectTab( "keyboard" + if ( not brc ) then + qaerrorlog( "#i61765# Keyboard tab missing when called via Tools/Macros->Assign" ) + endif + brc = hToolsCustomizeSelectTab( "events" ) + brc = hToolsCustomizeSelectTab( "toolbars" ) + + '///+<li>Cancel Tools/Customize dialog -> Back to Macro Organizer</li> + printlog( "Cancel Tools/Customize dialog -> Macro Organizer should be open" ) + brc = hToolsCustomizeClose( 2 ) + + + '///+<li>Click to run the macro</li> + printlog "Click to run macro" + kontext "makro" + try + Ausfuehren.Click() + catch + warnlog( "Unable to run macro" ) + kontext "Makro" + Makro.close() + endcatch + + '///+<li>The macro thriggers a messagebox, close it</li> + kontext "active" + if ( active.exists() ) then + cMsg = active.getText() + cMsg = hRemoveLineBreaks( cMsg ) + if ( cMsg = "TTMacro3" ) then + printlog( "The correct macro has been executed" ) + else + warnlog( "Unknown Messagebox: " & cMsg ) + endif + Active.OK() + endif + + '///+<li>Open Macro organizer from the current document</li> + printlog( "Open macro organizer from the current document" ) + brc = hOpenBasicOrganizerFromDoc() + + '///+<li>Select the last item in the treelist</li> + printlog( "Select the last item in the treelist" ) + brc = hSelectTheLastNode( MakroAus ) + + '///+<li>Delete the module we created earlier</li> + printlog( "Delete the new module" ) + Loeschen.Click() + + '///+<li>Close the deletion warning</li> + printlog( "Close the deletion warning" ) + kontext "active" + if ( active.exists() ) then + cMsg = active.getText() + cMsg = hRemoveLineBreaks( cMsg ) + printlog( "MessageBox: " & cMsg ) + Active.Yes() + else + warnlog( "No confirmation dialog for delete" ) + endif + + '///+<li>Close the macro organizer</li> + printlog( "Close the macro organizer" ) + kontext "makro" + Makro.Close() + + '///+<li>Close the document</li> + printlog( "Close the document" ) + Call hDestroyDocument() + + '///</ul> + +endcase + + + diff --git a/testautomation/framework/optional/includes/basic_modulehide.inc b/testautomation/framework/optional/includes/basic_modulehide.inc new file mode 100755 index 000000000000..aa5f127ead2e --- /dev/null +++ b/testautomation/framework/optional/includes/basic_modulehide.inc @@ -0,0 +1,119 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_modulehide.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Verify that hiding modules works +'* +'\****************************************************************************** + +testcase tBasicIdeModuleHide + + '///<h1>Hiding modules (make them invisible)</h1> + '///<ul> + + const CFN = "tBasicIdeModuleHide::" + + dim rc as integer + dim brc as boolean + dim cDefaultTabName as string + + gApplication = "Writer" + call hNewDocument() + + '///<li>Create a new BASIC module for the current (writer) document</li> + brc = hOpenBasicOrganizerFromDoc() + brc = hCreateModuleForDoc() + + '///<li>Write a macro (one that is unique to all modules)</li> + brc = hInsertMacro( 1 ) + if ( brc ) then + printlog( CFN & "Macro has been written successfully" ) + else + warnlog( CFN & "Failed to insert macro" ) + endif + + '///<li>Hide the module using the Tab-Bar's context menu</li> + rc = hHideModule() + if ( rc > 0 ) then + warnlog( "Some unexpected error occurred while trying to hide the module" ) + endif + + '///<li>Verify if the module is really hidden.</li> + try + ' hTestMacro is expected to fail, so we jump to the catch statement + rc = hTestMacro( 1 ) + if ( rc = 0 ) then + warnlog( "For some reason the original module is still visible" ) + else + warnlog( "There should not be any editingwindow visible" ) + endif + catch + printlog( " * unable to locate editwindow -> no module visible." ) + endcatch + + '///<li>Open the BASIC organizer and select the hidden module</li> + if ( hOpenBasicObjectOrganizer( 1 ) ) then + + modulliste.typekeys( "<END><RIGHT><DOWN><RIGHT><DOWN>" ) + '///<li>Click 'Edit' to open the module in the IDE</li> + try + bearbeiten.click() + catch + warnlog( "#i35097# Crash when editing last module" ) + endcatch + + + '///<li>Verify that the correct module is visible</li> + rc = hTestMacro( 1 ) + if ( rc = 1 ) then + printlog( " * the correct macro-module is open. Good." ) + else + warnlog( "The open macro-module is not the one that was expected" ) + endif + + '///<li>Close IDE and document</li> + hCloseBasicIDE() + + call hCloseDocument() + + else + + warnlog( "restarting the office to recover from errors" ) + call exitRestartTheOffice() + + endif + + '///</ul> + +endcase diff --git a/testautomation/framework/optional/includes/basic_modulenames.inc b/testautomation/framework/optional/includes/basic_modulenames.inc new file mode 100755 index 000000000000..85c58ddf1b73 --- /dev/null +++ b/testautomation/framework/optional/includes/basic_modulenames.inc @@ -0,0 +1,456 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_modulenames.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Test modulenames on the tabbar +'* +'\****************************************************************************** + +testcase tBasicIdeModuleNames + + '///<h1>Naming conventions in BASIC-IDE module-/dialog-tabs</h1> + + dim rc as integer + dim brc as boolean + dim i as integer + dim iCurrentName as integer + const CMODULE = "TModuleNames" + dim cTabName as string + + gApplication = "Writer" + hCreateDocument() + + ' ------ prerequisites --------- + + '///<ul> + '///+<li>Create a new module for the current (writer) document</li> + brc = hInitBasicIde( CMODULE ) + + + brc = hInsertMacro( 1 ) + if ( rc <> 0 ) then + warnlog( "Failed to insert macro" ) + endif + + '///+<li>Verify that the name makes it to the BASIC macro organizer</li> + cTabName = hGetTabNameFromOrganizer() + + '///+<li>Try to name the tab something containing invalid characters (should fail)</li> + Randomize + iCurrentName = Int( 24 * RND ) + 1 ' Range from 1 to 24 + + cTabName = hCreateInvalidModuleName( iCurrentName ) + rc = hRenameTab( cTabName ) + if ( rc = 1 ) then + hHandleInvalidNameWarning( cTabname ) + else + warnlog( "Warning missing" ) + endif + + '///+<li>Try to name the tab to the current name (should work)</li> + cTabname = CMODULE + rc = hRenameTab( cTabname ) + if ( rc <> 0 ) then + brc = hHandleInvalidNameWarning( cTabname ) + if ( brc ) then + warnlog( "Failed to set valid name" ) + endif + endif + + + '///+<li>Finally try to give the tab a valid name (should work)</li> + cTabname = hCreateInvalidModuleName( 0 ) + rc = hRenameTab( cTabName ) + if ( rc <> 0 ) then + brc = hHandleInvalidNameWarning( cTabname ) + if ( brc ) then + warnlog( "Failed to set valid name" ) + endif + endif + + + '///+<li>Verify that we are still in the same IDE-Window</li> + rc = hTestMacro( 1 ) + if ( rc <> 1 ) then + warnlog( "The open macro-module is not the one that was expected" ) + endif + + '///+<li>Close IDE and document</li> + hCloseBasicIDE() + + hDestroyDocument() + '///</ul> + +endcase + +'******************************************************************************* + +testcase tInvalidModuleNames + + '///<h1>Module naming conventions: Forbidden characters in module names</h1> + + dim brc as boolean + dim cMsg as string + dim iCurrentName as Integer + + dim sSeparator as String + dim cModuleName as string + + '///<ul> + '///+<li>Open a new writer document</li> + '///+<li>Open the BASIC Macro Organizer</li> + '///+<li>Select the last module (Document BASIC)</li> + '///+<li>Click the "New" button</li> + hBasicModuleCreateNew() + + '///+<li>Try a couple of names including '-', '+', '!', '(' ... <br> + '///+ -> Invalid name warnings are expected for all of these names</li> + + Randomize + iCurrentName = Int( 24 * RND ) + 1 ' Range from 1 to 24 + + cModuleName = hCreateInvalidModuleName( iCurrentName ) + printlog( "" ) + printlog( "Trying module name: " & cModuleName ) + + brc = hNameBasicModule( cModuleName ) + + '///+<li>Check if the Basic-Ide is open (should not be)</li> + if ( brc ) then + warnlog( "Basic-Ide should not open for invalid module names" ) + + ' try to recover and continue for other names + brc = hCloseBasicIde() + brc = hDestroyDocument + brc = hBasicModuleCreateNew() + + ' if we cannot recover, exit the test + if ( not brc ) then + goto endsub + endif + endif + + + '///+<li>Close the naming dialog</li> + printlog( "Close the naming dialog (cancel)" ) + kontext "neuesmodul" + if ( NeuesModul.Exists() ) then + NeuesModul.Cancel() + endif + + '///+<li>Close the macro dialog</li> + printlog( "Clsoe macro dialog (if it exists)" ) + kontext "makro" + if ( Makro.Exists() ) then + Makro.Close() + endif + + '///+<li>Close the last document</li> + printlog( "Close the document" ) + brc = hDestroyDocument() + '///</ul> + +endcase + +'******************************************************************************* + +testcase tValidModuleNames + + '///<h1>Module naming conventions: Basic keywords, underscores, long names</h1> + + dim brc as boolean + dim cMsg as string + dim iCurrentName as Integer + + dim sKeyword as String + + '///<ul> + '///+<li>Open a new writer document</li> + '///+<li>Open the BASIC Macro Organizer</li> + '///+<li>Select the last module (Document BASIC)</li> + '///+<li>Click the "New" button</li> + hBasicModuleCreateNew() + + '///+<li>Try a couple of basic keywords as module names such as + '///+ open, print, select, function etc.</li> + Randomize + iCurrentName = Int( 8 * RND ) + 1 ' Range from 1 to 8 + + select case iCurrentName + case 1 : sKeyword = "option" + case 2 : sKeyword = "sub" + case 3 : sKeyword = "function" + case 4 : sKeyword = "end" + case 5 : sKeyword = "exit" + case 6 : sKeyword = "_underscore1" + case 7 : sKeyword = "underscore_2" + case 8 : sKeyWord = "ThisIsQuiteALongNameForAModuleDontYouThink" + end select + + printlog( "" ) + printlog( "Trying module name: " & sKeyword ) + + brc = hNameBasicModule( sKeyword ) + + '///+<li>Check if the Basic-Ide is open (should not be)</li> + if ( brc ) then + + ' try to recover and continue for other names + brc = hCloseBasicIde() + brc = hDestroyDocument + brc = hBasicModuleCreateNew() + + ' if we cannot recover, exit the test + if ( not brc ) then + goto endsub + endif + endif + + '///+<li>Close the naming dialog</li> + printlog( "Close the naming dialog (cancel)" ) + kontext "neuesmodul" + if ( NeuesModul.Exists() ) then + NeuesModul.Cancel() + endif + + '///+<li>Close the macro dialog</li> + printlog( "Clsoe macro dialog (if it exists)" ) + kontext "makro" + if ( Makro.Exists() ) then + Makro.Close() + endif + + '///+<li>Close the last document</li> + printlog( "Close the document" ) + brc = hDestroyDocument() + '///</ul> + +endcase + +'******************************************************************************* + +function hBasicModuleCreateNew() as boolean + + '///<h3>Create a new doc, open Basic organizer, select last module, click New...</h3> + '///<i>Starting point: The first doc!</i><br> + '///<u>Input</u>: + '///<ol> + '///+<li>Nothing</li> + '///</ol> + '///<u>Returns</u>: + '///<ol> + '///+<li>Errorcode (boolean) </li> + '///<ul> + '///+<li>True if module naming dialog is open</li> + '///+<li>False on any other condition</li> + '///</ul> + '///</ol> + '///<u>Description</u>: + '///<ul> + + dim brc as boolean + brc = false + + dim iPos as integer + + const CFN = "hBasicModuleCreateNew::" + + '///+<li>Open a new writer document</li> + gApplication = "Writer" + brc = hCreateDocument() + + '///+<li>Open the BASIC Macro Organizer</li> + brc = hOpenBasicOrganizerFromDoc() + if ( not brc ) then + warnlog( CFN & "Could not open the BASIC Macro Organizer, aborting" ) + hDestroyDocument() + endif + + '///+<li>Select the last module (Document BASIC)</li> + if ( brc ) then + iPos = hSelectTheLastNode( MakroAus ) + if ( not Neu.isEnabled() ) then + warnlog( CFN & "New button is disabled for the current module, aborting" ) + kontext "Makro" + Makro.cancel() + brc = hDestroyDocument() + endif + endif + + '///+<li>Click the "New" button</li> + '///+<li>Verify that the renaming dialog is open</li> + if ( brc ) then + + printlog( "Click 'New'" ) + Neu.Click() + + kontext "NeuesModul" + if ( Neuesmodul.exists() ) then + brc = true + printlog( CFN & "Naming dialog is open" + endif + endif + + hBasicModuleCreateNew() = brc + '///</ul> + +end function + +'******************************************************************************* + +function hHandleInvalidNameWarning( cTabName as string ) as boolean + + '///<h3>Handle the "Invalid name" dialog when renaming a module</h3> + '///<u>Input</u>: + '///<ol> + '///+<li>Name of the tab</li> + '///<ul> + '///+<li>Used for debugging purpose (printlogs only)</li> + '///</ul> + '///</ol> + '///<u>Returns</u>: + '///<ol> + '///+<li>Errorcondition (boolean)</li> + '///<ul> + '///+<li>TRUE if warning was displayed and closed correctly</li> + '///+<li>FALSE on any other condition</li> + '///</ul> + '///</ol> + '///<u>Description</u>: + '///<ul> + + dim brc as boolean : brc = false + dim iTry as integer + + const CFN = "hHandleInvalidNameWarning::" + + '///+<li>Test for a messagebox (Invalid name warning), warn if missing</li> + kontext "Active" + for iTry = 1 to 5 + + if ( active.exists( 1 ) ) then + + if ( brc ) then + warnlog( CFN & "Too many invalid name warnings" ) + endif + + '///+<li>Retrieve the text from the messagebox, printlog</li> + printlog( CFN & "Message: " & active.getText() ) + + '///+<li>Click OK on the messagebox</li> + active.ok() + brc = true + + else + + if ( not brc ) then + warnlog( CFN & "Invalid name warning missing" ) + endif + + endif + + next iTry + + '///+<li>Return to Basic Ide, take focus from Tabbar</li> + kontext "basicide" + tabbar.typekeys( "<ESCAPE>" , true ) + hHandleInvalidNameWarning() = brc + '///</ul> + +end function + +'******************************************************************************* + +function hCreateInvalidModuleName( iName as integer ) as string + + '///<h3>Retrieve an invalid module name for Basic IDE by index</h3> + '///<u>Input</u>: + '///<ol> + '///+<li>Index (integer)</li> + '///<ul> + '///+<li>0 = insert underscore which creates a valid name</li> + '///+<li>1 ... 23 = insert characters like &, +, i, ;, etc. (invalid)</li> + '///+<li>> 23 = no character will be definde</li> + '///</ul> + '///</ol> + '///<u>Returns</u>: + '///<ol> + '///+<li>Name for a module (string)</li> + '///<ul> + '///+<li>Name of type "ttModule<Char>X"</li> + '///</ul> + '///</ol> + '///<u>Description</u>: + '///<ul> + + dim sSeparator as string + + ' Note: We cannot test for "<" and ">" because these are the characters + ' that identify keystrokes for the .typeKeys() method. + + '///+<li>Assign a character by index</li> + select case iName + case 0 : sSeparator = "_" + case 1 : sSeparator = "-" + case 2 : sSeparator = "." + case 3 : sSeparator = "," + case 4 : sSeparator = "+" + case 5 : sSeparator = ":" + case 6 : sSeparator = "!" + case 7 : sSeparator = "$" + case 8 : sSeparator = "(" + case 9 : sSeparator = ")" + case 10 : sSeparator = "=" + case 11 : sSeparator = "?" + case 12 : sSeparator = "*" + case 13 : sSeparator = " " + case 14 : sSeparator = "&" + case 15 : sSeparator = "\" + case 16 : sSeparator = "/" + case 17 : sSeparator = "§" + case 18 : sSeparator = """" + case 19 : sSeparator = "'" + case 20 : sSeparator = "@" + case 21 : sSeparator = "[" + case 22 : sSeparator = "]" + case 23 : sSeparator = "%" + case 24 : sSeparator = CHR$( 387 ) + case else : sSeparator = "" + end select + + '///+<li>Build a string containing the character</li> + hCreateInvalidModuleName() = "ttModule" & sSeparator & "X" + '///</ul> + +end function diff --git a/testautomation/framework/optional/includes/basic_modules.inc b/testautomation/framework/optional/includes/basic_modules.inc new file mode 100755 index 000000000000..14a24959a74c --- /dev/null +++ b/testautomation/framework/optional/includes/basic_modules.inc @@ -0,0 +1,161 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_modules.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Edit several modules and dialogs in basic ide +'* +'\****************************************************************************** + + +testcase tMore_Modules_Dialogs + + '///<h1>Work with macros - create multiple modules</h1> + '///<ul> + + dim brc as boolean + + dim iCurrentTab as integer + + dim cFile as string + cFile = gOfficePath & "user\work\basic.odt" + + const FILTER = "writer8" + + 'const iTABCOUNT is the number of dialogs and modules. + 'If iTABCOUNT = 10 then 20 tabs (+ the first one!) = 21 should be created. + + const iTABCOUNT as Integer = 10 + const CMODULE = "TTMODULE" + + '///+<li>Delete workfile just in case it was left over by prior testrun</li> + hDeleteFile( cFile ) + + '///+<li>Create a new Writer document.</li> + printlog "open a new writer-doc" + gApplication = "WRITER" + hCreateDocument() + + '///+<li>Create a new module for the new document (named TTModule)</li> + brc = hInitBasicIDE( CMODULE ) + + '///+<li>Insert 10 modules.</li> + printlog "insert 10 modules" + + for iCurrentTab = 1 to iTABCOUNT + printlog " - insert new module : " & iCurrentTab + + kontext "basicide" + Tabbar.OpenContextMenu + hMenuSelectNr(1) + hMenuSelectNr(1) + brc = hDeleteMacro() + if ( brc ) then + EditWindow.TypeKeys "'# " & ( iCurrentTab + 1 ) & ". module in this document" + endif + next iCurrentTab + + '///+<li>Insert 10 dialogs</li> + printlog "insert 10 dialogs" + + for iCurrentTab = 1 to iTABCOUNT + printlog " - insert new dialog : " & iCurrentTab + Tabbar.OpenContextMenu + hMenuSelectNr(1) + hMenuSelectNr (2) + + if DialogWindow.Exists (2) <> TRUE then + warnlog "No dialog window is shown!" + end if + + next iCurrentTab + + '///+<li>Close the BasicIDE.</li> + printlog Chr(13) + "- close the BasicIDE" + hCloseBasicIDE() + + '///+<li>Save the document.</li> + printlog Chr(13) + "- save the document" + Call hFileSaveAsWithFilterKill( cFile , FILTER ) + + '///+<li>Close the document</li> + printlog Chr(13) + "- close the document" + hDestroyDocument() + + '///+<li>Open the saved document</li> + printlog Chr(13) + "- open the saved document" + hFileOpen( cFile ) + + '///+<li>Open the BASIC Organizer, select the module for the current document</li> + ToolsMacro_uno + kontext "Makro" + hSelectNodeByName( MakroAus , CMODULE ) + + '///+<li>Select the last module and open the BASIC IDE.</li> + Bearbeiten.Click() + + '///+<li>Delete all modules and dialogs.</li> + printlog "delete all modules and dialogs" + + for iCurrentTab = 1 to ( 2 * iTABCOUNT + 1 ) + + try + printlog "delete - " & iCurrentTab & "/" & ( 2 * iTABCOUNT + 1 ) + UseBindings + + kontext "basicide" + Tabbar.OpenContextMenu + + hMenuSelectNr( 2 ) + + kontext "active" + + if Active.Exists then + Active.Yes + else + warnlog "No warning after deleting a dialog!" + end if + + catch + QAErrorLog "Deleting - " & iCurrentTab & "/" & ((2 * iTABCOUNT)+1) & " failed." + endcatch + + next iCurrentTab + + hDestroyDocument() + hDestroyDocument() + + '///</ul> + +endcase + diff --git a/testautomation/framework/optional/includes/basic_package_export.inc b/testautomation/framework/optional/includes/basic_package_export.inc new file mode 100755 index 000000000000..e1db3ddabfe7 --- /dev/null +++ b/testautomation/framework/optional/includes/basic_package_export.inc @@ -0,0 +1,181 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_package_export.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Export BASIC libraries as package +'* +'\****************************************************************************** + +testcase tBasicPackageExport + + '///<h1>Export a BASIC library as UNO package</h1> + ' Assumption: All actions take place in the user/work directory + ' macro taken from framework/tools/input/macros.txt::tBasicLibraryExport + + const PACKAGE_NAME = "tBasicExport.oxt" + const LIBRARY_NAME = "tBasicExport" + const DOCUMENT_POSITION = 4 + + dim cDocumentName as string + dim cLibraryName as string + + dim iNodeCount as integer + + dim iCurrentLib as integer + + dim cFile as string + cFile = hGetWorkPath() & PACKAGE_NAME + + ' cleanup + hDeleteFile( cFile ) + + hExtensionRemoveGUI( PACKAGE_NAME ) + + + '///<ul> + '///+<li>Make sure that we have exactly one open document</li> + hInitSingleDoc() + hChangeDoc() + + '///+<li>Create a new writer document</li> + printlog( "Create a new documentbound library for export" ) + gApplication = "WRITER" + hCreateDocument() + + '///+<li>Go to Tools/Macros/Organize Macros/OpenOffice.org Basic</li> + ToolsMacro_uno + + '///+<li>Select the last node (number 4, document untitled2)</li> + kontext "Makro" + iNodeCount = hGetNodeCount( MakroAus ) + cDocumentName = hSelectNode( MakroAus, iNodeCount ) + + '///+<li>Click to open the organizer</li> + Verwalten.click() + + '///+<li>Switch to the libraries-tab</li> + hSelectBasicObjectOrganizerTab( 3 ) + + '///+<li>Select the document (untitled2 at pos. 4)</li> + kontext "TabBibliotheken" + Bibliothek.select( DOCUMENT_POSITION ) + + ' verify that the correct document is selected + if ( Bibliothek.getSelText() <> cDocumentName ) then + warnlog( "Incorrect document selected on libraries tab, aborting" ) + goto endsub + endif + + '///+<li>Click to create a new library</li> + Neu.click() + + '///+<li>Name the library "tBasicLibraryExport", confirm with ok</li> + kontext "NeueBibliothek" + BibliotheksName.setText( LIBRARY_NAME ) + NeueBibliothek.ok() + + '///+<li>Verify that the correct library is selected</li> + kontext "TabBibliotheken" + cLibraryName = BibliotheksListe.getSelText() + + '///+<li>Click to edit the library</li> + Bearbeiten.click() + + '///+<li>Insert a macro (e.g. to print a messagebox)</li> + hInsertMacroFromFile( LIBRARY_NAME ) + + '///+<li>Close the Basic IDE</li> + hCloseBasicIDE() + + '///+<li>Go to Tools/Macros/Organize Macros/OpenOffice.org Basic</li> + ToolsMacro_uno + + '///+<li>Select the last node (untitled2)</li> + kontext "Makro" + iNodeCount = hGetNodeCount( MakroAus ) + hSelectNode( MakroAus, iNodeCount ) + + '///+<li>Click to open the organizer</li> + Verwalten.click() + + '///+<li>Switch to the libraries-tab</li> + hSelectBasicObjectOrganizerTab( 3 ) + + '///+<li>Select the document (untitled2 at pos. 4)</li> + kontext "TabBibliotheken" + Bibliothek.select( DOCUMENT_POSITION ) + + '///+<li>Find the new library, select it</li> + printlog( "Select the new library" ) + kontext "TabBibliotheken" + for iCurrentLib = 1 to Bibliotheksliste.getItemCount() + Bibliotheksliste.select( iCurrentLib ) + if ( Bibliotheksliste.getSelText() = LIBRARY_NAME ) then + exit for + endif + next iCurrentLib + + '///+<li>Click Export</li> + kontext "TabBibliotheken" + printlog( "Export the package, close the document afterwards" ) + Export.click() + + '///+<li>Select to export as package, click ok</li> + kontext "ExportBasicLibraryDlg" + ExportAsPackage.check() + ExportBasicLibraryDlg.ok() + + '///+<li>Name the package "tBasicLibraryExportAsPackage", save it</li> + kontext "SpeichernDlg" + DateiName.setText( hGetWorkPath() & LIBRARY_NAME ) ' automatic filename extension/uno-pkg is default + Speichern.click() + + '///+<li>Close the macro organizer</li> + kontext "TabBibliotheken" + TabBibliotheken.cancel() + + '///+<li>Close OpenOffice.org Basic Macros dialog</li> + kontext "Makro" + Makro.cancel() + + '///+<li>Close the first document</li> + hDestroyDocument() + + '///+<li>Close the second document</li> + hDestroyDocument() + + '///</ul> + +endcase + diff --git a/testautomation/framework/optional/includes/basic_package_import.inc b/testautomation/framework/optional/includes/basic_package_import.inc new file mode 100755 index 000000000000..a49774320482 --- /dev/null +++ b/testautomation/framework/optional/includes/basic_package_import.inc @@ -0,0 +1,168 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_package_import.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Import BASIC library via Package Manager GUI as UNO Package +'* +'\****************************************************************************** + +testcase tBasicPackageImport + + '///<h1>Import BASIC library as UNO package via Package Manager UI</h1> + + ' Assumption: All actions take place in the user/work directory + ' macro taken from framework/tools/input/macros.txt::tBasicLibraryExport + + dim package_name as string + + ' CWS jl44 introduced .oxt for extensions + if ( gBuild < 9075 ) then + package_name = "tBasicExport.uno.pkg" + qaerrorlog( "Using old extension naming scheme" ) + else + package_name = "tBasicExport.oxt" + endif + + const LIBRARY_NAME = "tBasicExport" + + dim cDocumentName as string + dim cLibraryName as string + + dim iNodeCount as integer + dim iCurrentLib as integer + dim iStatus as integer + + dim cFile as string + cFile = hGetWorkPath() & package_name + + '///<ul> + gApplication = "WRITER" + + '///+<li>Open the package manager ui</li> + '///+<li>Add a package</li> + '///+<li>Select "tBasicLibraryExportAsPackage.oxt", import it</li> + '///+<li>Close the package manager ui</li> + iStatus = hExtensionAddGUI( cFile, false ) + + ' Evaluate the returncode. Anything different from 0 causes the test to end. + if ( iStatus <> 0 ) then + warnlog( "Error adding extension. Aborting." ) + goto endsub + endif + + '///+<li>Run the macro via Macro Organizer</li> + hMacroOrganizerRunMacro( LIBRARY_NAME ) + + '///+<li>The macro triggers a dialog, close it</li> + kontext "active" + if ( active.exists( 5 ) ) then + active.ok() + else + warnlog( "The macro was not executed" ) + endif + + '///+<li>Go to Tools/Macros/Organize Macros/OpenOffice.org Basic</li> + ToolsMacro_uno + + '///+<li>Select the first node (My Macros)</li> + kontext "Makro" + MakroAus.select( 1 ) + + '///+<li>Click to open the organizer</li> + Verwalten.click() + + '///+<li>Switch to the libraries-tab</li> + hSelectBasicObjectOrganizerTab( 3 ) + + '///+<li>Select My Macros & Dialogs</li> + kontext "TabBibliotheken" + Bibliothek.select( 1 ) + + '///+<li>Find the new library, select it</li> + printlog( "Select the new library" ) + kontext "TabBibliotheken" + for iCurrentLib = 1 to Bibliotheksliste.getItemCount() + Bibliotheksliste.select( iCurrentLib ) + if ( Bibliotheksliste.getSelText() = LIBRARY_NAME ) then + exit for + endif + next iCurrentLib + cLibraryName = BibliotheksListe.getSelText() + + '///+<li>Click to import -> #i64007</li> + try + Hinzufuegen.click() + catch + warnlog( "#i64007 - Office crashes on clicking import button" ) + endcatch + + '///+<li>Cancel the FileOpen dialog</li> + kontext "OeffnenDlg" + OeffnenDlg.cancel() + + '///+<li>Cleanup: Delete the library</li> + printlog( "Cleanup: Delete Library, close dialogs and remove package" ) + + ' Note: It is assumed that the library is selected + kontext "TabBibliotheken" + cLibraryName = BibliotheksListe.getSelText() + if ( cLibraryName <> LIBRARY_NAME ) then + warnlog( "Incorrect library is selected" & cLibraryName ) + else + Loeschen.click() + + kontext "active" + if ( active.exists( 1 ) ) then + active.yes() + else + warnlog( "No warning for library deletion" ) + endif + endif + + + '///+<li>Cleanup: Close Libraries organizer</li> + kontext "TabBibliotheken" + TabBibliotheken.cancel() + + '///+<li>Cleanup: Close Macro Organizer</li> + kontext "Makro" + Makro.cancel() + + '///+<li>Remove package via package manager</li> + hExtensionRemoveGUI( package_name ) + + '///</ul> + +endcase + diff --git a/testautomation/framework/optional/includes/basic_protected_libraries.inc b/testautomation/framework/optional/includes/basic_protected_libraries.inc new file mode 100755 index 000000000000..b75f85c6f75e --- /dev/null +++ b/testautomation/framework/optional/includes/basic_protected_libraries.inc @@ -0,0 +1,188 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_protected_libraries.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Test protected libraries +'* +'\****************************************************************************** + +testcase tProtectedLibraries + + '///<H1>Test protected libraries</H1> + '///<ul> + + const CLIB = "aaTestLib" + const CPASSWORD = "SomePassword" + const IMACRO = 3 + + dim irc as integer + dim cPBAFile as string + cPBAFile = gOfficePath & "user\basic\" & CLIB & "\Module1.pba" + cPBAFile = convertpath( cPBAFile ) + + dim iPBAFile as long + dim iCurrentLib as integer + dim cMsg as string + + '///+<li>Open the Basic Organizer</li> + hOpenBasicOrganizerFromDoc() + + '///+<li>Ensure the node "My Macros" is selected</li> + printlog( "Select My Macros" ) + kontext "Makro" + hSelectNode( MakroAus , 1 ) + + '///+<li>Click "Organizer..."</li> + printlog( "Organize..." ) + Verwalten.click() + + '///+<li>Select the libraries tab</li> + hSelectBasicObjectOrganizerTab( 3 ) + + '///+<li>Click "New..."</li> + printlog( "New..." ) + kontext "TabBibliotheken" + Neu.click() + + '///+<li>Name the libraray, click "OK"</li> + printlog( "Name the Library" ) + kontext "NeueBibliothek" + BibliotheksName.setText( CLIB ) + NeueBibliothek.ok() + + '///+<li>Find the new library, select it</li> + printlog( "Select the new library" ) + kontext "TabBibliotheken" + for iCurrentLib = 1 to Bibliotheksliste.getItemCount() + Bibliotheksliste.select( iCurrentLib ) + if ( Bibliotheksliste.getSelText = CLIB ) then + exit for + endif + next iCurrentLib + + '///+<li>Click "Password..."</li> + printlog( "Set Password" ) + kontext "TabBibliotheken" + Passwort.click() + + '///+<li>Give a password, confirm with "OK"</li> + kontext "PasswdDLG" + NewPassword.setText( CPASSWORD ) + Confirm.setText( CPASSWORD ) + PasswdDLG.ok() + + '///+<li>Edit the protected library</li> + printlog( "Edit the library" ) + kontext "TabBibliotheken" + Bearbeiten.click() + + '///+<li>Modify the macro</li> + Kontext "BasicIDE" + hInsertMacro( IMACRO ) + + '///+<li>Close the Basic-IDE</li> + hCloseBasicIde() + + '///+<li>Exit and restart the office</li> + printlog( "Restart the application" ) + call ExitRestartTheOffice() + + '///+<li>Open the Basic Organizer</li> + hOpenBasicOrganizerFromDoc() + + '///+<li>Find the protected library</li> + printlog( "Select the protected library" ) + Kontext "Makro" + hSelectNode( MakroAus , 1 ) + hExpandNode( MakroAus , 0 ) + hSelectNode( MakroAus , 2 ) + hExpandNode( MakroAus , 0 ) + + '///+<li>Enter the correct Password, click "OK"</li> + printlog( "Enter correct Password" ) + kontext "PasswordDLG" + Password.setText( CPASSWORD ) + PasswordDLG.ok() + + ' Handle possible errormessage (Happens if password is correct but not accepted) + Kontext "Active" + if ( Active.exists() ) then + cMsg = Active.getText() + cMsg = hRemoveLineBreaks( cMsg ) + printlog( "Unexpected messagebox: " & cMsg ) + warnlog( "#i65955# - CWS Warnings01: Protected libraries do not accept valid password" ) + Active.ok() + Kontext "Makro" + Makro.cancel() + hDeleteLibrary( 1 , CLIB ) + goto endsub + endif + + '///+<li>Expand the library, select the Module</li> + Kontext "Makro" + hSelectNode( MakroAus , 3 ) + + '///+<li>Open the Basic-IDE by clicking on "Edit"</li> + printlog( "Edit Library" ) + Bearbeiten.click() + ' warnlog( "#144701 Crash on edit of password protected module" ) + + '///+<li>Verify that the correct macro is displayed</li> + printlog( "Check that the Macro is the correct one" ) + Kontext "BasicIDE" + if ( BasicIDE.exists( 3 ) ) then + + irc = htestMacro( IMACRO ) + if ( irc <> IMACRO ) then + warnlog( "#i54305 - Changes to protected macros lost on office restart" ) + + iPBAFile = hGetFileSizeAsLong( cPBAFile ) + if ( iPBAFile = 0 ) then + warnlog( "#i50568 - .pba-file has 0-byte size" ) + else + printlog( "Module1.pba has " & iPBAFile & " Bytes" ) + endif + endif + + + printlog( "Cleanup" ) + hCloseBasicIde() + else + warnlog( "BasicIDE did not open within 3 seconds" ) + endif + hDeleteLibrary( 1 , CLIB ) + '///</ul> + +endcase + diff --git a/testautomation/framework/optional/includes/basic_shared_modules.inc b/testautomation/framework/optional/includes/basic_shared_modules.inc new file mode 100755 index 000000000000..315c36ded89f --- /dev/null +++ b/testautomation/framework/optional/includes/basic_shared_modules.inc @@ -0,0 +1,110 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_shared_modules.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Access modules below OpenOffice.org macros +'* +'\****************************************************************************** + +testcase tBasicSharedModules + + '///<h3>Access modules below OpenOffice.org macros</h3> + '///Covers issues #i74058, #i74120 and #i74372 + + dim iObjectPosition as integer + dim iLibraryCount as integer + + '///<ul> + '///+<li>Open a document to work on</li> + hInitSingleDoc() + + '///+<li>Open the basic organizer</li> + ToolsMacro_uno + + '///+<li>Select one of the internal macros</li> + Kontext "Makro" + iObjectPosition = hSelectNodeByName( MakroAus , "Depot" ) + if ( iObjectPosition = 0 ) then + warnlog( "Could not find the specified node" ) + goto endsub + endif + + '///+<li>Jump to the last node</li> + hSelectTheLastNode( MakroAus ) + printlog( "Current node (Last node): " & MakroAus.getSelText() ) + + '///+<li>Select the next node (should be one of the modules below Depot)</li> + hSelectNode( MakroAus, iObjectPosition+1 ) + printlog( "Current node (Depot/..): " & MakroAus.getSelText() + + '///+<li>Click "Edit..."</li> + Kontext "Makro" + Bearbeiten.click() + + '///+<li>Check that we are on the BASIC-IDE</li> + Kontext "MacroBar" + if ( MacroBar.exists( 2 ) ) then + printlog( "Macro Bar is open." ) + else + warnlog( "MacroBar is not open but we should be on the Basic IDE" ) + endif + + '///+<li>Use the Library listbox (Jump to top)</li> + Kontext "MacroBar" + Library.typeKeys( "<HOME>" ) + printlog( "Top entry = " & Library.getSelText() ) + + '///+<li>Get the number of items from the Library control</li> + iLibraryCount = Library.getItemCount() + printlog( "There are " & iLibraryCount & " items in the list" ) + + if ( iLibraryCount <> 13 ) then + warnlog( "The number of items in the library-list is incorrect: " & iLibraryCount ) + endif + + '///+<li>Use the Library listbox (Jump to bottom)</li> + Kontext "MacroBar" + Library.select( iLibraryCount ) + printlog( "Last entry = " & Library.getSelText() ) + + '///+<li>Close the Basic-IDE</li> + hCloseBasicIDE() + + '///+<li>Close the document</li> + hDestroyDocument() + '///</ul> + + +endcase + diff --git a/testautomation/framework/optional/includes/basic_spectemplate.inc b/testautomation/framework/optional/includes/basic_spectemplate.inc new file mode 100755 index 000000000000..c32975b64359 --- /dev/null +++ b/testautomation/framework/optional/includes/basic_spectemplate.inc @@ -0,0 +1,149 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_spectemplate.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Load the spec template via http and enable macros +'* +'\****************************************************************************** + +testcase tBasicSpecTemplate + + warnlog( "#i89554# Macro dialog not displayed / document not loaded" ) + goto endsub + + '///<h1>Load the spec template via http and enable macros</h1> + '///<i>Required: Macro Security Level must be Default (Medium)</i> + '///<ul> + + const cFile = "http://specs.openoffice.org/collaterals/template/2.0/OpenOffice-org-Specification-Template.ott" + dim brc as boolean + dim cProxy as string + dim cPort as string + + dim cWorkFile as string + + cWorkFile = hGetWorkPath() & "SpecTemplate" & hGetSuffix( "current" ) + + + '///+<li>Retrieve the http-proxy from private environment</li> + hGetPrivateHttpServer( cProxy, cPort ) + + '///+<li>Set HTTP-Proxy to access a website outside SWAN (not for OOo)</li> + printlog( "Init: Set proxy (requires private environment to be set)" ) + hSetProxies( cProxy, cPort, "", "", "" ) + if ( WaitSlot() <> WSFinished ) then + warnlog( "Slot not finished after 1000 msec." ) + else + printlog( "Slot free in less than 1000 msec." ) + endif + + '///+<li>Open the file (using slot)</li> + printlog( "FileOpen" ) + hFileOpen( cFile ) + + '///+<li>Intercept a possible "General Internet error"</li> + kontext "Active" + if ( Active.exists( 2 ) ) then + warnlog( "Unexpected errormessage: " & active.getText() + active.ok() + + kontext "OeffnenDlg" + if ( OeffnenDlg.exists( 1 ) ) then + printlog( "Recovering - closing File Open dialog" ) + OeffnenDlg.cancel() + endif + + goto endsub + endif + + '///+<li>Handle security warning (allow execution of macros)</li> + printlog( "Accept to execute macros" ) + brc = hAllowMacroExecution() + if ( not brc ) then + warnlog( "Missing Macro execution dialog. Please check the file/security settings" ) + endif + + '///+<li>Wait until the document is loaded</li> + '///+<li>Check for possible warning dialog: Could not resolve host -> Fatal error</li> + kontext "Active" + if ( Active.exists( 5 ) ) then + warnlog( "Fatal: Unexpected active: " & Active.getText() ) + active.ok + + kontext "OeffnenDlg" + if ( OeffnenDlg.exists( 2 ) ) then + OeffnenDlg.close() + goto endsub + endif + endif + + '///+<li>Go to the end of the document, write some text</li> + printlog( "Change the document") + kontext "DocumentWriter" + DocumentWriter.typeKeys( "<MOD1 END>" ) + DocumentWriter.typeKeys( "Changing the document" ) + + '///+<li>Disable the help item from the Spectemplate-menu</li> + printlog( "Disable Help Entry from Spec-Template Menu") + hUseMenu() + hMenuSelectNr( 10 ) + hMenuSelectNr( 2 ) + + + '///+<li>Save the file</li> + hFileSaveAsKill( cWorkFile ) + + '///+<li>Close the document</li> + hDestroyDocument() + + '///+<li>Reload the file</li> + hFileOpen( cWorkFile ) + + '///+<li>Allow Macro execution</li> + hAllowMacroExecution() + + '///+<li>Close the document</li> + printlog( "Cleanup: Close the document" ) + hDestroyDocument() + + '///+<li>Reset proxies (delete all proxies, if changed)</li> + printlog( "Cleanup: Delete proxy settings" ) + hSetProxies( "", "", "", "", "" ) + + '///+<li>Remove the workfile</li> + hDeleteFile( cWorkFile ) + '///</ul> + +endcase + diff --git a/testautomation/framework/optional/includes/basic_usertemplate.inc b/testautomation/framework/optional/includes/basic_usertemplate.inc new file mode 100755 index 000000000000..036b4169ff9d --- /dev/null +++ b/testautomation/framework/optional/includes/basic_usertemplate.inc @@ -0,0 +1,236 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_usertemplate.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : My Macros/standard execution with user defined template +'* +'\****************************************************************************** + +testcase tMacroUsertemplate + + '///<H1>My Macros/standard execution with user defined template</H1> + '///<ul> + + ' requires: Default template path, default security level (medium) + + ' Details: + ' This test checks for some really weird behavior. A macro is created + ' for the standard lib in My Macros - this means the macro is stored with + ' the application, not the document. + ' When creating a document based on a user-created template the macro + ' will not execute, instead a com.sun.star... errormessage is displayed + + dim brc as boolean ' returncode + dim irc as integer ' returncode + + dim cMacroName as string ' Temp variable to store the name of current macro + + const DOC_IDENTIFIER = "A test document for tMacroUserTemplate" + + dim sPathOut as string ' output path for workfile + const FILEOUT = "tMacroUserTemplate" + dim sFilter as string : sFilter = hGetUIFilterName( "writer8_template" ) + + dim iCurrentNode as integer + + sPathOut = convertpath( gOfficePath & "user\template\" ) + hDeleteFile( sPathOut & FILEOUT & ".ott" ) + + '///+<li>Create one single document with identification string</li> + hInitSingleDoc() + kontext "DocumentWriter" + DocumentWriter.typeKeys( DOC_IDENTIFIER ) + + '///+<li>Open a plain new document</li> + brc = hCreateDocument() + + '///+<li>Open Basic Organizer</li> + brc = hOpenBasicOrganizerFromDoc() + + '///+<li>Select My Macros/Standard/Module1/main</li> + iCurrentNode = hSelectNodeByName( MakroAus, "Module1" ) + if ( iCurrentNode = 0 ) then + warnlog( "#i73521# - The expected node could not be found. Aborting test" ) + kontext "Makro" + Makro.close() + hDestroyDocument() + goto endsub + endif + + ' verify that we replace the correct macro. if not: Abort + if ( MakroListe.getItemCount() > 0 ) then + cMacroName = MakroListe.getSelText() + if ( lcase( cMacroName ) <> "main" ) then + warnlog( "Test abort: Incorrect macro is selected: " & cMacroName ) + printlog( "This should have been the <Main> Macro" ) + kontext "Makro" + Makro.cancel() + hDestroyDocument() + goto endsub + endif + else + warnlog( "There is no macro listed for the current module, the test cannot continue" ) + kontext "Makro" + Makro.close() + hDestroyDocument() + goto endsub + endif + + '///+<li>Open Basic Ide by clicking Edit...</li> + Bearbeiten.click() + + '///+<li>Overwrite existing macro: Insert macro that prints messagebox</li> + hInsertMacro( 3 ) + + '///+<li>Close IDE</li> + hCloseBasicIde() + + '///+<li>Close document</li> + hDestroyDocument() + + '///+<li>Open a plain new document</li> + hCreateDocument + + '///+<li>Open Run Macro-Dialog</li> + ToolsMacrosRunMacro + + '///+<li>Execute the macro - this should work</li> + cMacroName = hExecScript_tMacroUserTemplate() ' local function, see below + if ( lcase( cMacroName ) <> "main" ) then + warnlog( "Test abort: Incorrect macro is selected: " & cMacroName ) + printlog( "This should have been the <Main> Macro" ) + ScriptSelector.cancel() + brc = hDestroyDocument() + goto endsub + endif + + ' run + ScriptSelector.ok() + + '///+<li>Close the Macro-dialog</li> + kontext "Active" + if ( active.exists( 3 ) ) then + printlog( "Messagebox: " & active.getText() ) + active.ok() + else + warnlog( "The Macro has not been executed" ) + endif + + '///+<li>Close document</li> + brc = hDestroyDocument() + + '///+<li>Open a plain new document</li> + brc = hCreateDocument() + + '///+<li>Save it as {...work/user/template/MyTemplate} (template, autosuffix)</li> + printlog( "" ) + printlog( "Save as template" ) + hFileSaveAsWithFilterKill( sPathOut & FILEOUT, sFilter ) + + '///+<li>Close document</li> + hDestroyDocument() + + '///+<li>Open "Templates and Documents"</li> + printlog( "" ) + printlog( "File New from Template" ) + FileNewFromTemplate + + '///+<li>Find MyTemplate (note: No suffix displayed)</li> + hFindTemplate( FILEOUT ) + + '///+<li>Create a new document based ton this template</li> + hSelectDocumentObject( irc, 1 ) + + '///+<li>Open Run Macro-Dialog</li> + printlog( "" ) + printlog( "Run Macro..." ) + ToolsMacrosRunMacro + + '///+<li>Execute the macro - this should work</li> + cMacroName = hExecScript_tMacroUserTemplate() ' local function, see below + if ( lcase( cMacroName ) <> "main" ) then + warnlog( "Test abort: Incorrect macro is selected: " & cMacroName ) + printlog( "This should have been the <Main> Macro" ) + ScriptSelector.cancel() + hDestroyDocument() + goto endsub + endif + + ' run + printlog( "Run" ) + ScriptSelector.ok() + + '///#i58527 - com.sun.star... + kontext "Active" + if ( active.exists( 3 ) ) then + + if ( instr( active.getText() , "com.sun" ) <> 0 ) then + warnlog( "#i58527# - unable to run macro with user-template loaded" ) + endif + + if ( active.getText() = "TTMacro3" ) then + printlog( "The macro was executed" ) + else + printlog( "Unknown dialog: " & hRemoveLineBreaks( active.getText() ) ) + endif + + active.ok() + else + warnlog( "Macro not executed / no warning" ) + endif + + '///+<li>Close document</li> + hDestroyDocument() + + '///+<li>Cleanup: Delete the template</li> + hDeleteFile( sPathOut & FILEOUT & ".ott" ) + + '///</ul> + +endcase + +'******************************************************************************* + +function hExecScript_tMacroUserTemplate() as string + + Kontext "ScriptSelector" + hSelectTopNode( LibraryTreeList ) + hExpandNode( LibraryTreeList , 1 ) + hSelectNode( LibraryTreeList , 2 ) + hExpandNode( LibraryTreeList , 2 ) + hSelectNode( LibraryTreeList , 3 ) + + hExecScript_tMacroUserTemplate() = ScriptList.getSelText() + +end function diff --git a/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc b/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc new file mode 100755 index 000000000000..e0f6a7724ec5 --- /dev/null +++ b/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc @@ -0,0 +1,144 @@ +'encoding UTF-8 Do not remove or change this line! +'******************************************************************************* +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_vba-compat_import_disabled.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Test VBA compatibility switches +'* +'\****************************************************************************** + +testcase tBasicVBACompatImportDisabled() + + printlog( "Test VBA compatibility switch / executable Microsoft(R) Excel(R) Macros" ) + printlog( "Test case 2: Import macros but do not set the executable mode" ) + + + ' This test case is based on the use cases provided in issue #i88690 + ' Spec: http://specs.openoffice.org/appwide/options_settings/Option_Dialog.odt + + dim cTestFile as string + cTestFile = gTesttoolPath & "framework/optional/input/vba-compat/vba-test.xls" + + dim cNodeCount as integer + + dim caNodeData( 7 ) as string + caNodeData( 1 ) = "Standard" + caNodeData( 2 ) = "DieseArbeitsmappe" + caNodeData( 3 ) = "Modul1" + caNodeData( 4 ) = "Modul2" + caNodeData( 5 ) = "Tabelle1" + caNodeData( 6 ) = "Tabelle2" + caNodeData( 7 ) = "Tabelle3" + + dim iCurrentModule as integer + dim cCurrentModule as string + dim bFound as boolean + + ' Depending on the mode of macro import we have differtent basic libraries listed + const NODE_COUNT = 80 + + const DOCUMENT_POSITION_OFFSET = -7 + + const IMPORT_EXCEL_MACROS = TRUE + const EXEC_EXCEL_MACROS = FALSE + + printlog( "Set macro security to low" ) + hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_LOW ) + + printlog( "Open Tools/Options" ) + + hSetExcelBasicImportMode( IMPORT_EXCEL_MACROS, EXEC_EXCEL_MACROS ) + + printlog( "Load the test file" ) + hFileOpen( cTestFile ) + + printlog( "Open the Basic organizer" ) + hOpenBasicOrganizerFromDoc() + + printlog( "Expand all nodes" ) + cNodeCount = hExpandAllNodes( MakroAus ) + + printlog( "Verify that we have the correct node count for the current mode" ) + if ( cNodeCount <> NODE_COUNT ) then + warnlog( "The number of nodes is incorrect: " & cNodeCount ) + endif + + printlog( "Verify position of the document node" ) + MakroAus.select( cNodeCount + DOCUMENT_POSITION_OFFSET ) + if ( MakroAus.getSelText() <> "vba-test" ) then + warnlog( "The document node is not at the expected position" ) + endif + + for iCurrentModule = 2 to 7 + + printlog( "Look for: " & caNodeData( iCurrentModule ) ) + + bFound = false + + MakroAus.select( cNodeCount + DOCUMENT_POSITION_OFFSET + iCurrentModule ) + cCurrentModule = MakroAus.getSelText() + + for iCurrentModule = 2 to 7 + + if ( cCurrentModule = caNodeData( iCurrentModule ) ) then + bFound = TRUE + if ( MakroListe.getSelText() <> caNodeData( iCurrentModule ) ) then + warnlog( "Module has incorrect script: " & cCurrentModule ) + bFound = false + endif + exit for + endif + + next iCurrentModule + + if ( not bFound ) then + warnlog( "The node was not found: " & cCurrentModule ) + else + printlog( "Module found, script found, good" ) + endif + + next iCurrentModule + + printlog( "Close Macro Organizer" ) + Kontext "Makro" + Makro.close() + WaitSlot() + + hCloseDocument() + hSetExcelImportModeDefault() + hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT ) + + +endcase + + diff --git a/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc b/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc new file mode 100755 index 000000000000..c8f6352ba1c9 --- /dev/null +++ b/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc @@ -0,0 +1,141 @@ +'encoding UTF-8 Do not remove or change this line! +'******************************************************************************* +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_vba-compat_import_enabled.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Test VBA compatibility switches +'* +'\****************************************************************************** + +testcase tBasicVBACompatImportEnabled() + + printlog( "Test VBA compatibility switch / executable Microsoft(R) Excel(R) Macros" ) + printlog( "Test case 3: Import macros and set them executable" ) + + + ' This test case is based on the use cases provided in issue #i88690 + ' Spec: http://specs.openoffice.org/appwide/options_settings/Option_Dialog.odt + + dim cTestFile as string + cTestFile = gTesttoolPath & "framework/optional/input/vba-compat/vba-test.xls" + + dim cNodeCount as integer + + ' note that index 0 and 1 are ommitted intentionally + dim caNodeData( 3 ) as string + caNodeData( 2 ) = "Modul1" + caNodeData( 3 ) = "Modul2" + + dim caScripts( 3 ) as string + caScripts( 2 ) = "ConcatFct Ende" + caScripts( 3 ) = "WriteIt" + + dim iCurrentModule as integer + dim iCurrentScript as integer + dim cCurrentModule as string + dim bFound as boolean + + ' Depending on the mode of macro import we have differtent basic libraries listed + const NODE_COUNT = 76 + + const DOCUMENT_POSITION_OFFSET = -3 + + const IMPORT_EXCEL_MACROS = TRUE + const EXEC_EXCEL_MACROS = TRUE + + printlog( "Set macro security to low" ) + hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_LOW ) + + printlog( "Open Tools/Options" ) + + hSetExcelBasicImportMode( IMPORT_EXCEL_MACROS, EXEC_EXCEL_MACROS ) + + printlog( "Load the test file" ) + hFileOpen( cTestFile ) + + printlog( "Open the Basic organizer" ) + hOpenBasicOrganizerFromDoc() + + printlog( "Expand all nodes" ) + cNodeCount = hExpandAllNodes( MakroAus ) + + printlog( "Verify that we have the correct node count for the current mode" ) + if ( cNodeCount <> NODE_COUNT ) then + warnlog( "The number of nodes is incorrect: " & cNodeCount ) + endif + + printlog( "Verify position of the document node" ) + MakroAus.select( cNodeCount + DOCUMENT_POSITION_OFFSET ) + if ( MakroAus.getSelText() <> "vba-test" ) then + warnlog( "The document node is not at the expected position" ) + endif + + for iCurrentModule = 2 to 3 + + printlog( "Look for: " & caNodeData( iCurrentModule ) ) + + bFound = FALSE + + MakroAus.select( cNodeCount + DOCUMENT_POSITION_OFFSET + iCurrentModule ) + cCurrentModule = MakroAus.getSelText() + + if ( cCurrentModule = caNodeData( iCurrentModule ) ) then + bFound = TRUE + for iCurrentScript = 1 to MakroListe.getItemCount() + MakroListe.select( iCurrentScript ) + if ( instr( caScripts( iCurrentModule ), MakroListe.getSelText() ) = 0 ) then + warnlog( "Script for the current module not found" ) + bFound = FALSE + else + printlog( "Script(s) found." ) + endif + next iCurrentScript + endif + + if ( not bFound ) then + warnlog( "The node was not found: " & cCurrentModule ) + endif + + next iCurrentModule + + printlog( "Close Macro Organizer" ) + Kontext "Makro" + Makro.close() + WaitSlot() + + hCloseDocument() + hSetExcelImportModeDefault() + hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT ) + +endcase + diff --git a/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc b/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc new file mode 100755 index 000000000000..260ca94e1cba --- /dev/null +++ b/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc @@ -0,0 +1,107 @@ +'encoding UTF-8 Do not remove or change this line! +'******************************************************************************* +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_vba-compat_import_nothing.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Test VBA compatibility switches +'* +'\****************************************************************************** + +testcase tBasicVBACompatImportNothing() + + printlog( "Test VBA compatibility switch / executable Microsoft(R) Excel(R) Macros" ) + printlog( "Test case 1: Do not import macros at all" ) + + ' This test case is based on the use cases provided in issue #i88690 + ' Spec: http://specs.openoffice.org/appwide/options_settings/Option_Dialog.odt + + dim cTestFile as string + cTestFile = gTesttoolPath & "framework/optional/input/vba-compat/vba-test.xls" + + dim cNodeCount as integer + + ' Depending on the mode of macro import we have differtent basic libraries listed + const NODE_COUNT = 74 ' Do not import Microsoft(R) Excel(R) macros at all + const MACRO_LIST = 0 ' The document library should have no scripts listed + const DOCUMENT_POSITION_OFFSET = -1 + + const IMPORT_EXCEL_MACROS = FALSE + const EXEC_EXCEL_MACROS = FALSE + + printlog( "Set macro security to low" ) + hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_LOW ) + + printlog( "Open Tools/Options" ) + + hSetExcelBasicImportMode( IMPORT_EXCEL_MACROS, EXEC_EXCEL_MACROS ) + + printlog( "Load the test file" ) + hFileOpen( cTestFile ) + + printlog( "Open the Basic organizer" ) + hOpenBasicOrganizerFromDoc() + + printlog( "Expand all nodes" ) + cNodeCount = hExpandAllNodes( MakroAus ) + + printlog( "Verify that we have the correct node count for the current mode" ) + if ( cNodeCount <> NODE_COUNT ) then + warnlog( "The number of nodes is incorrect: " & cNodeCount ) + endif + + printlog( "Verify position of the document node" ) + MakroAus.select( cNodeCount + DOCUMENT_POSITION_OFFSET ) + if ( MakroAus.getSelText() <> "vba-test" ) then + warnlog( "The document node is not at the expected position" ) + endif + + printlog( "Select the last node, this should be the standard Library for the document" ) + MakroAus.select( cNodeCount ) + + printlog( "Verify that the Standard library for the document has no scripts" ) + if ( MakroListe.getItemCount <> MACRO_LIST ) then + warnlog( "There should be no macros listed for the current library" + endif + + printlog( "Close Macro Organizer" ) + Kontext "Makro" + Makro.close() + WaitSlot() + + hCloseDocument() + hSetExcelImportModeDefault() + hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT ) + +endcase + + diff --git a/testautomation/framework/optional/includes/basic_vba_compat_tools.inc b/testautomation/framework/optional/includes/basic_vba_compat_tools.inc new file mode 100755 index 000000000000..49cfc6b370d1 --- /dev/null +++ b/testautomation/framework/optional/includes/basic_vba_compat_tools.inc @@ -0,0 +1,78 @@ +'encoding UTF-8 Do not remove or change this line! +'******************************************************************************* +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_vba_compat_tools.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Small helpers for Excel BASIC import modes +'* +'\****************************************************************************** + +function hSetExcelBasicImportMode( bImport as boolean, bEnable as boolean ) + + printlog( "Changing Excel VBA import modes" ) + + ToolsOptions + hToolsOptions( "LoadSave", "VBAProperties" ) + + if ( bImport ) then + ExcelBasicLaden.check() + if ( bEnable ) then + ExecutableCode.check() + else + ExecutableCode.uncheck() + endif + else + ExcelBasicLaden.uncheck() + endif + + Kontext "OptionenDlg" + OptionenDlg.ok() + +end function + +'******************************************************************************* + +function hSetExcelImportModeDefault() + + printlog( "Setting Excel VBA import modes to default" ) + + ToolsOptions + hToolsOptions( "LoadSave", "VBAProperties" ) + + ExcelBasicLaden.check() + ExecutableCode.uncheck() + + Kontext "OptionenDlg" + OptionenDlg.ok() + +end function diff --git a/testautomation/framework/optional/includes/configuration.inc b/testautomation/framework/optional/includes/configuration.inc new file mode 100755 index 000000000000..69e1a43a13b2 --- /dev/null +++ b/testautomation/framework/optional/includes/configuration.inc @@ -0,0 +1,384 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: configuration.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* Owner : thorsten.bosbach@sun.com +'* +'* short description : Function Test for known global Issues +'* +'\***************************************************************** + +sub sToolsCustomizeKeyboardFunction + dim aApplication() as string + dim i,a,b as integer + dim lList(1000) as string + dim sTemp as string + + ' go through all applications: + aApplication()=array("WRITER","MASTERDOC","HTMLDOKUMENT","CALC","IMPRESS","DRAW","MATH","INSIGHT") + a=uBound(aApplication()) + sTemp = gApplication + for i = 0 to a + + if ( i = 7 and gtSysName = "Solaris x86" ) then + qaerrorlog( "#i62423# Solaris: Crash when opening new database" ) + else + gApplication = aApplication(i) + tToolsCustomizeKeyboardFunction(lList()) + endif + next i + gApplication = sTemp + + listsort(lList()) + a = ListCount(lList()) + printlog "Count1: " + a + if (a>0) then + b = 0 + sTemp="" + for i=1 to a + if (lList(i) <> sTemp) then + printlog ""+i+": '" + lList(i) + "'" + sTemp=lList(i) + inc(b) + endif + next i + printlog "Number of unique Errors: " + b + endif +end sub + +testcase tToolsCustomizeKeyboardFunction(lList()) + '/// idea from AS find .uno: in Keyboard Function list ///' + dim sKeys(300,2) as string + dim i,a,b,c,d as integer + dim sTemp, sTemp2 as string + dim iBugCount(10) as integer + dim bErrorFound as boolean + dim i43969 as string ' ALL + dim i60617 as string ' ALL + dim i64346 as string ' ALL + dim i80850 as string ' ALL + dim i84982 as string ' ALL + dim i84983 as string + dim i87950 as string + dim i87951 as string + dim i87952 as string + + i60617 = ".uno:ContinueNumbering" + i43969 = ".uno:MacroOrganizer" + i64346 = ".uno:SendMailDocAs" + i80850 = ".uno:ToggleFormula.uno:AssignMacro" + i84982 = ".uno:FontDialogForParagraph" + i84983 = ".uno:DBNewReportWithPreSelection" + i87950 = ".uno:DBMigrateScripts" + i87951 = ".uno:DeleteAllNotes.uno:DeleteAuthor.uno:DeleteNote.uno:HideAllNotes.uno:HideAuthor.uno:HideNote" + i87952 = ".uno:InsertApplet" + + '/// open application ///' + Call hNewDocument + sleep 2 + '/// Tools->Configure ///' + ToolsCustomize + sleep 3 + Kontext + '/// switch to tabpage 'Keyboard' ///' + Messagebox.SetPage TabTastatur ' 2 ------------------ + Kontext "TabTastatur" + for c = 1 to 2 + select case c + case 1: '/// Check Checkbox 'StarOffice' ///' + StarOffice.Check + Printlog ("-------------------- Keylist for StarOpenOfficeSuite.org --------------------") + case 2: '/// Check Checkbox '$APPLICATION' ///' + Application.Check + Printlog ("-------------------- Keylist for "+gApplication+" ------------------------") + end select + i = Bereich.getItemCount + for a = 1 to i + Bereich.select(a,true) + sTemp = Bereich.getSelText + for b=1 to Funktion.getItemCount + sTemp2 = Funktion.getItemText(b) + d = inStr(sTemp2,":") + if (d>0) then + ' translators use ':'-> check if ' ' follows or CHR$ < 128 + ' asc() returns 16 bit values in an integer -> sign is affected :-( -> use abs(asc()) + if (((mid(sTemp2,d+1,1)<>" ")AND(abs(asc(mid(sTemp2,d+1,1)))<128)) AND (abs(asc(mid(sTemp2,d-1,1)))<128))then + + listAppend(lList(),sTemp2) + bErrorFound = false + + if (inStr(i60617,sTemp2)>0) then + qaErrorLog "#i60617# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'" + bErrorFound = true + endif + + if (inStr(sTemp2,i64346)>0) then + qaErrorLog "#i64346# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'" + bErrorFound = true + endif + + if (inStr(i43969,sTemp2)>0) then + qaErrorLog "#i41265# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'" + bErrorFound = true + endif + + if (inStr(i80850,sTemp2)>0) then + qaErrorLog "#i80850# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'" + bErrorFound = true + endif + + if (inStr(i84982,sTemp2)>0) then + qaErrorLog "#i84982# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'" + bErrorFound = true + endif + + if (inStr(i84983,sTemp2)>0) then + qaErrorLog "#i84983# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'" + bErrorFound = true + endif + + if (inStr(i87950,sTemp2)>0) then + qaErrorLog "#i87950# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'" + bErrorFound = true + endif + + if (inStr(i87951,sTemp2)>0) then + qaErrorLog "#i87951# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'" + bErrorFound = true + endif + + if (inStr(i87952,sTemp2)>0) then + qaErrorLog "#i87952# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'" + bErrorFound = true + endif + + if ( not bErrorFound ) then + warnlog "("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'" + endif + inc(iBugCount(3)) + endif + else + ' printlog "("+c+"/"+a+"/"+b+"): '"+sTemp+"'::'"+sTemp2+"'" + endif + next b + next a + next c + ' if (iBugCount(3) > 0) then WarnLog ""+iBugCount(3)+": Missing Name for funktion; is .uno:..." + '/// cancel dialog 'Customize' ///' + TabTastatur.cancel + '/// close application ///' + Call hCloseDocument +endcase + +testcase tToolsOptionsAPIConfiguration + Dim iJump as Integer + Dim sComXML as String + Dim sHelpTip as String + Dim sHelpExtendedTip as String + Dim bHelpTip as Boolean + Dim bHelpExtendedTip as Boolean + Dim Silent as Boolean + Dim sTempPath as string + Dim sTempList(10) as string + Dim sLocalString as string + + 'Used for GetXMLValueGlobal (DEPRECATED function!) to get no output in resultfile. + Silent = TRUE + + try + ToolsOptions + '///+<li>Tools / Language Settings / Languages + call hToolsOptions ("Languagesettings", "Languages") + '///+ Check if Asian language support is enabled and verify <i>gAsianSup</i> variable. + if (gAsianSup <> Aktivieren.IsChecked) then + warnlog "gAsianSup differs from UI" + endif + '///+ Check if CTL (=complex text layout) is enabled amd set <i>gCTLSup</i> variable TRUE or FALSE. + if (gCTLSup <> ComplexScriptEnabled.IsChecked) then + warnlog "gCTLSup differs from UI" + endif + + '///+<li>Check <i>gAccessibility</i> for Win32 (from Options UI)</li> + call hToolsOptions ("STAROFFICE", "ACCESSIBILITY") + try + if (gPlatGroup <> "unx") then + if (gAccessibility <> SupportAssistiveTechnologyTools.IsChecked) then + warnlog "gAccessibility differs from UI" + endif + endif + catch + if (NOT gAccessibility) then + warnlog "gAccessibility differs from UI - catch" + endif + endcatch + + '///+ <li>Check the switch to the <i>system</i> dialogs to "internal" dialogs. + call hToolsOptions ("StarOffice", "General") + if StarOfficeDialogeBenutzen.Exists then + if (NOT StarOfficeDialogeBenutzen.isChecked) then + warnlog "StarOfficeDialogeBenutzen is not checked" + endif + end if + + '///+<li>Checking the <i>bubble help</i>. + call hToolsOptions ("StarOffice", "General") + if (Tips.isChecked) then + warnlog "Help Tip is checked" + endif + + + '///+<li>Checking the <i>work</i> directory in Tools / Options, + call hToolsOptions ("StarOffice", "Paths") + select case iSprache + case 01 : iJump = 6 ' English (USA) + case 03 : iJump = 7 ' Portuguese + case 07 : iJump = 0 ' Russian + case 30 : iJump = 0 ' Greek + case 31 : iJump = 0 ' Netherlands + case 33 : iJump = 0 ' French + case 34 : iJump = 0 ' Spanish + case 35 : iJump = 0 ' Finnish + case 36 : iJump = 0 ' Hungaria + case 37 : iJump = 0 ' Catalan + case 39 : iJump = 0 ' Italian + case 42 : iJump = 0 ' Czech + case 43 : iJump = 0 ' Slowak + case 44 : iJump = 0 ' English (GB) + case 45 : iJump = 0 ' Danish + case 46 : iJump = 0 ' Swedish + case 47 : iJump = 0 ' Norwegian + case 48 : iJump = 0 ' Polish + case 49 : iJump = 1 ' German + case 51 : iJump = 0 ' Slowak + case 55 : iJump = 0 ' Portuguese (Brazil) + case 66 : iJump = 0 ' Thai + case 81 : iJump = 0 ' Japanese ' disabled, because locale dependant! + case 82 : iJump = 0 ' Korean ' disabled, because locale dependant! + case 86 : iJump = 0 ' Chinese (simplified) ' disabled, because locale dependant! + case 88 : iJump = 0 ' Chinese (traditional) ' disabled, because locale dependant! + case 90 : iJump = 0 ' Turkish + case 91 : iJump = 0 ' Hindi + case 96 : iJump = 0 ' Arab + case 97 : iJump = 0 ' Hebrew + case else : qaErrorlog "The work-dir can't changed to the internal office-work-dir! Please insert the language in this list!" + iJump = 0 + end select + + if iJump <> 0 then + 'DEBUG: printlog "** master.inc::mMakeGeneralOptions::iJump(" & iSprache & ") = " & iJump + sLocalString = Typ.getItemText(iJump,3) ' works in gh13 + if sLocalString = "" then + sLocalString = Typ.getItemText(iJump,2) ' fallback for before gh13 + endif + if (sLocalString <> ConvertPath (gOfficePath + "user\work")) then + warnlog ("Work Directory differs from API setting? : is: '" + sLocalString + "' should: '" + ConvertPath (gOfficePath + "user\work") + "'") + endif + else + 'TODO: figure out which Entry it could be + for i = 1 to Typ.getItemCount + if (Typ.getItemText(i,2) = ConvertPath (gOfficePath + "user\work")) then + qaErrorLog ("found WorkDirectory at position: " + i) + iJump = i + endif + next i + if (iJump = 0) then + warnlog ("No workdirectory candidate found.") + endif + end if + + '///+<li>Checking the directory for temporary files (=temp-path). + select case iSprache + case 01 : iJump = 8 ' English (USA) + case 03 : iJump = 3 ' Portuguese + case 07 : iJump = 0 ' Russian + case 30 : iJump = 0 ' Greek + case 31 : iJump = 0 ' Netherlands + case 33 : iJump = 0 ' French + case 34 : iJump = 1 ' Spanish + case 35 : iJump = 0 ' Finnish + case 36 : iJump = 0 ' Hungaria + case 37 : iJump = 0 ' Catalan + case 39 : iJump = 0 ' Italian + case 42 : iJump = 0 ' Czech + case 43 : iJump = 0 ' Slowak + case 44 : iJump = 0 ' English (GB) + case 45 : iJump = 0 ' Danish + case 46 : iJump = 0 ' Swedish + case 47 : iJump = 0 ' Norwegian + case 48 : iJump = 0 ' Polish + case 49 : iJump = 8 ' German + case 51 : iJump = 0 ' Slowak + case 55 : iJump = 1 ' Portuguese (Brazil) + case 66 : iJump = 0 ' Thai + case 81 : iJump = 0 ' Japanese ' disabled, because locale dependant! + case 82 : iJump = 0 ' Korean ' disabled, because locale dependant! + case 86 : iJump = 0 ' Chinese (simplified) ' disabled, because locale dependant! + case 88 : iJump = 0 ' Chinese (traditional) ' disabled, because locale dependant! + case 90 : iJump = 0 ' Turkish + case 91 : iJump = 0 ' Hindi + case 96 : iJump = 0 ' Arab + case 97 : iJump = 0 ' Hebrew + case else : qaErrorLog "The temp-dir can't changed to the internal office-temp-dir! Please insert the language in this list!" + iJump = 0 + end select + if iJump <> 0 then + 'DEBUG: printlog "** master.inc::mMakeGeneralOptions::iJump(" & iSprache & ") = " & iJump + sLocalString = Typ.getItemText(iJump,3) ' works in gh13 + if sLocalString = "" then + sLocalString = Typ.getItemText(iJump,2) ' fallback for before gh13 + endif + if (sLocalString <> ConvertPath (gOfficePath + "user\temp")) then + warnlog ("Temp Directory differs from API setting? : is: '" + sLocalString + "' should: '" + ConvertPath (gOfficePath + "user\temp") + "'") + endif + else + 'TODO: figure out which Entry it could be + for i = 1 to Typ.getItemCount + if (Typ.getItemText(i,2) = ConvertPath (gOfficePath + "user\temp")) then + qaErrorLog ("found TempDirectory at position: " + i) + iJump = i + endif + next i + if (iJump = 0) then + warnlog ("No tempdirectory candidate found.") + endif + end if + + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + sleep(4) + catch + warnlog "Error during walking through optionsdialog" + endcatch + '///+</ul> +endcase + + diff --git a/testautomation/framework/optional/includes/extras_file_open.inc b/testautomation/framework/optional/includes/extras_file_open.inc new file mode 100755 index 000000000000..548d14146931 --- /dev/null +++ b/testautomation/framework/optional/includes/extras_file_open.inc @@ -0,0 +1,180 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: extras_file_open.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Perform standard operations on all samples/templates etc. +'* +'\*********************************************************************** + +private const MAX_FILE_COUNT = 3000 ' the max number of templates or samples + +' NOTE: Usually we have only about a 100 templates but in multi-language +' installations there are more than 2100. You should not run these +' tests on multi language installations. Really. + +testcase tOpenObjectsWithFileDialog( cCategory as string ) + + const CFN = "tOpenObjectsWithFileDialog::" + + '///<h1>Open all templates using the File-Open dialog</h1> + '///<i>Retrieve the templates out of ..\share\template\-directory</i><br> + '///<ul> + + dim lsFile ( MAX_FILE_COUNT ) as String ' list of all files below samples or templates + dim sRootPath as String ' rootpath, depends on cCategory + dim sRootPathFallback as string + + dim sFilter as string + + dim sFileIn as String ' file to open + dim sFileOut as string ' file to save, reload, delete + dim sPathOut as string + sPathOut = hGetWorkPath() + dim sExtension as String ' filter: determines whether to test the file + + dim iCurrentTemplate as Integer ' increment: current template from lsFile() + dim iCounterToBreak as Integer ' increment: after 10 files: restart + const RESETCOUNTER = 30 + + dim bSkipFile as boolean ' turns true if file is to be skipped + + dim brc as boolean ' some multi purpose boolan returncode + + ' the path where the samples/templates are located, verify function params + ' note that for some time the suffixes for the different filetypes are changed, + ' so we have separate names for samples and templates. + select case cCategory + case "SAMPLES" : sRootPath = gOfficeBasisPath & "share\samples" + sRootPathFallback = "/opt/openoffice.org/basis3.0/share/samples" + sFIlter = "*.od*" + case "TEMPLATES" : sRootPath = gOfficeBasisPath & "share\template" + sRootPathFallback = "/opt/openoffice.org/basis3.0/share/template" + sFilter = "*.ot*" + case default + warnlog( CFN & "Invalid category passed to function" ) + goto endsub + end select + + sRootPath = convertpath( sRootPath ) + + '///+<li>Get the complete list of all files below templates/samples</li> + if ( dir( sRootPath ) = "" ) then + qaerrorlog( "Root Path does not exist: " & sRootPath ) + sRootPath = sRootPathFallback + if ( dir( sRootPathFallback ) = "" ) then + warnlog( "No usable office root path found. Aborting test" ) + goto endsub + printlog( "Using hard coded fallback" ) + endif + endif + + printlog( "Using path..: " & sRootPath ) + printlog( "Using filter: " & sFilter ) + GetAllFileList ( sRootPath, sFilter, lsFile() ) + hListPrint ( lsFile() , "" , "" ) + if ( listcount( lsfile() ) = 1 ) then + if ( gProductName = "OpenOffice.org" ) then + printlog( gProductName & " comes with no samples, skipping" ) + goto endsub + else + warnlog( "Filelist seems to be incomplete. GetAllFileList() failed!" ) + goto endsub + endif + endif + + ' unfortunately we coannot load all samples/templates in a row, the office + ' freeezes at some point. So we do a restart every n files. + printlog( "Office will be restarted every " & RESETCOUNTER & " files." ) + iCounterToBreak = 0 + + '///+<li>Go through the list of samples/templates and do things</li> + '///<ul> + for iCurrentTemplate = 2 to ListCount ( lsFile() ) + + iCounterToBreak = iCounterToBreak + 1 + + '///+<li>Restart the office after every 10 templates/samples loaded</li> + if ( iCounterToBreak = RESETCOUNTER ) then + printlog( CFN & "Exit and restart StarOffice" ) + iCounterToBreak = 0 + call ExitRestartTheOffice() + end if + + ' sFileIn holds the file we currently work with + sFileIn = lsFile( iCurrentTemplate ) + + '///+<li>Load the file</li> + printlog( "" ) + brc = hFileOpen( sFileIn ) + brc = hHandleActivesOnLoad( 0 , 2 ) + + '///+<li>Cancel the filterdialog if present -> bug</li> + brc = hCancelFilterDialog() + + '///+<li>Close the navigator if present</li> + brc = hCloseNavigator() + + ' Build the filename + sFileOut = cCategory & "_" & iCurrentTemplate + sFileOut = convertpath( sPathOut & sFileOut ) + + '///+<li>Save the file, use autoextension</li> + brc = hFileSaveAsKill( sFileOut ) + + '///+<li>Close possible dialogs like "Update links" etc.</li> + ' note: this is delayed, because the dialogs take time to pop up + ' even while the dialog is visible, we can work with the doc. + brc = hHandleInitialDialogs() + + '///+<li>Close the document</li> + brc = hDestroyDocument() + + '///+<li>Load the file, close the navigator if present</li> + brc = hFileOpen( sFileOut ) + brc = hHandleActivesOnLoad( 0 , 2 ) + brc = hCloseNavigator() + + '///+<li>Close the file</li> + brc = hDestroyDocument() + + '///+<li>Delete the file</li> + brc = hDeleteFile( sFileOut ) + '///</ul> + + next iCurrentTemplate + '///</ul> + +endcase + + diff --git a/testautomation/framework/optional/includes/extras_labels.inc b/testautomation/framework/optional/includes/extras_labels.inc new file mode 100755 index 000000000000..bf4c9c139bc9 --- /dev/null +++ b/testautomation/framework/optional/includes/extras_labels.inc @@ -0,0 +1,135 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: extras_labels.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.co +'* +'* short description : test names of labels +'* +'\****************************************************************************** + +testcase tLabelTypes() + + if ( gIsoLang <> "en-US" ) then + printlog( "No testing for non-en_US languages" ) + goto endsub + endif + + '///<h1>Localization test for labels: Branding and types</h1> + '///<i>This test opens the labels dialog and compares the list of labels + '///+ with their brands and associated types agains a reference list.</i><br> + '///<ul> + + dim iBrandCount as integer + dim iCurrentBrand as integer + dim cBrandName as string + + dim iTypeCount as integer + dim iCurrentType as integer + dim cTypeName as string + + dim cBrandType as string + + dim al_UI_Labels( 1600 ) as string + al_UI_Labels( 0 ) = "0" + + dim irc as integer + + dim sFile as string + sFile = Labels_" & gISOLang & ".txt" + + dim sFileIn as string + sFileIn = gTesttoolPath & "framework\optional\input\extras_formats\" & sFile + sFileIn = convertpath( sFileIn ) + + dim sFileOut as string + sFileOut = hGetWorkPath() & sFile + + + '///+<li>Open the labels-dialog (suggested way: File->New->Labels)</li> + hCreateLabels() + + '///+<li>Switch to the Labels-Tab (which is the default)</li> + kontext + Active.SetPage TabEtiketten + + kontext "TabEtiketten" + + '///+<li>Find out how many brands are listed (might be language dependent)</li> + iBrandCount = Marke.getItemCount() + + '///+<li>Collect the types for each brand</li> + '///<ul> + for iCurrentBrand = 1 to iBrandCount + + '///+<li>Select brand</li> + Marke.select( iCurrentBrand ) + + '///+<li>Retrieve brand name</li> + cBrandName = Marke.getSelText() + + '///+<li>Count the number of types for the current brand</li> + iTypeCount = Typ.getItemCount() + + '///+<li>Retrieve the list of types</li> + '///<ul> + for iCurrentType = 1 to iTypeCount + + '///+<li>Select the next type</li> + Typ.select( iCurrentType ) + + '///+<li>Get the name of the current type</li> + cTypeName = Typ.getSelText() + + '///+<li>Build the list - format is: "Brand:Type"</li> + cBrandType = cBrandName & ":" & cTypeName + ListAppend( al_UI_Labels() , cBrandType ) + + next iCurrentType + '///</ul> + + next iCurrentBrand + '///</ul> + + '///+<li>Close the label dialog</li> + TabEtiketten.Cancel() + + '///+<li>Compare the list against the reference list</li> + irc = hManageComparisionList( sFileIn, sFileOut, al_UI_Labels() ) + if ( irc <> 0 ) then + warnlog( "The list of labels (Brand/Types) has changed, please review." ) + else + printlog( "The lists of labels are unchanged. Good." ) + endif + '///</ul> + +endcase diff --git a/testautomation/framework/optional/includes/extras_modify_objects.inc b/testautomation/framework/optional/includes/extras_modify_objects.inc new file mode 100755 index 000000000000..ef647bbac7c9 --- /dev/null +++ b/testautomation/framework/optional/includes/extras_modify_objects.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 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: extras_modify_objects.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Perform standard operations on all samples/templates etc. +'* +'\*********************************************************************** + +private const MAX_FILE_COUNT = 3000 ' the max number of templates or samples + +' NOTE: Usually we have only about a 100 templates but in multi-language +' installations there are more than 2100. You should not run these +' tests on multi language installations. Really. + +testcase tModifyObjects( iMode as integer, cCategory as string, sVer as string ) + + const CFN = "tModifyObjects::" + const RESTART = 15 + + '///<h1>Open all Objects, save, close, reload, save and close them</h1> + '///<i>The test should be able to handle any OOo 1.x and 2.x files</i><br> + '///<ul> + + dim iObjectFolder as Integer + dim iObjectFolders as integer + + dim iObject as Integer + + dim iObjectCount( 20 ) as integer + + dim sFile as string + dim sPath as string + sPath = hGetWorkPath() + dim brc as boolean + dim crc as string + + printlog( "" ) + + '///+<li>Open File->New->Templates and documents</li> + FileNewFromTemplate + + '///+<li>select the category in the template dialog (left pane)</li> + hSelectCategory( cCategory ) + + '///+<li>Get the number of folders in the root of cCategory</li> + iObjectFolders = FileList.getItemCount() + + '///+<li>get the number of all objects below cCategory and its subfolders</li> + for iObject = 1 to iObjectFolders + + '///+<li>select and open a folder</li> + hSelectFileFolder( iObject , true ) + + '///+<li>count the items in the list</li> + iObjectCount( iObject ) = FileList.getItemCount() + + '///+<li>move back up to the root of cCategory</li> + UpOneLevel.click() + + next iObject + + Kontext "TemplateAndDocuments" + + '///+<li>Click the document-info button, do not load the preview</li> + docinfo.click() + + '///+<li>close the templates and samples dialog</li> + TemplateAndDocuments.cancel() + + printlog( "" ) + printlog( "Starting to load/save/close/reload/close all Objects" ) + printlog( "" ) + + '///+<li>Step through all folders and Objects</li> + for iObjectFolder = 1 to iObjectFolders + + for iObject = 1 to iObjectCount( iObjectFolder ) + + ' to skip a document add the rule here and jump to SkipThisObject: + + gApplication = "WRITER" + + printlog( "" ) + printlog( "Folder index = " & iObjectFolder & ", Object index = " & iObject ) + + do while ( getDocumentCount > 0 ) + hDestroyDocument() + loop + + '///<ol> + FileNewFromTemplate + + '///+<li>Select the desired-category: Templates/Samples ...</li> + hSelectCategory( cCategory ) + + '///+<li>Select the current folder</li> + hSelectFileFolder( iObjectFolder , false ) + + '///+<li>Select the desired Object, open or edit it</li> + crc = hSelectDocumentObject( iObject , iMode ) + + '///+<li>If the object can be edited we open it. Skip otherwise</li> + ' treat it like a folder + kontext "TemplateAndDocuments" + if ( TemplateAndDocuments.exists() ) then + if ( not edit.isEnabled() ) then + crc = "Folder" + endif + else + printlog( "Templates And Documents dialog is closed" ) + endif + + '///+<li>If object is a folder, we skip the entire test</li> + if ( crc = "Folder" ) then + printlog( CFN & "Object is folder or #edit# is disabled, skipping" ) + UpOneLevel.click() + TemplateAndDocuments.cancel() + goto SkipThisObject + endif + + '///+<li>Cancel the filterdialog if present -> bug</li> + brc = hCancelFilterDialog() + if ( brc ) then + printlog( CFN & "Skipping document" ) + else + + '///+<li>Close the navigator if present</li> + brc = hCloseNavigator() + + '///+<li>Build the filename</li> + sFile = sPath & cCategory & iObjectFolder & "_" & iObject + sFile = convertpath( sFile ) + + '///+<li>Delete the file if it exists</li> + brc = hDeleteFile( sFile ) + + '///+<li>Save the file without suffix, use default filter, overwrite</li> + brc = hFileSaveAsKill( sFile ) + + '///+<li>Close the document</li> + brc = hDestroyDocument() + + '///+<li>Load the file again</li> + brc = hFileOpen( sFile ) + brc = hHandleActivesOnLoad( 1 , 2 ) + brc = hHandleInitialDialogs() + + '///+<li>Cancel the filterdialog if present -> bug</li> + brc = hCancelFilterDialog() + if ( not brc ) then + + '///+<li>Close the navigator if present</li> + brc = hCloseNavigator() + + '///+<li>Close the document</li> + brc = hDestroyDocument() + + endif + + '///+<li>Delete the file after completion</li> + brc = hDeleteFile( sFile ) + + '///</ol> + + endif + + SkipThisObject: + + next iObject + + next iObjectFolder + + hDestroyDocument() + + '///</ul> + +endcase + + diff --git a/testautomation/framework/optional/includes/extras_preview.inc b/testautomation/framework/optional/includes/extras_preview.inc new file mode 100755 index 000000000000..cd3f228985a3 --- /dev/null +++ b/testautomation/framework/optional/includes/extras_preview.inc @@ -0,0 +1,134 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: extras_preview.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Perform standard operations on all samples/templates etc. +'* +'\*********************************************************************** + +private const MAX_FILE_COUNT = 3000 ' the max number of templates or samples + +' NOTE: Usually we have only about a 100 templates but in multi-language +' installations there are more than 2100. You should not run these +' tests on multi language installations. Really. + +testcase tShowAllObjectsAsPreview( cCategory as string ) + + '///<h1>Show documents in the preview pane of the teplates-dialog</h1> + + dim iObjectFolder as Integer ' the current folder in loops + dim iObjectFolders as integer ' the number of template/sample-folders + + dim iObject as Integer ' the current template/sample within loops + dim iObjectCount( 20 ) as integer ' number of templates/samples in the folders + + + printlog( "" ) + + + '///<ul> + '///+<li>Open File->New->Templates and documents</li> + FileNewFromTemplate + if ( TemplateAndDocuments.exists( 1 ) ) then + + + '///+<li>find the category we want to work with (TEMPLATES/SAMPLES...)</li> + hSelectCategory( cCategory ) + + '///+<li>Count the folders in the root of cCategory</li> + iObjectFolders = FileList.getItemCount() + + '///+</li>Now go through every folder and count the number of objects</li> + for iObject = 1 to iObjectFolders + + '//<li>grab a folder below cCategory and open it</li> + hSelectFileFolder( iObject , true ) + + '<li>get the number of items</li> + iObjectCount( iObject ) = FileList.getItemCount() + + '<li>step up one level to the root of cCategory</li> + UpOneLevel.click() + + next iObject + + '///+<li>Click the preview button</li> + preview.click() + + printlog( "" ) + printlog( "Displaying documents in preview pane" ) + printlog( "" ) + + '///+<li>Step through all folders and templates/samples</li> + '///<ol> + for iObjectFolder = 1 to iObjectFolders + + kontext "TemplateAndDocuments" + + '///+<li>Select the category (samples, templates ...)</li> + hSelectCategory( cCategory ) + + '///+<li>Select the current folder</li> + hSelectFileFolder( iObjectFolder , false ) + + for iObject = 1 to iObjectCount( iObjectFolder ) + + printlog( "Object-Folder: " & iObjectFolder & " Entry: " & iObject ) + + '///+<li>Select the desired template</li> + hSelectDocumentObject( iObject , 0 ) + + '///+<li>Wait for the preview to be loaded and displayed</li> + 'Problem: Cannot verify the content of preview window. + WaitSlot( 5000 ) + + '///+<li>Next document</li> + + next iObject + + '///</ol> + + next iObjectFolder + + '///</ul> + Kontext "TemplateAndDocuments" + TemplateAndDocuments.cancel() + + else + warnlog( "Failed to open Templates And Documents dialog" ) + endif + +endcase + + diff --git a/testautomation/framework/optional/includes/extras_table_autoformat.inc b/testautomation/framework/optional/includes/extras_table_autoformat.inc new file mode 100755 index 000000000000..d4eb0329daa9 --- /dev/null +++ b/testautomation/framework/optional/includes/extras_table_autoformat.inc @@ -0,0 +1,147 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: extras_table_autoformat.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Test the autoformat-feature for tables +'* +'\****************************************************************************** + +testcase tAutoformatTable( iApp as integer ) + + if ( gIsoLang <> "en-US" ) then + printlog( "No testing for non-en_US languages" ) + goto endsub + endif + + '///<h1>Autoformats for tables in Writer and Calc</h1> + '///<ul> + + dim al_UI_formats( 1000 ) as string + al_UI_formats( 0 ) = "0" + + dim iFormatCount as integer + dim iCurrentFormat as integer + dim cCurrentFormat as string + + dim irc as integer + + dim sFileOut as string + dim sFile as string + dim sFileIn as string + sFileIn = gTesttoolPath & "framework\optional\input\extras_formats\" + + dim oControl as object + + ' Build the filenames + select case iApp + case 1 : sFile = "Tables_writer_" & gISOLang & ".txt" + case 2 : sFile = "Tables_calc_" & gISOLang & ".txt" + end select + + sFileIn = convertpath( sFileIn & sFile ) + sFileOut = hGetWorkPath() & sFile + + '///+<li>Open a new document - Writer or Calc</li> + hCreateDocument() + + '///+<li>Depending on the doctype create a table to work on</li> + select case iApp + case 1 : kontext "DocumentWriter" + hTabelleEinfuegen() + case 2 : kontext "DocumentCalc" + DocumentCalc.TypeKeys( "<Shift Right>", 5 ) + DocumentCalc.TypeKeys( "<Shift Down>", 3 ) + end select + + '///+<li>Open the table autoformat dialog</li> + FormatAutoformat + + select case iApp + case 1 : kontext "AutoformatTabelle" + if ( AutoformatTabelle.exists( 2 ) ) then + oControl = FormatBox + else + warnlog( "Unable to access Table Autoformat dialog (Writer)" ) + goto endsub + endif + + case 2 : kontext "AutoformatCalc" + if ( AutoformatCalc.exists( 2 ) ) then + oControl = FormatListe + else + warnlog( "Unable to access Table Autoformat dialog (Calc)" ) + goto endsub + endif + end select + + '///+<li>Get the number of items from the list</li> + iFormatCount = oControl.getItemCount() + + '///+<li>Compile a list of the autoformat names</li> + '///<ul> + for iCurrentFormat = 1 to iFormatCount + + '///+<li>Select the (next) format name from the list</li> + oControl.select( iCurrentFormat ) + + '///+<li>Retrieve the name of the current item and store it into a list + cCurrentFormat = oControl.getSelText() + ListAppend( al_UI_formats() , cCurrentFormat ) + + next iCurrentFormat + '///</ul> + + '///+<li>Close the autoformat dialog</li> + select case iApp + case 1 : AutoformatTabelle.ok() + case 2 : AutoformatCalc.ok() + end select + + '///+<li>Close the document</li> + hDestroyDocument() + + '///+<li>Compare the list against the reference file</li> + irc = hManageComparisionList( sFileIn, sFileOut, al_UI_formats() ) + if ( irc <> 0 ) then + warnlog( "The list of table autoformats has changed, please review." ) + else + printlog( "The list of table autoformats is unchanged. Good." ) + endif + '///</ul> + +endcase + + + + diff --git a/testautomation/framework/optional/includes/filedlg_allowed_names.inc b/testautomation/framework/optional/includes/filedlg_allowed_names.inc new file mode 100755 index 000000000000..4d9d3d51a905 --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_allowed_names.inc @@ -0,0 +1,130 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_allowed_names.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : check the internal file dialog ( extended tests ) +'* +'\****************************************************************************** + +testcase tSaveLoadDelFiles() + + '///<h1>Check allowed filenames on Windows using the File-Save dialog</h1> + + ' This test checks filenames that resemble Devices and files that contain + ' the allowed ASCII chars between 32 and 255. The latter is tested by five + ' random characters + ' The test should work for all applications and on all languages/locales. + + dim cStrangeName as string + dim iCounter ' iterator + dim iRandom ' random number. should end up to be a value between 32 and 255 + dim brc as boolean + + dim iCurrentDocType as integer ' increment + + for iCurrentDocType = 1 to 1 + + printlog( "" ) + printlog( "Current Documenttype: " & hNumericDocType( iCurrentDocType ) ) + printlog( "Check if filenames that resemble devicenames are treated ok" ) + printlog( "" ) + + '///<ul> + '///+<li>Open a new document</li> + printlog( "Open a new document" ) + + '///+<li>Save/Load/Delete names that resemble port-names (but are valid names)<br> + '///+ Please note that beginning with SRC680m238 we cannot save any file without suffix + '///+ anymore, whatever we do, a suffix will be present.</li> + brc = hSaveLoadDelSuccess( "COM0" , true ) + brc = hSaveLoadDelSuccess( "COM10" , true ) + brc = hSaveLoadDelSuccess( "LPT0" , true ) + brc = hSaveLoadDelSuccess( "LPT10" , true ) + + '///+<li>Save/Load/Delete files containing permitted ASCII-characters</li> + ' This test randomizes through a number of characters, a full test of all + ' possible ascii characters would simply take too long. + printlog( "" ) + printlog( "Names with allowed ASCII-chars" ) + printlog( "" ) + + call randomize() + + for iCounter = 1 to 3 + + iRandom = int( 32 + ( 223 * rnd ) ) + printlog( "" ) + printlog( " * Using decimal char: " & iRandom ) + printlog( "" ) + + + ' Exclude some special characters that cannot work + select case iRandom + + case 32 : printlog( " - skipping ASCII-Char: " & iRandom ) + case 34 : printlog( " - skipping ASCII-Char: " & iRandom ) + case 35 : printlog( " - skipping ASCII-Char: " & iRandom ) + case 42 : printlog( " - skipping ASCII-Char: " & iRandom ) + case 46 : printlog( " - skipping ASCII-Char: " & iRandom ) + case 47 : printlog( " - skipping ASCII-Char: " & iRandom ) + case 58 : printlog( " - skipping ASCII-Char: " & iRandom ) + case 60 : printlog( " - skipping ASCII-Char: " & iRandom ) + case 62 : printlog( " - skipping ASCII-Char: " & iRandom ) + case 63 : printlog( " - skipping ASCII-Char: " & iRandom ) + case 92 : printlog( " - skipping ASCII-Char: " & iRandom ) + case 124 : printlog( " - skipping ASCII-Char: " & iRandom ) + case 126 : printlog( " - skipping ASCII-Char: " & iRandom ) + + case else + + cStrangeName = hNameGen_append( iRandom ) + brc = hSaveLoadDelSuccess( cStrangeName , TRUE ) + + cStrangeName = hNameGen_lead( iRandom ) + brc = hSaveLoadDelSuccess( cStrangeName , TRUE ) + + end select + + next iCounter + + '///+<li>close the document</li> + brc = hDestroyDocument() + + next iCurrentDocType + + '///</ul> + +endcase + + diff --git a/testautomation/framework/optional/includes/filedlg_autocomplete.inc b/testautomation/framework/optional/includes/filedlg_autocomplete.inc new file mode 100755 index 000000000000..76fa8769acf2 --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_autocomplete.inc @@ -0,0 +1,247 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_autocomplete.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Autocompletion feature +'* +'\****************************************************************************** + +testcase tAutocomplete + + '///<h1>Autocompletion feature</h1> + + '///<u><pre>Synopsis</pre></u>Test the autocompletion feature, filename completion<br> + '///<u><pre>Specification document</pre></u>No specification document available<br> + '///<u><pre>Files used</pre></u> + '///+ (User-Layer)/user/work/autocomplete<br> + '///+ (User-Layer)/user/work/autocomplete/autocomplete_a.odt</br> + '///+ (User-Layer)/user/work/autocomplete/autocomplete_b.odt</br> + '///+ (User-Layer)/user/work/autocomplete/autocomplete_bb.odt</br> + + ' IMPORTANT NOTE: Autocompletion is asynchronous. This means that no rule + ' exists when exactly it is going to strike. If you are + ' using a networked environment you have to make sure that + ' all network ressources deliver a decent performance as + ' this seriously influences the speed of the autocompletion. + + dim cBasePath as string + + const WORKDIR = "autocomplete" + + ' These are the files we create in the users homedirectory + dim aWorkFile( 3 ) as string + aWorkFile( 1 ) = "autocomplete_a.odt" + aWorkFile( 2 ) = "autocomplete_b.odt" + aWorkFile( 3 ) = "autocomplete_bb.odt" + + ' These are the full paths to the files + dim aFullPath( 3 ) as string + + ' These are the wildcarded filter strings + dim aWildCard( 3 ) + aWildCard( 1 ) = "autocomplete_?.odt" + aWildCard( 2 ) = "autocomplete_b?.odt" + aWildCard( 3 ) = "autocomplete_*.odt" + + + dim cCurrentPath as string + dim cAutocomplete as string + + dim iCurrentDocument as integer + + dim cLeft as string + dim iLeft as integer + iLeft = 4 + + dim cEFString as string + + dim slot + + '///<u><pre>Test case specification</pre></u> + '///<ul> + '///+<li>Init: Make sure we only have no open documents</li> + do while( getDocumentCount > 0 ) + call hCloseDocument() + loop + + '///+<li>Init: Get the current workpath</li> + cBasePath = hGetWorkPath() + aFullPath( 1 ) = cBasePath & WORKDIR & gPathSigne & aWorkFile( 1 ) + aFullPath( 2 ) = cBasePath & WORKDIR & gPathSigne & aWorkFile( 2 ) + aFullPath( 3 ) = cBasePath & WORKDIR & gPathSigne & aWorkFile( 3 ) + hDeleteFile( aFullPath( 1 ) ) + hDeleteFile( aFullPath( 2 ) ) + hDeleteFile( aFullPath( 3 ) ) + if ( dir( cBasePath & WORKDIR ) <> "" ) then + rmdir( cBasePath & WORKDIR ) + endif + + '///+<li>Init: Create a directory called "autocomplete" in the user directory</li> + mkdir( cBasePath & WORKDIR ) + if ( dir( cBasePath & WORKDIR ) = "" ) then + warnlog( "Failed to create work directory, aborting" ) + goto endsub + endif + + '///+<li>Init: Create three documents within the workdir - autocomplete_a.odt/_b.odt/_bb.odt</li> + gApplication = "WRITER" + for iCurrentDocument = 1 to 3 + call hNewDocument() + kontext "DocumentWriter" + DocumentWriter.typeKeys( aWorkFile( iCurrentDocument ) ) + hFileSaveAs( aFullPath( iCurrentDocument ) ) + FileClose + next iCurrentDocument + + + '///+<li> + '///+<li>Open the File Open dialog</li> + printlog( "open the File Open dialog" ) + FileOpen + + '///+<li>Test case 1: Workdirectory and folder autocompletion</li> + '///<ul> + '///+<li>Go to the work directory using the "Home" button</li> + kontext "OeffnenDlg" + Standard.click() + + '///+<li>Enter the first 4 characters of the testdirectory</li> + cLeft = left( WORKDIR, iLeft ) + cEFString = convertpath( WORKDIR & "/" ) + printlog( "Type """ & cLeft & """ into the filename entryfield" ) + DateiName.typeKeys( cLeft ) + + '///+<li>Press the "END" key</li> + printlog( "Press the <END> key and wait for two seconds" ) + DateiName.typeKeys( "<END>" ) + sleep( 1 ) ' Required, do not remove + + '///+<li>Verify that the "autocomplete" dir has been autocompleted</li> + cAutocomplete = DateiName.getSelText() + if ( cEFString = cAutocomplete ) then + printlog( "Autocompletion succeeded for workdirectory" ) + else + warnlog( "Autocompletion failed" ) + printlog( "Expected: " & cRight ) + printlog( "Found...: " & cAutocomplete ) + endif + + '///+<li>Press return on the FileOpen dialog</li> + printlog( "Press <RETURN> on the file open dialog -> Open" + kontext "OeffnenDlg" + OeffnenDlg.typeKeys( "<RETURN>" ) + '///</ul> + + '///+<li>Test case 2: Filename autocompletion/selection</li> + '///<ul> + '///+<li>Enter the string "auto" into the entryfield</li> + printlog( "Type "" auto "" into the entryfield" ) + cLeft = left( aWorkFile( 1 ), 4 ) + DateiName.typeKeys( cLeft ) + sleep( 1 ) + + '///+<li>Verify that the filename is expanded to autocomplete_a.odt</li> + cAutocomplete = DateiName.getSelText() + if ( aWorkFile( 1 ) = cAutocomplete ) then + printlog( "Autocompletion succeeded for first file" ) + else + warnlog( "Autocompletion failed" ) + printlog( "Expected: " & cRight ) + printlog( "Found...: " & cAutocomplete ) + endif + + '///+<li>Press the down-key in the entry field</li> + printlog( "Press down key in entry field" ) + DateiName.typeKeys( "<DOWN>" ) + sleep( 1 ) + + '///+<li>Verify that the filename is expanded to autocomplete_b.odt</li> + cAutocomplete = DateiName.getSelText() + if ( aWorkFile( 2 ) = cAutocomplete ) then + printlog( "Autocompletion succeeded for second file" ) + else + warnlog( "Autocompletion failed" ) + printlog( "Expected: " & cRight ) + printlog( "Found...: " & cAutocomplete ) + endif + '///</ul> + + '///+<li>Test case 3: Wildcards ? and * (click "Open" to apply)</li> + '///<ul> + '///+<li>Enter autocomplete_?.odt -> 2 matches expected</li> + printlog( "Enter autocomplete_?.odt -> 2 matches expected" ) + Dateiname.setText( aWildCard( 1 ) ) + Oeffnen.click() + if ( DateiAuswahl.getItemCount() <> 2 ) then + warnlog( "Incorrect number of files displayed, 2 expected" ) + else + printlog( "Correct number of files listed in files-list" ) + endif + + '///+<li>Enter autocomplete_b?.odt -> 1 match expected</li> + printlog( "Enter autocomplete_b?.odt -> 1 match expected" ) + Dateiname.setText( aWildCard( 2 ) ) + Oeffnen.click() + if ( DateiAuswahl.getItemCount() <> 1 ) then + warnlog( "Incorrect number of files displayed, 1 expected" ) + else + printlog( "Correct number of files listed in files-list" ) + endif + + '///+<li>Enter autocomplete_*.odt -> 3 matches expected</li> + printlog( "Enter autocomplete_*.odt -> 3 matches expected" ) + Dateiname.setText( aWildCard( 3 ) ) + Oeffnen.click() + if ( DateiAuswahl.getItemCount() <> 3 ) then + warnlog( "Incorrect number of files displayed, 3 expected" ) + else + printlog( "Correct number of files listed in files-list" ) + endif + '///</ul> + + + '///+<li>Close File Open dialog</li> + printlog( "Close File Open dialog" ) + kontext "OeffnenDlg" + OeffnenDlg.cancel() + + '///+<li>Cleanup: Remove files, directories</li> + hDeleteFile( aFullPath( 1 ) ) + hDeleteFile( aFullPath( 2 ) ) + hDeleteFile( aFullPath( 3 ) ) + rmdir( cBasePath & WORKDIR ) + '///</ul> + +endcase + diff --git a/testautomation/framework/optional/includes/filedlg_cjk_files.inc b/testautomation/framework/optional/includes/filedlg_cjk_files.inc new file mode 100755 index 000000000000..838df3bdd8f1 --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_cjk_files.inc @@ -0,0 +1,113 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_cjk_files.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : check the internal file dialog ( extended tests ) +'* +'\****************************************************************************** + +testcase tSaveLoadDelFilesCJK() + + if ( not hTestLocale() ) then + warnlog( "Test requires UTF-8 locale" ) + goto endsub + endif + + '///<h1>Save, reload and delete files containing asian characters</h1> + '///<p>This test randomizes through the range of unified CJK characters + '///+ which ranges from dec 19968 (#4E00) to dec 40879 (#9FAF) - a grand + '///+ total of 20911 different characters. We take two samples for each + '///+ application this test is executed for. Note that this test does not + '///+ work with directories.</p> + + dim cStrangeName as string + dim iCounter as integer ' iterator + dim iRandom as long ' random number.(needs long for cjk chars) + dim brc as boolean + + printlog( CHR$(13) ) + printlog( "Check if CJK-filenames are loaded/saved/deleted" ) + printlog( CHR$(13) ) + + '///<ul> + printlog( CHR$(13) + "Names with CJK-chars" ) + printlog( "" ) + + ' Invoke randomizer + call randomize() + + '///+<li>Repeat following steps for two asian characters:</li> + '///<ul> + for iCounter = 1 to 2 + + '///+<li>Select a random character from the desired range</li> + iRandom = int( 19968 + ( 20911 * rnd ) ) + printlog( "" ) + printlog( " * Using decimal char: " & iRandom ) + + '///+<li>Open a new document</li> + '///+<li>Save file with trailing asian character and suffix</li> + cStrangeName = hNameGen_append( iRandom ) + brc = hSaveLoadDelSuccess( cStrangeName ) + + '///+<li>Save file with leading asian character and suffix</li> + cStrangeName = hNameGen_lead( iRandom ) + brc = hSaveLoadDelSuccess( cStrangeName ) + + '///+<li>Handle possible errormessages/warnings</li> + kontext "active" + if( active.exists() ) then + qaerrorlog( "#i33964# Document does not exist when the last document is deleted from filepicker" ) + printlog( active.gettext() ) + active.ok() + endif + + '///+<li>Delete the file via BASIC command (in case the file was not deleted eralier)</li> + hDeleteFile( hGetWorkPath() & cStrangeName ) + + '///+<li>Close the navigator if it is present, it might interfere</li> + hCloseNavigator() + + + next iCounter + '///</ul> + + '///+<li>Close the document</li> + printlog( "Close the document" ) + brc = hDestroyDocument() + + '///</ul> + +endcase + diff --git a/testautomation/framework/optional/includes/filedlg_cjk_folders.inc b/testautomation/framework/optional/includes/filedlg_cjk_folders.inc new file mode 100755 index 000000000000..2f6a63188f66 --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_cjk_folders.inc @@ -0,0 +1,109 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_cjk_folders.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : check the internal file dialog ( extended tests ) +'* +'\****************************************************************************** + +testcase tCJKFolders() + + '///<h1>Create and delete folders containing CJK characters</h1> + + if ( not hTestLocale() ) then + warnlog( "Test requires UTF-8 locale" ) + goto endsub + endif + + + '///<ul> + + dim cStrangeFolder as string + dim cStrangeFile as string + dim iCounter as integer ' iterator + dim iRandom as long ' random number.(needs long for cjk chars) + dim brc as boolean + + printlog( CHR$(13) ) + printlog( "Check if CJK-files/folders are handled ok" ) + printlog( CHR$(13) ) + + '///+<li>Create a new document</li> + printlog( "Open a new document" ) + brc = hCreateDocument() + + printlog( CHR$(13) + "Names with CJK-chars" ) + printlog( "" ) + + '///+<li>Invoke randomizer</li> + call randomize() + + '///+<li>Repeat following steps for at least three asian characters:</li> + '///<ul> + for iCounter = 1 to 3 + + iRandom = int( 19968 + ( 20911 * rnd ) ) + printlog( " * Using decimal char: " & iRandom ) + + '///+<li>Create a folder with a name containing cjk characters</li> + cStrangeFolder = hNameGen_append( iRandom ) + brc = hCreateDirctoryExpectSuccess( cStrangeFolder ) + + '///+<li>Save a file w. trailing cjk characters to the newly created directory</li> + '///+<li>Load the file again</li> + '///+<li>Delete the file</li> + cStrangeFile = hNameGen_append( iRandom ) + cStrangeFile = convertpath( cStrangeFolder & "\" & cStrangeFile ) + brc = hSaveLoadDelSuccess( cStrangeFile , TRUE ) + + '///+<li>Save a file w. leading cjk characters to the newly created directory</li> + '///+<li>Load the file again</li> + '///+<li>Delete the file</li> + cStrangeFile = hNameGen_lead( iRandom , true ) + cStrangeFile = convertpath( cStrangeFolder & "\" & cStrangeFile ) + brc = hSaveLoadDelSuccess( cStrangeName , true ) + + '///+<li>Delete the folder</li> + brc = hDeleteFileExpectSuccess( cStrangeFolder ) + + next iCounter + '///</ul> + + '///+<li>Close the document</li> + printlog( "Close the document" ) + brc = hDestroyDocument() + '///</ul> + +endcase + diff --git a/testautomation/framework/optional/includes/filedlg_document_properties.inc b/testautomation/framework/optional/includes/filedlg_document_properties.inc new file mode 100755 index 000000000000..4def34fae131 --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_document_properties.inc @@ -0,0 +1,120 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_document_properties.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Access document properties +'* +'\****************************************************************************** + +testcase tFiledlgDocumentProperties() + + '///<h3>Access document properties</h3> + + dim cFileName as string + cFileName = "DigitalSignature" & hGetSuffix( "current" ) + + dim cFilePath as string + cFilePath = gTesttoolPath & "framework\optional\input\security" + cFilePath = convertpath( cFilePath ) + + dim cFileURL as string : cFileURL = cFilePath & gPathSigne & cFileName + + dim iFileSize as long + dim cFileSize as string + dim iFileSizeInfo as long + dim cSignatureCreator as string + + dim cTestExpression as string + + dim cSelectAll as string + dim cCopy as string + + dim brc as boolean + + '///<ul> + printlog( "Using filename: " & cFileName ) + printlog( "Using filepath: " & cFilePath ) + + '///+<li>Retrieve the size from the workfile using direct BASIC calls</li> + if ( FileExists( cFileURL ) ) then + iFileSize = FileLen( cFileURL ) + printlog( "Testfile size is: " & iFileSize & " Bytes" ) + else + warnlog( "The workfile does not exist. aborting test" ) + goto endsub + endif + + '///+<li>Load the workfile (framework/security/input/DigitalSignature.???)</li> + hFileOpen( cFileURL ) + + '///+<li>open the file properties dialog</li> + FileProperties + + '///+<li>Document-Tab: Verify that the filename is correct</li> + brc = hDocumentInfoSelectTab( "General" ) + if ( not brc ) then + warnlog( "Unable to switch to the requested tabpage, trying to recover" ) + kontext "TabDokument" + TabDokument.cancel() + hDestroyDocument() + endif + + cTestExpression = hGetStringFromStaticTextField( FileLocationInfo ) + if ( cTestExpression = cFilePath ) then + printlog( "Path is correct" ) + else + warnlog( "The path string is incorrect: " & cTestExpression ) + endif + + '///+<li>Verify the filesize info</li> + kontext "TabDokument" + cFileSize = hGetStringFromStaticTextField( FileSizeInfo ) + iFileSizeInfo = hConvertStringToLong( cFileSize ) + if ( iFileSize <> iFileSizeInfo ) then + warnlog( "Filesize does not match, please check" ) + printlog( "Found...: " & iFileSizeInfo ) + printlog( "Expected: " & iFileSize ) + else + printlog( "Filesize is correct" ) + endif + + kontext "TabDokument" + TabDokument.cancel() + + hDestroyDocument() + + '///</ul> + +endcase + diff --git a/testautomation/framework/optional/includes/filedlg_filternames.inc b/testautomation/framework/optional/includes/filedlg_filternames.inc new file mode 100755 index 000000000000..61e16651fe0f --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_filternames.inc @@ -0,0 +1,135 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_filternames.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Verify that all filters are listed in the filter listbox +'* +'\****************************************************************************** + +testcase tVerifyFilterNames + + '///<h3>Verify that all filters are listed in the filter listbox</h3> + + if ( gIsoLang <> "en-US" ) then + qaerrorlog( "No testing for non-US languages" ) + goto endsub + endif + + const MAX_FILTERCOUNT = 300 + dim asFilterNames( MAX_FILTERCOUNT ) as string + dim iFilterCount as integer + dim iCurrentItem as integer + + dim cFile as string + dim iErr as integer + + + ' For Windows and Solaris Sparc there exists additional commercial filters + ' that are available for StarOffice only. + cFile = gProductName & "_Filternames_" + if ( not gOOo ) then + select case gtSysName + case "Windows" : cFile = cFile & "add_" & gIsoLang & ".txt" + case "Solaris SPARC" : cFile = cFile & "add_" & gIsoLang & ".txt" + case "WinXP" : cFile = cFile & "add_" & gIsoLang & ".txt" + case "Linux" : cFile = cFile & gIsoLang & ".txt" + case "Solaris x86" : cFile = cFile & gIsoLang & ".txt" + end select + else + cFile = cFile & gIsoLang & ".txt" + endif + + dim cFileIn as string + cFileIn = gTesttoolPath & "framework\optional\input\filternames\" & cFile + cFileIn = convertpath( cFileIn ) + + dim cFileOut as string + cFileOut = hGetWorkPath() & cFile + + + '///<ul> + '///+<li>New document</li> + hCreateDocument() + + '///+<li>Open FileOpen</li> + FileOpen + Kontext "OeffnenDlg" + + if ( OeffnenDlg.exists( 1 ) ) then + + '///+<li>Get the number of items from the filterlist</li> + iFilterCount = DateiTyp.getItemCount() + if ( iFilterCount > MAX_FILTERCOUNT ) then + warnlog( "Too many filters in filterlist for this test to handle" ) + goto endsub + endif + + printlog( "Reading in " & iFilterCount & " filternames" ) + + '///+<li>Make the list compatible to listfunctions</li> + asFilterNames( 0 ) = iFilterCount + + '///+<li>Collect the list of filternames (including all separators etc.</li> + for iCurrentItem = 1 to iFilterCount + + kontext "OeffnenDlg" + try + asFilterNames( iCurrentItem ) = DateiTyp.getItemText( iCurrentItem ) + catch + printlog( "Test broke at pos: " & iCurrentItem ) + endcatch + + next iCurrentItem + + '///+<li>Close FileOpen dialog</li> + OeffnenDlg.cancel() + + '///+<li>Compare the current list against a reference</li> + iErr = hManageComparisionList( cFileIn, cFileOut, asFilterNames() ) + + else + warnlog( "File Open dialog not present." ) + endif + + '///+<li>Cleanup: Close document</li> + hDestroyDocument() + + if ( iErr <> 0 ) then + warnlog( "Filterlist differs from reference, please review" ) + endif + + '///</ul> + +endcase + diff --git a/testautomation/framework/optional/includes/filedlg_folders1.inc b/testautomation/framework/optional/includes/filedlg_folders1.inc new file mode 100755 index 000000000000..471572ab7ab0 --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_folders1.inc @@ -0,0 +1,142 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_folders1.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : check the internal file dialog ( 1. part ) +'* +'\****************************************************************************** + +testcase tFolder1 + + '///<h1>Level 1 test: Create new folders from the File Open dialog</h1> + Dim VerList(50) as String + dim FULLPATH as string + FULLPATH = gOfficePath + "user\work\" + + '///<ul> + printlog " - cleanup the output-dir, kill all directories." + + '///+<li>Delete all directories in [home/Office-dir/user/work]</li> + GetDirList ( ConvertPath ( FULLPATH ), "*" , VerList() ) + KillDirList ( VerList() ) + + '///+<li>Either click on "FileOpen" or use the menu to get there</li> + FileOpen + + 'This is a hack to prevent trouble when opening 'FileOpen' and the path + 'is not accessible. + '///+<li>Handle possible errormessages (path not accessible)</li> + Kontext "Active" + if Active.Exists( 1 ) then + Warnlog "The preset path is invalid, a messagebox has been shown." + Active.OK() + endif + + '///+<li>Insert the pathname into the filename field</li> + Kontext "OeffnenDlg" + Dateiname.SetText( ConvertPath ( FULLPATH ) ) + Oeffnen.Click() + + + '///+<li>click on 'new folder', insert as name 'z' and click OK<br> + '///+ Verify that the folder was created ( if yes -> kill it )</li> + printlog " - foldername with only one character" + CreateValidDirectory( "z" ) + + + '///<li>click on 'new folder', insert as name '1234' and click OK<br> + '///+ Verify that the folder was created ( if yes -> kill it )</li> + printlog " - foldername only with numbers" + CreateValidDirectory( "1234" ) + + + '///+<li>click on 'new folder', insert as name 'xaxaxaxa' ( 8 characters ) and click OK<br> + '///+ Verify that the folder was created ( if yes -> kill it )</li> + printlog " - foldername with 8 characters" + CreateValidDirectory( "xaxaxaxa" ) + + + '///+<li>click on 'new folder', insert as name 'yxyxyxyx.aaa' ( 8.3 characters ) and click OK<br> + '///+ Verify that the folder was created ( if yes -> kill it )</li> + printlog " - foldername with 8.3 characters" + CreateValidDirectory( "yxyxyxyx.aaa" ) + + + '///+<li>click on 'new folder', insert as name 'yxyxyxyxyxyx.aaabbb' ( more than 8.3 characters ) and click OK<br> + '///+ Verify that the folder was created ( if yes -> kill it )</li> + printlog " - foldername with more than 8.3 characters" + CreateValidDirectory( "yxyxyxyxyxyx.aaabbb" ) + + + '///+<li>click on 'new folder', insert as name 'hälölüle' ( with special characters - umlauts ) and click OK<br> + '///+ Verify that the folder was created ( if yes -> kill it )</li> + printlog " - foldername with special charaters ( umlauts )" + CreateValidDirectory( "hälölüle" ) + + + '///+<li>click on 'new folder', insert as name 'aa bb' ( with spaces in the middle ) and click OK<br> + '///+ Verify that the folder was created ( if yes -> kill it )</li> + printlog " - foldername with one whitespace in the middle" + CreateValidDirectory( "aa bb" ) + + + '///+<li>click on 'new folder', insert as name ' ccdd' ( with leading spaces ) and click OK<br> + '///+ Verify that the folder was created ( if yes -> kill it )</li> + printlog " - foldername with leading spaces" + CreateValidDirectoryCrop( " lead" , "lead" ) + + + '///+<li>click on 'new folder', insert as name 'ddee ' ( with spaces at the end ) and click OK<br> + '///+ Verify that the folder was created ( if yes -> kill it )</li> + printlog " - foldername with trailing spaces" + CreateValidDirectoryCrop( "trail " , "trail" ) + + + '///+<li>click on 'new folder', insert as name 'Here is a dir with spaces' ( with more spaces ) and click OK<br> + '///+ Verify that the folder was created ( if yes -> kill it )</li> + printlog " - foldername with more spaces" + CreateValidDirectory( "here is a dir with spaces" ) + + + '///+<li>click on 'new folder', insert as name '??++!!' ( with forbidden signes on windows ) and click OK<br> + '///+ Verify that the folder was created ( if yes -> kill it )</li> + printlog " - foldername with forbidden signes ( ?+! ) - only on windows they are forbidden" + CreateInvalidDirectory( "??++!!" ) + + '///+<li>Cancel the File Open dialog</li> + Kontext "OeffnenDlg" + OeffnenDlg.Cancel() + '///</ul> + +endcase diff --git a/testautomation/framework/optional/includes/filedlg_folders2.inc b/testautomation/framework/optional/includes/filedlg_folders2.inc new file mode 100755 index 000000000000..2d006fee1369 --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_folders2.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 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_folders2.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : check the internal file dialog ( 1. part ) +'* +'\****************************************************************************** + +testcase tFolder2 + + '///<h1>Level 1 test: Create folders with duplicate names</h1> + + dim FULLPATH as string + FULLPATH = gOfficePath + "user\work\" + + Dim VerList(50) as String + + '///<ul> + + '///+<li>Delete all directories in [home/Office-dir/user/work]</li> + GetDirList ( ConvertPath ( FULLPATH ), "*" , VerList() ) + KillDirList ( VerList() ) + + '///+<li>Either click on "FileOpen" or use the menu to get there</li> + FileOpen + + '///+<li>Change to the local workdirectory (if necessary)</li> + Kontext "OeffnenDlg" + Dateiname.SetText( ConvertPath ( FULLPATH )) + Oeffnen.Click() + + '///+<li>Click on "New Folder" name it "aaa", repeat the two steps<br> + '///+ There should be a warning that the folder exist and it should not be possible to create it</li> + printlog( CHR$(13) + " - Create a folder named 'aaa' twice" ) + CheckDirectoryName( "aaa" ) + + '///+<li>Click on "New Folder" name it "123", repeat the two steps<br> + '///+ There should be a warning that the folder exist and it should not be possible to create it</li> + printlog( CHR$(13) + " - Create a folder named '123' twice" ) + CheckDirectoryName( "123" ) + + '///+<li>Click on "New Folder" name it "yayayaya", repeat the two steps<br> + '///+ There should be a warning that the folder exist and it should not be possible to create it</li> + printlog( CHR$(13) + " - Create a folder named 'yayayaya' twice" ) + CheckDirectoryName( "yayayaya" ) + + '///+<li>Click on "New Folder" name it "ycycycyc.aaa", repeat the two steps<br> + '///+ There should be a warning that the folder exist and it should not be possible to create it</li> + printlog( CHR$(13) + " - Create a folder named 'ycycycyc.aaa' twice" ) + CheckDirectoryName( "ycycycyc.aaa" ) + + '///+<li>If we hang on the "New Folder" dialog: Close it</li> + Kontext "NeuerOrdner" + if NeuerOrdner.Exists() then + NeuerOrdner.Cancel() + endif + + '///+<li>Cancel the FileOpen dialog</li> + Kontext "OeffnenDlg" + OeffnenDlg.Cancel() + '///</ul> + +endcase diff --git a/testautomation/framework/optional/includes/filedlg_folders3.inc b/testautomation/framework/optional/includes/filedlg_folders3.inc new file mode 100755 index 000000000000..5ed78ad0de14 --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_folders3.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 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_folders3.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : check the internal file dialog ( 1. part ) +'* +'\****************************************************************************** + +testcase tFolder3 + + '///<h1>Level 1 test: Create folders with lower and upper cases in the local file system</h1> + + dim FULLPATH as string + FULLPATH = gOfficePath + "user\work\" + + dim FOLDERNAME_U as string + FOLDERNAME_U = "AAABBB" + + dim FOLDERNAME_M as string + FOLDERNAME_M = "AAaabbBB" + + '///<ul> + + '///+<li>Click "FileOpen"</li> + FileOpen + + '///+<li>Make sure we are in the local working directory, go there if necessary</li> + printlog( " - change to working directory" ) + Kontext "OeffnenDlg" + Dateiname.SetText( ConvertPath ( FULLPATH )) + Oeffnen.Click() + + '///+<li>Click on the "New Folder" icon, insert an uppercase foldername<br> + '///+ Verify on filesystem level that the name is indeed in uppercase</li> + printlog( " - foldername with upper case characters only" ) + call CreateValidDirectory( FOLDERNAME_U ) + + '///+<li>Click on the "New Folder" icon, insert a mixed case foldername<br> + '///+ Verify on filesystem level that the name is indeed in mixed case</li> + printlog( " - foldername with mixed case characters" ) + call CreateValidDirectory( FOLDERNAME_M ) + + '///+<li>Cancel FileOpen dialog</li> + kontext "OeffnenDlg" + OeffnenDlg.Cancel() + '///</ul> + +endcase + + diff --git a/testautomation/framework/optional/includes/filedlg_folders4.inc b/testautomation/framework/optional/includes/filedlg_folders4.inc new file mode 100755 index 000000000000..2ee1f6ead5de --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_folders4.inc @@ -0,0 +1,153 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_folders4.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : check the internal file dialog ( 1. part ) +'* +'\***************************************************************************** + +testcase tUpOneLevel1 + + '///<h1>Click "Level-Up" button until we reach filesystem root</h1> + '///+This test verifies that each click moves one level up in the filesystem. + '///+Furthermore it is verified that the button does not get disabled under way. + '///<ul> + + dim iClick as integer + + ' We always want to start in a fixed directory structure so the first few dirnames are + ' known an can be used for verification + dim cStartDir as string + cStartDir = gTesttoolPath & "framework\optional\input\filetest\level1\level2\level3" + cStartDir = convertpath( cStartDir ) + printlog( "Start-Directory is: " & cStartDir ) + + + ' Find out how deep into the filesystem hierarchy we are so we know when we are at the + ' filesystem root. We add one because Windows has one more level where the drive icons + ' are shown + dim iDirLevels as integer + iDirLevels = hGetDirTreeLevel( cStartDir ) + + if ( instr( lcase( gtSYSName ) , "win" ) = 1 ) then + iDirLevels = iDirLevels + 1 + printlog( "Current threshold (Windows) is: " & iDirLevels) + elseif ( gtSysName = "ecomstation" ) then + iDirLevels = iDirLevels + 1 + printlog( "Current threshold (eComStation) is: " & iDirLevels) + else + printlog( "Current threshold (Unix/Linux) is: " & iDirLevels) + endif + + dim sCurrentDir as string + dim sExpectedDir as string + + + '///+<li>Click FileOpen</li> + FileOpen + + '///+<li>Open [Testtoolpath]\framework\optional\input\filetest\level1\level2\level3</li> + Kontext "OeffnenDlg" + Dateiname.SetText( cStartDir ) + Oeffnen.Click() + + '///+<li>Click the "Level-Up" button until we are in the filesystem root</li> + '///<ul> + printlog "Click the Level-Up button until we are in the filesystem root" + for iClick = 1 to iDirLevels + + '///+<li>Verify that the button exists</li> + if ( UebergeordneterOrdner.exists() ) then + + '///+<li>Verify that the button is enabled</li> + if ( UebergeordneterOrdner.isEnabled() ) then + + '///+<li>Click the "Level-Up" button</li> + UebergeordneterOrdner.Click() + else + warnlog( "Level-Up button is disabled" ) + endif + else + warnlog( "Level-Up button does not exist" ) + endif + + '///+<li>Get the name of the first item in the filepicker (excluding CVS)</li> + sCurrentDir = hGetFirstNameFromFileList() + + '///+<li>Verify that the name of the first item is correct. The names of the first six dirs are known</li> + select case iClick + case 1 : sExpectedDir = "level3" + case 2 : sExpectedDir = "level2" + case 3 : sExpectedDir = "level1" + case 4 : sExpectedDir = "alldocs" + case 5 : sExpectedDir = "includes" + case 6 : sExpectedDir = "optional" + end select + + if ( iClick < 7 ) then + if ( sCurrentDir = sExpectedDir ) then + printlog( "Current directory name is: " & sCurrentDir & " [ok]" ) + else + warnlog( "Error finding directory name:" ) + printlog( "Current directory name is: " & sCurrentDir & " which is NOT ok" ) + printlog( "Expected directory name..: " & sExpectedDir ) + endif + endif + next iClick + '///</ul> + + '///+<li>We should now be at the top of the tree, the "Level-Up" button should be disabled</li> + kontext "OeffnenDlg" + + '///+<li>Verify that the button exists</li> + if ( UebergeordneterOrdner.exists() ) then + + '///+<li>Check that the button is not enabled</li> + if ( not UebergeordneterOrdner.isEnabled() ) then + printlog( "Level-Up button is disabled, good" ) + else + '///+<li>Warn if the button is enabled</li> + warnlog( "The Level-up button should not be enabled for filesystem root" ) + endif + else + warnlog( "Level-Up button does not exist" ) + endif + '///</ul> + + OeffnenDlg.Cancel() + +endcase + + + diff --git a/testautomation/framework/optional/includes/filedlg_folders5.inc b/testautomation/framework/optional/includes/filedlg_folders5.inc new file mode 100755 index 000000000000..b37e98ca3bac --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_folders5.inc @@ -0,0 +1,141 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_folders5.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : check the internal file dialog ( 1. part ) +'* +'\***************************************************************************** + +testcase tUpOneLevel2 + + '///<h1>Enter ".." until we are at filesystem root level, verify</h1> + '///+This test verifies that each ".." moves one level up in the filesystem. + '///+Furthermore it is verified that the Level-Up button does not get disabled under way. + '///<ul> + + dim iParentDir as integer + + ' We always want to start in a fixed directory structure so the first few dirnames are + ' known an can be used for verification + dim cStartDir as string + cStartDir = gTesttoolPath & "framework\optional\input\filetest\level1\level2\level3" + cStartDir = convertpath( cStartDir ) + printlog( "Start-Directory is: " & cStartDir ) + + + ' Find out how deep into the filesystem hierarchy we are so we know when we are at the + ' filesystem root. We add one because Windows has one more level where the drive icons + ' are shown + dim iDirLevels as integer + iDirLevels = hGetDirTreeLevel( cStartDir ) + + if ( instr( lcase( gtSYSName ) , "win" ) = 1 ) then + iDirLevels = iDirLevels + 1 + printlog( "Current threshold (Windows) is: " & iDirLevels) + elseif ( gtSysName = "ecomstation" ) then + iDirLevels = iDirLevels + 1 + printlog( "Current threshold (eComStation) is: " & iDirLevels) + else + printlog( "Current threshold (Unix/Linux) is: " & iDirLevels) + endif + + dim sCurrentDir as string + dim sExpectedDir as string + + + '///+<li>Click FileOpen</li> + FileOpen + + '///+<li>Open [Testtoolpath]\framework\filedlg\input\filetest\level1\level2\level3</li> + Kontext "OeffnenDlg" + Dateiname.SetText( cStartDir ) + Oeffnen.Click() + + '///+<li>Enter ".." and press "Open" until we are at filesystem root</li> + '///<ul> + printlog "Enter '..' until we are in the filesystem root" + for iParentDir = 1 to iDirLevels + + '///+<li>Enter ".."</li> + Dateiname.setText( ".." ) + + '///+<li>Click "Open"</li> + Oeffnen.click() + + '///+<li>Get the name of the first item in the filepicker (excluding CVS)</li> + sCurrentDir = hGetFirstNameFromFileList() + + '///+<li>Verify that the name of the first item is correct. The names of the first six dirs are known</li> + select case iParentDir + case 1 : sExpectedDir = "level3" + case 2 : sExpectedDir = "level2" + case 3 : sExpectedDir = "level1" + case 4 : sExpectedDir = "alldocs" + case 5 : sExpectedDir = "includes" + case 6 : sExpectedDir = "optional" + end select + + if ( iParentDir < 7 ) then + if ( sCurrentDir = sExpectedDir ) then + printlog( "Current directory name is: " & sCurrentDir & " [ok]" ) + else + warnlog( "Error finding directory name:" ) + printlog( "Current directory name is: " & sCurrentDir & " which is NOT ok" ) + printlog( "Expected directory name..: " & sExpectedDir ) + endif + endif + next iParentDir + '///</ul> + + '///+<li>We should now be at the top of the tree, the "Level-Up" button should be disabled</li> + kontext "OeffnenDlg" + + '///+<li>Verify that the button exists</li> + if ( UebergeordneterOrdner.exists() ) then + + '///+<li>Check that the button is not enabled</li> + if ( not UebergeordneterOrdner.isEnabled() ) then + printlog( "Level-Up button is disabled, good" ) + else + '///+<li>Warn if the button is enabled</li> + warnlog( "The Level-up button should not be enabled for filesystem root" ) + endif + else + warnlog( "Level-Up button does not exist" ) + endif + '///</ul> + + OeffnenDlg.Cancel() + +endcase diff --git a/testautomation/framework/optional/includes/filedlg_folders6.inc b/testautomation/framework/optional/includes/filedlg_folders6.inc new file mode 100755 index 000000000000..ad520ce6ad92 --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_folders6.inc @@ -0,0 +1,196 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_folders6.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : check the internal file dialog +'* +'\***************************************************************************** + +testcase tUpOneLevel3 + + '///<h1>Jump to the filesystem root using pathseparator</h1> + '///+<i>Note that his is performed four times due to a bug that existed in + '///+ the past.<br> + '///+Windows and Unix interpret the pathseparator differently so this test + '///+ provides handling of all four combinations (win + /, win + \, unx + / + '///+ and unx + \)</i><br> + '///<ul> + + ' We always want to start in a fixed directory structure so the first few dirnames are + ' known an can be used for verification + dim cStartDir as string + cStartDir = gTesttoolPath & "framework\optional\input\filetest\level1\level2\level3" + cStartDir = convertpath( cStartDir ) + printlog( "Start-Directory is: " & cStartDir ) + + ' Find out how many items the array for pathnames must hold (do not use gTesttoolPath here) + dim iDirLevels as integer + iDirLevels = hGetDirTreeLevel( cStartDir ) + 2 + + ' Get the list of directories within the path + dim cPathArray( iDirLevels ) as string + iDirLevels = DirNameList( cStartDir , cPathArray() ) + + ' Create an array for the two pathseparators - Windows and Unix/Linux + dim cPathSeparator( 2 ) as string + cPathSeparator( 1 ) = "\" + cPathSeparator( 2 ) = "/" + + ' Some increment variables + dim iPathSeparator as integer + dim iPathRepeat as integer + + ' Variables needed to verify that we are a filesystem root + dim iFileOpenItemCount as integer + dim cCurrentPath as string + dim iObjectPosition as integer + + ' Needed for bug (see below) + const REPEAT_COUNT = 4 + + '///+<li>Open the FileOpen dialog</li> + FileOpen + + '///+<li>Change to the start-directory: ..framework\optional\input\filetest\level1\level2\level3</li> + kontext "OeffnenDlg" + DateiName.setText( cStartDir ) + Oeffnen.click() + + '///+<li>For both pathseparators (/ and \) do:</li> + '///<ul> + for iPathSeparator = 1 to 2 + + printlog( "" ) + printlog( "Trying: " & cPathSeparator( iPathSeparator ) ) + + '///<li>Repeat this four times (ancient bug, possible crash)</li> + '///<ul> + printlog( "Note: This is repeated four times due to ancient bug" ) + for iPathRepeat = 1 to REPEAT_COUNT + + '///+<li>Enter the pathseparator into the filename field</li> + Dateiname.setText( cPathSeparator( iPathSeparator ) ) + + '///+<li>Click "open"</li> + Oeffnen.click() + + select case iPathSeparator + case 1: ' backslash + + ' This is Unix, Linux + if ( gPlatGroup = "unx" ) then + + '///+<li>Handle the messagebox (Unix only)</li> + kontext "Active" + if ( active.exists() ) then + active.ok() + printlog( "Messagebox for Unix and \ present." ) + else + warnlog( "Error missing for invalid pathspec." ) + endif + + '///+<li>- Verify that the directory has not changed for Unix</li> + ' in the ../level3-directory we look for the file filetest.txt + kontext "OeffnenDlg" + cCurrentPath = hGetFirstNameFromFileList() + if ( cCurrentPath <> "filetest.txt" ) then + warnlog( "Path should not have changed." ) + else + printlog( "Still in same directory, ok." ) + endif + + else ' Windows, eComStation + + '///+<li>- Verify that we are a the virtual root (drives list) on windows</li> + kontext "OeffnenDlg" + cCurrentPath = hGetFirstNameFromFileList() + if ( cCurrentPath <> "a:\" ) then + if ( iPathRepeat = 1 ) then + qaerrorlog( "Did not reach virtual root or no drive a:\ present" ) + else + warnlog( "Did not reach virtual root or no drive a:\ present" ) + endif + else + printlog( "Switched to virtual root: a:\ - drive. ok" ) + endif + + endif + + case 2: ' slash + + ' Unix/Linux + if ( gPlatGroup = "unx" ) then + + '///+<li>- Verify that we are at top level of the drive</li> + ' Note: cPathArray( 1 ) = / so we need second element + ' Additionally we have a trailing slash that must be killed + cCurrentPath = left( cPathArray( 2 ) , len( cPathArray( 2 ) ) - 1 ) + kontext "OeffnenDlg" + iObjectPosition = hFindFileObjectViaFileOpen( cCurrentPath ) + if ( iObjectPosition <> 0 ) then + printlog( "Root for gTesttoolPath could be found. Good" ) + else + warnlog( "Top directory of gTesttoolPath could not be found" ) + printlog( "This probably means we are not at the root dir" ) + endif + + else ' Windows, eComStation + + '///+<li>- Verify that we are a the virtual root (drives list) on windows</li> + kontext "OeffnenDlg" + cCurrentPath = hGetFirstNameFromFileList() + if ( cCurrentPath <> "a:\" ) then + warnlog( "Did not reach virtual root or no drive a:\ present" ) + else + printlog( "Switched to virtual root: a:\ - drive. ok" ) + endif + + endif + + end select + + next iPathRepeat + '///</ul> + + next iPathSeparator + '///</ul> + + kontext "OeffnenDlg" + OeffnenDlg.cancel() + '///+<li>Cancel the FileOpen dialog</li> + '///</ul> + +endcase + + diff --git a/testautomation/framework/optional/includes/filedlg_folders7.inc b/testautomation/framework/optional/includes/filedlg_folders7.inc new file mode 100755 index 000000000000..7324785cb4ac --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_folders7.inc @@ -0,0 +1,165 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_folders7.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : check the internal file dialog ( 1. part ) +'* +'\***************************************************************************** + +testcase tUpOneLevel4 + + '///<h1>Check all context-menuentries of the "Level-Up" button</h1> + '///<ul> + + dim iCurrentItem as Integer ' increment variable + dim iCurrentItemCount as Integer ' actual number of entries in dropdown menu + + + ' The directory that we want to start in so we know how many steps we have + ' to the filesystem root (cStartDir is always good for at least 8 steps) + dim cStartDir as string + cStartDir = gTesttoolPath & "framework\optional\input\filetest\level1\level2\level3" + cStartDir = convertpath( cStartDir ) + + ' This is the threshold of the directory defined above. Usually we will have + ' 9 as the expected number of directories but depending on the mountpoint + ' of the testtool workdirectory the number may vary. + dim iExpectedItemCount as Integer + iExpectedItemCount = hGetDirTreeLevel( cStartDir ) + + ' Windows has one more level (Drives) + if ( gPlatGroup = "w95" ) then + iExpectedItemCount = iExpectedItemCount + 1 + endif + + printlog( "Test context menu of the Level Up button on the FileOpen dialog" ) + printlog( "Current threshold: " & iExpectedItemCount ) + + '///+<li>File open</li> + FileOpen + + '///+<li>Walk down to the starting directory: <br> + '///+ framework\filedlg\input\filetest\level1\level2\level3</li> + Kontext "OeffnenDlg" + Dateiname.SetText( cStartDir ) + Oeffnen.Click() + + '///+<li>Open the context menu of the "Level Up" button</li> + UebergeordneterOrdner.Open() + + '///+<li>Get the number of entries listed in the menu</li> + iCurrentItemCount = hMenuItemGetCount() + Printlog( "Current itemcount: " & iCurrentItemCount ) + + '///+<li>Verify that at least 9 items exist:</li> + '///<ul> + '///+<li>Too few entries</li> + if ( iCurrentItemCount < iExpectedItemCount ) then + warnlog( "Items missing in the menu." ) + printlog( "On Windows the node 'My Computer' might be missing" ) + printlog( "On UNIX filesystem root might be missing" ) + endif + + '///+<li>Correct number of entries</li> + if ( iCurrentItemCount = iExpectedItemCount ) then + printlog( "The number of entries in the context menu is correct" ) + endif + + '///+<li>Too many entries</li> + if ( iCurrentItemCount > iExpectedItemCount ) then + warnlog( "Found more menu-items than expected: " & iCurrentItemCount) + endif + '///</ul> + + '///+<li>Trigger the first entry, for each entry the menu list gets one shorter + '///+ as we walk up in the filesystem hierarchy.<br> + '///+ Note that the context menu is open at this point</li> + '///<ul> + for iCurrentItem = 1 to iCurrentItemCount - 1 + + '///+<li>Find out how many items should be in the context menu (minus one per loop)</li> + iExpectedItemCount = iCurrentItemCount - iCurrentItem + + '///+<li>Select the first item (it is dynamic)</li> + hMenuSelectNr ( 1 ) + + '///+<li>Open the context menu again</li> + kontext "OeffnenDlg" + UebergeordneterOrdner.Open() + + '///+<li>Verify the number of items</li> + '///<ul> + '///+<li>Too few items</li> + if ( hMenuItemGetCount < iExpectedItemCount ) then + printlog( "The number of entries is correct" ) + endif + + '///+<li>Too many items</li> + if ( hMenuItemGetCount > iExpectedItemCount ) then + printlog( "The number of entries is correct" ) + endif + '///</ul> + + next iCurrentItem + '///</ul> + + '///+<li>Select the first item from the context menu again (still open)</li> + hMenuSelectNr ( 1 ) + + '///+<li>Verify that we now have 8 items in the context menu</li> + if ( iCurrentItemCount = 8 ) then + + '///+<li>Click the "Level Up" button</li> + kontext "OeffnenDlg" + UebergeordneterOrdner.Click() + + endif + + '///+<li>Now we should be at filesystem root. Verify that "Level Up" is disabled</li> + kontext "OeffnenDlg" + if ( UebergeordneterOrdner.isEnabled() ) then + warnlog( "Level-Up is enabled, it should be disabled at filesystem root" ) + + else + printlog( "Good, button is disabled" ) + endif + + '///+<li>Close FileOpen dialog</li> + kontext "OeffnenDlg" + OeffnenDlg.Cancel() + '///</ul> + +endcase + + diff --git a/testautomation/framework/optional/includes/filedlg_forbidden_names_windows.inc b/testautomation/framework/optional/includes/filedlg_forbidden_names_windows.inc new file mode 100755 index 000000000000..b09e0aa8ed3c --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_forbidden_names_windows.inc @@ -0,0 +1,99 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_forbidden_names_windows.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : check the internal file dialog ( extended tests ) +'* +'\****************************************************************************** + +testcase tSLDForbiddenNamesWin() + + if ( lcase( gPlatGroup ) <> "w95" ) then + printlog( "No testing for Unix(like)" ) + goto endsub + endif + + '///<h1>Check forbidden filenames on Windows using File-Save dialog</h1> + + ' This test tries to save files that contain characters that are not allowed + ' in filenames on Windows. This covers the entire ASCII range from 0 to 31. + ' Currently the ASCII chars 0, 9, 10, and 13 are excluded because we - for some + ' reason - do not intercept them. + + '///<ul> + '///+<li>Open a new document</li> + '///+<li>Save the file with a name containing the ASCII chars 0 through 31, excluding 0,9,10,13</li> + '///+<li>Confirm the warning</li> + '///+<li>Close the document</li> + '///+<li>Repeat the test for all applications</li> + '///</ul> + + dim cStrangeName as string + dim iCounter as integer + dim brc as boolean + dim iDocumentType as integer + + + for iDocumentType = 1 to 6 step 3 + + printlog( "" ) + printlog( "Check if reserved filenames on Windows are handled ok" ) + printlog( "" ) + + printlog( " - names with forbidden ASCII-chars" ) + for iCounter = 1 to 31 + + select case iCounter + + case 9 : printlog( " - skipping ASCII 009 (horizontal tab)" ) + case 10 : printlog( " - skipping ASCII 010 (linefeed)" ) + case 13 : printlog( " - skipping ASCII 013 (carriage return)" ) + case else + printlog( CHR$(13) & "Using char at decimal position: " & iCounter ) + cStrangeName = hNameGen_append( iCounter ) + brc = hSaveFileExpectFailure( cStrangeName , 0 ) + if ( not brc ) then + warnlog( "failed" ) + else + printlog( "Test succeeded" ) + endif + + end select + + next iCounter + + next iDocumentType + +endcase + diff --git a/testautomation/framework/optional/includes/filedlg_ftp_proxy.inc b/testautomation/framework/optional/includes/filedlg_ftp_proxy.inc new file mode 100755 index 000000000000..77c835d1f0bc --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_ftp_proxy.inc @@ -0,0 +1,129 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_ftp_proxy.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Load/Save files using direct connection or proxy +'* +'\****************************************************************************** + +testcase tFiledlgFtpProxy + + '///<h3>Open a ftp connection to a server directly and via proxy</h3> + '///<p>This testcase uses the private environment feature, you need to be + '///+ behind a firewall for this to work.</p> + '///<ul> + + const URL = "ftp://ftp.mozilla.org" + + dim cProxyName as string + dim cProxyPort as string + + dim brc as boolean + + '///+<li>Make sure we have exactly one document open and that this is "The first doc!"</li> + do while( getDocumentCount > 0 ) + hCloseDocument() + loop + + '///+<li>Retrieve proxy configuration data</li> + brc = hGetPrivateFtpServer( cProxyName, cProxyPort ) + if ( not brc ) then + warnlog( "Could not retrieve valid proxy configuration, aborting test" ) + goto endsub + endif + + '///+<li>Configure a valid proxy (uses private environment data)</li> + hSetProxies( "", "", cProxyName, cProxyPort, "" ) + + '///+<li>Load the page</li> + printlog( "FileOpen / Set URL / Load the file" ) + FileOpen + kontext "OeffnenDlg" + if ( OeffnenDlg.exists( 2 ) ) then + Dateiname.setText( URL ) + Oeffnen.click() + sleep( 10 ) + else + warnlog( "File open dialog not open" ) + goto endsub + endif + + '///+<li>Verify that the document is loaded</li> + brc = hIdentifyWriterDoc( "Current directory is /" , true ) + if ( not brc ) then + warnlog( "This is either the incorrect file or we failed to load the document" ) + endif + + '///+<li>Close the loaded document</li> + hDestroyDocument() + + '///+<li>Reset the proxies to "none" (manual, with no proxy settings)</li> + hSetProxies( "", "", "", "", "" ) + + '///+<li>Try to load the file with no proxies -> should fail</li> + '///<ul> + '///+<li>FileOpen</li> + FileOpen + + '///+<li>Enter filename, click "Open"</li> + kontext "OeffnenDlg" + if ( OeffnenDlg.exists( 2 ) ) then + DateiName.setText( URL ) + Oeffnen.click() + + '///+<li>Close the "File not found" warning with "OK"</li> + Kontext "active" + if ( active.exists( 5 ) ) then + active.ok() + + '///+<li>Close the FileOpen dialog</li> + kontext "OeffnenDlg" + OeffnenDlg.cancel() + else + kontext "OeffnenDlg" + if ( OeffnenDlg.exists() ) then + qaerrorlog( "Document not loaded / Still on File Open dialog" ) + OeffnenDlg.cancel() + else + warnlog( "File not found warning is missing" ) + endif + endif + endif + + '///</ul> + '///</ul> + + +endcase + diff --git a/testautomation/framework/optional/includes/filedlg_multiselection.inc b/testautomation/framework/optional/includes/filedlg_multiselection.inc new file mode 100755 index 000000000000..cd51575d9ed7 --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_multiselection.inc @@ -0,0 +1,173 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_multiselection.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Select a huge number of documents and load +'* +'\****************************************************************************** + +testcase tFiledlgMultiselection1() + + warnlog( "#i78597# - Crash when loading multiple documents using multiselection - excluding test" ) + goto endsub + + '///<h1>Select a number of different documents and load</h1> + '///<ul> + + ' This is a test requested by framework development to be used in multi- + ' user environments like Terminal Servers. It is used to quickly create + ' a certain load. Furthermore issues (mostly unconfirmed) have been reported + ' that loading files using multiselection might lead to a crash. + + '///+<li>Determine the workdirectory</li> + dim cWorkPath as string + cWorkPath = gTesttoolPath & "framework\filedlg\input\multiselect\" + cWorkPath = convertpath( cWorkPath ) + + dim cMsg as string + + dim iCurrentFile as integer + dim iInitialDocumentCount as integer + dim iOpenDocuments as integer + dim iWait as integer + iWait = 0 + + dim brc as boolean + + const TESTFILE_COUNT = 60 ' the number of documents in cWorkPath + + '///<ul> + '///+<li>Test enter: Only one document may be open</li> + if ( getDocumentCount <> 1 ) then + printlog( "Restarting office, incorrect number of documents open" ) + call exitRestartTheOffice() + endif + + '///+<li>Test enter: It must be a WRITER document</li> + kontext "DocumentWriter" + if ( not documentwriter.exists() ) then + printlog( "Incorrect documenttype, need a WRITER document, restarting" ) + call exitRestartTheOffice() + endif + + '///+<li>And even more precisely: The first doc!</li> + if ( not hIdentifyWriterDoc( "The first doc!" , false ) ) then + printlog( "Incorrect WRITER document, restarting" ) + call exitRestartTheOffice() + endif + + '///+<li>Close the navigator if present</li> + hCloseNavigator() + '///</ul> + + '///+<li>Store the number of open documents (should be exactly one now)</li> + iInitialDocumentCount = getDocumentCount ' must be exactly 1 at this point + if ( iInitialDocumentCount <> 1 ) then + warnlog( "Expected exactly one writer document (The first doc!)" ) + endif + + '///+<li>Open the filepicker (via menu or toolbar)</li> + printlog( "FileOpen" ) + FileOpen + + '///+<li>Go to the workdirectory (framework\filedlg\input\multiselect\)</li> + printlog( "Go to the workdirectory: " & cWorkPath ) + kontext "OeffnenDlg" + DateiName.typeKeys( cWorkPath ) + Oeffnen.click() + + '///+<li>Check for messagebox - if one comes up we cannot continue</li> + kontext "Active" + if ( active.exists( 2 ) ) then + cMsg = active.getText() + cMsg = hRemoveLineBreaks( cMsg ) + warnlog( "Unexpected messagebox: " & cMsg ) + active.ok() + kontext "OeffnenDlg" + OeffnenDlg.cancel() + goto endsub + endif + + '///+<li>Select all documents and click "Open"</li> + printlog( "Select all documents and load them simultaneously" ) + kontext "OeffnenDlg" + DateiAuswahl.typeKeys( "<HOME>" ) + DateiAuswahl.typeKeys( "<SHIFT END>" ) + Oeffnen.Click() + + '///+<li>Wait max 60 seconds for the documents to load</li> + while ( getDocumentCount < ( TESTFILE_COUNT + 1 ) ) + + iWait = iWait + 1 + sleep( 1 ) + + if ( iWait = ( TESTFILE_COUNT + 1 ) ) then + warnlog( "The documents were not loaded within 60 seconds, abort" ) + goto endsub + endif + + wend + + printlog( "All documents loaded in " & iWait & " seconds" ) + + '///+<li>Close all the files again</li> + printlog( "Starting to close all documents" ) + for iCurrentFile = 1 to TESTFILE_COUNT + sleep( 1 ) + FileClose + next iCurrentFile + printlog( "Finished closing documents" ) + + '///+<li>Verify that the correct document is open "The first doc!"</li> + if ( getDocumentCount <> 1 ) then + warnlog( "Only <The first doc!> should be open. This is not the case" ) + iOpenDocuments = getDocumentCount + for iCurrentFile = 1 to iOpenDocuments - 1 + hDestroyDocument() + next iCurrentFile + call ExitRestartTheOffice() + else + brc = hIdentifyWriterDoc( "The first doc!" , false ) + if ( not brc ) then + warnlog( "Incorrect document order / <The first doc!> is missing" ) + else + printlog( "Ok, test succeeded" ) + endif + endif + + hCloseNavigator() + '///</ul> + + +endcase diff --git a/testautomation/framework/optional/includes/filedlg_passwords.inc b/testautomation/framework/optional/includes/filedlg_passwords.inc new file mode 100755 index 000000000000..e036da52ebff --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_passwords.inc @@ -0,0 +1,208 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_passwords.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : save and load passworded files +'* +'\****************************************************************************** + +testcase tFiledlgPasswords() + + '///<h1>Test saving/loading passworded files in three different formats</h1> + + dim workfile as string + dim workpath as string + workpath = hGetWorkPath() + + dim filetype as string + dim filetypeID as string + dim cMsg as string + + dim iCurrentDocumentType as integer + dim iCurrentFileFormat as integer + + + for iCurrentDocumentType = 1 to 6 + + printlog( "Document Type: " & hNumericDocType( iCurrentDocumentType ) ) + + for iCurrentFileFormat = 1 to 2 + + select case iCurrentFileFormat + case 1 : filetypeID = "645" + case 2 : filetypeID = "current" + end select + + '///<ul> + '///+<li>open a new document</li> + hCreateDocument() + + '///+<li>Close the navigator - if present</li> + hCloseNavigator() + + '///+<li>enter some random text</li> + call hChangeDoc() + + '///+<li>Open file-save dialog</li> + printlog( "Open file-save dialog" ) + if ( gApplication = "IMPRESS" ) then + printlog( " IMPRESS is slower than other apps, delaying for 2 sec." ) + sleep( 2 ) + endif + + FileSave + + Kontext "SpeichernDlg" + if ( SpeichernDlg.exists( 2 ) ) then + + '///+<li>Name the file and select filter</li> + filetype = hGetFilter( filetypeID ) + hSelectUIFilter( filetype ) + + workfile = "password" & hGetSuffix( filetypeID ) + DateiName.setText( workpath & workfile ) + + printlog( "Using fileformat: " & filetype ) + printlog( "Using filename..: " & workfile ) + + '///+<li>Check password</li> + printlog( "Check password" ) + if ( passwort.isEnabled() ) then + Passwort.check() + else + warnlog( "#i36663# Password checkbox is disabled" ) + endif + + '///+<li>Save the file</li> + printlog( "Save the file" ) + Speichern.click() + + kontext "active" + if ( active.exists( 2 ) ) then + printlog( "Handle overwrite warning (if any)" ) + active.yes() + endif + + + '///+<li>Enter the filename as password and confirm</li> + Kontext "PasswordDlg" + printlog( "Enter the name of the file as password and confirm" ) + if ( passwordDlg.exists() ) then + Password.settext( workfile ) + PasswordConfirm.settext( workfile ) + PasswordDlg.ok() + else + warnlog( "No password dialog is displayed" ) + endif + + kontext "AlienWarning" + if ( AlienWarning.exists( 2 ) ) then + if ( FileTypeID <> "current" ) then + printlog( "Handle alienwarning (expected)" ) + AlienWarning.ok() + else + warnlog( "Handle alienwarning (unexpected)" ) + AlienWarning.ok() + endif + endif + + '///+<li>Close the document</li> + hDestroyDocument() + + '///+<li>Open the file via file-open</li> + printlog( "Open the file via file-open" ) + FileOpen + + Kontext "OeffnenDlg" + if ( OeffnenDlg.exists( 2 ) ) then + Dateiname.settext( workfile ) + + Oeffnen.click() + + Kontext "PasswordFileOpen" + '///+<li>Enter the filename as password</li> + printlog( "Enter the filename as password" ) + if ( PasswordFileOpen.exists( 4 ) ) then + PasswortName.settext( workfile ) + PasswordFileOpen.ok() + else + kontext "Active" + if ( Active.exists( 2 ) ) then + cMsg = active.getText() + cMsg = hRemoveLineBreaks( cMsg ) + printlog( cMsg ) + warnlog( "#i65889# - CWS Warnings01: Cannot read password protected files" ) + active.ok() + goto endsub + else + warnlog( "No password dialog is displayed" ) + endif + endif + + '///+<li>Verify that the document is loaded</li> + printlog( "Verify that the document is loaded" ) + call IsItLoaded() + + '///+<li>Close the navigator if present</li> + Kontext "Navigator" + if ( Navigator.exists( 1 ) ) then + qaerrorlog( "Navigator should not be visible - setting not saved?" ) + endif + else + warnlog( "Second file open failed" ) + endif + else + warnlog( "File Open dislog did not come up" ) + endif + + '///+<li>Close navigator if present</li> + hCloseNavigator() + + '///+<li>Close the document</li> + hDestroyDocument() + + '///+<li>Delete the file</li> + hDeleteFile( workpath & workfile ) + + '///+<li>Close navigator if present</li> + hCloseNavigator() + + next iCurrentFileFormat + + next iCurrentDocumentType + + '///</ul> + + +endcase diff --git a/testautomation/framework/optional/includes/filedlg_rename.inc b/testautomation/framework/optional/includes/filedlg_rename.inc new file mode 100755 index 000000000000..394c8f850a47 --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_rename.inc @@ -0,0 +1,105 @@ +'encoding UTF-8 Do not remove or change this line! +'******************************************************************************* +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_rename.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* The Contents of this file are made available subject to +'* the terms of GNU Lesser General Public License Version 2.1. +'* +'* +'* GNU Lesser General Public License Version 2.1 +'* ============================================= +'* Copyright 2006 by Sun Microsystems, Inc. +'* 901 San Antonio Road, Palo Alto, CA 94303, USA +'* +'* This library is free software; you can redistribute it and/or +'* modify it under the terms of the GNU Lesser General Public +'* License version 2.1, as published by the Free Software Foundation. +'* +'* This library 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 for more details. +'* +'* You should have received a copy of the GNU Lesser General Public +'* License along with this library; if not, write to the Free Software +'* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +'* MA 02111-1307 USA +'* +'/****************************************************************************** +'* +'* owner : Joerg.Skottke@Sun.Com +'* +'* short description : Remane files dialog +'* +'\****************************************************************************** + +testcase tFileRename + + dim cPath as string + cPath = convertpath( gOfficePath & "user/work/" ) + + dim cFile as string + cFile = "tFileRename.odt" + + dim iCurrentFile as integer + dim cCurrentFile as string + dim iFileCount as integer + dim bFileFound as boolean : bFileFound = false + + ' Issue #i88446 + Printlog( "Rename file dialog" ) + + gApplication = "WRITER" + hNewDocument() + DocumentWriter.typeKeys( "framework/optional/filedlg_dialogtest.bas::tFileRename" ) + + hFileSaveAsKill( cPath & cFile ) + FileClose + FileOpen + kontext "OeffnenDlg" + if ( OeffnenDlg.exists( 2 ) ) then + + DateiName.setText( cPath ) + Oeffnen.click() + iFileCount = DateiAuswahl.getItemCount() + printlog( iFileCount & " files listed" ) + DateiAuswahl.typeKeys( "<HOME>" ) + + for iCurrentFile = 1 to iFileCount + + wait( 100 ) + DateiAuswahl.typeKeys( "<SPACE>" ) + wait( 100 ) + + cCurrentFile = DateiAuswahl.getSelText() + printlog( " * " & cCurrentFile ) + + if ( cCurrentFile = cFile ) then + printlog( "File found" ) + DateiAuswahl.openContextMenu() + hMenuSelectNr( 2 ) + DateiAuswahl.typeKeys( "<ESCAPE>" ) + kontext "OeffnenDlg" + OeffnenDlg.cancel() + exit for + endif + + wait( 100 ) + DateiAuswahl.typeKeys( "<DOWN>" ) + wait( 100 ) + + next iCurrentFile + endif + + if ( FileExists( cPath & cFile ) ) then kill( cPath & cFile ) + + +endcase + diff --git a/testautomation/framework/optional/includes/filedlg_reserved_names_unix.inc b/testautomation/framework/optional/includes/filedlg_reserved_names_unix.inc new file mode 100755 index 000000000000..a1446c29fba7 --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_reserved_names_unix.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 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_reserved_names_unix.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : check the internal file dialog ( extended tests ) +'* +'\****************************************************************************** + +testcase tSaveReservedNamesUNIX() + + '///<h1>Check if we accidentially disallow some special names on UNIX</h1> + '///<ul> + + if ( gPlatGroup = "w95" ) then + printlog( "Test not relevant for Unix(like)" + goto endsub + endif + + dim cStrangeName as string + dim irc as integer + dim iCurrentDocType as integer + + for iCurrentDocType = 1 to 2 + + printlog( "" ) + printlog( "Document Type is: " & hNumericDocType( iCurrentDocType ) ) + printlog( "Names that are reserved on WINDOWS but are OK on UNIX" ) + + '///+<li>Try "NUL" as filename -> should save ok</li> + irc = hSaveLoadDelSuccess( "NUL" , true ) + if ( irc <> 0 ) then warnlog( "failed" ) + + '///+<li>Try "CLOCK$" as filename -> should save ok</li> + irc = hSaveLoadDelSuccess( "CLOCK$" , true ) + if ( irc <> 0 ) then warnlog( "failed" ) + + '///+<li>Try "CON" as filename -> should save ok</li> + irc = hSaveLoadDelSuccess( "CON" , true ) + if ( irc <> 0 ) then warnlog( "failed" ) + + '///+<li>Try "PRN" as filename -> should save ok</li> + irc = hSaveLoadDelSuccess( "PRN" , true ) + if ( irc <> 0 ) then warnlog( "failed" ) + + '///+<li>Try "AUX" as filename -> should save ok</li> + irc = hSaveLoadDelSuccess( "AUX" , true ) + if ( irc <> 0 ) then warnlog( "failed" ) + + '///+<li>Try "LPT1" as filename -> should save ok</li> + irc = hSaveLoadDelSuccess( "LPT1" , true ) + if ( irc <> 0 ) then warnlog( "failed" ) + + '///+<li>Try "COM1" as filename -> should save ok</li> + irc = hSaveLoadDelSuccess( "COM1" , true ) + if ( irc <> 0 ) then warnlog( "failed" ) + + next iCurrentDocType + + '///</ul> +endcase + diff --git a/testautomation/framework/optional/includes/filedlg_reserved_names_windows.inc b/testautomation/framework/optional/includes/filedlg_reserved_names_windows.inc new file mode 100755 index 000000000000..09e3164ee09b --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_reserved_names_windows.inc @@ -0,0 +1,146 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_reserved_names_windows.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : check the internal file dialog ( extended tests ) +'* +'\****************************************************************************** + +testcase tSaveReservedNamesWin() + + if ( gPlatGroup <> "w95" ) then + printlog( "Test not relevant for Windows" ) + goto endsub + endif + + '///<h1>Check reserved filenames on Windows using the File-Save dialog</h1> + + ' This sub creates invalid filenames on Windows and tries to save files + ' with those names. This should fail. + ' The names are created dependent on the gApplication (documenttype) + ' which must have been specified in advance. To generate the names the + ' function hNameGenASCII_append( int, boolean ) is used which generates + ' the file-suffix based on the current 'gApplication' + ' Since saving is expected to fail in every case, there is no reload-test + ' for these filenames + + dim cStrangeName as string + dim iCounter as integer + dim brc as boolean + + const MAX_NUMBER = 1 + + dim iCurrentDocType as integer + + for iCurrentDocType = 1 to 2 + + printlog( "" ) + printlog( "Document Type is: " & hNumericDocType( iCurrentDocType ) ) + + '///<ul> + '///+<li>Reserved filenames are e.g. LPT1, COM2, NUL etc.</li> + + printlog( CHR$(13) ) + printlog( "Check if reserved filenames on Windows are handled ok" ) + printlog( CHR$(13) ) + + + ' serial ports with extension (COM1.xxx-COM9.xxx are not allowed) + '///+<li>Try to save files to names of serial ports with extension</li> + printlog( CHR$(13) + "Serial ports with extensions" ) + for iCounter = 1 to MAX_NUMBER + cStrangeName = "COM" & CHR$( iCounter + 48 ) + cStrangeName = cStrangeName & hGetSuffix( "current" ) + brc = hSaveFileExpectFailure( cStrangeName , 0 ) + if ( not brc ) then warnlog( "failed" ) + next iCounter + + + ' parallel ports with extension (LPT1.xxx-LPT9.xxx are not allowed) + '///+<li>Try to save files to parallel ports with extension</li> + printlog( CHR$(13) + "Parallel ports with extension" ) + for iCounter = 1 to MAX_NUMBER + cStrangeName = "LPT" & CHR$( iCounter + 48 ) + cStrangeName = cStrangeName & hGetSuffix( "current" ) + brc = hSaveFileExpectFailure( cStrangeName , 0 ) + if ( not brc ) then warnlog( "failed" ) + next iCounter + + + printlog( "" ) + printlog( "Reserved characters" ) + + ' descr: hNameGenASCII_append takes an ASCII-char as int and a boolean + ' value for "append file suffix" if true + ' descr: SaveFileExpectFailure takes a filename and a numeric value for + ' the type of errorhandling (0 = invalid char, 1 = path separator) + + cStrangeName = hNameGen_append( 60 ) ' char "<" + brc = hSaveFileExpectFailure( cStrangeName , 0 ) + if ( not brc ) then warnlog( "failed" ) + + cStrangeName = hNameGen_append( 62 ) ' char ">" + brc = hSaveFileExpectFailure( cStrangeName , 0 ) + if ( not brc ) then warnlog( "failed" ) + + cStrangeName = hNameGen_append( 34 ) ' char '"' + brc = hSaveFileExpectFailure( cStrangeName , 0 ) + if ( not brc ) then warnlog( "failed" ) + + cStrangeName = hNameGen_append( 124 ) ' char "|" + brc = hSaveFileExpectFailure( cStrangeName , 0 ) + if ( not brc ) then warnlog( "failed" ) + + 'misinterpreted characters (seen as UNC name or device by Windows) + cStrangeName = hNameGen_append( 92 ) ' char "\" + brc = hSaveFileExpectFailure( cStrangeName , 1 ) + if ( not brc ) then warnlog( "failed" ) + + cStrangeName = hNameGen_append( 47 ) ' char "/" + brc = hSaveFileExpectFailure( cStrangeName , 1 ) + if ( not brc ) then warnlog( "failed" ) + + cStrangeName = hNameGen_append( 58 ) ' char ":" + brc = hSaveFileExpectFailure( cStrangeName , 0 ) + if ( not brc ) then warnlog( "failed" ) + + '///+<li>Close the document</li> + printlog( "Close the document" ) + brc = hDestroyDocument() + + next iCurrentDocType + '///</ul> + +endcase + diff --git a/testautomation/framework/optional/includes/filedlg_tools.inc b/testautomation/framework/optional/includes/filedlg_tools.inc new file mode 100755 index 000000000000..67626c2a6cc5 --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_tools.inc @@ -0,0 +1,506 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_tools.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : check the internal file dialog ( 1. part ) +'* +'\*************************************************************************** + +sub CheckDirectoryName( dirname as string ) + + ' Try to create a folder twice and make sure a warning comes up that the + ' folder already exists + + dim i as integer + dim FULLPATH as string + FULLPATH = gOfficePath + "user\work\" + dirname + "\" + + printlog( " - Create the folder and verify it's existence" ) + + try + + for i=1 to 2 + + printlog( " - creating folder for the " + i + ". time" ) + + Kontext "OeffnenDlg" + printlog( " - press 'new folder' button" ) + NeuerOrdner.Click() + + Kontext "NeuerOrdner" + if ( NeuerOrdner.exists( 2 ) ) then + printlog( " - name the folder" ) + OrdnerName.SetText( dirname ) + printlog( " - press OK") + NeuerOrdner.OK() + else + warnlog( "New Folder dialog not displayed" ) + endif + + ' Take care of the File Exists Dialog + printlog( " - check for 'File Exists'-Dialog" ) + Kontext "Active" + If Active.Exists() then + Active.OK() + + 'if the file exists during first run of the test: just go on + if i = 1 then + warnlog( "File exists. Did you clean the output-dir?" ) + end if + + 'if the active exists, we will return to the 'new folder' dialog + 'it must be closed as well + Kontext "NeuerOrdner" + NeuerOrdner.Cancel() + else + 'this should only be displayed on second run + if i = 2 then + warnlog( "No message that the folder '" + dirname + "' exists!" ) + end if + end if + + next i + + printlog( " - verify the existence of the new directory" ) + if App.Dir ( ConvertPath ( FULLPATH ), 16 ) = "" then + Warnlog( "The directory'" + dirname + "' wasn't created!" ) + else + printlog( " - delete it") + App.RmDir ( ConvertPath ( FULLPATH ) ) + end if + + + catch + + warnlog( "Could not create the directory. Bugid: #108256# or #106510# ?" ) + + endcatch + +end sub + +'******************************************************************************* + +sub CreateInvalidDirectory( dirname as string ) + + 'Try to create a directory with a name that is invalid by using characters + 'that are not allowed for a filesystems. An errormessage is expected. + + dim i as integer + dim FULLPATH as string + FULLPATH = gOfficePath + "user\work\" + dirname + "\" 'experimental + + printlog( " - Trying to create directory <" + FULLPATH + ">" ) + + try + + Kontext "OeffnenDlg" + if ( OeffnenDlg.exists( 2 ) ) then + + NeuerOrdner.Click() + + Kontext "NeuerOrdner" + if ( NeuerOrdner.exists( 2 ) ) then + + OrdnerName.SetText( dirname ) + NeuerOrdner.OK() + else + warnlog( "New Folder dialog did not open" ) + endif + + + if gPlatgroup() = "unx" then + + 'unx allows weird filenames + if App.Dir ( ConvertPath ( FULLPATH ), 16 ) = "" then + Warnlog " the '" + dirname + "'-dir wasn't created!" + else + App.RmDir ( ConvertPath ( FULLPATH ) ) + end if + + else + + 'windows + Kontext "Active" + if Active.Exists( 2 ) then + + printlog( " - handle the 'Active' dialog" ) + Active.OK() + + Kontext "Active" + if Active.Exists( 2 ) then + warnlog( "Double errormessage displayed, one expected." ) + Active.OK() + end if + + Kontext "NeuerOrdner" + NeuerOrdner.Cancel() + + else + + warnlog( "No warning that the folder can't be created!" ) + + end if + + if App.Dir( ConvertPath ( FULLPATH ), 16 ) <> "" then + Warnlog "The directory '"+ dirname + "' contains invalid chars" + App.RmDir( ConvertPath ( FULLPATH ) ) + end if + + end if + + endif + + catch + + warnlog( "Could not create the directory. Bugid: #108256# or #106510# ?" ) + + endcatch + +end sub + +'******************************************************************************* + +sub CreateValidDirectory( dirname as string ) + + 'Create a directory that has a valid name at a valid location + 'The directory should not exist. + 'It will be created in the user's directory + + dim FULLPATH as string + FULLPATH = gOfficePath() + "user\work\" + dirname + "\" 'experimental + + + printlog( " - Trying to create directory: <" + FULLPATH + ">" ) + + try + + printlog( " - Open the file-open dialog" ) + Kontext "OeffnenDlg" + NeuerOrdner.Click() + + printlog( " - name the folder" ) + Kontext "NeuerOrdner" + OrdnerName.SetText( dirname ) + NeuerOrdner.OK() + + printlog( " - check if the directory has been created" ) + if App.Dir ( ConvertPath ( FULLPATH ) , 16 ) = "" then + warnlog( "The '" + dirname + "' has not been created!" ) + else + App.RmDir( ConvertPath ( FULLPATH ) ) + printlog( " - existing file was successfully deleted" ) + end if + + catch + + warnlog( "Could not create the directory. Bugid: #108256# or #106510# ?" ) + + endcatch + +end sub + +'******************************************************************************* + +sub CreateValidDirectoryCrop( dirname as string , cropname as string) + + 'Create a directory that has a name with leading or trailing spaces. + 'Those names are valid but must be cropped. + 'The directory should not exist. + 'It will be created in the user's directory. + + dim FULLPATH as string + FULLPATH = gOfficePath + "user\work\" + dirname + "\" 'experimental + dim CROPPATH as string + CROPPATH = gOfficePath + "user\work\" + cropname + "\" 'experimental + + printlog( " - Trying to create directory: <" + FULLPATH + ">" ) + + try + + printlog( " - open the file-open dialog" ) + Kontext "OeffnenDlg" + NeuerOrdner.Click() + + printlog( " - name the folder" ) + Kontext "NeuerOrdner" + OrdnerName.SetText( dirname ) + NeuerOrdner.OK() + + + printlog( " - check if the directory has been created" ) + if App.Dir( ConvertPath ( CROPPATH ), 16 ) = "" then + + warnlog( "The leading or trailing spaces have not been deleted!" ) + + else + + + App.RmDir( ConvertPath ( CROPPATH ) ) + printlog( " - existing directory was successfully deleted." ) + + end if + + catch + + warnlog( "Could not create the directory. Bugid: #108256# or #106510# ?" ) + + endcatch + +end sub + +'******************************************************************************* + +function LoadDocumentReadOnly ( sDatei as String, TypeOfDocument as Integer, ReadOnlyFlag as Boolean ) as Boolean + + LoadDocumentReadOnly = TRUE + + FileOpen + + Kontext "OeffnenDlg" + Dateiname.SetText sDatei + + if ReadOnlyFlag = TRUE then + NurLesen.Check() + endif + + Oeffnen.Click + IsItLoaded + + Kontext "Active" + if Active.Exists( 2 ) then + LoadDocumentReadOnly = FALSE + Warnlog Active.GetText + Active.OK + + if Active.Exists( 1 ) then + Warnlog "A second messagebox is active!" + Active.OK + end if + + Kontext "Filterauswahl" + If FilterAuswahl.Exists( 2 ) then + Warnlog "Filterbox is also active!" + FilterAuswahl.Cancel + end if + end if + + 'printlog( " - check for (unexpected) filter-dialog" ) + Kontext "Filterauswahl" + + If ( FilterAuswahl.Exists( 2 ) ) then + Warnlog( "Filterbox is active, this is not expected" ) + FilterAuswahl.Cancel() + + qaerrorlog( "TODO: There is no way that this function can handle " & _ + "the filterdialog correctly, rewrite it!" ) + warnlog( "The test will most likely fail!" ) + + LoadDocumentReadOnly() = false + exit function + + endif + + + + kontext "OeffnenDlg" + + if ( OeffnenDlg.exists( 2 ) ) then + warnlog( "File-Open dialog is open, this is not expected at this point" ) + printlog( "Exiting routine to recover" ) + + OeffnenDlg.cancel() + + LoadDocumentReadOnly() = false + exit function + + endif + + try + + select case TypeOfDocument + + case 1 : InsertSection ' Writer + Kontext + Active.Setpage TabBereiche + Kontext "TabBereiche" + TabBereiche.Cancel + case 2 : FormatCells ' Calc + Kontext + Active.SetPage TabZahlen + Kontext "TabZahlen" + TabZahlen.Cancel + case 3 : SlideShowPresentationSettings ' Impress + Kontext "Bildschirmpraesentation" + Bildschirmpraesentation.Cancel + case 4 : InsertLayer ' Draw + Kontext "EbeneEinfuegenDlg" + EbeneEinfuegenDlg.Cancel + case 5 : FormatLegend ' Chart + Kontext "TabUmrandungChart" : + TabUmrandungChart.Cancel + case 6 : FormatFonts ' Math + Kontext "Schriftarten" + Schriftarten.Cancel + end select + + if LoadDocumentReadOnly = TRUE then + Warnlog "The document wasn't loaded read only" + endif + + catch + + endcatch + +end function + +'******************************************************************************* + +sub hSetUNIXAttributes() + + ' NOTE: Requested by TBO + ' This sub tries to set the file-attributes on the qatesttool-snapshot on + ' mahler.germany. + ' Since all BASIC commands are platform independent, it cannot be checked + ' exactly. + ' If you are not the owner of the testtool snapshot, this is *not* going to + ' work. + + '///Make sure the file-attributes are correct for the next tests. + + dim cFullPath as string + dim cParameter as string + dim cCommand as string + dim rc as integer + + if ( gPLatGroup = "unx" ) then + + cCommand = "chmod" ' Fallback, if no following definition matches + if ( gPlatform = "sol" ) then + cCommand = "/usr/bin/chmod" + endif + if ( gPlatform = "x86" ) then + cCommand = "/usr/bin/chmod" + endif + if ( gPlatform = "lin" ) then + cCommand = "/bin/chmod" + endif + + cFullPath = convertpath( gTesttoolPath + "framework/filedlg/input/noentry" ) + printlog( "Trying to set attributes for " + cFullPath ) + cParameter = "-R 000 " + cFullPath + rc = shell( cCommand , 0 , cParameter , false ) + + ' the readentry-directory must be readonly, the files as well + cFullPath = convertpath( gTesttoolPath + "framework/filedlg/input/readentry" ) + printlog( "Trying to set attributes for " + cFullPath ) + cParameter = "-R 444 " + cFullPath + rc = shell( cCommand , 0 , cParameter , false ) + 'need to remove the "S" attribute + cParameter = "-R -s " + cFullPath + rc = shell( cCommand , 0 , cParameter , false ) + + ' the readonly-directory: Only the directory is read-only, the files are rw + cFullPath = convertpath( gTesttoolPath + "framework/filedlg/input/readonly/*.*" ) + printlog( "Trying to set attributes for " + cFullPath ) + cParameter = "444 " + cFullPath + rc = shell( cCommand , 0 , cParameter , false ) + + else + + printlog( "No file-attribute setting for non-UNIX platforms" ) + + endif + +end sub + + +'******************************************************************************* + +function hGetFirstNameFromFileList() as string + + + '///<h3>Retrieve the first valid ffilename from the filepickers filelist</h3><br> + + '///<u>Parameter(s):</u><br> + '///<ol> + '///+<li>No input parameters</li> + '///</ol> + + + '///<u>Returns:</u><br> + '///<ol> + '///+<li>First valid filename from filelist (either first or second item)</li> + '///<ul> + '///+<li>Eliminates directory "CVS"</li> + '///</ul> + '///</ol> + + const CFN = "hGetFirstNameFromFileList()::" + dim brc as boolean 'a multi purpose boolean returnvalue + dim cFileName as string + + '///<u>Description:</u> + '///<ul> + '///+<li>Select the first item in the filelist of the File Open Dialog</li> + + Kontext "OeffnenDlg" + Dateiauswahl.typeKeys( "<HOME>" ) + Dateiauswahl.typeKeys( "<SPACE>" ) + + '///+<li>Retrieve the current name (First entry, usually this is <CVS>)</li> + cFileName =lcase( Dateiauswahl.GetSelText() ) + printlog( CFN & "File: " & cFileName ) + + '///+<li>Intercept blank filename (might be a timing issue)</li> + if ( cFileName = "" ) then + warnlog( CFN & "Filename is empty, probably a timing issue" ) + endif + + '///+<li>Move one down if we are on the CVS directory</li> + if ( cFileName = "cvs" ) then + printlog( CFN & "Skipping CVS directory" ) + Dateiauswahl.TypeKeys( "<Down>" ) + + '///+<li>Retrieve the filename at pos. 2</li> + cFileName = lcase ( Dateiauswahl.GetSelText() ) + printlog( CFN & "File: " & cFileName ) + endif + + '///+<li>Return the filename</li> + hGetFirstNameFromFileList() = cFileName + + '///</ul> + +end function + diff --git a/testautomation/framework/optional/includes/filedlg_triggers.inc b/testautomation/framework/optional/includes/filedlg_triggers.inc new file mode 100755 index 000000000000..63a30463305d --- /dev/null +++ b/testautomation/framework/optional/includes/filedlg_triggers.inc @@ -0,0 +1,309 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: filedlg_triggers.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Alternative ways to open file-dialogs / slot availablilty +'* +'\****************************************************************************** + +testcase tDialogTriggers + + '///<h1>Alternative ways to open file-dialogs / slot availablilty</h1> + + '///<u><pre>Synopsis</pre></u>Test that some slots for the file-save, file-save-as + '///+ and file-open dialogs are not available in special situations, using accelerators.<br> + '///<u><pre>Specification document</pre></u>No specification provided<br> + '///<u><pre>Files used</pre></u>framework/tools/input/accelerators.txt<br>framework/tools/inc/accels.inc<br> + '///<u><pre>Test case specification</pre></u> + '///<ul> + + dim cAcceleratorFileOpen as string + dim cAcceleratorFileSave as string + dim cAcceleratorFileSaveAs as string + + '///+<li>Make sure we are on the backing window</li> + do while ( getDocumentCount > 0 ) + call hCloseDocument() + loop + + '///+<li>Get the accelerators from reference file for FileOpen, FileSave + '///+ and FileSaveAs</li> + cAcceleratorFileOpen = hGetAccel( "FileOpen" ) + cAcceleratorFileSave = hGetAccel( "FileSave" ) + cAcceleratorFileSaveAs = hGetAccel( "FileSaveAs" ) + + + '///+<li>Actions on backing window</li> + '///<ul> + '///+<li>Test case 1: FileOpen should be possible from backing window (accelerator)</li> + printlog( "Test case 1: FileOpen should be possible from backing window (accelerator)" ) + + kontext "DocumentBackground" + if ( DocumentBackground.exists( 1 ) ) then + + DocumentBackground.typeKeys( cAcceleratorFileOpen ) + + kontext "OeffnenDlg" + if ( OeffnenDlg.exists( 1 ) ) then + printlog( "File Open dialog is open. Good." ) + OeffnenDlg.cancel() + else + warnlog( "File Open dialog did not open." ) + endif + else + warnlog( "Backing window not found" ) + endif + + + + '///+<li>Test case 2: File Save should not work from backing window (accelerator)</li> + printlog( "Test case 2: File Save should not work from backing window (accelerator)" ) + + kontext "DocumentBackground" + if ( DocumentBackground.exists( 1 ) ) then + + DocumentBackground.typeKeys( cAcceleratorFileSave ) + + kontext "SpeichernDlg" + if ( SpeichernDlg.exists( 1 ) ) then + warnlog( "File Save dialog should not open." ) + SpeichernDlg.cancel() + else + printlog( "File Open dialog is not open. Good." ) + endif + else + warnlog( "Backing window not found" ) + endif + + + + '///+<li>Test case 3: File Save As should not work from backing window (accelerator)</li> + printlog( "Test case 3: File Save As should not work from backing window (accelerator)" ) + + kontext "DocumentBackground" + if ( DocumentBackground.exists( 1 ) ) then + + DocumentBackground.typeKeys( cAcceleratorFileSaveAs ) + + kontext "SpeichernDlg" + if ( SpeichernDlg.exists( 1 ) ) then + warnlog( "File Save dialog should not open." ) + SpeichernDlg.cancel() + else + printlog( "File Open dialog is not open. Good." ) + endif + else + warnlog( "Backing window not found" ) + endif + + + '///+<li>Test case 4: FileOpen should be possible from backing window (slot)</li> + printlog( "Test case 4: FileOpen should be possible from backing window (slot)" ) + + kontext "DocumentBackground" + if ( DocumentBackground.exists( 1 ) ) then + + FileOpen + + kontext "OeffnenDlg" + if ( OeffnenDlg.exists( 1 ) ) then + printlog( "File Open dialog is open. Good." ) + OeffnenDlg.cancel() + else + warnlog( "File Open dialog did not open." ) + endif + else + warnlog( "Backing window not found" ) + endif + + + + '///+<li>Test case 5: File Save should not work from backing window (slot)</li> + printlog( "Test case 5: File Save should not work from backing window (slot)" ) + + kontext "DocumentBackground" + if ( DocumentBackground.exists( 1 ) ) then + + try + FileSave + + kontext "SpeichernDlg" + if ( SpeichernDlg.exists( 1 ) ) then + warnlog( "File Save dialog should not open." ) + SpeichernDlg.cancel() + else + printlog( "File Open dialog is not open. Good." ) + endif + catch + printlog( "Slot blocked, good" ) + endcatch + + else + warnlog( "Backing window not found" ) + endif + + + + '///+<li>Test case 6: File Save As should not work from backing window (slot)</li> + printlog( "Test case 6: File Save As should not work from backing window (slot)" ) + + kontext "DocumentBackground" + if ( DocumentBackground.exists( 1 ) ) then + + try + FileSaveAs + + kontext "SpeichernDlg" + if ( SpeichernDlg.exists( 1 ) ) then + warnlog( "File Save dialog should not open." ) + SpeichernDlg.cancel() + else + printlog( "File Open dialog is not open. Good." ) + endif + catch + printlog( "Slot blocked, good" ) + endcatch + + else + warnlog( "Backing window not found" ) + endif + + '///</ul> + + + + '///+<li>Actions on unmodified documents (Writer)</li> + '///<ul> + + gApplication = "WRITER" + + '///+<li>Open a new writer document</li> + call hNewDocument() + + '///+<li>Test case 7: File Save should not work from unmodified documents (accelerator)</li> + printlog( "Test case 7: File Save should not work from unmodified documents (accelerator)" ) + + kontext "DocumentWriter" + if ( DocumentWriter.exists( 1 ) ) then + + DocumentWriter.typeKeys( cAcceleratorFileSave ) + + kontext "SpeichernDlg" + if ( SpeichernDlg.exists( 1 ) ) then + warnlog( "File Save dialog should not open." ) + SpeichernDlg.cancel() + else + printlog( "File Open dialog is not open. Good." ) + endif + else + warnlog( "Writer document not not found" ) + endif + + + + '///+<li>Test case 8: File Save As should work from unmodified documents (accelerator)</li> + printlog( "Test case 8: File Save As should work from unmodified documents (accelerator)" ) + + kontext "DocumentWriter" + if ( DocumentWriter.exists( 1 ) ) then + + DocumentWriter.typeKeys( cAcceleratorFileSaveAs ) + + kontext "SpeichernDlg" + if ( SpeichernDlg.exists( 1 ) ) then + printlog( "File Save dialog is open. Good." ) + SpeichernDlg.cancel() + else + warnlog( "File Open dialog is not open." ) + endif + else + warnlog( "Writer document not not found" ) + endif + + + '///+<li>Test case 9: File Save should not work from unmodified documents (slot)</li> + printlog( "Test case 9: File Save should not work from unmodified documents (slot)" ) + + kontext "DocumentWriter" + if ( DocumentWriter.exists( 1 ) ) then + + try + FileSave + + kontext "SpeichernDlg" + if ( SpeichernDlg.exists( 1 ) ) then + warnlog( "File Save dialog should not open." ) + SpeichernDlg.cancel() + else + printlog( "File Save dialog is not open. Good." ) + endif + catch + printlog( "Slot blocked, good" ) + endcatch + else + warnlog( "Writer document not not found" ) + endif + + + + '///+<li>Test case 10: File Save As should work from unmodified documents (slot)</li> + printlog( "Test case 10: File Save As should work from unmodified documents (slot)" ) + + kontext "DocumentWriter" + if ( DocumentWriter.exists( 1 ) ) then + + try + FileSaveAs + + kontext "SpeichernDlg" + if ( SpeichernDlg.exists( 1 ) ) then + printlog( "File Save dialog is open. Good." ) + SpeichernDlg.cancel() + else + warnlog( "File Save dialog should open." ) + endif + catch + warnlog( "Slot blocked" ) + endcatch + else + warnlog( "Writer document not not found" ) + endif + + '///+<li>Close the document</li> + call hCloseDocument() + '///</ul> + '///</ul> + +endcase + diff --git a/testautomation/framework/optional/includes/fontworkgallery.inc b/testautomation/framework/optional/includes/fontworkgallery.inc new file mode 100755 index 000000000000..756ca965880c --- /dev/null +++ b/testautomation/framework/optional/includes/fontworkgallery.inc @@ -0,0 +1,177 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: fontworkgallery.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : Resource test of font work gallery +'* +'\************************************************************************ + +sub sFontworkGalleryUpdate + dim sApplication + dim i,a as integer + + sApplication = array("WRITER","MASTERDOC","CALC","IMPRESS","DRAW") + + ' for every application + a = uBound(sApplication()) + for i = 0 to a + gApplication = sApplication(i) + printlog "********** " + gApplication + tFontworkGalleryUpdate + next i + call hCloseDocument() + call hNewDocument() +end sub + +testcase tFontworkGalleryUpdate + dim j,b as integer + +'i67024 - tbo sj Help-IDs missing on the windows items for FontworkAlignment and FontworkCharacterSpacing +'i66989 - tbo sj Fontwork Gallery control has no Help-ID + '/// close all applications, exept the backingwindow, to make sure the right toolbar is used by TestTool ///' + b = getDocumentCount + for j = 1 to b + printlog "closing: " + j + hCloseDocument() + next j + '/// open new application window ///' + hNewDocument() + sleep (5) + '/// if toolbar 'Drawing' is not visible, open it by View - Toolbars - Drawing ///' + Kontext "Drawbar" + if NOT Drawbar.exists then + hToolbarSelect("DRAWING",true) + printlog "opened drawing toolbar" + endif + if Drawbar.exists then + '/// Click button 'Fontwork Gallery' on toolbar 'Drawing' ///' + FontworkGallery.click + + Kontext "FontworkGallery" + '/// the dialog 'Fontwork Gallery' has to come up ///' + dialogtest(FontworkGallery) + '/// In the dialog 'Fontwork Gallery' type key <cursor right> ///' + FontworkGallery.typeKeys("<right>", true) + '/// In the dialog 'Fontwork Gallery' press and release right mouse button in the middle of the dialog ///' + FontworkGallery.mousedown(50,50) + FontworkGallery.mouseup(50,50) + '/// on the dialog 'Fontwork Gallery' press button OK ///' + FontworkGallery.OK + + '/// an Fontwork object will be inserted now ///' + sleep 5 + '/// The toolbar 'Fontwork' has to come up///' + Kontext "FontworkObjectbar" + if FontworkObjectbar.exists then + '/// On the toolbar 'Fontwork' click the button 'Fontwork Gallery' ///' + FontworkGallery.click + '/// dialog 'Fontwork Gallery' has to come up ///' + Kontext "FontworkGallery" + dialogtest(FontworkGallery) + '/// close dialog 'Fontwork Gallery' by clicking CANCEL button ///' + FontworkGallery.cancel + + Kontext "FontworkObjectbar" + '/// On the toolbar 'Fontwork' click the button 'Fontwork Shape' ///' + FontworkShape.click + '/// toolbar 'Fontwork Shape' has to come up ///' + Kontext "FontworkShape" + '/// press button 'Plain Text' on toolbar 'Fontwork Shape' ///' + PlainText.click + + Kontext "FontworkObjectbar" + '/// On the toolbar 'Fontwork' click the button 'Fontwork Same Letter Heights' ///' + FontworkSameLetterHeights.click + sleep 3 + + Kontext "FontworkObjectbar" + '/// On the toolbar 'Fontwork' click the button 'Fontwork Alignment' ///' + FontworkAlignment.click + Kontext "FontworkAlignment" + if FontworkAlignment.exists(5) then + dialogtest(FontworkAlignment) + FontworkAlignment.close + else + printlog "beginning workaround lockup" + hUseMenu() + hMenuClose() + sleep 3 + Kontext "FontworkObjectbar" + FontworkAlignment.click + Kontext "FontworkAlignment" + if FontworkAlignment.exists(5) then + dialogtest(FontworkAlignment) + FontworkAlignment.close + else + warnlog "FontworkAlignment dialog not visible" + endif + endif + + Kontext "FontworkObjectbar" + '/// On the toolbar 'Fontwork' click the button 'Fontwork Character Spacing' ///' + FontworkCharacterSpacing.click + '/// toolbox 'Fontwork Character Spacing' has to come up ///' + Kontext "FontworkCharacterSpacing" + if FontworkCharacterSpacing.exists(5) then + 'dialogtest(FontworkCharacterSpacing) + '/// try to select the entry 'Custom ...' with keys, since Help Ids are missing ///' + FontworkCharacterSpacing.typeKeys ("<down><down><down><down><down><return>") + '/// dialog 'Fontwork Character Spacing' has to come up ///' + Kontext "FontworkCharacterSpacingCustom" + if FontworkCharacterSpacingCustom.exists(5) then + dialogtest(FontworkCharacterSpacingCustom) + printlog value.getText + '/// close dialog 'Fontwork Character Spacing' ///' + FontworkCharacterSpacingCustom.close + else + printlog "dialog FontworkCharacterSpacingCustom didn't came up" + endif + Kontext "FontworkCharacterSpacing" + if FontworkCharacterSpacing.exists(5) then + '/// close dialog 'Fontwork Character Spacing' ///' + FontworkCharacterSpacing.close + else + printlog "dialog FontworkCharacterSpacing was closed in another way" + endif + else + warnlog "fontWork characterspacing drop down menu is not visible" + endif + else + warnlog "fontWork toolbar is not visible" + endif + else + warnlog "Draw toolbar is not visible" + endif +endcase + diff --git a/testautomation/framework/optional/includes/help_bookmarks.inc b/testautomation/framework/optional/includes/help_bookmarks.inc new file mode 100755 index 000000000000..04b47d7d5d62 --- /dev/null +++ b/testautomation/framework/optional/includes/help_bookmarks.inc @@ -0,0 +1,217 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: help_bookmarks.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Bookmarks in the help browser +'* +'\****************************************************************************** + +testcase tHelpBookmarks + + warnlog( "#i84486# crash when clicking on find-button in help browser" ) + goto endsub + + '///<H1>Bookmarks in the help browser</H1> + '///<h2>help_bookmarks.bas::tHelpBookmarks</h2> + '///<ul> + dim brc as boolean + dim cStringFind as string + dim cStringBookmark as string + dim iItemCount as integer + const MYBOOKMARK = "myBookMark" + + '///+<li>Open Help</li> + brc = hOpenHelp() + if ( not brc ) then + warnlog( "Help not open, aborting test" ) + goto endsub + endif + + '///+<li>Select "Find" tab</li> + brc = hSelectHelpTab( "find" ) + + '///+<li>Enter Search Term (Java)</li> + SearchFind.setText( "java" ) + + '///+<li>Search whole words and headers only</li> + FindInHeadingsOnly.check() + FindFullWords.check() + FindButton.click() + + '///+<li>Select first match and display the item</li> + Result.select( 1 ) + cStringFind = Result.getSelText() + DisplayFind.click() + + '///+<li>Switch to the bookmarks tab</li> + brc = hSelectHelpTab( "bookmarks" ) + + '///+<li>Click the "Add Bookmark" button</li> + printlog( " Adding bookmark" ) + SetBookmarks.click() + + '///+<li>Name the bookmark after checking its default name</li> + Kontext "AddBookmark" + + printlog( " Verifying default name of bookmark" ) + cStringBookmark = BookmarkName.getText() + if ( cStringFind = cStringBookmark ) then + printlog( " Bookmark has correct default name: " & cStringFind ) + else + warnlog( "Incorrect default name for new bookmark" ) + endif + + printlog( " Accept default name, close dialog with ok" ) + AddBookmark.ok() + + '///+<li>Verify that the bookmark has been added to the list</li> + hSelectHelpTab( "bookmarks" ) + printlog( " Verify that the bookmark has been added" ) + Kontext "BookmarksPage" + iItemCount = Bookmarks.getItemCount() + if ( iItemCount = 1 ) then + printlog( " The correct number of bookmarks is listed (1)" ) + else + warnlog( "Incorrect number of bookmarks listed" ) + endif + + '///+<li>Abort the test if there is no bookmark listed at all</li> + if ( iItemCount = 0 ) then + warnlog( "Bookmark has not been created, aborting test" ) + call hCloseHelp() + goto endsub + endif + + '///+<li>Verify that the bookmark name makes it to the bookmarks list</li> + Kontext "BookmarksPage" + Bookmarks.select( 1 ) + cStringBookmark = Bookmarks.getSelText() + if ( cStringBookmark = cStringFind ) then + printlog( " Name in the bookmarks-list: " & cStringFind ) + else + warnlog( "Incorrect name in bookmarks list: " & cStringBookmark ) + endif + + '///+<li>Close the help</li> + brc = hCloseHelp() + + '///+<li>Reopen Help</li> + brc = hOpenHelp() + + '///+<li>Verify that the bookmark is still present</li> + brc = hSelectHelpTab( "bookmarks" ) + + '///+<li>Open context menu, select "Rename"</li> + printlog( " Open the context menu and rename the bookmark" ) + Kontext "BookmarksPage" + Bookmarks.select( 1 ) + brc = hUseBookmarksContextMenu( "rename" ) + + '///+<li>Change the name of the bookmark, accept with ok</li> + Kontext "AddBookmark" + if ( brc and AddBookmark.exists() ) then + BookmarkName.setText( MYBOOKMARK ) + AddBookmark.ok() + else + warnlog( "The AddBookmarks dialog is not open" ) + endif + + '///+<li>Verify that the changed name is listed in the listbox</li> + hSelectHelpTab( "bookmarks" ) + kontext "BookmarksPage" + Bookmarks.select( 1 ) + cStringBookmark = Bookmarks.getSelText() + if ( cStringBookmark = MYBOOKMARK ) then + printlog( " The Bookmark has been renamed: " & cStringBookmark ) + else + warnlog( "Incorrect name displayed in bookmarks list" ) + endif + + '///+<li>Close the Help, Close the Office</li> + brc = hCloseHelp() + + '///+<li>Restart the office, open help, switch to Bookmarks tab</li> + printlog( " Exit and restart the office" ) + call ExitRestartTheOffice() + sleep( 3 ) + brc = hOpenHelp() + brc = hSelectHelpTab( "bookmarks" ) + + '///+<li>Verify that the renamed bookmark still exists</li> + Kontext "BookmarksPage" + Bookmarks.select( 1 ) + cStringBookmark = Bookmarks.getSelText() + if ( cStringBookmark = MYBOOKMARK ) then + printlog( " The bookmark has the correct name" ) + else + warnlog( "Incorrect name displayed in bookmarks list" ) + endif + + '///+<li>Delete the Bookmark (using context menu)</li> + brc = hUseBookmarksContextMenu( "delete" ) + + '///+<li>verify that the bookmark has been deleted (none left)</li> + kontext "Bookmarks" + if ( bookmarks.getItemCount = 0 ) then + printlog( " Bookmark has been deleted" ) + else + warnlog( "There are bookmarks left over, please check" ) + endif + + '///+<li>Close the help</li> + brc = hClosehelp() + + '///+<li>Open help, switch to bookmarks tab</li> + brc = hOpenhelp() + brc = hSelectHelpTab( "bookmarks" ) + + '///+<li>Verify that the bookmark has been deleted</li> + kontext "BookmarksPage" + iItemCount = Bookmarks.getItemCount() + if ( iItemCount = 0 ) then + printlog( " The bookmark has been deleted" ) + else + warnlog( "Bookmarks have been left over, there should be none" ) + endif + + '///+<li>Close help</li> + brc = hCloseHelp() + + Kontext "DocumentWriter" + DocumentWriter.restore() + + '///</ul> + +endcase + diff --git a/testautomation/framework/optional/includes/help_compare_applications.inc b/testautomation/framework/optional/includes/help_compare_applications.inc new file mode 100755 index 000000000000..af145865da9d --- /dev/null +++ b/testautomation/framework/optional/includes/help_compare_applications.inc @@ -0,0 +1,113 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: help_compare_applications.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : +'* +'\****************************************************************************** + +testcase tCompareHelpApps() + + if ( gIsoLang <> "en-US" ) then + printlog( "No testing for languages other than en_US" ) + goto endsub + endif + + '///<h1>Compare the About-Items in the Help-Viewer against a reference</h1> + '///<ul> + + ' file related variables + dim sFileOut as string + dim sFilein as string + dim sFileName as string + + ' the array that holds the names of the applications + dim aTopicsFromUI( 10 ) as string ' max index = 7 expected + + ' some incremant variables and temporary stuff + dim iTopicsFromUI as integer + dim iCurrentItem as integer + dim sCurrentItem as string + dim irc as integer + dim brc as boolean + + ' define input and output paths, presetting variables + sFileName = gProductName & "_help_applications_" & gIsoLang & ".txt" + sFileOut = hGetWorkFile( sFilename ) + sFileIn = gTesttoolPath & "framework\optional\input\help_browser\" + sFileIn = sFileIn & sFileName + sFileIn = convertpath( sFileIn ) + + aTopicsFromUI( 0 ) = "0" + + '///+<li>Open the Help</li> + brc = hOpenHelp() + if ( not brc ) then + warnlog( "Help not open, aborting test" ) + goto endsub + endif + + + '///+<li>Switch to the Index-Tab</li> + hSelectHelpTab( "index" ) + + '///+<li>Retrieve the number of About-Items (Listbox, to the upper left)</li> + iTopicsFromUI = HelpAbout.getItemCount() + + '///+<li>copy the strings from the ListBox into an array</li> + for iCurrentItem = 1 to iTopicsFromUI + + HelpAbout.select( iCurrentItem ) + sCurrentItem = HelpAbout.getSelText() + hListAppend( sCurrentItem, aTopicsFromUI() ) + + next iCurrentItem + + call hCloseHelp() + + ' Compare the list against a reference or create a new list, if the + ' reference does not exist + printlog( "" ) + printlog( "Beginning comparision" ) + + '///+<li>Compare the array to the reference file</li> + irc = hManageComparisionList( sFileIn, sFileOut, aTopicsFromUI() ) + if ( irc <> 0 ) then + warnlog( "Something went wrong, please review the log" ) + endif + '///</ul> + +endcase + + diff --git a/testautomation/framework/optional/includes/help_compare_content.inc b/testautomation/framework/optional/includes/help_compare_content.inc new file mode 100755 index 000000000000..1ebda485d659 --- /dev/null +++ b/testautomation/framework/optional/includes/help_compare_content.inc @@ -0,0 +1,109 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: help_compare_content.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : +'* +'\****************************************************************************** + +testcase tCompareHelpContent() + + if ( gIsoLang <> "en-US" ) then + printlog( "No testing for languages other than en_US" ) + goto endsub + endif + + '///<h1>Compare the help content in the Help-Viewer against a reference</h1> + '///<h2>help_compare_content::tCompareHelpContent</h2> + '///<ul> + '///+<li>Open the Help-Viewer</li> + '///+<li>Go to the Content-Page</li> + '///+<li>Read all entries in the Content-Treelist</li> + '///+<li>Close the Help</li> + '///+<li>Compare the list to a reference</li> + '///</ul> + + ' file related variables + dim sFileOut as string + dim sFilein as string + dim sFileName as string + + ' the array that holds the names of the applications + dim aTopicsFromUI( 1200 ) as string + + ' some incremant variables and temporary stuff + dim iTopicsFromUI as integer + dim iCurrentItem as integer + dim sCurrentItem as string + dim irc as integer + dim brc as boolean + + ' define input and output paths, presetting variables + sFileName = gProductName & "_help_content_" & gIsoLang & ".txt" + sFileOut = hGetWorkFile( sFilename ) + sFileIn = gTesttoolPath & "framework\optional\input\help_browser\" + sFileIn = convertpath( sFileIn & sFileName ) + + aTopicsFromUI( 0 ) = "0" + + ' get the names from the listbox + brc = hOpenHelp() + if ( not brc ) then + warnlog( "Help not open, aborting test" ) + goto endsub + endif + + hSelectHelpTab( "content" ) + + ' find out, how many items we have in the list + iTopicsFromUI = hExpandAllNodes( SearchContent ) + printlog( "Reading " & iTopicsFromUI & " items from Content Treelist" ) + + ' get all topics from the contents-treelist + hGetVisibleNodeNames( SearchContent , aTopicsFromUI() ) + + call hCloseHelp() + + ' Compare the list against a reference or create a new list, if the + ' reference does not exist + printlog( "" ) + printlog( "Beginning comparision" ) + irc = hManageComparisionList( sFileIn, sFileOut, aTopicsFromUI() ) + if ( irc <> 0 ) then + warnlog( "Something went wrong, please review the log." ) + endif + +endcase + + diff --git a/testautomation/framework/optional/includes/help_compare_topics.inc b/testautomation/framework/optional/includes/help_compare_topics.inc new file mode 100755 index 000000000000..122b9bf3c1b6 --- /dev/null +++ b/testautomation/framework/optional/includes/help_compare_topics.inc @@ -0,0 +1,145 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: help_compare_topics.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : +'* +'\****************************************************************************** + +testcase tCompareHelpTopics() + + if ( gIsoLang <> "en-US" ) then + printlog( "No testing for languages other than en_US" ) + goto endsub + endif + + + '///<h1>Compare list of help topics against a reference file</h1> + '///<h2>help_compare_topics::tCompareHelpTopics</h2> + '///<ul> + + ' NOTE: As some of the entries might exists twice or multiple times it is quite + ' possible that the results are inaccurate. The new implementation of + ' gCompare2Lists() (hListCompare() as used here) should be able to + ' handle this. If problems occur, this shuld be the first place to + ' look. + + const MAX_ENTRIES = 30000 + + ' variables related to filenames + dim sFileOut as string + dim sFileIn as string + dim sfileName as string + + ' The list that will hold all the entries + dim aTopicsFromUI( MAX_ENTRIES ) as string + + ' some increment operators and temporary variables + dim iCurrentItem as integer + dim sCurrentItem as string + dim iCurrentApp as integer + dim iAboutItems as integer + dim cAboutItem as string + dim irc as integer + dim brc as boolean + dim bNextItem as boolean + + ' define input and output paths, presetting variables + sFileName = gProductName & "_help_topics_" & gIsoLang & ".txt" + sFileOut = hGetWorkFile( sFilename ) + sFileIn = gTesttoolPath & "framework\optional\input\help_browser\" + sFileIn = convertpath( sFileIn & sFileName ) + + aTopicsFromUI( 0 ) = "0" + + '///+<li>Go to the Index-Page of the Help-Viewer</li> + brc = hOpenHelp() + if ( not brc ) then + warnlog( "Help not open, aborting test" ) + goto endsub + endif + + hSelectHelpTab( "index" ) + + '///+<li>Find out how many About-Items we have - usually this is 7 = Applications</li> + ' NOTE: This testcase will not warn about missing About-Items, this is done + ' by the update-test. But you will get an enormous list of missing + ' Items. + iAboutItems = HelpAbout.getItemCount() + + '///+<li>cycle through all applications listed in the About-List</li> + for iCurrentApp = 1 to iAboutItems + + '///+<li>select and print the name of the current item</li> + HelpAbout.select( icurrentApp ) + sleep( 5 ) + cAboutItem = HelpAbout.getSeltext() + + '///+<li>copy the strings from the ListBox into an array</li> + iCurrentItem = 1 + bNextItem = true + + while( bNextItem ) + + try + SearchIndex.select( iCurrentItem ) + sCurrentItem = cAboutItem & " : " & SearchIndex.getSelText() + hListAppend( sCurrentItem, aTopicsFromUI() ) + iCurrentItem = iCurrentItem + 1 + catch + printlog( cAboutItem & ": Read " & iCurrentItem & " items" ) + bNextItem = false + endcatch + + wend + + next iCurrentApp + + call hCloseHelp() + + ' hManageComparisionList takes care of a lot of things like checking + ' for reference file and comparing or creating a new ref-file + printlog( "" ) + printlog( "Beginning comparision. This will take a while ..." ) + + '///+<li>Compare the items to the reference list</li> + irc = hManageComparisionList( sFileIn, sFileOut, aTopicsFromUI() ) + if ( irc <> 0 ) then + warnlog( "The list has changed, please review" ) + endif + '///</ul> + +endcase + + diff --git a/testautomation/framework/optional/includes/help_search.inc b/testautomation/framework/optional/includes/help_search.inc new file mode 100755 index 000000000000..33268c3d6a2f --- /dev/null +++ b/testautomation/framework/optional/includes/help_search.inc @@ -0,0 +1,188 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: help_search.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Search for a string, apply restrictions, verify +'* +'\****************************************************************************** + +testcase tHelpSearch + + if ( gIsoLang <> "en-US" ) then + printlog( "No testing for languages other than en_US" ) + goto endsub + endif + + '///<H1>Search for a string, apply restrictions, verify</H1> + '///<h2>help_search.bas::tHelpSearch</h2> + '///<ul> + dim brc as boolean + dim irc as integer + + dim sFileIn as string + dim sFileOut as string + dim aUIList( 100 ) as string + + dim cBasePath as string + cBasePath = gTesttoolPath & "framework\optional\input\help_browser\" + dim cDataFile as string + + '///+<li>Open the help browser</li> + brc = hOpenHelp() + if ( not brc ) then + warnlog( "Help not open, aborting test" ) + goto endsub + endif + + + '///+<li>Switch to the Search-tab (find)</li> + brc = hSelectHelpTab( "find" ) + if ( not brc ) then + warnlog( "Could not access requested TabPage, aborting test" ) + call hClosehelp() + goto endsub + endif + + '----------- Search without filter ----------------------------------------- + printlog( "" ) + printlog( "Search for <java> without any filter" ) + + '///+<li>Enter "Java" into the search entryfield</li> + '///+<li>Uncheck Whole words only and headings only</li> + SearchFind.setText( "java" ) + FindFullWords.unCheck() + FindInHeadingsOnly.unCheck() + + '///+<li>Click "Search"</li> + FindButton.click() + + '///+<li>Retrieve all entries from the list</li> + ListAllDelete( aUIList() ) + hGetListItems( Result, aUIList() ) + + '///+<li>Compare content to a reference or create a new ref-file</li> + cDataFile = gProductName & "_search_without_filter_" & gIsoLang & ".txt" + sFileOut = hGetWorkFile( cDataFile ) + sFileIn = convertpath( cBasePath & cDataFile ) + + irc = hManageComparisionList( sFileIn, sFileOut, aUIList() ) + if ( irc <> 0 ) then + warnlog( "Lists are not identical, please review the log" ) + endif + + ' ------------ Search whole words only ------------------------------------- + printlog( "" ) + printlog( "Search for <java>, whole words only" ) + + '///+<li>Apply filter: Whole words only</li> + SearchFind.setText( "java" ) + FindFullWords.Check() + FindInHeadingsOnly.unCheck() + + '///+<li>Click "Search"</li> + FindButton.click() + + '///+<li>Retrieve all entries from the list</li> + ListAllDelete( aUIList() ) + hGetListItems( Result, aUIList() ) + + '///+<li>Compare content to a reference or create a new ref-file</li> + cDataFile = gProductName & "_search_whole_words_only_" & gIsoLang & ".txt" + sFileOut = hGetWorkFile( cDataFile ) + sFileIn = convertpath( cBasePath & cDataFile ) + + irc = hManageComparisionList( sFileIn, sFileOut, aUIList() ) + if ( irc <> 0 ) then + warnlog( "Lists are not identical, please review the log" ) + endif + + ' ------------ Search headings only ---------------------------------------- + printlog( "" ) + printlog( "Search for <java>, headings only" ) + + '///+<li>Apply filter: Whole words only</li> + SearchFind.setText( "java" ) + FindFullWords.unCheck() + FindInHeadingsOnly.Check() + + '///+<li>Click "Search"</li> + FindButton.click() + + '///+<li>Retrieve all entries from the list</li> + ListAllDelete( aUIList() ) + hGetListItems( Result, aUIList() ) + + '///+<li>Compare content to a reference or create a new ref-file</li> + cDataFile = gProductName & "_search_headings_only_" & gIsoLang & ".txt" + sFileOut = hGetWorkFile( cDataFile ) + sFileIn = convertpath( cBasePath & cDataFile ) + + irc = hManageComparisionList( sFileIn, sFileOut, aUIList() ) + if ( irc <> 0 ) then + warnlog( "Lists are not identical, please review the log" ) + endif + + ' ------------ Search headings and whole words ----------------------------- + printlog( "" ) + printlog( "Search for <java>, limit results to whole words and headings" ) + + '///+<li>Apply filter: Headings and whole words</li> + SearchFind.setText( "java" ) + FindFullWords.Check() + FindInHeadingsOnly.Check() + + '///+<li>Click "Search"</li> + FindButton.click() + + '///+<li>Retrieve all entries from the list</li> + ListAllDelete( aUIList() ) + hGetListItems( Result, aUIList() ) + + '///+<li>Compare content to a reference or create a new ref-file</li> + cDataFile = gProductName & "_search_headings_and_whole_words_" & gIsoLang & ".txt" + sFileOut = hGetWorkFile( cDataFile ) + sFileIn = convertpath( cBasePath & cDataFile ) + + irc = hManageComparisionList( sFileIn, sFileOut, aUIList() ) + if ( irc <> 0 ) then + warnlog( "Lists are not identical, please review the log" ) + endif + + + hCloseHelp() + +endcase + + + diff --git a/testautomation/framework/optional/includes/help_view_topics.inc b/testautomation/framework/optional/includes/help_view_topics.inc new file mode 100755 index 000000000000..aea302436498 --- /dev/null +++ b/testautomation/framework/optional/includes/help_view_topics.inc @@ -0,0 +1,130 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: help_view_topics.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Display each help topic +'* +'\****************************************************************************** + +testcase tHelpRessourceTest( iCurrentAboutItem as integer ) + + '///<h1>Ressourcetest for OpenOffice.org help viewer</h1> + + dim iTopicCount as integer + dim iCurrentTopic as integer + dim cCurrentTopic as string + dim cPreviousTopic as string + dim cCurrentAboutItem as string + dim brc as boolean + + '///<i>help.bas::tHelpRessourceTest</i><br> + '///<ul> + '///+<li>Open help</li> + brc = hOpenHelp() + if ( not brc ) then + warnlog( "Help not open, aborting test" ) + goto endsub + endif + + '///+<li>Switch to the index tabpage</li> + brc = hSelectHelpTab( "index" ) + if ( not brc ) then + warnlog( "There was a problem switching to the index tabpage" ) + endif + + '///+<li>Set and printout the current application for which to display the index</li> + Kontext "IndexPage" + HelpAbout.select( iCurrentAboutItem ) + sleep( 3 ) + + '///+<li>Retrieve the text from the Multilistbox</li> + cCurrentAboutItem = HelpAbout.getSelText() + printlog( " " ) + printlog( " * Current Application: " & cCurrentAboutItem ) + + '///+<li>Get number of entries in combo-box (help topics)</li> + iTopicCount = SearchIndex.getItemcount() + printlog( "For this application " & iTopicCount & " pages will be loaded." ) + printlog( " " ) + + '///+<li>Open every item in the index, one by one, give enough time to load</li> + '///<ul> + cPreviousTopic = "<not yet set>" + for iCurrentTopic = 1 to iTopicCount + + try + '///+<li>select one item from the list</li> + SearchIndex.Select( iCurrentTopic ) + + '///+<li>Retrieve the name of the entry</li> + cCurrentTopic = SearchIndex.getSelText() + 'printlog( " - " & cCurrentTopic ) + catch + warnlog( "Failed to select entry at " & iCurrentTopic ) + printlog( "Previous entry: " & cPreviousTopic ) + exit for + endcatch + + try + '///+<li>Click the "Display" button</li> + DisplayIndex.click() + WaitSlot( 5000 ) + catch + warnlog( "Failed to display index item (fatal):" ) + printlog( " - Index...........: " & iCurrentTopic ) + printlog( " - Topic (current).: " & cCurrentTopic ) + printlog( " - Topic (previous): " & cPreviousTopic ) + call ExitRestartTheOffice + goto endsub + endcatch + + + cPreviousTopic = cCurrentTopic + + next iCurrentTopic + '///</ul> + + '///+<li>Close the help-viewer</li> + brc = hCloseHelp() + if ( not brc ) then + warnlog( "There was a problem closing the help viewer" ) + endif + + '///+<li>Exit and restart the office</li> + call ExitRestartTheOffice() + '///</ul> + +endcase + + diff --git a/testautomation/framework/optional/includes/loadsave_files.inc b/testautomation/framework/optional/includes/loadsave_files.inc new file mode 100755 index 000000000000..601025362424 --- /dev/null +++ b/testautomation/framework/optional/includes/loadsave_files.inc @@ -0,0 +1,211 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: loadsave_files.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : File / New-Saving-Loading-Saving-Loading +'* +'\*********************************************************************** + +sub l1_lasp + + PrintLog Chr(13)+"****** File / New-Saving-Loading-Saving-Loading ******" + gApplication = "WRITER" + Call tFileLoadSave + gApplication = "CALC" + Call tFileLoadSave + gApplication = "IMPRESS" + Call tFileLoadSave + gApplication = "DRAW" + Call tFileLoadSave + gApplication = "MATH" + Call tFileLoadSave + gApplication = "HTML" + Call tFileLoadSave + gApplication = "MASTERDOC" + Call tFileLoadSave + +end sub + +' -------------------------------------------------------------------------------- + +testcase tFileLoadSave +'///general load-save-routine for level1-test + +'///create the document and save it ( 'edit/save as' ) + Dim Datei1$ + Dim Datei2$ + Dim DokName1$ + Dim DokName2$ + Dim DefaultPfad$ + Dim AppsFilter$ + Dim sApp$ + Dim DefFilter$ + Dim vExtension(10) as string + + DefFilter$ = hGetFilter( "current" ) + + if gApplication = "HTML" then + 'hGetFilternameExtension is able to read more than one extension entry + vExtension() = hGetFilternameExtension("writer_web_HTML") + DokName1$ = "ls_test1" & "." & vExtension(0) + Dokname2$ = "ls_test2" & "." & vExtension(0) + else + DokName1$ = "ls_test1" & hGetSuffix( "current" ) + DokName2$ = "ls_test2" & hGetSuffix( "current" ) + end if + + PrintLog Chr(13)+"** " + gApplication + +'///file/new/ -> all applications ( one by one ) + Call hNewDocument + +'///+ insert a short text in Writer/MasterDoc/WriterWeb document + if gApplication = "WRITER" OR gApplication = "HTML" OR gApplication = "MASTERDOC" then + Kontext "DocumentWriter" + DocumentWriter.TypeKeys gApplication + " => Load - Save - Load - Save<Return>" + DocumentWriter.TypeKeys "- first saving / loading<Return>" + end if + +'///+_ or insert a short text in the Calc document + if gApplication = "CALC" then + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "Testdokument => Load - Save - Load - Save<Return>" + DocumentCalc.TypeKeys "- first saving / loading<Return>" + end if + +'///+_ or insert a short text in the Math document + if gApplication = "MATH" then + SchreibenInMathDok "a over 2 = 3 over d" + Sleep (2) + end if + +'///+_ or create a rectangle in a Draw/Impress document + if gApplication = "DRAW" OR gApplication = "IMPRESS" then + hRechteckErstellen ( 30, 30, 60, 60 ) + end if + + DefaultPfad$ = ConvertPath ( gOfficePath + "user\work\" ) + Datei1$ = ConvertPath ( DefaultPfad$+DokName1 ) + Datei2$ = ConvertPath ( DefaultPfad$+DokName2 ) + + if app.Dir (Datei1$) <> "" then app.kill Datei1$ + if app.Dir (Datei2$) <> "" then app.kill Datei2$ + Sleep 2 + +'///+ save the file locally + PrintLog "- first saving" + hFileSaveAsKill ( Datei1$ ) + +'///change the file and save if again ( edit/save ) + PrintLog "- change and save" +'///+ insert a short text in Writer/MasterDoc/WriterWeb document + if gApplication = "WRITER" OR gApplication = "HTML" OR gApplication = "MASTERDOC" then + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "- file/save<Return>" + end if + +'///+_ or insert a short text in the Calc document + if gApplication = "CALC" then + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "- file/save<Return>" + end if + +'///+_ or insert a short text in the Math document + if gApplication = "MATH" then + SchreibenInMathDok "file save : 4 over 5 = 3 over d" + Sleep (2) + end if + +'///+_ or create a rectangle in a Draw/Impress document + if gApplication = "DRAW" OR gApplication = "IMPRESS" then + hRechteckErstellen ( 10, 10, 20, 20 ) + end if + +'///+file save ( edit/save ) + hFileSave() + +'///+close the document + PrintLog "- close" + Call hCloseDocument() + +'///load the file again change it and save it with another name + PrintLog "- first loading" +'///+ file/open the file + hFileOpen ( Datei1$ ) + sleep( 2 ) + +'///+ insert a short text in Writer/MasterDoc/WriterWeb document + if gApplication = "WRITER" OR gApplication = "HTML" OR gApplication = "MASTERDOC" then + Kontext "DocumentWriter" + gMouseClick ( 50, 50 ) + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<Down>", 4 + DocumentWriter.TypeKeys "<Return>- second saving / loading" + end if + +'///+_ or insert a short text in the Calc document + if gApplication = "CALC" then + Kontext "DocumentCalc" + gMouseClick ( 50, 50 ) + DocumentCalc.TypeKeys "<Down>", 4 + DocumentCalc.TypeKeys "<Return>- second saving / loading" + end if + +'///+_ or insert a short text in the Math document + if gApplication = "MATH" then + SchreibenInMathDok "file save : 4 over 5 = 3 over d" + Sleep (2) + end if + +'///+_ or create a rectangle in a Draw/Impress document + if gApplication = "DRAW" OR gApplication = "IMPRESS" then + hRechteckErstellen ( 65, 65, 75, 75 ) + end if + +'///+file save with another name ( edit/save as ) + PrintLog "- second saving" + hFileSaveAsKill ( Datei2$ ) +'///+close the document + Call hCloseDocument + +'///+open it again ( file/open ) + PrintLog "- second loading" + hFileOpen ( Datei2$ ) + Kontext "Navigator" + sleep (1) + if Navigator.Exists(5) then Navigator.Close + Call hCloseDocument + +endcase + diff --git a/testautomation/framework/optional/includes/loadsave_new.inc b/testautomation/framework/optional/includes/loadsave_new.inc new file mode 100755 index 000000000000..d12d44540e27 --- /dev/null +++ b/testautomation/framework/optional/includes/loadsave_new.inc @@ -0,0 +1,139 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: loadsave_new.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* 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 : tborsten.bosbach@sun.com +'* +'* short description : global functionality - load/save documents +'* +'\*************************************************************************** + +testcase NewCloseDok + PrintLog " open and close all documenttypes" + '///open all applications and close the document + '///file/new/textdocument => file/close + Call hNewCloseDocument ("Writer") + '///file/new/spreadsheet => file/close + Call hNewCloseDocument ("Calc") + '///file/new/presentation => file/close + Call hNewCloseDocument ("Impress") + '///file/new/drawing => file/close + Call hNewCloseDocument ("Draw") + '///file/new/formular => file/close + Call hNewCloseDocument ("Math") + '///file/new/HTML document => file/close + Call hNewCloseDocument ("HTMLDokument") + '///file/new/master document => file/close + Call hNewCloseDocument ("MASTERDOC") +endcase + +testcase NewDok + Dim i% + PrintLog " open all applications and close all one by one" + '///open all document types and close all one by one + '///create a new Writer-doc + '///+a new Calc-doc + '///+a new Impress-doc + '///+a new Draw-doc + '///+a new HTML-doc + '///+a new Master-doc + '///+a new Math-doc + Call NewDocument ("Writer") + Call NewDocument ("Calc") + Call NewDocument ("Impress") + Call NewDocument ("Draw") + Call NewDocument ("Math") + Call NewDocument ("HTMLDokument") + Call NewDocument ("MASTERDOC") + + '///close one by one with file/close + PrintLog " Close all documents ( file/close )" + for i%=1 to 7 + Kontext "Navigator" + if Navigator.Exists then Navigator.Close + Sleep (1) + FileClose + kontext "Active" + if Active.Exists(10) then + try + printlog "" + i% + " " +active.gettext + Active.No + catch + try + Active.Click ( 202 ) + catch + warnlog "Error on hitting 'No' button" + sleep 5 + endcatch + endcatch + end if + next i% +endcase + +sub hNewCloseDocument ( sApplikation as String ) + PrintLog "- " + sApplikation + gApplication = sApplikation + + try + hNewDocument + if gApplication = "DRAW" OR gApplication = "IMPRESS" then + hTextrahmenErstellen ( "Dummy text", 20, 20, 50, 50 ) + else + hTypeKeys "Dummy text<Return>" + end if + Sleep 2 + Kontext "Navigator" + if Navigator.Exists then Navigator.Close + hCloseDocument + catch + Warnlog gApplication + ": a error is occurred." + Exceptlog + endcatch +end sub + +sub NewDocument ( sApplikation as String ) + PrintLog "- " + sApplikation + gApplication = sApplikation + try + hNewDocument + if gApplication = "DRAW" OR gApplication = "IMPRESS" then + hTextrahmenerstellen ( "Dummy text",20,20,50,50 ) + else + Call hTypeKeys "Dummy text<Return>" + end if + Sleep 2 + catch + Warnlog gApplication + ": a error is occurred." + Exceptlog + endcatch +end sub + diff --git a/testautomation/framework/optional/includes/menuentries.inc b/testautomation/framework/optional/includes/menuentries.inc new file mode 100755 index 000000000000..ed6350b56028 --- /dev/null +++ b/testautomation/framework/optional/includes/menuentries.inc @@ -0,0 +1,178 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: menuentries.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* Owner : thorsten.bosbach@sun.com +'* +'* short description : Read menubar and first level drop down lists and compare to reference +'* +'\***************************************************************** + +sub t_getMenuText + dim k,c as integer + dim sApplication() as string + + sApplication = array("WRITER","MASTERDOC","HTMLDOKUMENT","CALC","IMPRESS","DRAW","MATH","BASIC","INSIGHT") + + ' for every application + c = uBound(sApplication()) + for k = 0 to c + gApplication = sApplication(k) + printlog "********** " + gApplication + call s_getMenuText + next k + gApplication = "Writer" +end sub + +testcase s_getMenuText + dim i,j,l,m,a,b,d,e as integer + dim sReference(400) as string + dim sCurrent(400) as string + dim sFileName as string + dim sTemp as string + dim bError as boolean + dim iTopLevelCount as integer + dim iOffset as integer + + for i=0 to uBound(sReference()) + sReference(i) = 0 + sCurrent(i) = 0 + next i + bError = FALSE + hNewDocument + hUseMenu + ' for every item in main menu bar + a = MenuGetItemCount + iTopLevelCount = a + MenuSelect (0) + for i = 1 to a + hUseMenu + stemp = MenuGetItemText(MenuGetItemID(i)) + 'printlog sTemp + listAppend(sCurrent(),"********** "+sTemp) + MenuSelect(MenuGetItemID(i)) + b = MenuGetItemCount + for j = 1 to b + sTemp = MenuGetItemText(MenuGetItemID(j)) + 'printlog " " + sTemp + listAppend(sCurrent(),sTemp) + next j + MenuSelect (0) + next i + hCloseDocument + sFileName = convertPath(gTestToolPath+"framework\optional\input/menu/"+lCase(gISOLang+"_"+gApplication+".txt")) + printlog( "Using reference file: " & sFileName ) + ' gProductName should not make a big difference. + if fileExists(sFileName) then + ' load to compare + listRead(sReference(), sFileName, "utf8") + d = listCount(sCurrent()) + m = d + e = listCount(sReference()) + if (d <> e) then + warnlog "The count of Menuentries differs from reference "+gApplication+". should: '" + e + "'; delta is: '" + (d - e) + "'" + bError = TRUE + ' always take the shorter list count + if cBool(d - e) then + d = e + endif + e = m - e + else + printlog "Count of Menuentries is ok" + e = 0 + endif + ' compare all entries + iOffset = 0 + m = 0 + for l=1 to d + ' count main menu bar items + if inStr(sReference(l), "********** ") > 0 then + m = m + 1 + ' bug in inc m :-( + printlog mid(sReference(l),12) + endif + ' complain non existing accelerator + if (sReference(l) <> "") AND (inStr(sReference(l),"~") < 1) then + qaErrorLog "No accelerator (~) in item: '" + sReference(l) + "'" + endif + ' compare the menu entries + if (sReference(l) <> sCurrent(l+iOffset))then + ' try to syncronize different count of entries + if (e <> 0) then + iOffset = iOffset + sgn(e) + 'qaerrorlog "io: " + ioffset + e = e - sgn(e) + 'qaerrorlog "e: " + e + endif + ' + if (m = (iTopLevelCount-1)) then + ' tolerate the window menu + printlog "String differs: " + chr(13) + "current : '"+sCurrent(l) + "'" + chr(13) + "reference: '" + sReference(l) + "'" + else + bError = TRUE + warnlog "String differs: " + chr(13) + "current : '"+sCurrent(l) + "'" + chr(13) + "reference: '" + sReference(l) + "'" + endif + endif + next l + ' for l=d-5 to d+5 + ' printlog "------" + ' printlog sreference(l) + ' printlog scurrent(l) + ' next l + ' if there is still is a difference in count + if (e <> 0) then + if sgn(e) then + warnlog "Not all reference entries are there, e.g.: '" + sReference(l+1) + "'" + else + warnlog "There are too much entries, e.g.: '" + sCurrent(l+1) + "'" + endif + endif + if bError then + sFileName = convertPath(gOfficePath+"user/work/menu/"+lCase(gISOLang+"_"+gApplication+".txt")) + listWrite(sCurrent(), sFileName, "utf8") + printlog "Written strings from this build to: " + chr(13) + sFileName + else + ' OK + endif + else + ' write to checkin + warnlog "No reference found; please copy:"+lCase(gISOLang+"_"+gApplication+".txt") + sFileName = convertPath(gOfficePath+"user/work/menu/"+lCase(gISOLang+"_"+gApplication+".txt")) + listWrite(sCurrent(), sFileName, "utf8") + printlog sFileName + chr(13) + "to" + sFileName = convertPath(gTestToolPath+"framework/level1/input/menu/"+lCase(gISOLang+"_"+gApplication+".txt")) + printlog sFilename + 'listWrite(sCurrent(), sFileName, "utf8") + endif + 'speichern: (vendor?) sprache gISOLang applikation +endcase + diff --git a/testautomation/framework/optional/includes/ole_1.inc b/testautomation/framework/optional/includes/ole_1.inc new file mode 100755 index 000000000000..24607c8d3b38 --- /dev/null +++ b/testautomation/framework/optional/includes/ole_1.inc @@ -0,0 +1,562 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: ole_1.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : global-level-1-test -> insert all OLE-Objects out of OLE-dialog into all doc-types +'* +'\****************************************************************************** + +testcase tOLEWriter + + '///Test all OLE-Objects you can insert out of menu + Dim i% : Dim k% + Dim sText$ + + gApplication = "WRITER" + + '///'file / new / text document' + Call hNewDocument + + '///'insert / object / chart' without a table + PrintLog "- Writer : Chart without table" + InsertObjectChart + sleep(4) + '///+ click 'create' on the Autoformat dialog for Charts + Kontext "DocumentChart" + if DocumentChart.Exists(5) then + '///+ format / vhart type + FormatChartType + Kontext "ChartType" + if ChartType.Exists(5) then + '///+ press ( cancel ) in chart type dialog + ChartType.Cancel + else + warnlog "Chart Type dialog did bot occour." + end if + Kontext "DocumentChart" + '///+ type ( escape ) + DocumentChart.TypeKeys "<ESCAPE>" + '///+ delete the selected chart with keyboard ( delete ) + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<DELETE>" + sleep(1) + else + warnlog "Chart has not been inserted." + end if + sleep(4) + '///create a table with numbers + PrintLog "- Writer : Chart out of a table only with numbers" + InsertTableWriter + + Kontext "TabelleEinfuegenWriter" + Spalten.SetText "3" + Zeilen.SetText "10" + TabelleEinfuegenWriter.OK + + Kontext "DocumentWriter" + for i%=1 to 10 + for k%=1 to 3 + sText$ = (i%+k%)*k% + DocumentWriter.TypeKeys sText$ + DocumentWriter.TypeKeys "<Right>" + next k% + DocumentWriter.TypeKeys "<Down>" + DocumentWriter.TypeKeys "<Left>", 3 + next i% + + '///+if you are in the table 'insert / object / chart' + InsertObjectChart + hStepThroughChartWizard() + + '///+ delete the selected chart with keyboard ( delete ) + Kontext "DocumentChart" + DocumentChart.typeKeys "<ESCAPE>" + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<Delete>" + Sleep 1 + DocumentWriter.TypeKeys "<Down>", 20 + DocumentWriter.TypeKeys "<Return>", 2 + Sleep 1 + + + '///create a new table only with characters + PrintLog "- Writer : Chart out of a table only with chars" + InsertTableWriter + + Kontext "TabelleEinfuegenWriter" + Spalten.SetText "3" + Zeilen.SetText "10" + TabelleEinfuegenWriter.OK + + Kontext "DocumentWriter" + for i%=1 to 10 + for k%=1 to 3 + sText$ = (i%+k%)*k% + DocumentWriter.TypeKeys "Hallo" + sText$ + DocumentWriter.TypeKeys "<Right>" + next k% + DocumentWriter.TypeKeys "<Down>" + DocumentWriter.TypeKeys "<Left>", 3 + next i% + + '///+if you are in the table 'insert / object / chart' + InsertObjectChart + + hStepThroughChartWizard() + + '///+ delete the selected chart with keyboard ( delete ) + Kontext "DocumentChart" + DocumentChart.typeKeys "<ESCAPE>" + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<Delete>" + Sleep 1 + DocumentWriter.TypeKeys "<Down>", 20 + DocumentWriter.TypeKeys "<Return>", 2 + Sleep 1 + + '///insert a math object into the writer doc + PrintLog "- Writer : Math" + + '///+ insert / object / formula + InsertObjectFormulaWriter + gMouseClick ( 1, 1) + + '///+ delete the selected mathobject with keyboard ( delete ) + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<Delete>" + Sleep 1 + + '///insert a floating object into the writer doc + PrintLog "- Writer : floating frame" + + 'warnlog( "#148094# - Crash when deselecting floating frame in Writer" ) + + '///+insert / floating frame + InsertFloatingFrame + + '///+insert in the dialog as name 'hello' and as contents '[Testtoolpath]\global\input\graf_inp\borabora.jpg' + Kontext "TabEigenschaften" + FrameName.SetText "Hallo" + Inhalt.SetText ConvertPath ( gTesttoolPath+"global\input\graf_inp\borabora.jpg" ) + + '///+click 'OK' + TabEigenschaften.OK + Sleep 2 + + '///+ delete the selected frame with keyboard ( delete ) + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<Delete>" + Sleep 1 + + '///close the document + hCloseDocument + +endcase + +'******************************************************************************* + +testcase tOLECalc + + + '///<h1>Create charts within Calc as OLE objects</h1> + '///<ul> + + dim i as Integer + dim k as Integer + + const ICWAIT as Integer = 2 + dim brc as boolean + dim iCurrentPos as integer + dim iColumn as integer + dim iRow as integer + + const CHART_OBJECT_DEFAULT_POSITION_X = 30 + const CHART_OBJECT_DEFAULT_POSITION_Y = 30 + const OUTSIDE_CHART_OBJECT_X = 1 + const OUTSIDE_CHART_OBJECT_Y = 1 + const CURSOR_MOVEMENT_RETRIES = 20 + const SELECT_CELLS_X = 7 + const SELECT_CELLS_Y = 7 + + gApplication = "CALC" + + '///+<li>Create a new spredsheet document</li> + brc = hCreateDocument() + if ( not brc ) then + warnlog( "Failed to create new " & gApplication & " document" ) + endif + + '///+<li>Insert a Chart Object without specifying a data range</li> + PrintLog "- Calc : Chart without data" + InsertChartCalc + + '///+<li>Step through the wizard without changing any settings, close it</li> + hStepThroughChartWizard() + + '///+<li>Switch from editing to select mode of the OLE object by typing <ESC></li> + kontext "DocumentChart" + DocumentChart.typeKeys( "<ESCAPE>" ) + + '///+<li>Remove focus from object by clicking into the document</li> + Kontext "DocumentCalc" + gMouseClick ( OUTSIDE_CHART_OBJECT_X , OUTSIDE_CHART_OBJECT_Y ) + sleep( ICWAIT ) + + '///+<li>Click on the chart and delete it with 'delete'</li> + ' If the OLE object is in selection mode the Drawing Object Bar should be + ' visible. As we do not know exactly where on the spreadsheet the object + ' appears we move from the upper left to the lower right corner of the + ' document until we hit an OLE object and the Drawing Object Bar is enabled. + ' Then <DEL> is sent to the document hopefully deleting the object. + + for iCurrentPos = 1 to 9 + + kontext "DocumentCalc" + gMouseClick( 10 * iCurrentPos , 10 * iCurrentPos ) + + Kontext "DrawingObjectBar" + if ( DrawingObjectBar.exists( 1 ) ) then + + kontext "DocumentCalc" + DocumentCalc.TypeKeys( "<Delete>" ) + printlog( "Found drawing object, executed <DEL> on the object" ) + exit for + + else + + qaerrorlog( "Drawing object not hit, trying again" ) + + endif + + next iCurrentPos + '</ul> + + + '///+<li>insert a chart with data</li> + '///<ul> + + PrintLog "- Calc : Chart with data" + + '///+<li>Create a table with random numbers in the cells A1 to G7</li> + kontext "DocumentCalc" + DocumentCalc.TypeKeys( "<MOD1 HOME>" ) + for iColumn = 1 to SELECT_CELLS_Y + for iRow = 1 to SELECT_CELLS_X + hTypeKeys ( iColumn * iRow ) + hTypeKeys ( "<Return>" ) + next iRow + DocumentCalc.TypeKeys( "<Up><Left>", CURSOR_MOVEMENT_RETRIES ) + DocumentCalc.TypeKeys( "<Right>", iColumn ) + next iColumn + + '///+<li>Select the range A1 to G7</li> + DocumentCalc.TypeKeys( "<Up><Left>", CURSOR_MOVEMENT_RETRIES ) + call ZellenMarkieren ( SELECT_CELLS_X , SELECT_CELLS_Y ) + + '///+<li>Insert / chart</li> + InsertChartCalc + + '///+<li>Click on 'next' for each page in AutoFormat dialog for charts and on the last page click 'create'</li> + hStepThroughChartWizard() + + '///+<li>click in the spreadsheet document to deselect the chart</li> + Kontext "DocumentCalc" + DocumentCalc.typeKeys("<escape>") + sleep( ICWAIT ) + '///</ul> + + '///+<li>insert a chart only with text in the table</li> + '///<ul> + PrintLog "- Calc : Chart for a table only with text" + + '///+<li>Create a range of cells from A1 to G7 containing text content</li> + Kontext "DocumentCalc" + DocumentCalc.TypeKeys( "<MOD1 HOME>" ) + for iColumn = 1 to SELECT_CELLS_Y + for iRow = 1 to SELECT_CELLS_X + hTypeKeys ( "Hallo<Return>" ) + next iRow + DocumentCalc.TypeKeys "<Up><Left>", CURSOR_MOVEMENT_RETRIES + DocumentCalc.TypeKeys "<Right>", iColumn + next iColumn + + '///+<li>Select the range from A1 to G7</li> + DocumentCalc.TypeKeys "<Up><Left>", CURSOR_MOVEMENT_RETRIES + call ZellenMarkieren ( SELECT_CELLS_X , SELECT_CELLS_Y ) + + '///+<li>Click insert / chart or go there via menu</li> + InsertChartCalc + + '///+<li>Step through the Chart Wizard keeping all defaults, finish it</li> + hStepThroughChartWizard() + + '///+<li>Click in the spreadsheet document to deselect the chart</li> + Kontext "DocumentCalc" + gMouseCLick ( OUTSIDE_CHART_OBJECT_X , OUTSIDE_CHART_OBJECT_Y ) + sleep( ICWAIT ) + '///</ul> + + '///+<li>Insert a math object</li> + '///<ul> + PrintLog( "- Calc : Math" ) + + '///+<li>Insert / object / formula</li> + InsertObjectFormulaCalc + sleep( ICWAIT ) + + '///+<li>Click in the spreadsheet document to deselect the chart</li> + gMouseClick ( 50, 99 ) + sleep( ICWAIT ) + '///</ul> + + '///+<li>insert a floating frame</li> + '///<ul> + PrintLog( "- Calc : floating frame" ) + + '///+<li>Insert a floating frame</li> + InsertFloatingFrame + + '///+<li>Insert in the dialog as name 'hello' and as contents '[Testtoolpath]\global\input\graf_inp\borabora.jpg'</li> + Kontext "TabEigenschaften" + FrameName.SetText( "Hallo" ) + Inhalt.SetText( ConvertPath ( gTesttoolPath+"global\input\graf_inp\borabora.jpg" ) ) + + '///+<li>Click 'OK'</li> + TabEigenschaften.OK() + sleep( ICWAIT ) + + '///+<li>Click in the spreadsheet document to deselect the chart</li> + gMouseCLick ( OUTSIDE_CHART_OBJECT_X , OUTSIDE_CHART_OBJECT_Y ) + sleep( ICWAIT ) + + '///</ul> + '///+<li>close the document</li> + brc = hDestroyDocument() + '///</ul> + +endcase + +'******************************************************************************* + +testcase tOLEDraw + + Dim i% : Dim k% + Dim iMenuCount(1) as integer + + gApplication = "DRAW" + + '///file / new / drawing + Call hNewDocument + + '///insert a math object + PrintLog "- Draw : Math" + '///+insert / object / formula + InsertObjectFormulaDraw + sleep 2 + + '///+click into the draw document once to set the focus on the math object + gMouseClick ( 1 , 1 ) + sleep 1 + + '///+delete the object with keyboard ( delete ) + DocumentDraw.TypeKeys "<Delete>" + + '///insert a chart + PrintLog "- Draw : Chart" + + '/// Special test: check that menubar switches, by comparing the count. ///' + hUseMenu() + iMenuCount(0) = menuGetItemCount + MenuSelect(0) + + '///+insert / chart + try + InsertObjectChart + Sleep ( 2 ) + + Kontext "DocumentChart" + DocumentChart.useMenu + iMenuCount(1) = menuGetItemCount + MenuSelect(0) + if iMenuCount(0) = iMenuCount(1) then + warnlog "Menu bar didn't change after inserting OLE object; It should be different from: " +iMenuCount(0) + else + printlog "Menu bar did change; from: " + iMenuCount(0) + "; to: " + iMenuCount(1) + endif + + '///+click into the draw document once to set the focus on the math object + gMouseClick ( 1 , 1 ) + Sleep ( 1 ) + + '///+delete the object with keyboard ( delete ) + DocumentDraw.TypeKeys "<Delete>" + catch + Call hReopenDoc + endcatch + + '///insert a spreadsheet + PrintLog "- Draw : Calc" + + '///+insert / spreadsheet + InsertSpreadsheetDraw + sleep 2 + + '///+click one time into the draw document to set only the focus on the math object + gMouseClick ( 1 , 1 ) + sleep 1 + + '///+delete the object with keyboard ( delete ) + DocumentDraw.TypeKeys "<Delete>" + + '///insert a floating frame + PrintLog "- Draw : floating frame" + + '///+insert / floating frame + try + InsertFloatingFrame + + Kontext "TabEigenschaften" + + '///+insert in the dialog as name 'hello' and as contents '[Testtoolpath]\global\input\graf_inp\borabora.jpg' + FrameName.SetText "Hallo" + Inhalt.SetText ConvertPath ( gTesttoolPath+"global\input\graf_inp\borabora.jpg" ) + + '///+click 'OK' + TabEigenschaften.OK + Sleep 2 + + '///+click one time into the draw document to set only the focus on the math object + gMouseClick ( 1 , 1 ) + Sleep 1 + + '///+delete the object with keyboard ( delete ) + DocumentDraw.TypeKeys "<Delete>" + catch + Call hReopenDoc + endcatch + + hCloseDocument + +endcase + +'******************************************************************************* + +testcase tOLEImpress + + Dim i% : Dim k% + + gApplication = "IMPRESS" + + '///file / new / presentation + Call hNewDocument + + '///insert a math object + PrintLog "- Impress : Math" + + '///+insert / object / formula + InsertObjectFormulaDraw + sleep 2 + + '///+click one time into the impress document to set only the focus on the math object + gMouseClick ( 1 , 1 ) + sleep 1 + + '///+delete the object with keyboard ( delete ) + DocumentImpress.TypeKeys "<Delete>" + + '*** Chart + PrintLog "- Impress : Chart" + + try + '///+insert / chart + InsertObjectChart + sleep 2 + + '///+click one time into the impress document to set only the focus on the math object + gMouseClick ( 1 , 1 ) + sleep 1 + + '///+delete the object with keyboard ( delete ) + DocumentImpress.TypeKeys "<Delete>" + catch + Call hReopenDoc + endcatch + + '*** Calc + PrintLog "- Impress : Calc" + + '///+insert / spreadsheet + InsertSpreadsheetDraw + sleep 2 + + '///+click one time into the impress document to set only the focus on the math object + gMouseClick ( 1 , 1 ) + sleep 1 + + '///+delete the object with keyboard ( delete ) + DocumentImpress.TypeKeys "<Delete>" + + '*** floating frame + PrintLog "- Impress : floating frame" + + try + '///+insert / floating frame + InsertFloatingFrame + + Kontext "TabEigenschaften" + FrameName.SetText "Hallo" + + '///+insert in the dialog as name 'hello' and as contents '[Testtoolpath]\global\input\graf_inp\borabora.jpg' + Inhalt.SetText ConvertPath ( gTesttoolPath+"global\input\graf_inp\borabora.jpg" ) + + '///+click 'OK' + TabEigenschaften.OK + Sleep 2 + + '///+click one time into the impress document to set only the focus on the math object + gMouseClick ( 1 , 1 ) + Sleep 1 + catch + hReopenDoc + endcatch + + '///+delete the object with keyboard ( delete ) + DocumentImpress.TypeKeys "<Delete>" + + hCloseDocument + +endcase + + + diff --git a/testautomation/framework/optional/includes/ole_2.inc b/testautomation/framework/optional/includes/ole_2.inc new file mode 100755 index 000000000000..49f210b05b7e --- /dev/null +++ b/testautomation/framework/optional/includes/ole_2.inc @@ -0,0 +1,141 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: ole_2.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : global-level-1-test -> insert all OLE-Objects out of OLE-dialog into all doc-types +'* +'\****************************************************************************** + +testcase tCheckTheOLEObjectDialog +'///check in all applications ( Writer/Calc/Draw/Impress/Masterdocument ) the names of all OLE-Objects in the OLE-Dialog + + qaerrorlog( "#i80670# The OLE retrieval routine is broken beyond repair, redesign required" ) + goto endsub + + Dim lListe (10) as String : Dim lListSoll (10) as String + Dim i, j as Integer + Dim iCount, sCount as Integer + + call ClosePresentationfloat() + call GetOLEDefaultNames() + + for i=1 to 5 + + select case i + case 1 : gApplication = "WRITER" + case 2 : gApplication = "CALC" + case 3 : gApplication = "IMPRESS" + case 4 : gApplication = "DRAW" + case 5 : gApplication = "GLOBALDOC" + end select + + lListe ( 0 ) = 0 : lListSoll ( 0 ) = 0 + printlog "check OLE-Object-Dialog for " + gApplication + + '///file / new / .sxw or .sxc, .sxd, .sxi, .sxm + Call hNewDocument + + '///+insert / objects / OLE-objects + InsertObjectOLEObject + + Kontext "OLEObjektEinfuegen" + if ( not OLEObjektEinfuegen.exists() ) then + warnlog( "cannot access the OLE object dialog" ) + endif + + '///+select 'create new' + NeuErstellen.Check + Sleep (1) + + '///+check all names in the list with a comparison list in [TesttoolPath]\global\input\olenames\ole_[lang-code].txt + for j=1 to ObjektTyp.GetItemCount + ObjektTyp.Select j + ListAppend ( lListe(), ObjektTyp.GetSelText ) + next j + + ListSort ( lListe() ) + iCount = ListCount ( lListe() ) + + select case gApplication + case "WRITER" : ListAppend ( lListSoll (), gOLECalc ) + ListAppend ( lListSoll (), gOLEImpress ) + ListAppend ( lListSoll (), gOLEDraw ) + ListAppend ( lListSoll (), gOLEChart ) + ListAppend ( lListSoll (), gOLEMath ) + case "CALC" : ListAppend ( lListSoll (), gOLEWriter ) + ListAppend ( lListSoll (), gOLEImpress ) + ListAppend ( lListSoll (), gOLEDraw ) + ListAppend ( lListSoll (), gOLEChart ) + ListAppend ( lListSoll (), gOLEMath ) + case "DRAW" : ListAppend ( lListSoll (), gOLECalc ) + ListAppend ( lListSoll (), gOLEImpress ) + ListAppend ( lListSoll (), gOLEWriter ) + ListAppend ( lListSoll (), gOLEChart ) + ListAppend ( lListSoll (), gOLEMath ) + case "IMPRESS" : ListAppend ( lListSoll (), gOLECalc ) + ListAppend ( lListSoll (), gOLEDraw ) + ListAppend ( lListSoll (), gOLEWriter ) + ListAppend ( lListSoll (), gOLEChart ) + ListAppend ( lListSoll (), gOLEMath ) + case "GLOBALDOC" : ListAppend ( lListSoll (), gOLECalc ) + ListAppend ( lListSoll (), gOLEImpress ) + ListAppend ( lListSoll (), gOLEDraw ) + ListAppend ( lListSoll (), gOLEChart ) + ListAppend ( lListSoll (), gOLEMath ) + end select + + if gPlatgroup = "w95" then + ListAppend ( lListSoll (), gOLEOthers ) + endif + + ListSort ( lListSoll () ) + sCount = ListCount ( lListSoll () ) + + if iCount <> sCount then + Warnlog "Expected: " + sCount + " Found: " + iCount + else + for j=1 to sCount + if lListe (j) <> lListSoll (j) then + Warnlog "Expected: '" + lListSoll (j) + "' Found: '" + lListe (j) +"'" + endif + next j + end if + + '///+cancel the dialog + OLEObjektEinfuegen.Cancel + '///+close the document and repeat it for each application + hCloseDocument() + next i +endcase + diff --git a/testautomation/framework/optional/includes/ole_3.inc b/testautomation/framework/optional/includes/ole_3.inc new file mode 100755 index 000000000000..36dc350b7b95 --- /dev/null +++ b/testautomation/framework/optional/includes/ole_3.inc @@ -0,0 +1,418 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: ole_3.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : +'* +'\****************************************************************************** + +testcase tDraw_As_OLE_Object() + + '///<h1>Insert, save, reload, close files with Draw as OLE object</h1> + call ClosePresentationfloat() + call hInsertOLEObject( true, gOLEDraw, "DRAW" ) + 'call hInsertOLEObject( false, gOLEDraw, "DRAW" ) + +endcase + +testcase tCalc_as_OLE_Object() + + '///<h1>Insert, save, reload, close files with Calc as OLE object</h1> + call ClosePresentationfloat() + call hInsertOLEObject( true, gOLECalc, "CALC" ) + 'call hInsertOLEObject( false, gOLECalc, "CALC" ) + +endcase + +testcase tImpress_As_OLE_Object() + + '///<h1>Insert, save, reload, close files with Impress as OLE object</h1> + call ClosePresentationfloat() + call hInsertOLEObject( true, gOLEImpress, "IMPRESS" ) + 'call hInsertOLEObject( false, gOLEImpress, "IMPRESS" ) + +endcase + +testcase tWriter_As_OLE_Object() + + '///<h1>Insert, save, reload, close files with Writer as OLE object</h1> + call ClosePresentationfloat() + call hInsertOLEObject( true, gOLEWriter, "WRITER" ) + 'call hInsertOLEObject( false, gOLEWriter, "WRITER" ) + +endcase + +testcase tMath_As_OLE_Object() + + '///<h1>Insert, save, reload, close files with Math as OLE object</h1> + call ClosePresentationfloat() + call hInsertOLEObject( true, gOLEMath, "MATH" ) + 'call hInsertOLEObject( false, gOLEMath, "MATH" ) + +endcase + +testcase tChart_As_OLE_Object() + + '///<h1>Insert, save, reload, close files with Chart as OLE object</h1> + call ClosePresentationfloat() + call hInsertOLEObject( true, gOLEChart, "CHART" ) + 'call hInsertOLEObject( false, gOLEChart, "CHART" ) + +endcase + +'******************************************************************************* + +sub hInsertOLEObject( bRemoveFocus as boolean, cOLEObject as string, cOleType as string ) + + dim sFile as String + dim bOleAvailable as boolean + + '///<h3>Insert OLE objects into the applications / all possible combinations</h3> + '///<u>Input</u>: + '///<ol> + '///+<li>bRemoveFocus (boolean)</li> + '///<ul> + '///+<li>TRUE = Click into the application frame to remove focus from OLE object before saving</li> + '///+<li>FALSE = Do not remove focus from OLE object</li> + '///</ul> + '///+<li>cOLEObject (string).</li> + '///<ul> + '///+<li>Any valid entry stored in gOLExxxx (set those with GetOLEDefaultNames())</li> + '///</ul> + + '///+<li>cOLEType (string). valid options are: + '///<ul> + '///+<li>"WRITER"</li> + '///+<li>"CALC"</li> + '///+<li>"DRAW"</li> + '///+<li>"IMPRESS"</li> + '///+<li>"CHART"</li> + '///+<li>"MATH"</li> + '///</ul> + '///</ol> + + '///<u>Returns</u>: + '///<ol> + '///+<li>Nothing</li> + '///</ol> + + '///<u>Description</u>: + '///<ul> + + printlog( "" ) + printlog( "Beginning testcase with options: " ) + printlog( "* Remove focus...: " & bRemoveFocus ) + printlog( "* OLE object name: " & cOLEObject ) + printlog( "* OLE object type: " & cOLEType ) + printlog( "* Document type..: " & gApplication ) + printlog( "" ) + + ' We cannot insert an OLE object of same type as the current document + ' So writer/writer, calc/calc, masterdoc/writer is skipped ... + if ( gApplication = cOleType ) then + printlog( "Skipping " & cOleType & " as OLE object" ) + goto testend + endif + + if ( gApplication = "MASTERDOC" and cOleType = "WRITER" ) then + printlog( "Skipping " & cOleType & " as OLE object" ) + goto testend + endif + + '///+<li>Open a new document ( Writer / Calc / Draw / Masterdocument ... )</li> + hCreateDocument() + + '///+<li>Insert / object / OLE-object</li> + printlog( "Menu: insert / object / OLE object" ) + InsertObjectOLEObject + + Kontext "OLEObjektEinfuegen" + if ( OLEObjektEinfuegen.exists( 1 ) ) then + + '///+<li>Select 'create new'</li> + printlog( "Select 'create new'" ) + NeuErstellen.Check() + + '///+<li>Select the draw-OLE-object ( you can find the name for each language at [TesttoolPath]/global/input/olenames/ole_[lang-code].txt )</li> + printlog( "Select objecttype: " & cOLEObject ) + ObjektTyp.Select( cOLEObject ) + + '///+<li>Click 'OK'</li> + printlog( "Click OK" ) + OLEObjektEinfuegen.OK() + WaitSlot( 3000 ) + else + warnlog( "Insert OLE object dialog is missing, test ends" ) + hDestroyDocument() + goto testend + endif + + '///+<li>Optionally remove focus from OLE object</li> + if ( bRemoveFocus ) then + printlog( "Remove focus from OLE object" ) + call OLERemoveFocus() + else + printlog( "Focus is not to be removed from OLE object" ) + + ' The following can - in some cases - reproduce a nasty crash-bug when + ' saving files with selected/activated OLE object + select case gApplication + case "DRAW" : gMouseClick( 99 , 99 ) + case "IMPRESS" : gMouseClick( 99 , 99 ) + end select + endif + + '///+<li>Build the filename with full path but without suffix</li> + sFile = ConvertPath ( gOfficePath + "user\work\ole_" & cOleType ) + printlog( "Save the file; File to be written (w/o extension): " & sFile ) + if fileexists(sFile) then + kill(sFile) + qaerrorlog("killed file from former test run") + endif + + '///+<li>Save the file via FileSave, current fileformat, overwrite</li> + hFileSaveAsKill( sFile ) + + '///+<li>Close the document</li> + printlog( "Close the document" ) + hDestroyDocument() + + '///+<li>Load the file again via FileOpen (filename with suffix)</li> + printlog( "Reopen the file: " & sFile ) + hFileOpen( sFile ) + + '///+<li>Check that the OLE object is listed in the navigator</li> + bOleAvailable = isOleAvailable() + if ( bOleAvailable ) then + + '///+<li>Disable the navigator if it exists</li> + call DisableNavigator() + + '///+<li>Set focus to OLE object</li> + call OLESetFocus() + + '///+<li>Remove focus from OLE object</li> + call SendEscape() + else + qaErrorLog( "#i44725# OLE Object not saved in Master Document" ) + endif + + '///+<li>Cleanup: Close the document</li> + printlog( "Cleanup: Close the document" ) + hDestroyDocument() + + '///+<li>Cleanup: Delete the workfile</li> + printlog( "Cleanup: Delete the workfile" ) + hDeleteFile( sFile ) + '///</ul> + + ' We end up here when the test has been skipped or aborted + testend: + +end sub + +'******************************************************************************* + +function isOleAvailable() as boolean + + '///<h3>Funtion to determine whether OLE is available</h3> + dim i as integer + dim a as integer + + const CFN = "isOleAvailable::" + + printlog( CFN & "Testing whether OLE object is present in Navigator" ) +' qaerrorlog( CFN & "Replace me i'm old, poorly written and undocumented" ) + + isOleAvailable = FALSE + ' check if OLE-Objects are in the document with the navigator + kontext "NavigatorGlobaldoc" + if NavigatorGlobaldoc.exists( 1 ) then + printlog CFN & "Navigator globaldoc is available" + if NOT AuswahlListe.exists then + Umschalten.click + endif + a = AuswahlListe.getItemCount + ' somehow not all items might be displayed + if NOT (a>2) then + inhaltsansicht.click + i = AuswahlListe.getItemCount + if NOT(i>a) then + inhaltsansicht.click + else + a = i + endif + endif + AuswahlListe.typeKeys("<home>") + 'fold everything + for i = 1 to a + AuswahlListe.typeKeys("-<down>") + next i + ' unfold everything, until there is something to unfold + ' then we found the object we looked for: OLE + AuswahlListe.typeKeys("<home>") + i = 0 + a = AuswahlListe.getItemCount + ' don't run indefinite + while ((AuswahlListe.getItemCount = a) AND (i < a)) + AuswahlListe.typeKeys("+<down>") + inc(i) + wend + try + printlog CFN & AuswahlListe.getSelText + catch + qaerrorlog CFN & "no item in navigator is selected" + endcatch + ' activate object + AuswahlListe.typeKeys("<return>") + i = AuswahlListe.getItemCount + printlog CFN & i + if (i > a) then + isOleAvailable = TRUE + else + isOleAvailable = FALSE + endif + else + Kontext "NavigatorWriter" + if NOT NavigatorWriter.exists( 1 ) then + EditNavigator + endif + Kontext "NavigatorWriter" + if NavigatorWriter.exists( 2 ) then ' was 5 secs + printlog CFN & "Navigator writer was available" + if NOT AuswahlListe.exists then + Umschalten.click + Sleep( 5 ) + endif + a = AuswahlListe.getItemCount + ' somehow not all items might be displayed + if a=0 then + Sleep( 5 ) + a = AuswahlListe.getItemCount + endif + if NOT (a>2) then + inhaltsansicht.click + Sleep( 3 ) + i = AuswahlListe.getItemCount + if NOT(i>a) then + qaerrorlog "failed" + else + a = i + endif + endif + AuswahlListe.typeKeys("<home>") + 'fold everything + for i = 1 to a + AuswahlListe.typeKeys("-<down>") + next i + ' unfold everything, until there is something to unfold + ' then we found the object we looked for: OLE + AuswahlListe.typeKeys("<home>") + i = 0 + a = AuswahlListe.getItemCount + ' don't run indefinite + while ((AuswahlListe.getItemCount = a) AND (i < a)) + AuswahlListe.typeKeys("+<down>") + inc(i) + wend + try + printlog CFN & AuswahlListe.getSelText + catch + qaerrorlog CFN & "no item in navigator is selected" + endcatch + i = AuswahlListe.getItemCount + ' activate object + AuswahlListe.typeKeys("<return>") + if (i > a) then + isOleAvailable = TRUE + else + isOleAvailable = FALSE + endif + else + kontext "NavigatorDraw" + if NavigatorDraw.exists( 2 ) then ' was 5 secs + printlog CFN & "Navigator draw is available" + else + EditNavigator + endif + kontext "NavigatorDraw" + if NavigatorDraw.exists( 2 ) then ' was 5 secs + printlog CFN & "Navigator draw is available." + if NOT Liste.exists then + Umschalten.click + endif + Liste.typeKeys("<home>") + 'fold everything + a = Liste.getItemCount + for i = 1 to a + Liste.typeKeys("-<down>") + next i + ' unfold everything, until there is something to unfold + ' then we found the object we looked for: OLE + Liste.typeKeys("<home>") + i = 0 + a = Liste.getItemCount + ' don't run indefinite + while ((Liste.getItemCount = a) AND (i < a)) + Liste.typeKeys("+<down>") + inc(i) + wend + try + printlog CFN & Liste.getSelText + catch + qaerrorlog CFN & "no item in navigator is selected" + endcatch + i = Liste.getItemCount + if (i > a) then + isOleAvailable = TRUE + else + isOleAvailable = FALSE + endif + else + ' no globaldoc + ' check if something is selected + try + EditCopy + printlog CFN & "Something was selected; executed Edit->Copy" + isOleAvailable = TRUE + catch + qaErrorLog CFN & "Nothing is selected." + isOleAvailable = FALSE + endcatch + endif + endif + endif + +end function + diff --git a/testautomation/framework/optional/includes/ole_tools.inc b/testautomation/framework/optional/includes/ole_tools.inc new file mode 100755 index 000000000000..d74d289bca70 --- /dev/null +++ b/testautomation/framework/optional/includes/ole_tools.inc @@ -0,0 +1,469 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: ole_tools.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : global-level-1-test -> insert all OLE-Objects out of OLE-dialog into all doc-types +'* +'\****************************************************************************** + +sub hReopenDoc + 'Only for bughandling if closing an OLE object fails + Warnlog "Cannot release Chart Object -> #107005#?" + hCloseDocument() + 'if Active.Exists ( 1 ) then Active.TypeKeys "<RIGHT><ENTER>" + hNewDocument() +end sub + +'******************************************************************************* + +sub hOleSelektieren ( xStart%, yStart%, xEnde%, yEnde% ) + WL_TB_ZF_Auswahl + select case gApplication + case "CALC" :Kontext "DocumentCalc" + DocumentCalc.MouseDown xStart%, yStart% + DocumentCalc.MouseMove xEnde%, yEnde% + DocumentCalc.MouseUp xEnde%, yEnde% + wait 200 + case "DRAW" :Kontext "DocumentDraw" + DocumentDraw.MouseDown xStart%, yStart% + DocumentDraw.MouseMove xEnde%, yEnde% + DocumentDraw.MouseUp xEnde%, yEnde% + case "WRITER" :Kontext "DocumentWriter" + DocumentWriter.MouseDown xStart%, yStart% + DocumentWriter.MouseMove xEnde%, yEnde% + DocumentWriter.MouseUp xEnde%, yEnde% + case "IMPRESS" :Kontext "DocumentImpress" + DocumentImpress.MouseDown xStart%, yStart% + DocumentImpress.MouseMove xEnde%, yEnde% + DocumentImpress.MouseUp xEnde%, yEnde% + case "MATH" :Kontext "DocumentMath" + DocumentMath.MouseDown xStart%, yStart% + DocumentMath.MouseMove xEnde%, yEnde% + DocumentMath.MouseUp xEnde%, yEnde% + case "GLOBALDOC":Kontext "DocumentMasterDoc" + DocumentMasterDoc.MouseDown xStart%, yStart% + DocumentMasterDoc.MouseMove xEnde%, yEnde% + DocumentMasterDoc.MouseUp xEnde%, yEnde% + end select +end sub + +'******************************************************************************* + +sub hSetToStandardView ( DieApp$ ) + select case DieApp$ + case "WRITER" : gApplication = "WRITER" + Call hNewDocument + Kontext "DocumentWriter" + case "GLOBALDOC" : gApplication = "GLOBALDOC" + Call hNewDocument + Kontext "DocumentMasterDoc" + end select + ViewZoom + Kontext "Massstab" + Optimal.Check + Massstab.ok() + Call hCloseDocument +end sub + +'******************************************************************************* + +sub SendEscape(optional iTimes as Integer) + dim i as Integer + const ICWAIT as Integer = 1 + + if IsMissing( iTimes ) then + iTimes = 1 + endif + '///+press [ESCAPE] + printlog( " - send <ESCAPE> keystroke to document" ) + select case gApplication + case "WRITER" : Kontext "DocumentWriter" + for i = 1 to iTimes + sleep( ICWAIT ) + DocumentWriter.TypeKeys( "<ESCAPE>" , 1 , TRUE ) + next i + case "CALC" : Kontext "DocumentCalc" + for i = 1 to iTimes + sleep( ICWAIT ) + DocumentCalc.TypeKeys( "<ESCAPE>" , 1 , TRUE ) + next i + case "GLOBALDOC" : Kontext "DocumentMasterDoc" + for i = 1 to iTimes + sleep( ICWAIT ) + DocumentMasterDoc.TypeKeys( "<ESCAPE>" , 1 , TRUE ) + next i + case "DRAW" : Kontext "DocumentDraw" + for i = 1 to iTimes + sleep( ICWAIT ) + DocumentDraw.TypeKeys( "<ESCAPE>" , 1 , TRUE ) + next i + case "IMPRESS" : Kontext "DocumentImpress" + for i = 1 to iTimes + sleep( ICWAIT ) + DocumentImpress.TypeKeys( "<ESCAPE>" , 1 , TRUE ) + next i + end select +end sub + +'******************************************************************************* + +sub DisableNavigator() + printlog( " - disable the navigator in globaldoc/writer" ) + select case gApplication + case "GLOBALDOC" : Kontext "NavigatorGlobalDoc" + if NavigatorGlobalDoc.Exists() then + EditNavigator + endif + case "WRITER" : Kontext "NavigatorWriter" + if NavigatorWriter.Exists() then + EditNavigator + endif + end select + sleep( 1) +end sub + +'******************************************************************************* + +sub UncheckAutoFileExtension() + '///+uncheck automatic file extension, if checked + Kontext "SpeichernDlg" + if SpeichernDlg.exists(5) then + if AutomatischeDateinamenserweiterung.Exists() then + printlog("l1_ole_tools::UncheckAutoFileExtension - unchecking automatic file extension" ) + If AutomatischeDateinamenserweiterung.IsChecked() then + AutomatischeDateinamenserweiterung.Uncheck() + endif + else + QAErrorLog ( "OBSOLETE: l1_ole_tools::UncheckAutoFileExtension Checkbox 'Automatic Filename Extension' unavailable" ) + endif + else + warnlog( "l1_ole_tools::UncheckAutoFileExtension SaveAs Dialog not open." ) + endif +end sub + +'******************************************************************************* + +function getExtension( optional sExtension as string ) as string + qaerrorlog( "getExtension is outdated. Use hGetSuffix( ... ) instead" ) + printlog("l1_ole_ttols::getExtension:: - define the expected file extension" ) + select case gApplication + case "WRITER" : sExtension = ".sxw" + case "DRAW" : sExtension = ".sxd" + case "IMPRESS" : sExtension = ".sxi" + case "CALC" : sExtension = ".sxc" + case "MATH" : sExtension = ".sxm" + case "GLOBALDOC" : sExtension = ".sgl" + end select + getExtension = sExtension +end function + +'******************************************************************************* + +sub OLESetFocus() + '///+activate the OLE-Object with a doubleclick + const ICWAIT as Integer = 10 + PrintLog " - set focus to OLE object (edit mode)" + select case gApplication + case "WRITER" : printlog " Select and deselect " + gApplication + Kontext "DocumentWriter" + DocumentWriter.TypeKeys("<F6>" , 4 , TRUE ) + DocumentWriter.TypeKeys("<DOWN>" , 3 , TRUE ) + DocumentWriter.TypeKeys("<RIGHT>" , 1 , TRUE ) + DocumentWriter.TypeKeys("<MOD1 RETURN>" , 1 , TRUE ) + DocumentWriter.TypeKeys("<TAB>" , 1 , TRUE ) + DocumentWriter.TypeKeys("<RETURN>" , 1 , TRUE ) + 'DocumentWriter.MouseDoubleClick ( 50, 50 ) + sleep( ICWAIT ) + call SendEscape( 3 ) '(to close the float as well) + case "IMPRESS" : printlog " Select and deselect " + gApplication + Kontext "DocumentImpress" + DocumentImpress.MouseDoubleClick ( 50, 50 ) + sleep( ICWAIT ) + case "CALC" : printlog " Select and deselect " + gApplication + Kontext "DocumentCalc" + DocumentCalc.TypeKeys( "<F6>" , 5 , TRUE ) + DocumentCalc.TypeKeys( "<DOWN>" , 3 , TRUE ) + DocumentCalc.TypeKeys( "<MOD1 RETURN>" , 1 , TRUE ) + DocumentCalc.TypeKeys( "<RETURN>" , 1 , TRUE ) + 'gMouseClick ( 20, 20 ) + 'DocumentCalc.MouseDoubleClick ( 20, 20 ) + sleep( ICWAIT ) + call SendEscape( 3 ) '(to close the float as well) + case "GLOBALDOC" : printlog " Select and deselect " + gApplication + Kontext "DocumentMasterDoc" + DocumentMasterDoc.MouseDown( 50 , 50 , 1 ) + DocumentMasterDoc.MouseUp( 50 , 50 , 1 ) + EditObjectEdit + sleep( ICWAIT ) + end select +end sub + +'******************************************************************************* + +sub OLESetFocus2() + '///+activate the OLE-Object with a doubleclick + 'default waitstate + const ICWAIT as Integer = 1 + PrintLog " - set focus to OLE object (edit mode)" + select case gApplication + case "WRITER" : Kontext "DocumentWriter" + try + FormatObject + Kontext ' This is by intention, do not change! + active.SetPage TabType + Kontext "TabType" + TabType.Cancel() + sleep( ICWAIT ) + EditObjectEdit + catch + warnlog "Can't activate object" + endcatch + sleep( ICWAIT * 2 ) + gMouseClick ( 5 , 5 ) 'out of edit mode + gMouseClick ( 5 , 5 ) 'remove focus + case "DRAW" : Kontext "DocumentDraw" + if OLEApp = "MATH" then + DocumentDraw.MouseDoubleClick ( 45, 46 ) + else + DocumentDraw.MouseDoubleClick ( 50, 45 ) + end if + sleep( ICWAIT * 5 ) + gMouseClick ( 1 , 1 ) + case "IMPRESS" : Kontext "DocumentImpress" + printlog( " - using accessibility shortcuts for objecthandling" ) + printlog( " (select, activate and release object)" ) + DocumentImpress.TypeKeys( "<F6>" , 5 , TRUE ) + DocumentImpress.TypeKeys( "<TAB><RETURN>" ) + sleep( ICWAIT * 2 ) + call SendEscape() + case "CALC" : Kontext "DocumentCalc" + printlog( " - using accessibility shortcuts for objecthandling" ) + printlog( " (select, activate and release object)" ) + DocumentCalc.TypeKeys( "<F6>" , 5 , TRUE ) + DocumentCalc.TypeKeys( "<DOWN>" , 3 , TRUE ) + DocumentCalc.TypeKeys( "<RIGHT>" , 1 , TRUE ) + DocumentCalc.TypeKeys( "<MOD1 RETURN>" , 1 , TRUE ) + DocumentCalc.TypeKeys( "<RETURN>" , 1 , TRUE ) + sleep( ICWAIT * 2 ) + call sendEscape() + case "GLOBALDOC": Kontext "DocumentMasterDoc" + try + FormatObject + sleep( ICWAIT ) + Kontext ' This is by intention, do not change! + Active.SetPage TabType + Kontext "TabType" + TabType.Cancel + Sleep ( ICWAIT ) + EditObjectEdit + catch + qaerrorlog( "The object is not selected after reload." ) + endcatch + Sleep( ICWAIT ) + Kontext "DocumentMasterDoc" + DocumentMasterDoc.MouseDoubleClick ( 1 , 1 ) + end select +end sub + +'******************************************************************************* + +sub OLESetFocus3() + 'TODO: Get rid of as many mousemovements as possible + 'default waitstate + const ICWAIT as Integer = 1 + printlog( " - set focus to OLE object (edit mode)" ) + select case gApplication + case "WRITER" : Kontext "DocumentWriter" + try + FormatObject + sleep( ICWAIT ) + Kontext ' This is by intention, do not change! + active.SetPage TabType + Kontext "TabType" + TabType.Cancel + sleep( ICWAIT ) + EditObjectEdit + catch + warnlog "Can't activate object" + endcatch + sleep( ICWAIT * 5 ) + gMouseClick ( 1, 1 ) + case "DRAW" : Kontext "DocumentDraw" + DocumentDraw.TypeKeys ("<Tab>") + DocumentDraw.MouseDoubleClick ( 50, 50 ) + sleep( ICWAIT * 5 ) + gMouseClick ( 1, 1 ) + case "IMPRESS" : Kontext "DocumentImpress" + printlog( " - Using accessibility-shortcuts to manipulate object") + DocumentImpress.TypeKeys( "<TAB>" ) + sleep( ICWAIT ) + DocumentImpress.TypeKeys( "<SHIFT RETURN>" ) + call SendEscape( 3 ) + case "GLOBALDOC" : Kontext "DocumentMasterDoc" + try + FormatObject + sleep( ICWAIT ) + Kontext ' This is by intention, do not change! + active.SetPage( TabType ) + Kontext "TabType" + TabType.Cancel() + sleep( ICWAIT ) + EditObjectEdit + catch + qaerrorlog( "The object is not selected after reload." ) + endcatch + sleep( ICWAIT * 5 ) + call SendEscape( 2 ) + end select +end sub + +'******************************************************************************* + +sub OLERemoveFocus + '///+Deselect OLE object + printlog( "Remove focus from OLE object for " & gApplication ) + select case gApplication + case "WRITER" : call SendEscape( 2 ) + case "GLOBALDOC" : Kontext "DocumentMasterDoc" + DocumentMasterDoc.MouseDoubleClick ( 1, 1 ) + case "IMPRESS" : gMouseClick ( 5, 99 ) + case "CALC" : Kontext "DocumentCalc" + call SendEscape() + end select +end sub + +'******************************************************************************* + +sub ClosePresentationFloat() + gApplication = "IMPRESS" + '///+Open a new document + printlog( "Open a new document" ) + hNewDocument + 'use the tiny little hammer to kill the presentation float + printlog( "Reset the application (which closes the presentation toolbar)" ) + resetapplication + '///+Open a new document + printlog( "Open a new document" ) + hNewDocument + '///+Look if the presentation toolbar is visible, if yes->warning + Kontext "CommonTaskbar" + try + printlog( "Try to click a button on the presentation toolbar" ) + Seiteduplizieren.click() + warnlog( "The presentation toolbar is open" ) + catch + printlog( "Button is unavailable. Good" ) + endcatch + '///+Close the document + printlog( "Close the document" ) + hCloseDocument + gApplication = "WRITER" ' reset, just in case... +end sub + + +'******************************************************************************* + +function hStepThroughChartWizard() as boolean + + + '///<h3>Step through the Chart Wizard leaving all defaults</h3> + '///<i>This functin just steps through the Chart Wizard using the + '///+ "Next..." button on each page. It will not change any + '///+ values under way. The Wizard is closed using the "Finish" + '///+ button.</i><br><br> + + '///<u>Parameter(s):</u><br> + '///<ol> + '///+<li>No input parameters</li> + '///</ol> + + + '///<u>Returns:</u><br> + '///<ol> + '///+<li>Errorcondition (Boolean)</li> + '///<ul> + '///+<li>TRUE: Wizard finished without errors</li> + '///+<li>FALSE: Wizard did not open</li> + '///+<li>In case of problems you need to perfom recovery yourself</li> + '///</ul> + '///</ol> + + const CFN = "hStepThroughChartWizard::" + printlog( CFN & "Enter" ) + dim brc as boolean 'a multi purpose boolean returnvalue + + '///<u>Description:</u> + '///<ul> + '///+<li>Verify that the Chart Wizard is open</li> + Kontext "ChartWizard" + if ( not chartWizard.exists( 1 ) ) then + + warnlog( CFN & "Chart Wizard not open within reasonable time" ) + hStepThroughChartWizard() = false + + else + + '///+<li>Click "Next" on the first page of the Chart wizard</li> + Kontext "ChartWizard" + GoNext.Click() + + '///+<li>Click "Next" on the second page of the Chart wizard</li> + Kontext "ChartWizard" + GoNext.Click() + + '///+<li>Click "Next" on the third page of the Chart wizard</li> + Kontext "ChartWizard" + GoNext.Click() + + '///+<li>Click "Finish" on the fourth page of the Chart wizard</li> + Kontext "ChartWizard" + ChartWizard.ok() + Sleep( 3 ) + + endif + + '///+<li>Verify that the Chart Wizard is closed</li> + kontext "ChartWizard" + if ( ChartWizard.exists( 1 ) ) then + warnlog( CFN & "Chart Wizard is still open" ) + endif + + '///</ul> + + printlog( CFN & "Exit" ) + + hStepThroughChartWizard() = true + +end function + diff --git a/testautomation/framework/optional/includes/options_asia.inc b/testautomation/framework/optional/includes/options_asia.inc new file mode 100755 index 000000000000..0a2730337833 --- /dev/null +++ b/testautomation/framework/optional/includes/options_asia.inc @@ -0,0 +1,798 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_asia.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : functionality test for language/settings +'* +'\***************************************************************** + +testcase func_LanguageSettings_Language + Dim bSave as Boolean +'///func_LanguageSettings_Language : functionality test for asian settings ( activated Asian-Support ) + +'///Open tools / options / Language Settings / Language + ToolsOptions + hToolsOptions ( "LanguageSettings", "Languages" ) +'///+save the setting for 'activated' Asian Support + bSave = Aktivieren.IsChecked +'///+check 'activated' Asian support and press OK + Printlog "asian support = TRUE" + if Aktivieren.isEnabled then + Aktivieren.unCheck + else + qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'") + printlog Aktivieren.isEnabled + endif + + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///+check Asian-Support in Writer ( see hTestAsianForWriter ) + hTestAsianForWriter ( TRUE ) +'///+check Asian-Support in Calc ( see hTestAsianForCalc ) + hTestAsianForCalc ( TRUE ) +'///+check Asian-Support in Impress ( see hTestAsianForImpress ) + hTestAsianForImpress ( TRUE ) +'///+check Asian-Support in Draw ( see hTestAsianForDraw ) + hTestAsianForDraw ( TRUE ) + +'///Open tools / options / Language Settings / Language + ToolsOptions + hToolsOptions ( "LanguageSettings", "Languages" ) + Printlog Chr(13) + "asian support = FALSE" +'///+uncheck 'activated' Asian support and press OK + Aktivieren.Uncheck + + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///+check the unabled Asian-Support in Writer ( see hTestAsianForWriter ) + hTestAsianForWriter ( FALSE ) +'///+check the unabled Asian-Support in Calc ( see hTestAsianForCalc ) + hTestAsianForCalc ( FALSE ) +'///+check the unabled Asian-Support in Impress ( see hTestAsianForImpress ) + hTestAsianForImpress ( FALSE ) +'///+check the unabled Asian-Support in Draw ( see hTestAsianForDraw ) + hTestAsianForDraw ( FALSE ) + +'///Open tools / options / Language Settings / Language + ToolsOptions + hToolsOptions ( "LanguageSettings", "Languages" ) + Printlog Chr(13) + "asian support = TRUE" +'///+check 'activated' Asian support and press OK + if Aktivieren.isEnabled then + Aktivieren.unCheck + else + qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'") + printlog Aktivieren.isEnabled + endif + + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///+check Asian-Support in Writer ( see hTestAsianForWriter ) + hTestAsianForWriter ( TRUE ) +'///+check Asian-Support in Calc ( see hTestAsianForCalc ) + hTestAsianForCalc ( TRUE ) +'///+check Asian-Support in Impress ( see hTestAsianForImpress ) + hTestAsianForImpress ( TRUE ) +'///+check Asian-Support in Draw ( see hTestAsianForDraw ) + hTestAsianForDraw ( TRUE ) + +'///Open tools / options / Language Settings / Language + ToolsOptions + hToolsOptions ( "LanguageSettings", "Languages" ) +'///+set 'activated' Asian Support to the saved state and press OK + if bSave = TRUE then Aktivieren.Check else Aktivieren.UnCheck + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) +endcase + +' ********************************************* +' ** +' ** +sub hTestAsianForWriter ( bAsianTrue as Boolean ) + Dim iTabCounter as Integer +'///check if all changes are made when Asian support is activated or not ( in Writer ) + + gApplication = "WRITER" +'///open a new writer doc + hNewDocument + Printlog "- test in writer" + +'///open Format / Character + FormatCharacter + +'///+- if Asian Support is activated => 6 Tabpages +'///+- if Asian Support is not activated => 5 Tabpages + if bAsianTrue = TRUE then + Kontext + iTabCounter = active.GetPageCount + if iTabCounter <> 6 then Warnlog "There are not 6 pages on the dialog, there are " + iTabCounter + "!" + else + Kontext + iTabCounter = active.GetPageCount + if iTabCounter <> 5 then Warnlog "There are not 5 pages on the dialog, there are " + iTabCounter + "!" + end if + +'///select Font-Tabpage + printlog " - check tab-dialog for FormatCharacter" + Kontext + active.SetPage TabFont + Kontext "TabFont" +'///+- if Asian Support is activated + if bAsianTrue = TRUE then +'///+-- Font west => exists and is visible + if FontWest.Exists then + if FontWest.IsVisible = FALSE then Warnlog "'Western Font' is not visible!" + else + Warnlog "'Western Font' does not exists!" + end if +'///+-- Style west => exists and is visible + if StyleWest.Exists then + if StyleWest.IsVisible = FALSE then Warnlog "'Western Style' is not visible!" + else + Warnlog "'Western Style' does not exists!" + end if +'///+-- Size west => exists and is visible + if SizeWest.Exists then + if SizeWest.IsVisible = FALSE then Warnlog "'Western Size' is not visible!" + else + Warnlog "'Western Size' does not exists!" + end if +'///+-- Language west => exists and is visible + if LanguageWest.Exists then + if LanguageWest.IsVisible = FALSE then Warnlog "'Western Language' is not visible!" + else + Warnlog "'Western Language' does not exists=> Bug!" + end if +'///+-- Font east => exists and is visible + if FontEast.Exists then + if FontEast.IsVisible = FALSE then Warnlog "'Eastern Font' is not visible!" + else + Warnlog "'Eastern Font' does not exists!" + end if +'///+-- Style east => exists and is visible + if StyleEast.Exists then + if StyleEast.IsVisible = FALSE then Warnlog "'Eastern Style' is not visible!" + else + Warnlog "'Eastern Style' does not exists!" + end if +'///+-- Size east => exists and is visible + if SizeEast.Exists then + if SizeEast.IsVisible = FALSE then Warnlog "'Eastern Size' is not visible!" + else + Warnlog "'Eastern Size' does not exists!" + end if +'///+-- Language east => exists and is visible + if LanguageEast.Exists then + if LanguageEast.IsVisible = FALSE then Warnlog "'Eastern Language' is not visible!" + else + Warnlog "'Eastern Language' does not exists!" + end if + else +'///+- if Asian Support is not activated +'///+-- Font east => mustn't exists + if FontEast.Exists then + if FontEast.IsVisible then Warnlog "'Eastern Font' is visible!" + end if +'///+-- Style east => mustn't exists + if StyleEast.Exists then + if StyleEast.IsVisible then Warnlog "'Eastern Style' is visible!" + end if +'///+-- Size east => mustn't exists + if SizeEast.Exists then + if SizeEast.IsVisible then Warnlog "'Eastern Size' is visible!" + end if +'///+-- Language east => mustn't exists + if LanguageEast.Exists then + if LanguageEast.IsVisible then Warnlog "'Eastern Language' is visible!" + end if +'///+-- Font west => mustn't exists + if FontWest.Exists then + if FontWest.IsVisible then Warnlog "'Eastern Font' is visible!" + end if +'///+-- Style west => mustn't exists + if StyleWest.Exists then + if StyleWest.IsVisible then Warnlog "'Eastern Style' is visible!" + end if +'///+-- Size west => mustn't exists + if SizeWest.Exists then + if SizeWest.IsVisible then Warnlog "'Eastern Size' is visible!" + end if +'///+-- Language west => mustn't exists + if LanguageWest.Exists then + if LanguageWest.IsVisible then Warnlog "'Eastern Language' is visible!" + end if + end if + +'///select FontEffects-Tabpage + Kontext + active.SetPage TabFontEffects + Kontext "TabFontEffects" +'///+- if Asian Support is activated + if bAsianTrue = TRUE then +'///+-- Emphasis Mark => exist and is visible + if Emphasis.Exists then + if Emphasis.IsVisible = FALSE then + Warnlog "'Emphasis mark' is not visible!" + else + Emphasis.Select 2 + end if + else + Warnlog "'Emphasis mark' does not exists!" + end if +'///+-- Position for Emphasis Mark => exist and is visible + if Position.Exists then + if Position.IsVisible = FALSE then Warnlog "'Position' is not visible!" + else + Warnlog "'Position' does not exists!" + end if + else +'///+- if Asian Support is not activated +'///+-- Emphasis Mark mustn't exist + if Emphasis.Exists then + if Emphasis.IsVisible then Warnlog "'Emphasis mark' is visible!" + end if +'///+-- Position for Emphasis Mark mustn't exist + if Position.Exists then + if Position.IsVisible then Warnlog "'Position' is visible!" + end if + end if + + Kontext + Active.SetPage TabFontPosition + +'///select AsianLayout-Tabpage +'///+- if Asian Support is activated +'///+-- try to select the tabpage 'Asian Layout' + if bAsianTrue = TRUE then + try + Kontext + Active.SetPage TabAsianLayout + catch + Warnlog "The tabpage 'Asian Layout' does not exists!" + endcatch + else +'///+- if Asian Support is not activated +'///+-- the tabpage 'Asian Layout' mustn't exist + try + Kontext + Active.SetPage TabAsianLayout + Warnlog "The tabpage 'Asian Layout' exists!" + catch + endcatch + end if + + Kontext + active.SetPage TabHyperlinkZeichen + + Kontext + active.SetPage TabHintergrund + kontext "TabHintergrund" + TabHintergrund.Close +'///close the Tabpage dialog + +'///Ruby Dialog + printlog " - check ruby-dialog" + if bAsianTrue = TRUE then +'///+- if Asian Support is activated +'///+-- menu item 'Format/Ruby' exists and is enabled + try + FormatRuby + Kontext "RubyDialog" + RubyDialog.Close + catch + Warnlog "Ruby-Dialog can't be opened!" + endcatch + else +'///+- if Asian Support is not activated +'///+-- menu item 'Format/Ruby' mustn't exists and or is disabled + try + FormatRuby + Kontext "RubyDialog" + RubyDialog.Close + Warnlog "Ruby-Dialog can be opened!" + catch + endcatch + end if + +'///format/change case + printlog " - check menu items for format/change case" + if bAsianTrue = TRUE then +'///+- if Asian Support is activated +'///+-- menu item 'Format/ChangeCase/Half width' exists and is enabled + try + FormatChangeCaseHalfWidth + Wait 500 + catch + Warnlog "Format/Case/Half width is not active!" + endcatch + +'///+-- menu item 'Format/ChangeCase/Full width' exists and is enabled + try + FormatChangeCaseFullWidth + Wait 500 + catch + Warnlog "Format/Case/Full width is not active!" + endcatch + +'///+-- menu item 'Format/ChangeCase/Hiragana' exists and is enabled + try + FormatChangeCaseHiragana + Wait 500 + catch + Warnlog "Format/Case/Hiragana is not active!" + endcatch + +'///+-- menu item 'Format/ChangeCase/Katagana' exists and is enabled + try + FormatChangeCaseKatagana + Wait 500 + catch + Warnlog "Format/Case/Katagana is not active!" + endcatch + else +'///+- if Asian Support is not activated +'///+-- menu item 'Format/ChangeCase/Half width' mustn't exists and is disabled + try + FormatChangeCaseHalfWidth + Wait 500 + Warnlog "Format/Case/Half width is active!" + catch + endcatch + +'///+-- menu item 'Format/ChangeCase/full width' mustn't exists and is disabled + try + FormatChangeCaseFullWidth + Wait 500 + Warnlog "Format/Case/Full width is active!" + catch + endcatch + +'///+-- menu item 'Format/ChangeCase/Hiragana' mustn't exists and is disabled + try + FormatChangeCaseHiragana + Wait 500 + Warnlog "Format/Case/Hiragana is active!" + catch + endcatch + +'///+-- menu item 'Format/ChangeCase/Katagana' mustn't exists and is disabled + try + FormatChangeCaseKatagana + Wait 500 + Warnlog "Format/Case/Katagana is active!" + catch + endcatch + end if + +'///Find&Replace-Dialog + printlog " - check find&replace-dialog" + EditSearchAndReplace + Kontext "SuchenUndErsetzenWriter" +'///+- if Asian Support is activated + if bAsianTrue = TRUE then +'///+-- 'Match half-/full-width forms' exists and is visible + if HalbNormalbreiteFormen.Exists then + if HalbNormalbreiteFormen.IsVisible = FALSE then Warnlog "'Match half-/full-width forms' is not visible!" + else + Warnlog "'Match half-/full-width forms' does not exists!" + end if +'///+-- 'Sounds like (Japanese)' exists and is visible + if AehnlicheSchreibweise.Exists then + if AehnlicheSchreibweise.IsVisible = FALSE then + Warnlog "'Sounds like (Japanese)' is not visible!" + else + AehnlicheSchreibweise.Check + end if + else + Warnlog "'Sounds like (Japanese)' does not exists!" + end if +'///+-- 'Options for 'Sounds like' exists and is visible + if AehnlicheSchreibweiseOptionen.Exists then + if AehnlicheSchreibweiseOptionen.IsVisible = FALSE then Warnlog "'Options for 'Sounds like' is not visible!" + else + Warnlog "'Options for 'Sounds like' does not exists!" + end if + else +'///+- if Asian Support is not activated +'///+-- 'Match half-/full-width forms' mustn't exists + if HalbNormalbreiteFormen.Exists then + if HalbNormalbreiteFormen.IsVisible then Warnlog "'Match half-/full-width forms' is visible!" + end if +'///+-- 'Sounds like (Japanese)' mustn't exists + if AehnlicheSchreibweise.Exists then + if AehnlicheSchreibweise.IsVisible then Warnlog "'Sounds like (Japanese)' is visible!" + end if +'///+-- 'Options for 'Sounds like' mustn't exists + if AehnlicheSchreibweiseOptionen.Exists then + if AehnlicheSchreibweiseOptionen.IsVisible then Warnlog "'Options for 'Sounds like' is visible!" + end if + end if +'///+close the Find&Replace-Dialog + SuchenUndErsetzenWriter.Close + +'///close writer doc + Call hCloseDocument + +end sub + +' ********************************************* +' ** +' ** +sub hTestAsianForCalc ( bAsianTrue as Boolean ) +'///check if all changes are made when Asian support is activated or not ( in Calc ) + Dim iTabCounter as Integer + + Printlog "- test in calc" + gApplication = "CALC" +'///open a new calc doc + hNewDocument + +'///open Format / Cells + FormatCells + +'///+- if Asian Support is activated => 8 tabpages +'///+- if Asian Support is not activated => 7 tabpages + if bAsianTrue = TRUE then + Kontext + iTabCounter = active.GetPageCount + if iTabCounter <> 8 then Warnlog "There are not 8 pages on the dialog, there are " + iTabCounter + "!" + else + Kontext + iTabCounter = active.GetPageCount + if iTabCounter <> 7 then Warnlog "There are not 7 pages on the dialog, there are " + iTabCounter + "!" + end if + + printlog " - check tab-dialog for Format/Cell" + Kontext + active.SetPage TabZahlen + + Kontext + active.SetPage TabFont + Kontext "TabFont" +'///+- if Asian Support is activated + if bAsianTrue = TRUE then +'///+-- Font west => exists and is visible + if FontWest.Exists then + if FontWest.IsVisible = FALSE then Warnlog "'Western Font' is not visible!" + else + Warnlog "'Western Font' does not exists!" + end if +'///+-- Style west => exists and is visible + if StyleWest.Exists then + if StyleWest.IsVisible = FALSE then Warnlog "'Western Style' is not visible!" + else + Warnlog "'Western Style' does not exists!" + end if +'///+-- Size west => exists and is visible + if SizeWest.Exists then + if SizeWest.IsVisible = FALSE then Warnlog "'Western Size' is not visible!" + else + Warnlog "'Western Size' does not exists!" + end if +'///+-- Language west => exists and is visible + if LanguageWest.Exists then + if LanguageWest.IsVisible = FALSE then Warnlog "'Western Language' is not visible!" + else + Warnlog "'Western Language' does not exists=> Bug!" + end if +'///+-- Font east => exists and is visible + if FontEast.Exists then + if FontEast.IsVisible = FALSE then Warnlog "'Eastern Font' is not visible!" + else + Warnlog "'Eastern Font' does not exists!" + end if +'///+-- Style east => exists and is visible + if StyleEast.Exists then + if StyleEast.IsVisible = FALSE then Warnlog "'Eastern Style' is not visible!" + else + Warnlog "'Eastern Style' does not exists!" + end if +'///+-- Size east => exists and is visible + if SizeEast.Exists then + if SizeEast.IsVisible = FALSE then Warnlog "'Eastern Size' is not visible!" + else + Warnlog "'Eastern Size' does not exists!" + end if +'///+-- Language east => exists and is visible + if LanguageEast.Exists then + if LanguageEast.IsVisible = FALSE then Warnlog "'Eastern Language' is not visible!" + else + Warnlog "'Eastern Language' does not exists!" + end if + else +'///+- if Asian Support is not activated +'///+-- Font east => mustn't exists + if FontEast.Exists then + if FontEast.IsVisible then Warnlog "'Eastern Font' is visible!" + end if +'///+-- Style east => mustn't exists + if StyleEast.Exists then + if StyleEast.IsVisible then Warnlog "'Eastern Style' is visible!" + end if +'///+-- Size east => mustn't exists + if SizeEast.Exists then + if SizeEast.IsVisible then Warnlog "'Eastern Size' is visible!" + end if +'///+-- Language east => mustn't exists + if LanguageEast.Exists then + if LanguageEast.IsVisible then Warnlog "'Eastern Language' is visible!" + end if +'///+-- Font west => mustn't exists + if FontWest.Exists then + if FontWest.IsVisible then Warnlog "'Eastern Font' is visible!" + end if +'///+-- Style west => mustn't exists + if StyleWest.Exists then + if StyleWest.IsVisible then Warnlog "'Eastern Style' is visible!" + end if +'///+-- Size west => mustn't exists + if SizeWest.Exists then + if SizeWest.IsVisible then Warnlog "'Eastern Size' is visible!" + end if +'///+-- Language west => mustn't exists + if LanguageWest.Exists then + if LanguageWest.IsVisible then Warnlog "'Eastern Language' is visible!" + end if + end if + + Kontext + active.SetPage TabFontEffects + Kontext "TabFontEffects" +'///+- if Asian Support is activated + if bAsianTrue = TRUE then +'///+-- Emphasis Mark => exist and is visible + if Emphasis.Exists then + if Emphasis.IsVisible = FALSE then + Warnlog "'Emphasis mark' is not visible!" + else + Emphasis.Select 2 + end if + else + Warnlog "'Emphasis mark' does not exists!" + end if +'///+-- Position for Emphasis Mark => exist and is visible + if Position.Exists then + if Position.IsVisible = FALSE then Warnlog "'Position' is not visible!" + else + Warnlog "'Position' does not exists!" + end if + else +'///+- if Asian Support is not activated +'///+-- Emphasis Mark mustn't exist + if Emphasis.Exists then + if Emphasis.IsVisible then Warnlog "'Emphasis mark' is visible!" + end if +'///+-- Position for Emphasis Mark mustn't exist + if Position.Exists then + if Position.IsVisible then Warnlog "'Position' is visible!" + end if + end if + +'///select AsianLayout-Tabpage +'///+- if Asian Support is activated +'///+-- try to select the tabpage 'Asian Layout' + if bAsianTrue = TRUE then + try + Kontext + Active.SetPage TabAsianTypography + catch + Warnlog "The tabpage 'Asian Typography' does not exists!" + endcatch + else +'///+- if Asian Support is not activated +'///+-- the tabpage 'Asian Layout' mustn't exist + try + Kontext + Active.SetPage TabAsianTypography + Warnlog "The tabpage 'Asian Typography' exists!" + catch + endcatch + end if + + Kontext + active.SetPage TabAusrichtung + + Kontext + active.SetPage TabUmrandung + + Kontext + active.SetPage TabHintergrund + + Kontext + active.SetPage TabZellschutz + Kontext "TabZellschutz" + TabZellschutz.Cancel +'///close the Tabpage dialog + + printlog " - check find&replace-dialog" + EditSearchAndReplace + Kontext "SuchenUndErsetzenCalc" +'///+- if Asian Support is activated + if bAsianTrue = TRUE then +'///+-- 'Match half-/full-width forms' exists and is visible + if HalbNormalbreiteFormen.Exists then + if HalbNormalbreiteFormen.IsVisible = FALSE then Warnlog "'Match half-/full-width forms' is not visible!" + else + Warnlog "'Match half-/full-width forms' does not exists!" + end if +'///+-- 'Sounds like (Japanese)' exists and is visible + if AehnlicheSchreibweise.Exists then + if AehnlicheSchreibweise.IsVisible = FALSE then + Warnlog "'Sounds like (Japanese)' is not visible!" + else + AehnlicheSchreibweise.Check + end if + else + Warnlog "'Sounds like (Japanese)' does not exists!" + end if +'///+-- 'Options for 'Sounds like' exists and is visible + if AehnlicheSchreibweiseOptionen.Exists then + if AehnlicheSchreibweiseOptionen.IsVisible = FALSE then Warnlog "'Options for 'Sounds like' is not visible!" + else + Warnlog "'Options for 'Sounds like' does not exists!" + end if + else +'///+- if Asian Support is not activated +'///+-- 'Match half-/full-width forms' mustn't exists + if HalbNormalbreiteFormen.Exists then + if HalbNormalbreiteFormen.IsVisible then Warnlog "'Match half-/full-width forms' is visible!" + end if +'///+-- 'Sounds like (Japanese)' mustn't exists + if AehnlicheSchreibweise.Exists then + if AehnlicheSchreibweise.IsVisible then Warnlog "'Sounds like (Japanese)' is visible!" + end if +'///+-- 'Options for 'Sounds like' mustn't exists + if AehnlicheSchreibweiseOptionen.Exists then + if AehnlicheSchreibweiseOptionen.IsVisible then Warnlog "'Options for 'Sounds like' is visible!" + end if + end if +'///+close the Find&Replace-Dialog + SuchenUndErsetzenCalc.Close + +'///close calc doc + Call hCloseDocument + +end sub + +' ********************************************* +' ** +' ** +sub hTestAsianForImpress ( bAsianTrue as Boolean ) +'///check if all changes are made when Asian support is activated or not ( in Impress ) + Dim iTabCounter as Integer + + Printlog "- test in impress" + gApplication = "IMPRESS" +'///open a new impress doc + hNewDocument + +'///Format/Paragraph + printlog " - check 'asian typography' at Format/Paragraph" + FormatParagraph + Kontext + active.SetPage TabEinzuegeUndAbstaende + +'///select AsianLayout-Tabpage +'///+- if Asian Support is activated +'///+-- try to select the tabpage 'Asian Layout' + if bAsianTrue = TRUE then + try + Kontext + Active.SetPage TabAsianTypography + catch + Warnlog "The tabpage 'Asian Typography' does not exists!" + endcatch + else +'///+- if Asian Support is not activated +'///+-- the tabpage 'Asian Layout' mustn't exist + try + Kontext + Active.SetPage TabAsianTypography + Warnlog "The tabpage 'Asian Typography' exists!" + catch + endcatch + end if + + Kontext + active.SetPage TabAusrichtungAbsatz + + Kontext + active.SetPage TabTabulator + kontext "TabTabulator" + TabTabulator.Cancel +'///close the Tabpage dialog + +'///close impress doc + hCloseDocument +end sub + +' ********************************************* +' ** +' ** +sub hTestAsianForDraw ( bAsianTrue as Boolean ) +'///check if all changes are made when Asian support is activated or not ( in Draw ) + Dim iTabCounter as Integer + + Printlog "- test in draw" + gApplication = "DRAW" +'///open a new draw doc + hNewDocument + +'///Format/Paragraph + printlog " - check 'asian typography' at Format/Paragraph" + FormatParagraph + Kontext + active.SetPage TabEinzuegeUndAbstaende + +'///select AsianLayout-Tabpage +'///+- if Asian Support is activated +'///+-- try to select the tabpage 'Asian Layout' + if bAsianTrue = TRUE then + try + Kontext + Active.SetPage TabAsianTypography + catch + Warnlog "The tabpage 'Asian Typography' does not exists!" + endcatch + else +'///+- if Asian Support is not activated +'///+-- the tabpage 'Asian Layout' mustn't exist + try + Kontext + Active.SetPage TabAsianTypography + Warnlog "The tabpage 'Asian Typography' exists!" + catch + endcatch + end if + + Kontext + active.SetPage TabAusrichtungAbsatz + + Kontext + active.SetPage TabTabulator + kontext "TabTabulator" + TabTabulator.Cancel +'///close the Tabpage dialog + +'///close impress doc + hCloseDocument +end sub + diff --git a/testautomation/framework/optional/includes/options_data.inc b/testautomation/framework/optional/includes/options_data.inc new file mode 100755 index 000000000000..be7c80996391 --- /dev/null +++ b/testautomation/framework/optional/includes/options_data.inc @@ -0,0 +1,215 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_data.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : general option test ( datasource - group ) +'* +'\****************************************************************************** + +testcase tDatasourceConnections + Dim lsTimeout ( 20 ) as String + Dim lbPool ( 20 ) as Boolean + Dim i as Integer, iCounter as Integer + Dim bSave as Boolean + Dim sDiv as String + Dim iDummy as Single + + iCounter = 9 ' sorry only hard coded the number of entries, it gives no way to get the real count ( GetText crashes ) +qaerrorLog "GetTextCrasjhes??? TBO" +'///check if all settings are saved in configuration ( Datasources / Connections ) + +'///open a new document +'///+open options 'Datasources' / 'Connections' + + hNewDocument + ToolsOptions + hToolsOptions ( "Datasources", "Connections" ) + +'///+save raw data + printlog " - save raw data" + bSave = ConnectionPoolingEnabled.IsChecked + ConnectionPoolingEnabled.Check + DriverList.TypeKeys "<Up>", 20 + for i=1 to iCounter + if i <> 1 then DriverList.TypeKeys "<Down>" + lbPool (i) = EnablePoolingForThisDriver.IsChecked + if lbPool (i) = TRUE then + lsTimeout (i) = Timeout.GetText + else + EnablePoolingForThisDriver.Check + lsTimeout (i) = Timeout.GetText + end if + next i + + printlog " - change all settings" + DriverList.TypeKeys "<Up>", 20 + for i=1 to iCounter + if i <> 1 then DriverList.TypeKeys "<Down>" + sDiv = str ( i/2 ) + if Instr ( sDiv, "." ) <> 0 or Instr ( sDiv, "," ) <> 0 then + EnablePoolingForThisDriver.Check + Timeout.SetText "4" + i + else + EnablePoolingForThisDriver.Uncheck + end if + Sleep (1) + next i + if bSave = TRUE then ConnectionPoolingEnabled.UnCheck + +'///+close options dialog with OK, close all documents and exit StarOffice + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + hCloseDocument + +'///+wait until StarOffice is out of memory and restart it + printlog " - exit/restart StarOffice" + ExitRestartTheOffice + +'///+open options 'Datasources' / 'Connections' +'///+check all changes + printlog " - check all changes" + ToolsOptions + hToolsOptions ( "Datasources", "Connections" ) + + if ConnectionPoolingEnabled.IsChecked = bSave then Warnlog "Connection pooling enabled => changes not saved!" + ConnectionPoolingEnabled.Check + + DriverList.TypeKeys "<Up>", 20 + for i=1 to iCounter + if i <> 1 then DriverList.TypeKeys "<Down>" + sDiv = str ( i/2 ) + if Instr ( sDiv, "." ) <> 0 or Instr ( sDiv, "," ) <> 0 then + if EnablePoolingForThisDriver.IsChecked <> TRUE then Warnlog "Entry " + i + " : enable pooling for this driver => changes not saved!" + EnablePoolingForThisDriver.Check + if Timeout.GetText <> "4" + i then Warnlog "Entry " + i + " : timeout => changes not saved!" + else + if EnablePoolingForThisDriver.Ischecked = TRUE then Warnlog "Entry " + i + " : enable pooling for this driver => changes not saved!" + end if + Sleep (1) + next i + +'///+second changes + printlog " - make second changes" + DriverList.TypeKeys "<Up>", 20 + for i=1 to iCounter + if i <> 1 then DriverList.TypeKeys "<Down>" + sDiv = str ( i/2 ) + if Instr ( sDiv, "." ) <> 0 or Instr ( sDiv, "," ) <> 0 then + EnablePoolingForThisDriver.Uncheck + else + EnablePoolingForThisDriver.Check + if i<>10 then + Timeout.SetText "6" + i + else + Timeout.SetText "540" + end if + end if + Sleep (1) + next i + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///+open options 'Datasources' / 'Connections' +'///+check all changes + printlog " - check all changes" + ToolsOptions + hToolsOptions ( "Datasources", "Connections" ) + + DriverList.TypeKeys "<Up>", 20 + for i=1 to iCounter + if i <> 1 then DriverList.TypeKeys "<Down>" + sDiv = str ( i/2 ) + if Instr ( sDiv, "." ) <> 0 or Instr ( sDiv, "," ) <> 0 then + if EnablePoolingForThisDriver.Ischecked = TRUE then Warnlog "Entry " + i + " : enable pooling for this driver => changes not saved!" + else + if EnablePoolingForThisDriver.IsChecked <> TRUE then Warnlog "Entry " + i + " : enable pooling for this driver => changes not saved!" + EnablePoolingForThisDriver.Check + if i<>10 then + if Timeout.GetText <> "6" + i then Warnlog "Entry " + i + " : timeout => changes not saved!" + else + if Timeout.GetText <> "540" then Warnlog "Entry " + i + " : timeout => changes not saved!" + end if + + end if + Sleep (1) + next i + +'///+reset to raw data + printlog " - reset all settings" + DriverList.TypeKeys "<Up>", 20 + for i=1 to iCounter + if i <> 1 then DriverList.TypeKeys "<Down>" + EnablePoolingForThisDriver.Check + Timeout.SetText lsTimeout (i) + if lbPool (i) = TRUE then EnablePoolingForThisDriver.Check else EnablePoolingForThisDriver.UnCheck + next i + if bSave = TRUE then ConnectionPoolingEnabled.Check else ConnectionPoolingEnabled.UnCheck + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///+open options 'Datasources' / 'Connections' +'///+check the raw data + printlog " - check the raw data" + ToolsOptions + hToolsOptions ( "Datasources", "Connections" ) + + ConnectionPoolingEnabled.check + DriverList.TypeKeys "<Up>", 20 + for i=1 to iCounter + if i <> 1 then DriverList.TypeKeys "<Down>" + if EnablePoolingForThisDriver.IsChecked <> lbPool (i) then Warnlog "Entry " + i + " : enable pooling for this driver => changes not saved!" + EnablePoolingForThisDriver.Check + if Timeout.GetText <> lsTimeout (i) then Warnlog "Entry " + i + " : timeout => changes not saved!" + if lbPool (i) = TRUE then EnablePoolingForThisDriver.Check else EnablePoolingForThisDriver.UnCheck + Sleep (1) + next i + ConnectionPoolingEnabled.unCheck + +'///+close options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +endcase + + + + diff --git a/testautomation/framework/optional/includes/options_int1.inc b/testautomation/framework/optional/includes/options_int1.inc new file mode 100755 index 000000000000..0518d891e6c4 --- /dev/null +++ b/testautomation/framework/optional/includes/options_int1.inc @@ -0,0 +1,324 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_int1.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : general options test (test for internet-group) +'* +'\****************************************************************************** + +testcase tInternetProxy + Dim iSave as Integer + Dim lsSave ( 9 ) as String + +'///check if all settings are saved in configuration ( Internet / Proxy ) + +'///open a new document + hNewDocument +'///open tools / options / internet / proxy + ToolsOptions + hToolsOptions ( "Internet", "Proxy" ) + + printlog " - save settings" +'///save all default settings + iSave = ProxyServer.GetSelIndex + ProxyServer.Select ( ProxyServer.GetItemCount ) + if ProxyServer.GetItemCount > 2 then Warnlog "More than 2 entries are available for ProxyServer-Setting => Bug 88387" + + lsSave (1) = HTTPProxy.GetText + lsSave (2) = HTTPPort.GetText + lsSave (3) = FTPProxy.GetText + lsSave (4) = FTPPort.GetText + lsSave (7) = NoProxy.GetText + +'///change settings + printlog " - change settings" +'///+change all settings to dummy server + HTTPProxy.SetText "staroffice-news.germany.sun.com.test" + HTTPPort.SetText "1508" + FTPProxy.SetText "staroffice-news.germany.sun.com.test" + FTPPort.SetText "1509" + NoProxy.SetText "staroffice;stardivision;starstarstar" + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///+close the document + hCloseDocument + +'///exit and restart StarOffice + printlog " - exit/restart StarOffice" + ExitRestartTheOffice + +'///check changes + printlog " - check changes" +'///+open tools / options / internet / proxy + ToolsOptions + hToolsOptions ( "Internet", "Proxy" ) + + if ProxyServer.GetSelIndex <> ProxyServer.GetItemCount then + Warnlog "Proxy Server => changes not saved ( should be the last entry )!" + ProxyServer.Select ( ProxyServer.GetItemCount ) + end if + + if HTTPProxy.GetText <> "staroffice-news.germany.sun.com.test" then warnlog "HTTP Proxy => changes not saved!" + if FTPProxy.GetText <> "staroffice-news.germany.sun.com.test" then warnlog "FTP Proxy => changes not saved!" + if NoProxy.GetText <> "staroffice;stardivision;starstarstar" then warnlog "No Proxy => changes not saved!" + if HTTPPort.GetText <> "1508" then warnlog "HTTP Port => changes not saved!" + if FTPPort.GetText <> "1509" then warnlog "FTP Port => changes not saved!" + + if gPlatgroup = "w95" then + printlog " - change settings ( only windows )" + ProxyServer.Select 2 + + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + + printlog " - check changes" + ToolsOptions + hToolsOptions ( "Internet", "Proxy" ) + + if ProxyServer.GetSelIndex <> 2 then Warnlog "Proxy Server => changes not saved ( should be the 2nd entry )!" + end if + +'///reset to default settings + printlog " - reset settings" + ProxyServer.Select(3) ' manual + HTTPProxy.SetText lsSave (1) + HTTPPort.SetText lsSave (2) + FTPProxy.SetText lsSave (3) + FTPPort.SetText lsSave (4) + NoProxy.SetText lsSave (7) + ProxyServer.Select iSave + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///check the reset + printlog " - check default" +'///+open tools / options / internet / proxy + ToolsOptions + hToolsOptions ( "Internet", "Proxy" ) + if ProxyServer.GetSelIndex <> iSave then Warnlog "Proxy Server => changes not saved!" + if HTTPProxy.GetText <> lsSave (1) then warnlog "HTTP Proxy => changes not saved!" + if FTPProxy.GetText <> lsSave (3) then warnlog "FTP Proxy => changes not saved!" + if NoProxy.GetText <> lsSave (7) then warnlog "No Proxy => changes not saved!" + if FTPPort.GetText <> lsSave (4) AND FTPPort.GetText <> "0" then warnlog "FTP Port => changes not saved!" + if HTTPPort.GetText <> lsSave (2) AND HTTPPort.GetText <> "0" then warnlog "HTTP Port => changes not saved!" + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +endcase + +testcase tInternetSearch + Dim iSave, iInterim, i as Integer + Dim lbSave ( 3, 10 ) as boolean + Dim lsSave ( 6, 10 ) as String + +'///check if all settings are saved in configuration ( Internet / Search ) + +'///open a new document + hNewDocument +'///open tools / options / internet / search + ToolsOptions + hToolsOptions ( "Internet", "Search" ) + +'///save settings + printlog " - save settings" + iSave = SuchenIn.GetItemCount + if iSave > 8 then + Warnlog "Please change the index for this test, there are too many entries in the Search-List!" + iSave = 8 + end if + + for i=1 to iSave + SuchenIn.Select i + lsSave (1, i) = DienstName.GetText + lsSave (2, i) = Praefix.GetText + lsSave (3, i) = Suffix.GetText + lsSave (4, i) = Trenner.GetText + lsSave (5, i) = Schreibstil.GetSelText + + lbSave (1, i) = Und.IsChecked + lbSave (2, i) = Oder.IsChecked + lbSave (3, i) = Exakt.IsChecked + next i + +'///change settings and insert new entries + printlog " - change/insert settings" + if iSave > 0 then + SuchenIn.Select 1 + DienstName.SetText "AAAA_TT_Changes_Name" + Und.Check + Praefix.SetText "TT_Changes_Prefix" + Suffix.SetText "TT_Changes_Suffix" + Trenner.SetText ";;;;" + Schreibstil.Select 3 + Sleep (1) + Aendern.Click + end if + +'///+ insert an new entry named ( ZZZZ_TT_New_Name ) + Neu.Click + Sleep (1) + DienstName.SetText "ZZZZ_TT_New_Name" + Oder.Check + Praefix.SetText "TT_New_Prefix" + Suffix.SetText "TT_New_Suffix" + Trenner.SetText ":::::" + Schreibstil.Select 2 + Hinzufuegen.Click + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///+close the document + hCloseDocument + +'///exit and restart StarOffice + printlog " - exit/restart StarOffice" + ExitRestartTheOffice + +'///check the changes + printlog " - check changes" +'///+open tools / options / internet / search + ToolsOptions + hToolsOptions ( "Internet", "Search" ) + + iInterim = SuchenIn.GetItemCount + if iInterim = 0 then + Warnlog "No entrie in Search-List, entries are not saved! The test ends here! => BugID: 82922" + else + if iInterim <> ( iSave + 1 ) then + Warnlog "Not all entries in the Search-List are saved! => BugID: 82922" + else + for i=1 to iInterim + if i=1 then + SuchenIn.Select "AAAA_TT_Changes_Name" + if DienstName.GetText <> "AAAA_TT_Changes_Name" then Warnlog "AAAA_TT_Changes_Name : Name => changes not saved" + Und.Check + if Praefix.GetText <> "TT_Changes_Prefix" then Warnlog "AAAA_TT_Changes_Name : Prefix => changes not saved!" + if Suffix.GetText <> "TT_Changes_Suffix" then Warnlog "AAAA_TT_Changes_Name : Suffix => changes not saved!" + if Trenner.GetText <> ";;;;" then Warnlog "AAAA_TT_Changes_Name : Seperator => changes not saved!" + if Schreibstil.GetSelIndex <> 3 then Warnlog "AAAA_TT_Changes_Name : Case match => changes not saved! BugID:86660" + else + if i <> ( iSave + 1 ) then + SuchenIn.Select i + if DienstName.GetText <> lsSave (1, i) then Warnlog lsSave (1, i) + " : Name => old entry not saved correctly!" + if Und.IsChecked <> lbSave (1, i) then Warnlog lsSave (1, i) + " : Und => old entry not saved correctly!" + if Oder.IsChecked <> lbSave (2, i) then Warnlog lsSave (1, i) + " : Oder => old entry not saved correctly!" + if Exakt.IsChecked <> lbSave (3, i) then Warnlog lsSave (1, i) + " : Exakt => old entry not saved correctly!" + if Praefix.GetText <> lsSave (2, i) then Warnlog lsSave (1, i) + " : Prefix => old entry not saved correctly!" + if Suffix.GetText <> lsSave (3, i) then Warnlog lsSave (1, i) + " : Suffix => old entry not saved correctly!" + if Trenner.GetText <> lsSave (4, i) then Warnlog lsSave (1, i) + " : Seperator => old entry not saved correctly!" + if Schreibstil.GetSelText <> lsSave (5, i) then Warnlog lsSave (1, i) + " : Case match => old entry not saved correctly!" + else + SuchenIn.Select "ZZZZ_TT_New_Name" + if DienstName.GetText <> "ZZZZ_TT_New_Name" then Warnlog "ZZZZ_TT_New_Name : Name => new entry not saved correctly!" + Oder.Check + if Praefix.GetText <> "TT_New_Prefix" then Warnlog "ZZZZ_TT_New_Name : Prefix => new entry not saved correctly!" + if Suffix.GetText <> "TT_New_Suffix" then Warnlog "ZZZZ_TT_New_Name : Suffix => new entry not saved correctly!" + if Trenner.GetText <> ":::::" then Warnlog "ZZZZ_TT_New_Name : Seperator => new entry not saved correctly!" + if Schreibstil.GetSelIndex <> 2 then Warnlog "ZZZZ_TT_New_Name : Case match => new entry not saved correctly! BugID:86660" + end if + end if + next i + end if + +'///reset all settings + printlog " - reset settings" + SuchenIn.Select "AAAA_TT_Changes_Name" + DienstName.SetText lsSave (1, 1) + if lbSave(1, 1) = TRUE then Und.Check + if lbSave(2, 1) = TRUE then Oder.Check + if lbSave(3, 1) = TRUE then Exakt.Check + Praefix.SetText lsSave (2, 1) + Suffix.SetText lsSave (3, 1) + Trenner.SetText lsSave (4, 1) + Schreibstil.Select lsSave (5, 1) + Sleep (1) + Aendern.Click + Sleep (1) + + SuchenIn.Select "ZZZZ_TT_New_Name" + Sleep (1) + Loeschen.Click + Sleep (1) + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///check the reset + printlog " - check the reset" +'///+open tools / options / internet / search + ToolsOptions + hToolsOptions ( "Internet", "Search" ) + + iInterim = SuchenIn.GetItemCount + if iInterim <> iSave then + Warnlog "The default can't be reached!" + else + for i=1 to iInterim + SuchenIn.Select lsSave (1, i) + if DienstName.GetText <> lsSave (1, i) then Warnlog lsSave (1, i) + " : Name => old entry not saved correctly!" + if Und.IsChecked <> lbSave (1, i) then Warnlog lsSave (1, i) + " : Und => old entry not saved correctly!" + if Oder.IsChecked <> lbSave (2, i) then Warnlog lsSave (1, i) + " : Oder => old entry not saved correctly!" + if Exakt.IsChecked <> lbSave (3, i) then Warnlog lsSave (1, i) + " : Exakt => old entry not saved correctly!" + if Praefix.GetText <> lsSave (2, i) then Warnlog lsSave (1, i) + " : Prefix => old entry not saved correctly!" + if Suffix.GetText <> lsSave (3, i) then Warnlog lsSave (1, i) + " : Suffix => old entry not saved correctly!" + if Trenner.GetText <> lsSave (4, i) then Warnlog lsSave (1, i) + " : Seperator => old entry not saved correctly!" + if Schreibstil.GetSelText <> lsSave (5, i) then Warnlog lsSave (1, i) + " : Case match => old entry not saved correctly!" + next i + end if + end if + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +endcase + + diff --git a/testautomation/framework/optional/includes/options_lan1.inc b/testautomation/framework/optional/includes/options_lan1.inc new file mode 100755 index 000000000000..49025d4ac7eb --- /dev/null +++ b/testautomation/framework/optional/includes/options_lan1.inc @@ -0,0 +1,967 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_lan1.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : general option test (test for language-group) +'* +'\****************************************************************************** + +sub opt_lan1 + Dim bOld as Boolean + + bOld = ActiveDeactivateAsianSupport ( FALSE ) + + Call tLanguageSettingsLanguages + Call tLanguageSettingsWritingAids + + printlog "++ activate the asian support in StarOffice ++" + ActiveDeactivateAsianSupport ( TRUE ) + Call tLanguageSettingsJapaneseFind + Call tLanguageSettingsAsianLayout + + printlog "++ reset asian support in StarOffice to default ++" + if bOld = TRUE then + ActiveDeactivateAsianSupport ( TRUE ) + else + ActiveDeactivateAsianSupport ( FALSE ) + end if + +end sub + +'******************************************************************************* + +testcase tLanguageSettingsLanguages + + Dim lsSave ( 5 ) as String, lsSave2 (3) as String + Dim bChanged as Boolean, bSave as Boolean, bSave2 as Boolean + + bChanged = FALSE + + '///check if all settings are saved in configuration ( Language Settings / Languages ) + + '///open a new document + '///+open options 'Language settings' / 'languages' + + hNewDocument + ToolsOptions + hToolsOptions ( "LanguageSettings", "Languages" ) + + '///+check dependences in this dialog + '///+- asian support <-> listbox for default language for asian + printlog "- check dependences in this dialog" + printlog " - asian support" + if Aktivieren.IsChecked() = FALSE then + if Asiatisch.IsEnabled() = TRUE then + Warnlog "Asian support is not active, the listbox is in wrong state:" + printlog "...the language for asian is active => Perhaps #108220#" + end if + if Aktivieren.isEnabled then + Aktivieren.Check + else + qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'") + printlog Aktivieren.isEnabled + endif + if Asiatisch.IsEnabled() <> TRUE then + Warnlog "Asian support is active, the listbox is in wrong state:" + printlog "...language for asian is not active => BUG!" + end if + if Aktivieren.isEnabled then + Aktivieren.unCheck + else + qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'") + printlog Aktivieren.isEnabled + endif + else + if Asiatisch.IsEnabled() <> TRUE then + Warnlog "Asian support is not active, the listbox is in wrong state:" + printlog "...language for asian is not active => BUG!" + end if + if Aktivieren.isEnabled then + Aktivieren.unCheck + else + qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'") + printlog Aktivieren.isEnabled + endif + if Asiatisch.IsEnabled() = TRUE then + Warnlog "Asian support is active, the listbox is in wrong state:" + printlog "...language for asian is active => BUG!" + end if + if Aktivieren.isEnabled then + Aktivieren.Check + else + qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'") + printlog Aktivieren.isEnabled + endif + end if + + '///+- CTL support <-> listbox for default language for CTL + printlog " - CTL support" + if ComplexScriptEnabled.IsChecked() = FALSE then + if LanguageComplexScript.IsEnabled() = TRUE then + Warnlog "CTL support is not active, the listbox is in wrong state:" + printlog "...language for CTL is active => BUG!" + end if + ComplexScriptEnabled.Check() + if LanguageComplexScript.IsEnabled() <> TRUE then + Warnlog "CTL support is active, the listbox is in wrong state:" + printlog "...language for CTL is not active => BUG!" + end if + ComplexScriptEnabled.UnCheck() + else + if LanguageComplexScript.IsEnabled() <> TRUE then + Warnlog "CTL support is active, the listbox is in wrong state:" + printlog "...language for CTL is not active => BUG!" + end if + ComplexScriptEnabled.UnCheck() + if LanguageComplexScript.IsEnabled() = TRUE then + Warnlog "CTL support is not active, the listbox is in wrong state:" + printlog "...the language for CTL is active => BUG!" + end if + ComplexScriptEnabled.Check() + end if + + '///save raw data + printlog "- save raw data" + lsSave (1) = Gebietsschema.GetSelText() + lsSave (2) = StandardWaehrung.GetSelText() + lsSave (3) = Westlich.GetSelText() + bSave = Aktivieren.IsChecked() + if Aktivieren.isEnabled then + Aktivieren.Check + else + qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'") + printlog Aktivieren.isEnabled + endif + lsSave (4) = Asiatisch.GetSelText() + + if lsSave (4) = "" then + Warnlog "Empty entry is selected for 'Asian'! => Bug 102046" + endif + + bSave2 = ComplexScriptEnabled.IsChecked() + ComplexScriptEnabled.Check() + lsSave (5) = LanguageComplexScript.GetSelText() + + if lsSave (5) = "" then + Warnlog "Empty entry is selected for 'Complex script'! => Bug 102046" + endif + + '///+change all settings + printlog "- change settings" + select case iSprache + case 34 : Gebietsschema.Select( 40 ) + case 39 : Gebietsschema.Select( 17 ) + case 81 : Gebietsschema.Select( 22 ) + case 88 : Gebietsschema.Select( 19 ) + case else : Gebietsschema.Select( 15 ) + end select + StandardWaehrung.Select( 20 ) + Westlich.Select( 10 ) + lsSave2(1) = Westlich.GetSelText() + + if Aktivieren.isEnabled then + Aktivieren.Check + else + qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'") + printlog Aktivieren.isEnabled + endif + Asiatisch.Select( 5 ) + lsSave2(2) = Asiatisch.GetSelText() + AktuellesDokument.Uncheck() + + ComplexScriptEnabled.Check + LanguageComplexScript.Select( 7 ) + lsSave2 (3) = LanguageComplexScript.GetSelText() + + '///+close options dialog with OK, close all documents + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK() + Sleep ( 3 ) + + hCloseDocument + + '///+wait until StarOffice is out of memory and restart it + printlog "- exit/restart StarOffice" + ExitRestartTheOffice + + '///+open options 'Language settings' / 'languages' + '///+check all changes + printlog "- check changes" + ToolsOptions + hToolsOptions ( "LanguageSettings", "Languages" ) + + select case iSprache + case 34 : if Gebietsschema.GetSelIndex <> 40 then + Warnlog "locale settings => changes not saved!" + endif + case 39 : if Gebietsschema.GetSelIndex <> 17 then + Warnlog "locale settings => changes not saved!" + endif + case 81 : if Gebietsschema.GetSelIndex <> 22 then + Warnlog "locale settings => changes not saved!" + endif + case 88 : if Gebietsschema.GetSelIndex <> 19 then + Warnlog "locale settings => changes not saved!" + endif + case else : if Gebietsschema.GetSelIndex <> 15 then + Warnlog "locale settings => changes not saved!" + endif + end select + + if StandardWaehrung.GetSelIndex <> 20 then + Warnlog "default currency => changes not saved!" + endif + + if Westlich.GetSelText <> lsSave2(1) then + Warnlog "western => changes not saved! " + endif + + if Aktivieren.IsChecked <> TRUE then + Warnlog "Enabled asian support => changes not saved!" + endif + + if Asiatisch.GetSelText <> lsSave2(2) then + Warnlog "asian => changes not saved! " + endif + + if ComplexScriptEnabled.IsChecked <> TRUE then + Warnlog "CTL support => changes not saved!" + endif + + if LanguageComplexScript.GetSelText <> lsSave2 (3) then + Warnlog "CTL language => changes not saved! " + endif + + '///+set all to default and close options dialog with OK + printlog "- set to default" + Gebietsschema.Select lsSave(1) + StandardWaehrung.Select lsSave (2) + Westlich.Select lsSave (3) + AktuellesDokument.Uncheck() + if Aktivieren.isEnabled then + Aktivieren.Check + else + qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'") + printlog Aktivieren.isEnabled + endif + + if lsSave (4) <> "" then + Asiatisch.Select lsSave (4) + else + Asiatisch.Select 1 + end if + + if Aktivieren.isEnabled then + if bSave = TRUE then + Aktivieren.Check + else + Aktivieren.Uncheck + endif + else + qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'") + printlog Aktivieren.isEnabled + endif + ComplexScriptEnabled.Check() + + if lsSave (5) <> "" then + LanguageComplexScript.Select( lsSave(5) ) + else + LanguageComplexScript.Select( 1 ) + end if + + if bSave2 = TRUE then + ComplexScriptEnabled.Check() + else + ComplexScriptEnabled.Uncheck() + endif + + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK() + Sleep (3) + + '///+open options 'Language settings' / 'languages' + '///+check the default settings + printlog "- check the data" + ToolsOptions + hToolsOptions ( "LanguageSettings", "Languages" ) + + if Gebietsschema.GetSelText() <> lsSave(1) then + Warnlog "locale settings => changes not saved! => BugID : 87977" + endif + + if StandardWaehrung.GetSelText() <> lsSave(2) then + Warnlog "default currency => changes not saved!" + endif + + if Westlich.GetSelText() <> lsSave (3) then + Warnlog "western => changes not saved!" + endif + + if Aktivieren.IsChecked() <> bSave then + Warnlog "Enabled asian support => changes not saved!" + endif + + if Aktivieren.isEnabled then + Aktivieren.Check + else + qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'") + printlog Aktivieren.isEnabled + endif + if lsSave (4) <> "" then + if Asiatisch.GetSelText() <> lsSave (4) then + Warnlog "asian => changes not saved!" + endif + end if + + if ComplexScriptEnabled.IsChecked() <> bSave2 then + Warnlog "CTL support => changes not saved!" + endif + + ComplexScriptEnabled.Check() + + if lsSave (5) <> "" then + if LanguageComplexScript.GetSelText() <> lsSave (5) then + Warnlog "CTL language => changes not saved! " + endif + end if + if Aktivieren.isEnabled then + if bSave = TRUE then + Aktivieren.Check + else + Aktivieren.Uncheck + endif + else + qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'") + printlog Aktivieren.isEnabled + endif + if bSave2 = TRUE then + ComplexScriptEnabled.Check() + else + ComplexScriptEnabled.Uncheck() + endif + + '///+close the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK() + Sleep (3) +endcase + +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +testcase tLanguageSettingsWritingAids + + Dim lbSave1 ( 5 ) as Boolean + Dim lbSave2 ( 5 ) as Boolean + Dim lbSave3 ( 15 ) as Boolean + dim iCounter as Integer + Dim i as Integer, iCounter1 as Integer, iCounter2 as Integer, iCounter3 as Integer + + '///check if all settings are saved in configuration ( Language Settings / writing aids ) + + '///open a new document + '///+open options 'Language settings' / 'writing aids' + + hNewDocument + ToolsOptions + hToolsOptions ( "LanguageSettings", "WritingAids" ) + + '///+save raw data and inverted all settings + printlog " - save raw data / and inverted settings" + iCounter1 = Sprachmodule.GetItemCount + Sprachmodule.TypeKeys "<PageUp>", 6 + + for i=1 to iCounter1 + lbSave1 (i) = Sprachmodule.IsChecked + if lbSave1 (i) = TRUE then Sprachmodule.Uncheck else Sprachmodule.Check + Sprachmodule.TypeKeys "<Down>" + next i + + iCounter2 = Benutzerwoerterbuch.GetItemCount + Benutzerwoerterbuch.TypeKeys "<PageUp>", 6 + + for i=1 to iCounter2 - 1 + lbSave2 (i) = Benutzerwoerterbuch.IsChecked + if lbSave2 (i) = TRUE then Benutzerwoerterbuch.Uncheck else Benutzerwoerterbuch.Check + Benutzerwoerterbuch.TypeKeys "<Down>" + next i + + '///+- last entry of 'User-defined dictionaries' - internal IgnoreAll-List - cannot be changed + if Benutzerwoerterbuch.IsChecked <> TRUE then + Warnlog "Last entry in 'User-defined dictionaries' should be checked ( internal Ignore-All List ), but it isn't => BUG?!" + endif + + iCounter3 = Optionen.GetItemCount + Optionen.TypeKeys "<PageUp>", 6 + for i=1 to iCounter3 + if i<>9 AND i<>10 AND i<>11 then + lbSave3 (i) = Optionen.IsChecked + if lbSave3 (i) = TRUE then Optionen.Uncheck else Optionen.Check + end if + Optionen.TypeKeys "<Down>" + next i + + '///+close options dialog with OK, close all documents and exit StarOffice + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + hCloseDocument + + '///+wait until StarOffice is out of memory and restart it + printlog " - exit/restart StarOffice" + ExitRestartTheOffice + + '///+open options 'Language settings' / 'writing aids' + '///+check all changes + printlog " - check changes" + + hNewDocument + + ToolsOptions + hToolsOptions ( "LanguageSettings", "WritingAids" ) + printlog " 'available language modules'" + Sprachmodule.TypeKeys "<PageUp>", 6 + + for i=1 to iCounter1 + if Sprachmodule.Ischecked = lbSave1 (i) then + Warnlog "entry no. " + i + " => changes not saved! perhaps #i15841!" + end if + Sprachmodule.TypeKeys "<Down>" + next i + + printlog " 'user-definded dictonaries'" + Benutzerwoerterbuch.TypeKeys "<PageUp>", 6 + + for i=1 to iCounter2 - 1 + if Benutzerwoerterbuch.Ischecked = lbSave2 (i) then Warnlog "entry no. " + i + " => changes not saved!" + Benutzerwoerterbuch.TypeKeys "<Down>" + next i + + if Benutzerwoerterbuch.IsChecked <> TRUE then + Warnlog "Last entry in 'User-defined dictionaries' should be checked ( internal Ignore-All List ), but it isn't => BUG?!" + endif + + printlog " 'options'" + Optionen.TypeKeys "<PageUp>", 6 + for i=1 to iCounter3 + '///+- options list : entry 9, 10 and 11 are depend only at a document => cannot check globally + if i<>9 AND i<>10 AND i<>11 then + if Optionen.IsChecked = lbSave3 (i) then Warnlog "entry no. " + i + " => changes not saved!" + end if + Optionen.TypeKeys "<Down>" + next i + + '///+make different changes in options list + printlog " - make second changes" + Optionen.TypeKeys "<PageUp>", 6 + + for i=1 to iCounter3 + if i=1 then Optionen.Uncheck + if i=3 then Optionen.Check + if i=5 then Optionen.Uncheck + if i=6 then Optionen.Check + if i=7 then Optionen.Uncheck + if i=12 then Optionen.Check + Optionen.TypeKeys "<Down>" + next i + + '///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + + hCloseDocument + + '///+open options 'Language settings' / 'writing aids' + '///+check second changes + printlog " - check second changes" + ToolsOptions + hToolsOptions ( "LanguageSettings", "WritingAids" ) + Optionen.TypeKeys "<PageUp>", 6 + + for i=1 to iCounter + select case i + case 1 : if Optionen.IsChecked <> FALSE then + Warnlog "entry no. 1 => changes not saved!" + endif + case 3 : if Optionen.IsChecked <> TRUE then + Warnlog "entry no. 3 => changes not saved!" + endif + case 5 : if Optionen.IsChecked <> FALSE then + Warnlog "entry no. 5 => changes not saved!" + endif + case 6 : if Optionen.IsChecked <> TRUE then + Warnlog "entry no. 6 => changes not saved!" + endif + case 7 : if Optionen.IsChecked <> FALSE then + printlog "entry no. 7 => not saved! => it is only for documents" + endif + case 12 : if Optionen.IsChecked <> TRUE then + Warnlog "entry no. 12 => changes not saved!" + endif + end select + Optionen.TypeKeys "<Down>" + next i + + '///+reset all to default settings + printlog " - reset settings" + Sprachmodule.TypeKeys "<PageUp>", 6 + + for i=1 to iCounter1 + if lbSave1 (i) = TRUE then Sprachmodule.Check else Sprachmodule.UnCheck + Sprachmodule.TypeKeys "<Down>" + next i + + Benutzerwoerterbuch.TypeKeys "<PageUp>", 6 + + for i=1 to iCounter2 - 1 + if lbSave2 (i) = TRUE then Benutzerwoerterbuch.Check else Benutzerwoerterbuch.UnCheck + Benutzerwoerterbuch.TypeKeys "<Down>" + next i + + Optionen.TypeKeys "<PageUp>", 6 + + for i=1 to iCounter3 + if i<>9 AND i<>10 AND i<>11 then + if lbSave3 (i) = TRUE then Optionen.Check else Optionen.UnCheck + end if + Optionen.TypeKeys "<Down>" + next i + + '///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + + '///+open options 'Language settings' / 'writing aids' + '///+check the changes + printlog " - check raw data" + ToolsOptions + hToolsOptions ( "LanguageSettings", "WritingAids" ) + + printlog " 'available language modules'" + Sprachmodule.TypeKeys "<PageUp>", 6 + + for i=1 to iCounter1 + if Sprachmodule.Ischecked <> lbSave1 (i) then Warnlog "entry no. " + i + " => changes not saved!" + Sprachmodule.TypeKeys "<Down>" + next i + + printlog " 'user-definded dictonaries'" + Benutzerwoerterbuch.TypeKeys "<PageUp>", 6 + for i=1 to iCounter2 - 1 + if Benutzerwoerterbuch.Ischecked <> lbSave2 (i) then Warnlog "entry no. " + i + " => changes not saved!" + Benutzerwoerterbuch.TypeKeys "<Down>" + next i + + printlog " 'options'" + Optionen.TypeKeys "<PageUp>", 6 + for i=1 to iCounter3 + '///+- options list : entry 9, 10 and 11 are depend only at a document => cannot check globally + if i<>9 AND i<>10 AND i<>11 then + if Optionen.IsChecked <> lbSave3 (i) then Warnlog "entry no. " + i + " => changes not saved!" + end if + Optionen.TypeKeys "<Down>" + next i + + '///+close options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) +endcase + +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +testcase tLanguageSettingsJapaneseFind + Dim bSave ( 20 ) as Boolean + +'///check if all settings are saved in configuration ( Language Settings / Japanese find ) => asian support must be activated +'///open a new document +'///+open options 'Language settings' / 'japanese find' + + hNewDocument + ToolsOptions + hToolsOptions ( "LanguageSettings", "SearchingInJapanese" ) + +'///+save raw data and inverted all settings + printlog " - save data" + bSave (1 ) = MatchCase.IsChecked + bSave (2 ) = MatchFullHalf.IsChecked + bSave (3 ) = MatchHiraganaKatakana.IsChecked + bSave (4 ) = MatchContractions.IsChecked + bSave (5 ) = MatchMinusDashChoOn.IsChecked + bSave (6 ) = MatchRepeatcharacterMarks.IsChecked + bSave (7 ) = MatchVariantFormKanji.IsChecked + bSave (8 ) = MatchOldKanaForms.IsChecked + bSave (9 ) = MatchDiZiDuZu.IsChecked + bSave (10) = MatchBaVaHaFa.IsChecked + bSave (11) = MatchTsiThiChiDhiZi.IsChecked + bSave (12) = MatchHyuFyuByuVyu.IsChecked + bSave (13) = MatchDeSheZeJe.IsChecked + bSave (14) = MatchIaIya.IsChecked + bSave (15) = MatchKiKu.IsChecked + bSave (16) = PunctuationCharacters.IsChecked + bSave (17) = WhitespaceCharacters.IsChecked + bSave (18) = ProlongedSoundmarks.IsChecked + bSave (19) = MiddleDots.IsChecked + + printlog " - invert data" + if bSave (1 ) = TRUE then MatchCase.Uncheck else MatchCase.Check + if bSave (2 ) = TRUE then MatchFullHalf.Uncheck else MatchFullHalf.Check + if bSave (3 ) = TRUE then MatchHiraganaKatakana.Uncheck else MatchHiraganaKatakana.Check + if bSave (4 ) = TRUE then MatchContractions.Uncheck else MatchContractions.Check + if bSave (5 ) = TRUE then MatchMinusDashChoOn.Uncheck else MatchMinusDashChoOn.Check + if bSave (6 ) = TRUE then MatchRepeatcharacterMarks.Uncheck else MatchRepeatcharacterMarks.Check + if bSave (7 ) = TRUE then MatchVariantFormKanji.Uncheck else MatchVariantFormKanji.Check + if bSave (8 ) = TRUE then MatchOldKanaForms.Uncheck else MatchOldKanaForms.Check + if bSave (9 ) = TRUE then MatchDiZiDuZu.Uncheck else MatchDiZiDuZu.Check + if bSave (10) = TRUE then MatchBaVaHaFa.Uncheck else MatchBaVaHaFa.Check + if bSave (11) = TRUE then MatchTsiThiChiDhiZi.Uncheck else MatchTsiThiChiDhiZi.Check + if bSave (12) = TRUE then MatchHyuFyuByuVyu.Uncheck else MatchHyuFyuByuVyu.Check + if bSave (13) = TRUE then MatchDeSheZeJe.Uncheck else MatchDeSheZeJe.Check + if bSave (14) = TRUE then MatchIaIya.Uncheck else MatchIaIya.Check + if bSave (15) = TRUE then MatchKiKu.Uncheck else MatchKiKu.Check + if bSave (16) = TRUE then PunctuationCharacters.Uncheck else PunctuationCharacters.Check + if bSave (17) = TRUE then WhitespaceCharacters.Uncheck else WhitespaceCharacters.Check + if bSave (18) = TRUE then ProlongedSoundmarks.Uncheck else ProlongedSoundmarks.Check + if bSave (19) = TRUE then MiddleDots.Uncheck else MiddleDots.Check + +'///+close options dialog with OK, close all documents and exit StarOffice + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + hCloseDocument + +'///+wait until StarOffice is out of memory and restart it + printlog " - exit/restart StarOffice" + ExitRestartTheOffice + +'///+open options 'Language settings' / 'japanese find' +'///+check all changes + printlog " - check changes" + ToolsOptions + hToolsOptions ( "LanguageSettings", "SearchingInJapanese" ) + + if MatchCase.IsChecked = bSave (1 ) then Warnlog "Match Case => changes not saved!" + if MatchFullHalf.IsChecked = bSave (2 ) then Warnlog "Match Full Half => changes not saved!" + if MatchHiraganaKatakana.IsChecked = bSave (3 ) then Warnlog "Match Hiragana Katakana => changes not saved!" + if MatchContractions.IsChecked = bSave (4 ) then Warnlog "Match Contractions => changes not saved!" + if MatchMinusDashChoOn.IsChecked = bSave (5 ) then Warnlog "Match Minus Dash Cho On => changes not saved!" + if MatchRepeatcharacterMarks.IsChecked = bSave (6 ) then Warnlog "Match Repeatcharacter Marks => changes not saved!" + if MatchVariantFormKanji.IsChecked = bSave (7 ) then Warnlog "Match Variant Form Kanji => changes not saved!" + if MatchOldKanaForms.IsChecked = bSave (8 ) then Warnlog "Match Old Kana Forms => changes not saved!" + if MatchDiZiDuZu.IsChecked = bSave (9 ) then Warnlog "Match Di Zi Du Zu => changes not saved!" + if MatchBaVaHaFa.IsChecked = bSave (10) then Warnlog "Match Ba Va Ha Fa => changes not saved!" + if MatchTsiThiChiDhiZi.IsChecked = bSave (11) then Warnlog "Match Tsi Thi Chi Dhi Zi => changes not saved!" + if MatchHyuFyuByuVyu.IsChecked = bSave (12) then Warnlog "Match Hyu Iyu Byu Vyu => changes not saved!" + if MatchDeSheZeJe.IsChecked = bSave (13) then Warnlog "Match De She Ze Je => changes not saved!" + if MatchIaIya.IsChecked = bSave (14) then Warnlog "Match Ia Iya => changes not saved!" + if MatchKiKu.IsChecked = bSave (15) then Warnlog "Match Ki Ku => changes not saved!" + if PunctuationCharacters.IsChecked = bSave (16) then Warnlog "Punctuation Characters => changes not saved!" + if WhitespaceCharacters.IsChecked = bSave (17) then Warnlog "Whitespace Characters => changes not saved!" + if ProlongedSoundmarks.IsChecked = bSave (18) then Warnlog "Prolonged Soundmarks => changes not saved!" + if MiddleDots.IsChecked = bSave (19) then Warnlog "Middle Dots => changes not saved!" + +'///+make different changes + printlog " - second changes" + MatchCase.Check + MatchFullHalf.Uncheck + MatchHiraganaKatakana.Check + MatchContractions.Check + MatchMinusDashChoOn.Uncheck + MatchRepeatcharacterMarks.Uncheck + MatchVariantFormKanji.Check + MatchOldKanaForms.Check + MatchDiZiDuZu.Uncheck + MatchBaVaHaFa.Check + MatchTsiThiChiDhiZi.Uncheck + MatchHyuFyuByuVyu.Check + MatchDeSheZeJe.Uncheck + MatchIaIya.Check + MatchKiKu.Uncheck + PunctuationCharacters.Uncheck + WhitespaceCharacters.Uncheck + ProlongedSoundmarks.Uncheck + MiddleDots.Check + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///+open options 'Language settings' / 'japanese find' +'///+check the second changes + printlog " - check changes" + ToolsOptions + hToolsOptions ( "LanguageSettings", "SearchingInJapanese" ) + + if MatchCase.IsChecked <> TRUE then Warnlog "Match Case => changes not saved!" + if MatchFullHalf.IsChecked <> FALSE then Warnlog "Match Full Half => changes not saved!" + if MatchHiraganaKatakana.IsChecked <> TRUE then Warnlog "Match Hiragana Katakana => changes not saved!" + if MatchContractions.IsChecked <> TRUE then Warnlog "Match Contractions => changes not saved!" + if MatchMinusDashChoOn.IsChecked <> FALSE then Warnlog "Match Minus Dash Cho On => changes not saved!" + if MatchRepeatcharacterMarks.IsChecked <> FALSE then Warnlog "Match Repeatcharacter Marks => changes not saved!" + if MatchVariantFormKanji.IsChecked <> TRUE then Warnlog "Match Variant Form Kanji => changes not saved!" + if MatchOldKanaForms.IsChecked <> TRUE then Warnlog "Match Old Kana Forms => changes not saved!" + if MatchDiZiDuZu.IsChecked <> FALSE then Warnlog "Match Di Zi Du Zu => changes not saved!" + if MatchBaVaHaFa.IsChecked <> TRUE then Warnlog "Match Ba Va Ha Fa => changes not saved!" + if MatchTsiThiChiDhiZi.IsChecked <> FALSE then Warnlog "Match Tsi Thi Chi Dhi Zi => changes not saved!" + if MatchHyuFyuByuVyu.IsChecked <> TRUE then Warnlog "Match Hyu Iyu Byu Vyu => changes not saved!" + if MatchDeSheZeJe.IsChecked <> FALSE then Warnlog "Match De She Ze Je => changes not saved!" + if MatchIaIya.IsChecked <> TRUE then Warnlog "Match Ia Iya => changes not saved!" + if MatchKiKu.IsChecked <> FALSE then Warnlog "Match Ki Ku => changes not saved!" + if PunctuationCharacters.IsChecked <> FALSE then Warnlog "Punctuation Characters => changes not saved!" + if WhitespaceCharacters.IsChecked <> FALSE then Warnlog "Whitespace Characters => changes not saved!" + if ProlongedSoundmarks.IsChecked <> FALSE then Warnlog "Prolonged Soundmarks => changes not saved!" + if MiddleDots.IsChecked <> TRUE then Warnlog "Middle Dots => changes not saved!" + +'///+reset all settings to default + printlog " - reset to saved data" + if bSave (1 ) = TRUE then MatchCase.Check else MatchCase.UnCheck + if bSave (2 ) = TRUE then MatchFullHalf.Check else MatchFullHalf.UnCheck + if bSave (3 ) = TRUE then MatchHiraganaKatakana.Check else MatchHiraganaKatakana.UnCheck + if bSave (4 ) = TRUE then MatchContractions.Check else MatchContractions.UnCheck + if bSave (5 ) = TRUE then MatchMinusDashChoOn.Check else MatchMinusDashChoOn.UnCheck + if bSave (6 ) = TRUE then MatchRepeatcharacterMarks.Check else MatchRepeatcharacterMarks.UnCheck + if bSave (7 ) = TRUE then MatchVariantFormKanji.Check else MatchVariantFormKanji.UnCheck + if bSave (8 ) = TRUE then MatchOldKanaForms.Check else MatchOldKanaForms.UnCheck + if bSave (9 ) = TRUE then MatchDiZiDuZu.Check else MatchDiZiDuZu.UnCheck + if bSave (10) = TRUE then MatchBaVaHaFa.Check else MatchBaVaHaFa.UnCheck + if bSave (11) = TRUE then MatchTsiThiChiDhiZi.Check else MatchTsiThiChiDhiZi.UnCheck + if bSave (12) = TRUE then MatchHyuFyuByuVyu.Check else MatchHyuFyuByuVyu.UnCheck + if bSave (13) = TRUE then MatchDeSheZeJe.Check else MatchDeSheZeJe.UnCheck + if bSave (14) = TRUE then MatchIaIya.Check else MatchIaIya.UnCheck + if bSave (15) = TRUE then MatchKiKu.Check else MatchKiKu.UnCheck + if bSave (16) = TRUE then PunctuationCharacters.Check else PunctuationCharacters.UnCheck + if bSave (17) = TRUE then WhitespaceCharacters.Check else WhitespaceCharacters.UnCheck + if bSave (18) = TRUE then ProlongedSoundmarks.Check else ProlongedSoundmarks.UnCheck + if bSave (19) = TRUE then MiddleDots.Check else MiddleDots.UnCheck + +'///+close options dialoge with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///+open options 'Language settings' / 'japanese find' +'///+check the raw data + printlog " - check saved data" + ToolsOptions + hToolsOptions ( "LanguageSettings", "SearchingInJapanese" ) + + if MatchCase.IsChecked <> bSave (1 ) then Warnlog "Match Case => changes not saved!" + if MatchFullHalf.IsChecked <> bSave (2 ) then Warnlog "Match Full Half => changes not saved!" + if MatchHiraganaKatakana.IsChecked <> bSave (3 ) then Warnlog "Match Hiragana Katakana => changes not saved!" + if MatchContractions.IsChecked <> bSave (4 ) then Warnlog "Match Contractions => changes not saved!" + if MatchMinusDashChoOn.IsChecked <> bSave (5 ) then Warnlog "Match Minus Dash Cho On => changes not saved!" + if MatchRepeatcharacterMarks.IsChecked <> bSave (6 ) then Warnlog "Match Repeatcharacter Marks => changes not saved!" + if MatchVariantFormKanji.IsChecked <> bSave (7 ) then Warnlog "Match Variant Form Kanji => changes not saved!" + if MatchOldKanaForms.IsChecked <> bSave (8 ) then Warnlog "Match Old Kana Forms => changes not saved!" + if MatchDiZiDuZu.IsChecked <> bSave (9 ) then Warnlog "Match Di Zi Du Zu => changes not saved!" + if MatchBaVaHaFa.IsChecked <> bSave (10) then Warnlog "Match Ba Va Ha Fa => changes not saved!" + if MatchTsiThiChiDhiZi.IsChecked <> bSave (11) then Warnlog "Match Tsi Thi Chi Dhi Zi => changes not saved!" + if MatchHyuFyuByuVyu.IsChecked <> bSave (12) then Warnlog "Match Hyu Fyu Byu Vyu => changes not saved!" + if MatchDeSheZeJe.IsChecked <> bSave (13) then Warnlog "Match De She Ze Je => changes not saved!" + if MatchIaIya.IsChecked <> bSave (14) then Warnlog "Match Ia Iya => changes not saved!" + if MatchKiKu.IsChecked <> bSave (15) then Warnlog "Match Ki Ku => changes not saved!" + if PunctuationCharacters.IsChecked <> bSave (16) then Warnlog "Punctuation Characters => changes not saved!" + if WhitespaceCharacters.IsChecked <> bSave (17) then Warnlog "Whitespace Characters => changes not saved!" + if ProlongedSoundmarks.IsChecked <> bSave (18) then Warnlog "Prolonged Soundmarks => changes not saved!" + if MiddleDots.IsChecked <> bSave (19) then Warnlog "Middle Dots => changes not saved!" + +'///+close options dialoge + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +endcase + +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +testcase tLanguageSettingsAsianLayout + Dim bSave ( 20 ) as Boolean + Dim sSave ( 20 ) as String + Dim i as Integer, iLan as Integer + +'///check if all settings are saved in configuration ( Language Settings / Asian Layout ) => asian support must be activated + +'///open a new document +'///+open options 'Language settings' / 'asian layout' + hNewDocument + ToolsOptions + hToolsOptions ( "LanguageSettings", "AsianLayout" ) + +'///+save raw data + printlog " - save raw data" + bSave ( 1 ) = WesternCharactersOnly.IsChecked + bSave ( 2 ) = WesternTextAndPunctuation.IsChecked + bSave ( 3 ) = NoCompression.IsChecked + bSave ( 4 ) = CompressPunctuationOnly.IsChecked + bSave ( 5 ) = CompressPunctuationAndJapaneseKana.IsChecked + + iLan = Language.GetItemCount + if iLan > 4 then + Warnlog "There are more than 4 languages in the list. The test break here, because it can't work with more than 4 entries. Bug?!?" + goto endsub + end if + + for i=1 to iLan + Language.Select i + sSave ( i ) = Language.GetSelText + bSave ( 5+i ) = Standard.IsChecked + Standard.Uncheck + sSave ( 5+i ) = NoStartOfLine.GetText + sSave ( 10+i ) = NoEndOfLine.GetText + if bSave ( 5+1 ) = TRUE then + Standard.Check + else + Standard.Uncheck + end if + next i + +'///+change all settings + printlog " - change data" + WesternTextAndPunctuation.Check + CompressPunctuationOnly.Check + for i=1 to Language.GetItemCount + Language.Select i + Standard.UnCheck + select case i + case 1 : NoStartOfLine.SetText "avc" : NoEndOfLine.SetText "vca" + case 2 : NoStartOfLine.SetText ">" : NoEndOfLine.SetText "<" + case 3 : NoStartOfLine.SetText "!d?$" : NoEndOfLine.SetText "!d?$" + case 4 : NoStartOfLine.SetText "aS$%6" : NoEndOfLine.SetText "aS$$6" + end select + next i + +'///+close options dialog with OK, close all documents and exit StarOffice + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + hCloseDocument + +'///+wait until StarOffice is out of memory and restart it + printlog " - exit/restart StarOffice" + ExitRestartTheOffice + +'///+open options 'Language settings' / 'asian layout' +'///+check the changes + printlog " - check changes" + ToolsOptions + hToolsOptions ( "LanguageSettings", "AsianLayout" ) + + if WesternTextAndPunctuation.IsChecked <> TRUE then Warnlog "Western Text And Punctuation => changes not saved!" + if CompressPunctuationOnly.IsChecked <> TRUE then Warnlog "Compress Punctuation Only => changes not saved!" + for i=1 to iLan + Language.Select i + if Language.GetSelText <> sSave (i) then Warnlog "The language-entries are changed!" + if Standard.IsChecked then + Warnlog sSave(i) + " : Standard is not unchecked" + Standard.Uncheck + end if + select case i + case 1 : if NoStartOfLine.GetText <> "avc" then Warnlog sSave (i) + " : NoStartOfLine -> changes not saved" + if NoEndOfLine.GetText <> "vca" then Warnlog sSave (i) + " : NoEndOfLine -> changes not saved" + case 2 : if NoStartOfLine.GetText <> ">" then Warnlog sSave (i) + " : NoStartOfLine -> changes not saved" + if NoEndOfLine.GetText <> "<" then Warnlog sSave (i) + " : NoEndOfLine -> changes not saved" + case 3 : if NoStartOfLine.GetText <> "!d?$" then Warnlog sSave (i) + " : NoStartOfLine -> changes not saved" + if NoEndOfLine.GetText <> "!d?$" then Warnlog sSave (i) + " : NoEndOfLine -> changes not saved" + case 4 : if NoStartOfLine.GetText <> "aS$%6" then Warnlog sSave (i) + " : NoStartOfLine -> changes not saved" + if NoEndOfLine.GetText <> "aS$$6" then Warnlog sSave (i) + " : NoEndOfLine -> changes not saved" + end select + next i + +'///+make different changes + printlog " - second changes" + WesternCharactersOnly.Check + CompressPunctuationAndJapaneseKana.Check + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///+open options 'Language settings' / 'asian layout' +'///+check the changes + printlog " - check changes" + ToolsOptions + hToolsOptions ( "LanguageSettings", "AsianLayout" ) + + if WesternCharactersOnly.IsChecked <> TRUE then Warnlog "Western Characters Only => changes not saved!" + if CompressPunctuationAndJapaneseKana.IsChecked <> TRUE then Warnlog "Compress Punctuation And Japanese Kana => changes not saved!" + +'///+reset all changes to default data + printlog " - reset to saved data" + if bSave ( 1 ) = TRUE then WesternCharactersOnly.Check + if bSave ( 2 ) = TRUE then WesternTextAndPunctuation.Check + if bSave ( 3 ) = TRUE then NoCompression.Check + if bSave ( 4 ) = TRUE then CompressPunctuationOnly.Check + if bSave ( 5 ) = TRUE then CompressPunctuationAndJapaneseKana.Check + + for i=1 to iLan + Language.Select sSave(i) + Standard.Uncheck + NoStartOfLine.SetText sSave ( 5+i ) + NoEndOfLine.SetText sSave ( 10+i ) + if bSave ( 5+i ) = TRUE then Standard.Check else Standard.Uncheck + next i + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///+open options 'Language settings' / 'asian layout' +'///+check raw data + printlog " - check reset" + ToolsOptions + hToolsOptions ( "LanguageSettings", "AsianLayout" ) + + if WesternCharactersOnly.IsChecked <> bSave ( 1 ) then Warnlog "Western Characters Only => changes not saved!" + if WesternTextAndPunctuation.IsChecked <> bSave ( 2 ) then Warnlog "Western Text And Punctuation => changes not saved!" + if NoCompression.IsChecked <> bSave ( 3 ) then Warnlog "No Compression => changes not saved!" + if CompressPunctuationOnly.IsChecked <> bSave ( 4 ) then Warnlog "Compress Punctuation Only => changes not saved!" + if CompressPunctuationAndJapaneseKana.IsChecked <> bSave ( 5 ) then Warnlog "Compress Punctuation And Japanese Kana => changes not saved!" + for i=1 to iLan + Language.Select sSave(i) + if Standard.IsChecked <> bSave ( 5+i ) then Warnlog sSave(i) + " : Standard -> changes not saved" + Standard.Uncheck + if NoStartOfLine.GetText <> sSave ( 5+i ) then Warnlog sSave(i) + " : NoStartOfLine -> changes not saved" + if NoEndOfLine.GetText <> sSave ( 10+i ) then Warnlog sSave(i) + " : NoEndOfLine -> changes not saved" + if bSave ( 5+i ) = TRUE then Standard.Check else Standard.Uncheck + next i + +'///+close options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) +endcase diff --git a/testautomation/framework/optional/includes/options_loadsave_general.inc b/testautomation/framework/optional/includes/options_loadsave_general.inc new file mode 100755 index 000000000000..798cdc5f7397 --- /dev/null +++ b/testautomation/framework/optional/includes/options_loadsave_general.inc @@ -0,0 +1,308 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_loadsave_general.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : Tools->Options Load/Save: General +'* +'\****************************************************************************** + +testcase tLoadSaveGeneral + Dim lbSave(15) as Boolean + Dim lsSave(20) as String + Dim AppCount as Integer + dim i as Integer + + '///check if all settings are saved in configuration ( Load & Save / General ) + + '///+open tools / options / load & save / general + ToolsOptions + hToolsOptions("LoadSave","General") + '///save old settings + printlog " - save old settings" + lbSave(13) = BenutzerspezifischeEinstellungen.IsChecked + lbSave(1) = DokumenteigenschaftenBearbeiten.IsChecked + lbSave(2) = Sicherungskopie.IsChecked + lbSave(3) = AutomatischSpeichern.IsChecked + + if AutomatischSpeichern.IsChecked then + lsSave(1) = Minuten.GetText + endif + + lbSave(10) = NoPrettyPrinting.IsChecked + lbSave(11) = URLimDateisystem.IsChecked + lbSave(12) = URLimInternet.IsChecked + + printlog("Listed Documenttypes are: ") + AppCount = Dokumenttyp.GetItemCount + if (AppCount > 7) then + Warnlog( "Seven applications should be listed, there are " & AppCount ) + for i = 1 to AppCount + DokumentTyp.select(i) + printlog( " - " & DokumentTyp.getSelText) + next i + endif + for i=1 to AppCount + Dokumenttyp.Select(i) + lsSave(2+i) = Dokumenttyp.GetSelText + lsSave(2+AppCount+i) = Filter.GetSelText + next i + + '///+invert and change all settings + printlog " - invert/change settings" + if lbSave(13) then BenutzerspezifischeEinstellungen.UnCheck else BenutzerspezifischeEinstellungen.Check + if lbSave(1) then DokumenteigenschaftenBearbeiten.Uncheck else DokumenteigenschaftenBearbeiten.Check + if lbSave(2) then Sicherungskopie.Uncheck else Sicherungskopie.Check + if lbSave(3) then AutomatischSpeichern.Uncheck else AutomatischSpeichern.Check + if AutomatischSpeichern.IsChecked then + lsSave(1) = Minuten.GetText + Minuten.SetText "23" + endif + if lbSave(10) then NoPrettyPrinting.Uncheck else NoPrettyPrinting.Check + if lbSave(11) then URLimDateisystem.Uncheck else URLimDateisystem.Check + if lbSave(12) then URLimInternet.Uncheck else URLimInternet.Check + printlog( "Setting filters for documenttypes: Select third item from every list" ) + for i=1 to AppCount + Dokumenttyp.Select(i) + Filter.Select(3) + printlog( "Doctype: " & Dokumenttyp.getSelText() & " has filter: " & Filter.getSelText() ) + next i + + '///+close options dialog with OK + printlog " - close options-dlg with OK" + kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + sleep(3) + + '///exit and restart StarOffice + printlog " - exit/restart StarOffice" + ExitRestartTheOffice + + '///check inverting and changes + printlog " - check inverting/changes" + '///+open tools / options / load & save / general + ToolsOptions + hToolsOptions ( "LoadSave", "General" ) + + if BenutzerspezifischeEinstellungen.IsChecked = lbSave ( 13 ) then + Warnlog "'Load user setting with document' => changes not saved" + endif + if DokumenteigenschaftenBearbeiten.IsChecked = lbSave ( 1 ) then + Warnlog "'Edit document properties before saving' => changes not saved" + endif + if Sicherungskopie.IsChecked = lbSave ( 2 ) then + Warnlog "'Create backup copy' => changes not saved" + endif + if AutomatischSpeichern.IsChecked = lbSave ( 3 ) then + printlog "AutoSave => changes not saved" + endif + if AutomatischSpeichern.IsChecked then + if Minuten.GetText <> "23" then + Warnlog "Minutes for AutoSave => changes not saved" + endif + endif + if NoPrettyPrinting.IsChecked = lbSave ( 10 ) then + Warnlog "no pretty printing => changes not saved" + endif + if URLimDateisystem.IsChecked = lbSave ( 11 ) then + Warnlog "URL: File system => changes not saved" + endif + if URLimInternet.IsChecked = lbSave ( 12 ) then + Warnlog "URL: Internet => changes not saved" + endif + + printlog( "Verifying filters for documenttypes: Select third item from every list" ) + for i=1 to AppCount + Dokumenttyp.Select(i) + printlog( "Doctype: " & Dokumenttyp.getSelText() & " has filter: " & Filter.getSelText() ) + + if Filter.GetSelIndex <> 3 then + warnlog( "#i79150# some options in Tools/Options->Load/Save->General are not saved" ) + endif + next i + + '///make other changes + printlog " - make other changes" + BenutzerspezifischeEinstellungen.Uncheck + DokumenteigenschaftenBearbeiten.Check + Sicherungskopie.Uncheck + AutomatischSpeichern.Check + Minuten.SetText "01" + NoPrettyPrinting.Uncheck + URLimDateisystem.Uncheck + URLimInternet.Uncheck + for i=1 to AppCount + Dokumenttyp.Select(i) + Filter.Select(4) + next i + + printlog " - close options-dlg with OK" + '///+close options dialog with OK + + kontext "extrasoptionendlg" + ExtrasOptionenDlg.OK + Sleep (1) + + '///+you must get for all applications a filter-changes-warning ( perhaps not for all ) + printlog " - react on messageboxes for loosing settings after changing default-filters" + kontext "FilterWarning" + for i=1 to AppCount + if FilterWarning.Exists(5) then + FilterWarning.OK + else + i = AppCount + 1 + endif + next i + Sleep (3) + + '///check second changes + printlog " - check second changes" + '///+open tools / options / load & save / general + ToolsOptions + hToolsOptions ( "LoadSave", "General" ) + + if BenutzerspezifischeEinstellungen.IsChecked <> FALSE then + Warnlog "'Load user setting with document' => changes not saved" + endif + if DokumenteigenschaftenBearbeiten.IsChecked <> TRUE then + Warnlog "'Edit document properties before saving' => changes not saved" + endif + if Sicherungskopie.IsChecked <> FALSE then + Warnlog "'Create backup copy' => changes not saved" + endif + if AutomatischSpeichern.IsChecked <> TRUE then + Warnlog "AutoSave => changes not saved" + endif + if Minuten.GetText <> "1" then + Warnlog "Minutes for AutoSave => changes not saved" + endif + if NoPrettyPrinting.IsChecked <> FALSE then + Warnlog "no pretty printing => changes not saved" + endif + if URLimDateisystem.IsChecked <> FALSE then + Warnlog "URL: File system => changes not saved" + endif + if URLimInternet.IsChecked <> FALSE then + Warnlog "URL: Internet => changes not saved" + endif + for i=1 to AppCount + Dokumenttyp.Select(i) + if Filter.GetSelIndex <> 4 then + Warnlog "Document '" + Dokumenttyp.GetSelText + "': changes not saved" + endif + next i + + '///reset to default settings + printlog " - reset to saved settings" + if lbSave ( 13 ) = FALSE then + BenutzerspezifischeEinstellungen.UnCheck else BenutzerspezifischeEinstellungen.Check + endif + if lbSave ( 1 ) = FALSE then + DokumenteigenschaftenBearbeiten.UnCheck else DokumenteigenschaftenBearbeiten.Check + endif + if lbSave ( 2 ) = FALSE then + Sicherungskopie.Uncheck else Sicherungskopie.Check + endif + AutomatischSpeichern.Check + Minuten.SetText lsSave ( 1 ) + if lbSave ( 3 ) = FALSE then + AutomatischSpeichern.Uncheck else AutomatischSpeichern.Check + endif + if lbSave ( 10 ) = FALSE then + NoPrettyPrinting.Uncheck else NoPrettyPrinting.Check + endif + if lbSave ( 11 ) = FALSE then + URLimDateisystem.UnCheck else URLimDateisystem.Check + endif + if lbSave ( 12 ) = FALSE then + URLimInternet.UnCheck else URLimInternet.Check + endif + for i=1 to AppCount + Dokumenttyp.Select(i) + if Dokumenttyp.GetSelText <> lsSave ( 2 + i ) then + Warnlog "The sorting of the document-listbox has been changed!" + endif + Filter.Select(lsSave(2+AppCount+i)) + next i + + '///+close options dialog with OK + kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + + '///check the reset + printlog " - check settings" + '///+open tools / options / load & save / general + ToolsOptions + hToolsOptions ( "LoadSave", "General" ) + + if BenutzerspezifischeEinstellungen.IsChecked <> lbSave ( 13 ) then + Warnlog "'Load user setting with document' => changes not saved" + endif + if DokumenteigenschaftenBearbeiten.IsChecked <> lbSave ( 1 ) then + Warnlog "'Edit document properties before saving' => changes not saved" + endif + if Sicherungskopie.IsChecked <> lbSave ( 2 ) then + Warnlog "'Create backup copy' => changes not saved" + endif + if AutomatischSpeichern.IsChecked <> lbSave ( 3 ) then + Warnlog "AutoSave => changes not saved" + endif + if AutomatischSpeichern.IsChecked then + if Minuten.GetText <> lsSave( 1 ) then + Warnlog "Minutes for AutoSave => changes not saved" + endif + endif + if NoPrettyPrinting.IsChecked <> lbSave ( 10 ) then + Warnlog "no pretty printing => changes not saved" + endif + if URLimDateisystem.IsChecked <> lbSave ( 11 ) then + Warnlog "URL: File system => changes not saved" + endif + if URLimInternet.IsChecked <> lbSave ( 12 ) then + Warnlog "URL: Internet => changes not saved" + endif + for i=1 to AppCount + Dokumenttyp.Select(i) + if Dokumenttyp.GetSelText <> lsSave ( 2 + i ) then + Warnlog "The sorting of the document-listbox has been changed!" + endif + if Filter.GetSelText <> lsSave ( 2 + AppCount + i ) then + Warnlog "Document '" + Dokumenttyp.GetSelText + "': changes not saved" + endif + next i + + '///+close options dialog with OK + kontext "extrasoptionendlg" + ExtrasOptionenDlg.OK +endcase diff --git a/testautomation/framework/optional/includes/options_loadsave_html.inc b/testautomation/framework/optional/includes/options_loadsave_html.inc new file mode 100755 index 000000000000..47d4a9bb8c5e --- /dev/null +++ b/testautomation/framework/optional/includes/options_loadsave_html.inc @@ -0,0 +1,244 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_loadsave_html.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Test the Load/Save HTML compatibility page +'* +'\****************************************************************************** + +testcase tLoadSaveHTML + + Dim lbSave ( 10 ) as Boolean + Dim lsSave2 ( 8 ) as String + Dim lsSave ( 10 ) as String + Dim i as Integer + +'///check if all settings are saved in configuration ( Load & Save / HTML Compatibility ) + +'///open a new document + hNewDocument +'///+open tools / options / load & save / HTML Compatibility + ToolsOptions + hToolsOptions ( "LoadSave", "HTMLCompatibility" ) + +'///save old settings + printlog " - save old settings" + lsSave ( 1 ) = Groesse1.GetText + lsSave ( 2 ) = Groesse2.GetText + lsSave ( 3 ) = Groesse3.GetText + lsSave ( 4 ) = Groesse4.GetText + lsSave ( 5 ) = Groesse5.GetText + lsSave ( 6 ) = Groesse6.GetText + lsSave ( 7 ) = Groesse7.GetText + lbSave ( 1 ) = UnbekannteHTML.IsChecked + lbSave ( 2 ) = FontEinstellungen.IsChecked + lbSave ( 3 ) = StarBasic.IsChecked + lbSave ( 4 ) = WarnungAnzeigen.IsChecked + lbSave ( 5 ) = Drucklayout.IsChecked + lbSave ( 6 ) = Grafikenkopieren.IsChecked + lsSave ( 8 ) = Export.GetSelText + lsSave ( 9 ) = Zeichensatz.GetSelText + lbSave ( 7 ) = UseEnglishlocaleForNumbers.isChecked + +'///change and invert all settings + printlog " - change/invert settings" + Groesse1.More 1 : lsSave2 (1) = Groesse1.GetText + Groesse2.More 2 : lsSave2 (2) = Groesse2.GetText + Groesse3.More 3 : lsSave2 (3) = Groesse3.GetText + Groesse4.More 4 : lsSave2 (4) = Groesse4.GetText + Groesse5.More 5 : lsSave2 (5) = Groesse5.GetText + Groesse6.More 6 : lsSave2 (6) = Groesse6.GetText + Groesse7.More 7 : lsSave2 (7) = Groesse7.GetText + if lbSave ( 1 ) = TRUE then UnbekannteHTML.Uncheck else UnbekannteHTML.Check + if lbSave ( 2 ) = TRUE then FontEinstellungen.Uncheck else FontEinstellungen.Check + if FontEinstellungen.IsChecked <> TRUE then + if lbSave ( 3 ) = TRUE then StarBasic.Uncheck else StarBasic.Check + end if + if lbSave ( 4 ) = TRUE then WarnungAnzeigen.Uncheck else WarnungAnzeigen.Check + if lbSave ( 5 ) = TRUE then Drucklayout.Uncheck else Drucklayout.Check + if lbSave ( 6 ) = TRUE then Grafikenkopieren.Uncheck else Grafikenkopieren.Check + if lbSave ( 7 ) = TRUE then UseEnglishlocaleForNumbers.Uncheck else UseEnglishlocaleForNumbers.Check + Export.Select 1 + Zeichensatz.Select 10 + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///+close the document + hCloseDocument + +'///exit and restart StarOffice + printlog " - exit/restart StarOffice" + ExitRestartTheOffice + +'///check inverting and changes + printlog " - check inverting / changes" +'///+open tools / options / load & save / HTML Compatibility + ToolsOptions + hToolsOptions ( "LoadSave", "HTMLCompatibility" ) + + if Groesse1.GetText <> lsSave2 (1) then Warnlog "Size 1 => changes not saved!" + if Groesse2.GetText <> lsSave2 (2) then Warnlog "Size 2 => changes not saved!" + if Groesse3.GetText <> lsSave2 (3) then Warnlog "Size 3 => changes not saved!" + if Groesse4.GetText <> lsSave2 (4) then Warnlog "Size 4 => changes not saved!" + if Groesse5.GetText <> lsSave2 (5) then Warnlog "Size 5 => changes not saved!" + if Groesse6.GetText <> lsSave2 (6) then Warnlog "Size 6 => changes not saved!" + if Groesse7.GetText <> lsSave2 (7) then Warnlog "Size 7 => changes not saved!" + if UnbekannteHTML.IsChecked = lbSave ( 1 ) then Warnlog "Unknown HTML => changes not saved!" + if FontEinstellungen.IsChecked = lbSave ( 2 ) then Warnlog "Font settings => changes not saved!" + if FontEinstellungen.IsChecked <> TRUE then + if StarBasic.IsChecked = lbSave ( 3 ) then Warnlog "StarBasic => changes not saved!" + end if + if WarnungAnzeigen.IsChecked = lbSave ( 4 ) then Warnlog "Show Warnings => changes not saved!" + if Drucklayout.IsEnabled then + if Drucklayout.IsChecked = lbSave ( 5 ) then Warnlog "Printlayout => changes not saved!" + end if + if Grafikenkopieren.IsChecked = lbSave ( 6 ) then Warnlog "Copy graphics => changes not saved!" + if UseEnglishlocaleForNumbers.IsChecked = lbSave ( 7 ) then Warnlog "UseEnglishlocaleForNumbers => changes not saved!" + if Export.GetSelIndex <> 1 then Warnlog "Export => changes not saved!" + if Zeichensatz.GetSelIndex <> 10 then Warnlog "Font => changes not saved!" + +'///make 2. changes + printlog " - 2. changes" + Groesse1.SetText "6" + Groesse2.SetText "9" + Groesse3.SetText "10" + Groesse4.SetText "11" + Groesse5.SetText "20" + Groesse6.SetText "38" + Groesse7.SetText "50" + UnbekannteHTML.Uncheck + FontEinstellungen.Check + Export.Select 2 + StarBasic.UnCheck + WarnungAnzeigen.UnCheck + Drucklayout.Check + Grafikenkopieren.Check + UseEnglishlocaleForNumbers.Check + Zeichensatz.Select 2 + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///check 2. changes + printlog " - check 2. changes" +'///+open tools / options / load & save / HTML Compatibility + ToolsOptions + hToolsOptions ( "LoadSave", "HTMLCompatibility" ) + + if Groesse1.GetText <> "6" then Warnlog "Size 1 => changes not saved!" + if Groesse2.GetText <> "9" then Warnlog "Size 2 => changes not saved!" + if Groesse3.GetText <> "10" then Warnlog "Size 3 => changes not saved!" + if Groesse4.GetText <> "11" then Warnlog "Size 4 => changes not saved!" + if Groesse5.GetText <> "20" then Warnlog "Size 5 => changes not saved!" + if Groesse6.GetText <> "38" then Warnlog "Size 6 => changes not saved!" + if Groesse7.GetText <> "50" then Warnlog "Size 7 => changes not saved!" + if UnbekannteHTML.IsChecked <> FALSE then Warnlog "Unknown HTML => changes not saved!" + if FontEinstellungen.IsChecked <> TRUE then Warnlog "Font settings => changes not saved!" + if StarBasic.IsChecked <> FALSE then + Warnlog "StarBasic => changes not saved!" + else + if WarnungAnzeigen.IsChecked <> FALSE then Warnlog "Show Warnings => changes not saved!" + end if + if Drucklayout.IsEnabled then + if Drucklayout.IsChecked <> TRUE then Warnlog "Printlayout => changes not saved!" + end if + if Grafikenkopieren.IsChecked <> TRUE then Warnlog "Copy graphics => changes not saved!" + if UseEnglishlocaleForNumbers.IsChecked <> TRUE then Warnlog "UseEnglishlocaleForNumbers => changes not saved!" + if Export.GetSelIndex <> 2 then Warnlog "Export => changes not saved!" + if Zeichensatz.GetSelIndex <> 2 then Warnlog "Font => changes not saved!" + +'///reset to default settings + printlog " - reset to saved settings" + Groesse1.SetText lsSave (1) + Groesse2.SetText lsSave (2) + Groesse3.SetText lsSave (3) + Groesse4.SetText lsSave (4) + Groesse5.SetText lsSave (5) + Groesse6.SetText lsSave (6) + Groesse7.SetText lsSave (7) + if lbSave(1) = TRUE then UnbekannteHTML.Check else UnbekannteHTML.UnCheck + if lbSave(2) = TRUE then FontEinstellungen.Check else FontEinstellungen.UnCheck + StarBasic.Uncheck + if lbSave(4) = TRUE then WarnungAnzeigen.Check else WarnungAnzeigen.UnCheck + + if lbSave(3) = TRUE then StarBasic.Check else StarBasic.UnCheck + Export.Select lsSave ( 8 ) + if lbSave(5) = TRUE then Drucklayout.Check else Drucklayout.UnCheck + if lbSave(6) = TRUE then Grafikenkopieren.Check else Grafikenkopieren.UnCheck + if lbSave(7) = TRUE then UseEnglishlocaleForNumbers.Check else UseEnglishlocaleForNumbers.UnCheck + Export.Select lsSave ( 8 ) + Zeichensatz.Select lsSave ( 9 ) + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + + printlog " - check default settings" +'///+open tools / options / load & save / HTML Compatibility + ToolsOptions + hToolsOptions ( "LoadSave", "HTMLCompatibility" ) + + if Groesse1.GetText <> lsSave (1) then Warnlog "Size 1 => changes not saved!" + if Groesse2.GetText <> lsSave (2) then Warnlog "Size 2 => changes not saved!" + if Groesse3.GetText <> lsSave (3) then Warnlog "Size 3 => changes not saved!" + if Groesse4.GetText <> lsSave (4) then Warnlog "Size 4 => changes not saved!" + if Groesse5.GetText <> lsSave (5) then Warnlog "Size 5 => changes not saved!" + if Groesse6.GetText <> lsSave (6) then Warnlog "Size 6 => changes not saved!" + if Groesse7.GetText <> lsSave (7) then Warnlog "Size 7 => changes not saved!" + if UnbekannteHTML.IsChecked <> lbSave(1) then Warnlog "Unknown HTML => changes not saved!" + if FontEinstellungen.IsChecked <> lbSave(2) then Warnlog "Font settings => changes not saved!" + if StarBasic.IsChecked <> lbSave(3) then Warnlog "StarBasic => changes not saved!" + StarBasic.Uncheck + if WarnungAnzeigen.IsChecked <> lbSave(4) then Warnlog "Show Warnings => changes not saved!" + + if lbSave(3) = TRUE then StarBasic.Check else StarBasic.UnCheck + if Drucklayout.IsEnabled then + if Drucklayout.IsChecked <> lbSave(5) then Warnlog "Printlayout => changes not saved!" + end if + if Grafikenkopieren.IsChecked <> lbSave(6) then Warnlog "Copy graphics => changes not saved!" + if UseEnglishlocaleForNumbers.IsChecked <> lbSave(7) then Warnlog "UseEnglishlocaleForNumbers => changes not saved!" + if Export.GetSeltext <> lsSave (8) then Warnlog "Export => changes not saved!" + if Zeichensatz.GetSeltext <> lsSave (9) then Warnlog "Font => changes not saved!" + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + +endcase diff --git a/testautomation/framework/optional/includes/options_loadsave_msoffice.inc b/testautomation/framework/optional/includes/options_loadsave_msoffice.inc new file mode 100755 index 000000000000..aaec872139b7 --- /dev/null +++ b/testautomation/framework/optional/includes/options_loadsave_msoffice.inc @@ -0,0 +1,149 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_loadsave_msoffice.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Test Load/Save MS-Office settings page +'* +'\****************************************************************************** + +testcase tLoadSaveMSOffice + + Dim lbSave1 ( 9 ) as Boolean + Dim lbSave2 ( 9 ) as Boolean + Dim i as Integer +'///!!!!This routine works only with default settings (all checkboxes are checked, or all boxes are unchecked) + printlog "If you get errors in this test, please check the settings." + printlog "This test can only run without an error, when all checkboxes are checked or all are unchecked." +'///check if all settings are saved in configuration ( Load & Save / Microsoft Office ) + + +'///open a new document + hNewDocument +'///+open tools / options / load & save / Microsoft Office + ToolsOptions + hToolsOptions ( "LoadSave", "MicrosoftOffice" ) + +'///save old settings ( only the state of the first checkbox can be saved ) + printlog " - save old settings" + Auswahl.TypeKeys "<PageUp>" + for i=1 to 4 + lbSave1(i) = Auswahl.IsChecked (1) + lbSave2(i) = Auswahl.IsChecked (2) + Auswahl.TypeKeys "<Down>" + next i + +'///inverted first checkbox for all entries + + Auswahl.TypeKeys "<PageUp>" + for i=1 to 4 + + printlog( " - invert setting: " + i ) + + if lbSave1(i) = TRUE then + if lbSave2(i) = FALSE then Auswahl.TypeKeys ("<Space>") ' 2. checkboxes must be checked + if lbSave2(i) = TRUE then Auswahl.TypeKeys ("<Space><Space><Space>") ' 2. checkboxes must be unchecked + else + if lbSave2(i) = FALSE then Auswahl.TypeKeys ("<Space>") ' 2. checkboxes must be checked + if lbSave2(i) = TRUE then Auswahl.TypeKeys ("<Space><Space><Space>") ' 2. checkboxes must be unchecked + end if + + Auswahl.TypeKeys ("<Down>") + + next i + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///+close document + hCloseDocument + +'///exit and restart StarOffice + printlog " - exit/restart StarOffice" + ExitRestartTheOffice + +'///check inverting + printlog " - check inverting" +'///+open tools / options / load & save / Microsoft Office + ToolsOptions + hToolsOptions ( "LoadSave", "MicrosoftOffice" ) + + Auswahl.TypeKeys( "<PageUp>" ) + for i=1 to 4 + if Auswahl.IsChecked(1) = lbSave1(i) then warnlog "Entry " + i + ": state of 1. checkbox isn't saved" + if Auswahl.IsChecked(2) = lbSave2(i) then warnlog "Entry " + i + ": state of 2. checkbox isn't saved" + Auswahl.TypeKeys( "<Down>" ) + next i + +'///reset changes + printlog " - reset to saved settings" + Auswahl.TypeKeys "<PageUp>" + for i=1 to 4 + + if lbSave1(i) = TRUE then + if lbSave2(i) = FALSE then Auswahl.TypeKeys ("<Space><Space><Space>") ' 2. checkboxes must be unchecked + if lbSave2(i) = TRUE then Auswahl.TypeKeys ("<Space>") ' 2. checkboxes must be checked + else + if lbSave2(i) = FALSE then Auswahl.TypeKeys ("<Space><Space><Space>") ' 2. checkboxes must be unchecked + if lbSave2(i) = TRUE then Auswahl.TypeKeys ("<Space>") ' 2. checkboxes must be checked + end if + + Auswahl.TypeKeys ("<Down>") + + next i + + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///check the reset + printlog " - check default settings" +'///+open tools / options / load & save / Microsoft Office + ToolsOptions + hToolsOptions ( "LoadSave", "MicrosoftOffice" ) + + for i=1 to 4 + if Auswahl.IsChecked(1) <> lbSave1(i) then warnlog "Entry " + i + ": state of 1. checkbox isn't saved" + if Auswahl.IsChecked(2) <> lbSave2(i) then warnlog "Entry " + i + ": state of 2. checkbox isn't saved" + Auswahl.TypeKeys "<Down>" + next i + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + +endcase diff --git a/testautomation/framework/optional/includes/options_loadsave_vba.inc b/testautomation/framework/optional/includes/options_loadsave_vba.inc new file mode 100755 index 000000000000..1b205cadfe2d --- /dev/null +++ b/testautomation/framework/optional/includes/options_loadsave_vba.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 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_loadsave_vba.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Test VBA settings-page +'* +'\****************************************************************************** + +testcase tLoadSaveVBA + + Dim lbSave ( 7 ) as Boolean + +'///check if all settings are saved in configuration ( Load & Save / VBA Settings ) + +'///open a new document + hNewDocument +'///+open tools / options / load & save / VBA settings + ToolsOptions + hToolsOptions ( "LoadSave", "VBAProperties" ) + +'///save old settings + printlog " - save old settings" + lbSave ( 1 ) = WinwordBasicLaden.IsChecked + lbSave ( 2 ) = WinwordBasicSpeichern.IsChecked + lbSave ( 3 ) = ExcelBasicLaden.IsChecked + lbSave ( 4 ) = ExcelBasicSpeichern.IsChecked + lbSave ( 5 ) = PowerpointBasicLaden.IsChecked + lbSave ( 6 ) = PowerpointBasicSpeichern.IsChecked + +'///invert all settings + printlog " - invert settings" + if lbSave ( 1 ) = TRUE then WinwordBasicLaden.UnCheck else WinwordBasicLaden.Check + if lbSave ( 2 ) = TRUE then WinwordBasicSpeichern.UnCheck else WinwordBasicSpeichern.Check + if lbSave ( 3 ) = TRUE then ExcelBasicLaden.UnCheck else ExcelBasicLaden.Check + if lbSave ( 4 ) = TRUE then ExcelBasicSpeichern.UnCheck else ExcelBasicSpeichern.Check + if lbSave ( 5 ) = TRUE then PowerpointBasicLaden.UnCheck else PowerpointBasicLaden.Check + if lbSave ( 6 ) = TRUE then PowerpointBasicSpeichern.UnCheck else PowerpointBasicSpeichern.Check + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///+close the document + hCloseDocument + +'///exit and restart StarOffice + printlog " - exit/restart StarOffice" + ExitRestartTheOffice + +'///check the invitation + printlog " - check inverting" +'///+open tools / options / load & save / VBA settings + ToolsOptions + hToolsOptions ( "LoadSave", "VBAProperties" ) + + if WinwordBasicLaden.IsChecked = lbSave ( 1 ) then Warnlog "'Load Winword basic' => changes not saved!" + if WinwordBasicSpeichern.IsChecked = lbSave ( 2 ) then Warnlog "'Save Winword basic' => changes not saved!" + if ExcelBasicLaden.IsChecked = lbSave ( 3 ) then Warnlog "'Load Excel basic' => changes not saved!" + if ExcelBasicSpeichern.IsChecked = lbSave ( 4 ) then Warnlog "'Save Excel basic' => changes not saved!" + if PowerpointBasicLaden.IsChecked = lbSave ( 5 ) then Warnlog "'Load Powerpoint basic' => changes not saved!" + if PowerpointBasicSpeichern.IsChecked = lbSave ( 6 ) then Warnlog "'Save Powerpoint basic' => changes not saved!" + +'///make other changes + printlog " - make other changes" + WinwordBasicLaden.Check + WinwordBasicSpeichern.Uncheck + ExcelBasicLaden.Uncheck + ExcelBasicSpeichern.Check + PowerpointBasicLaden.Uncheck + PowerpointBasicSpeichern.Check + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///check 2. changes + printlog " - check changes" +'///+open tools / options / load & save / VBA settings + ToolsOptions + hToolsOptions ( "LoadSave", "VBAProperties" ) + + if WinwordBasicLaden.IsChecked <> TRUE then Warnlog "'Load Winword basic' => changes not saved!" + if WinwordBasicSpeichern.IsChecked <> FALSE then Warnlog "'Save Winword basic' => changes not saved!" + if ExcelBasicLaden.IsChecked <> FALSE then Warnlog "'Load Excel basic' => changes not saved!" + if ExcelBasicSpeichern.IsChecked <> TRUE then Warnlog "'Save Excel basic' => changes not saved!" + if PowerpointBasicLaden.IsChecked <> FALSE then Warnlog "'Load Powerpoint basic' => changes not saved!" + if PowerpointBasicSpeichern.IsChecked <> TRUE then Warnlog "'Save Powerpoint basic' => changes not saved!" + +'///reset to default settings + printlog " - reset to saved settings" + + if lbSave ( 1 ) = TRUE then WinwordBasicLaden.Check else WinwordBasicLaden.UnCheck + if lbSave ( 2 ) = TRUE then WinwordBasicSpeichern.Check else WinwordBasicSpeichern.UnCheck + if lbSave ( 3 ) = TRUE then ExcelBasicLaden.Check else ExcelBasicLaden.UnCheck + if lbSave ( 4 ) = TRUE then ExcelBasicSpeichern.Check else ExcelBasicSpeichern.UnCheck + if lbSave ( 5 ) = TRUE then PowerpointBasicLaden.Check else PowerpointBasicLaden.UnCheck + if lbSave ( 6 ) = TRUE then PowerpointBasicSpeichern.Check else PowerpointBasicSpeichern.UnCheck + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///check the reset + printlog " - check settings" +'///+open tools / options / load & save / VBA settings + ToolsOptions + hToolsOptions ( "LoadSave", "VBAProperties" ) + + if WinwordBasicLaden.IsChecked <> lbSave ( 1 ) then Warnlog "'Load Winword basic' => changes not saved!" + if WinwordBasicSpeichern.IsChecked <> lbSave ( 2 ) then Warnlog "'Save Winword basic' => changes not saved!" + if ExcelBasicLaden.IsChecked <> lbSave ( 3 ) then Warnlog "'Load Excel basic' => changes not saved!" + if ExcelBasicSpeichern.IsChecked <> lbSave ( 4 ) then Warnlog "'Save Excel basic' => changes not saved!" + if PowerpointBasicLaden.IsChecked <> lbSave ( 5 ) then Warnlog "'Load Powerpoint basic' => changes not saved!" + if PowerpointBasicSpeichern.IsChecked <> lbSave ( 6 ) then Warnlog "'Save Powerpoint basic' => changes not saved!" + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + +endcase diff --git a/testautomation/framework/optional/includes/options_ls_2.inc b/testautomation/framework/optional/includes/options_ls_2.inc new file mode 100755 index 000000000000..7301c00648f5 --- /dev/null +++ b/testautomation/framework/optional/includes/options_ls_2.inc @@ -0,0 +1,358 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_ls_2.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : (functionality test for load/save group) +'* +'\****************************************************************************** + +testcase func_LoadSaveGeneral_1 + Dim bSave as boolean, bPromptSave as boolean + Dim sSaveTime as String + Dim sFilename, sFilebak as String + Dim i as Integer + + gApplication = "Writer" + +'///load&save/general : functionality test of all settings in 'Save'-group + + sFilename = ConvertPath ( gOfficePath + "user\work\o_save.sxw" ) + sFilebak = ConvertPath ( gOfficePath + "user\backup\o_save.bak" ) + + if app.Dir ( sFilename ) <> "" then app.kill ( sFilename ) + if app.Dir ( sFilebak ) <> "" then app.kill ( sFilebak ) + +'///save : 'document properties before saving' +'///+open a new document + printlog " - save" + printlog " - document properties before saving" + printlog " open a new document" + hNewDocument + +'///+insert a short paragraph + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tools/options/load-save/general: save-> edit document properties before saving<Return>" +'///+tools / options / load&save / general + printlog " open tools / options / load & save / general" + ToolsOptions + hToolsOptions ( "LoadSave", "General" ) + + printlog " check 'document properties before saving'" +'///+save the default setting for 'document properties before saving' and check it + bSave = DokumenteigenschaftenBearbeiten.IsChecked + DokumenteigenschaftenBearbeiten.Check + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + printlog " save the document" + +'///+file / save as + FileSaveAs +'///+insert a file name and press 'save' + Kontext "SpeichernDlg" + Dateiname.SetText sFilename + Sleep (1) + Speichern.Click + Sleep (1) + + printlog " activate all tabpages on properties dialog and cancel it" +'///+=> now the properties dialog must be actived + try + Kontext + active.SetPage( TabDokument) + active.SetPage TabDokumentinfo + active.SetPage TabBenutzer + active.SetPage TabInternet + active.SetPage TabStatistik + Kontext "TabStatistik" +'///+cancel the properties dialog + TabStatistik.Cancel + catch + Warnlog "Perhaps the document properties aren't active after saving => the dialog come not up after file save!" + endcatch + +'///save : 'always create backup copy' + printlog " - always create backup copy" + Kontext "DocumentWriter" +'///+insert a short paragraph in the writer doc + DocumentWriter.TypeKeys "tools/options/load-save/general: save-> always create backup copy<Return>" +'///+tools / options / load&save / general + printlog " open tools / options / load & save / general" + ToolsOptions + hToolsOptions ( "LoadSave", "General" ) + +'///+uncheck 'document properties before saving' + if bSave = TRUE then DokumenteigenschaftenBearbeiten.Check else DokumenteigenschaftenBearbeiten.UnCheck + bSave = Sicherungskopie.IsChecked +'///+check 'always create backup copy' + Sicherungskopie.Check +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///+check if the backup file exists before saving => BUG + if app.Dir ( sFilebak ) <> "" then Warnlog "Before saving the document the backup-file exists!" +'///+file / save + hFileSave +'///+check if the backup file exists after saving => ( ../user/backup/.. ) + if app.Dir ( sFilebak ) = "" then Warnlog "After saving the document the backup-file doesn't exists => BUG!" + +'///save : 'auto save' after 1 min + printlog " - autosave : after 1 min, with prompt" +'///+write another short paragraph into the writer document + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "tools/options/load-save/general: save-> autosave after 1 min with prompt<Return>" +'///+tools / options / load&save / general + ToolsOptions + hToolsOptions ( "LoadSave", "General" ) + +'///+set 'always create backup copy' to default + if bSave = TRUE then Sicherungskopie.Check else Sicherungskopie.UnCheck + bSave = AutomatischSpeichern.IsChecked +'///+check 'auto save' and set the time to 1 minute + AutomatischSpeichern.Check + bPromptSave = MitRueckfrage.IsChecked + sSaveTime = 15 'debug + + Minuten.SetText "2" + MitRueckfrage.Check + + '///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (130) + +'///+wait about 2 minutes +'///+two 'save file?" dialogs should pop up, one for each document. +'///+Select 'yes' for both dialogs and cancel both file-save dialogs + for i=1 to 2 + Kontext "Active" + if Active.Exists (3) then + Active.Yes + Kontext "SpeichernDlg" + if SpeichernDlg.Exists then SpeichernDlg.Cancel + Sleep (2) + printlog "Active came up :-) " + i + else + printlog "Active didn't come up :-( " + i + end if + next i + + '///check the documents + '///+close the document, there should be a warning that the file has not been saved + '///+discard the file + printlog " - close the document and check the saved data" + hCloseDocument ' closes the document with 'discard' + '///+reopen the file and check if all paragraphs are inserted, t + hOpenFile ( sFilename ) + + ' This part compares the content of the file after reload with text entered + ' during the entire test. It should contain three lines of text. + printlog( " - Compare the content of the file with the text entered during the test." ) + printlog( " First line..." ) + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<Up>", 5 + DocumentWriter.TypeKeys "<Home>" + DocumentWriter.TypeKeys "<Shift End>" + EditCopy + WaitSlot() + if lcase ( GetClipboardText ) <> "tools/options/load-save/general: save-> edit document properties before saving" then Warnlog "The first sentence is wrong!" + + printlog( " Second line..." ) + DocumentWriter.TypeKeys "<Down>" + DocumentWriter.TypeKeys "<Home>" + DocumentWriter.TypeKeys "<Shift End>" + EditCopy + WaitSlot() + if lcase ( GetClipboardText ) <> "tools/options/load-save/general: save-> always create backup copy" then Warnlog "The second sentence is wrong!" + + printlog( " Third line..." ) + DocumentWriter.TypeKeys "<Down>" + DocumentWriter.TypeKeys "<Home>" + DocumentWriter.TypeKeys "<Shift End>" + EditCopy + WaitSlot() + if lcase ( GetClipboardText ) <> "tools/options/load-save/general: save-> autosave after 1 min with prompt" then Warnlog "The third sentence is wrong!" + + '///+close the document + hCloseDocument + + '///+open the backup file ( ../user/backup/.. ) and check if there are 2 paragraphs (last paragraph should not have been saved) + printlog " - load the backup-file" + hOpenFile ( sFilebak ) + + Kontext "Filterauswahl" + if Filterauswahl.Exists(2) then + warnlog "Is bugId 107399 present? => Detection of our own fileformar fails when the extension is not the standard extension!" + Filterauswahl.Close + else + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<Up>", 5 + DocumentWriter.TypeKeys "<Home>" + DocumentWriter.TypeKeys "<Shift End>" + EditCopy + + '///+close the document + WaitSlot() + + if GetClipboardText <> "" then + call hCloseDocument + else + warnlog "Perhaps the bak-file was not loaded. => Verify BugID 86607!" + end if + end if + + '///reset the options to default settings + printlog " - reset options" + ToolsOptions + hToolsOptions ( "LoadSave", "General" ) + AutomatischSpeichern.Check + if bPromptSave = TRUE then MitRueckfrage.Check else MitRueckfrage.UnCheck + Minuten.SetText sSaveTime + if bSave = TRUE then AutomatischSpeichern.Check else AutomatischSpeichern.UnCheck +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + +endcase + +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +testcase func_LoadSaveGeneral_2 + Dim bSave as Boolean + Dim sFilename, sFilename2, sCharSet as String + + const ICWAIT as integer = 1 + +'///load&save/general : functionality test of all settings in 'Save URLs relativ to'-group + + sFilename = ConvertPath ( gOfficePath + "user\work\o_save_1.html" ) + sFilename2 = ConvertPath ( gOfficePath + "user\work\o_save_2.html" ) + + if app.dir ( sFilename ) <> "" then app.kill ( sFilename ) + if app.dir ( sFilename2 ) <> "" then app.kill ( sFilename2 ) + + printlog " - save" + printlog " - save URL relative to" + +'///if you test a StarSuite ( asian language ) you have to change the encoding for HTML-export to 'UTF8' ( load&save/HTML compatibility ) + if bAsianLan = TRUE then + sCharSet = GetHTMLCharSet + if SetHTMLCharSetToUTF8 = FALSE then + Warnlog "The test cannot find the UTF8 Character Set for HTML-Export. The test can have many errors at saving HTML-Files!" + else + printlog "The Character Set for HTML-Export is now Unicode UTF8!" + end if + end if + +'///open a new HTML document + gApplication = "HTML" + hNewDocument + +'///+ insert a graphic out of the internal gallery ( [Officepath]/share/gallery/photos/desert.jpg ) + if gNetzInst = TRUE then + hGrafikEinfuegen ( ConvertPath ( gNetzOfficePath + "share\gallery\photos\desert1.jpg" ) ) + else + hGrafikEinfuegen ( ConvertPath ( gOfficePath + "share\gallery\photos\desert1.jpg" ) ) + end if + +'///+open tools/options/load&save/general + printlog " - relative to filesystem" + ToolsOptions + hToolsOptions ( "LoadSave", "General" ) + +'///+check 'relativ to filesystem' + bSave = URLimDateisystem.IsChecked + URLimDateisystem.Check + Kontext "ExtrasOptionenDlg" +'///+close options dialog with OK + ExtrasOptionenDlg.OK + Sleep (2) + + printlog " save the HTML file" +'///+save the HTML-doc at ../user/work/.. + hFileSaveAs ( sFilename ) + +'///+check if the path for the graphic is 'relativ' in the source code + printlog " check the relativ path in source code of HTML file" + Call URLGraphicCheck ( TRUE, sFilename ) + +'///+open tools/options/load&save/general + printlog " - relative to filesystem ( unchecked )" + ToolsOptions + hToolsOptions ( "LoadSave", "General" ) + +'///+uncheck 'relativ to filesystem' + URLimDateisystem.UnCheck +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+save the HTML-doc at ../user/work/.. with another name + printlog " save the HTML file" + hSpeichernUnter ( sFilename2 ) + +'///+check if the path for the graphic is 'not relativ' in the source code + printlog " check the hard coded path in source code of HTML file" + Call URLGraphicCheck ( FALSE, sFilename2 ) + +'///+close the document + hCloseDocument + +'///+reset 'relativ to file system' to default and close the options dialog with OK + printlog " - reset the options" + ToolsOptions + hToolsOptions ( "LoadSave", "General" ) + + if bSave = TRUE then URLimDateisystem.Check else URLimDateisystem.UnCheck + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + + printlog "No test for 'relative to internet'" + +'///<FONT COLOR="#ff0000">No test for 'relative to internet'</FONT> + if bAsianLan = TRUE then + printlog Chr(13 ) + "Reset the Character Set back to default : " + sCharSet + SetHTMLCharSet ( sCharSet ) + end if + + gApplication = "WRITER" +endcase + + diff --git a/testautomation/framework/optional/includes/options_ooo_accessibility.inc b/testautomation/framework/optional/includes/options_ooo_accessibility.inc new file mode 100755 index 000000000000..bdc82c32afcb --- /dev/null +++ b/testautomation/framework/optional/includes/options_ooo_accessibility.inc @@ -0,0 +1,211 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_ooo_accessibility.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : Tools->Options: OpenOffice.org Accessibility +'* +'\****************************************************************************** + +testcase tOOoAccessibility + +'///</b>check if all settings are saved in configuration ( StarOffice / Accessibility ) + Dim lbSave ( 10 ) as Boolean + Dim sSave as String + + printlog " - save default setting" +'///save settings +'///tools / options / staroffice / accessibility + ToolsOptions + hToolsOptions ( "StarOffice", "Accessibility" ) + + lbSave (9) = AutomaticDetectHC.IsChecked + lbSave (2) = ForPagePreviews.IsChecked + lbSave (3) = HelpTips.IsChecked + sSave = After.GetText + lbSave (4) = AllowAnimatedGraphics.IsChecked + lbSave (5) = AllowAnimatedText.IsChecked + lbSave (6) = AlwaysUseAutomaticFontColor.IsChecked + 'lbSave (7) = UseSystemFont.IsChecked + lbSave (10) = UseTextSelectionCursor.IsChecked + if SupportAssistiveTechnologyTools.Exists and SupportAssistiveTechnologyTools.IsVisible then + lbSave (8) = SupportAssistiveTechnologyTools.IsChecked + end if + + +'///revers/change settings + printlog " - revers/change settings" + if lbSave (9) = TRUE then AutomaticDetectHC.UnCheck else AutomaticDetectHC.Check + if lbSave (2) = TRUE then ForPagePreviews.Uncheck else ForPagePreviews.Check + HelpTips.Check + After.SetText "17" + if lbSave (3) = TRUE then HelpTips.Uncheck else HelpTips.Check + if lbSave (4) = TRUE then AllowAnimatedGraphics.Uncheck else AllowAnimatedGraphics.Check + if lbSave (5) = TRUE then AllowAnimatedText.Uncheck else AllowAnimatedText.Check + if lbSave (6) = TRUE then AlwaysUseAutomaticFontColor.Uncheck else AlwaysUseAutomaticFontColor.Check + 'if lbSave (7) = TRUE then UseSystemFont.Uncheck else UseSystemFont.Check + if lbSave (10) = TRUE then UseTextSelectionCursor.Uncheck else UseTextSelectionCursor.Check + if SupportAssistiveTechnologyTools.Exists and SupportAssistiveTechnologyTools.IsVisible then + '/// - 'Support assistive technology tools' is only available on windows platform ///' + '/// - if you enable it, and you have not the right / or none version of teh Java Access Bridge a system dialog comes up ///' + '/// - this is a wanted behaviour! but can't be handled by testtool. so this option won't be checked! ///' + if (gPlatgroup <> "unx") then + Printlog "'Support assistive technology tools' won't be tested due to system dialog could come up and look the test out :-(" + else + Warnlog "unexpected error 4711 :-)" + endif +' if lbSave (8) = TRUE then SupportAssistiveTechnologyTools.Uncheck else SupportAssistiveTechnologyTools.Check + else + if (gPlatgroup <> "unx") then + Warnlog "'Support assistive technology tools' is not available :-(" + endif + end if + +'///press OK at the options dialog + printlog " - press OK at the options dialog" + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///exit and restart StarOffice + printlog " - exit/restart StarOffice" + ExitRestartTheOffice + +'///check the changes + printlog " - check settings" +'///tools / options / staroffice / accessibility + ToolsOptions + hToolsOptions ( "StarOffice", "Accessibility" ) + + if AutomaticDetectHC.IsChecked = lbSave (9) then warnlog "Automatic Detect HC ... : => changes not saved!" + if ForPagePreviews.IsChecked = lbSave (2) then warnlog "For Page Previews : => changes not saved!" + if HelpTips.IsChecked = lbSave (3) then warnlog "Help Tips : => changes not saved!" + HelpTips.Check + if After.GetText <> "17" then warnlog "After... : => changes not saved!" + if AllowAnimatedGraphics.IsChecked = lbSave (4) then warnlog "Allow Animated Graphics : => changes not saved!" + if AllowAnimatedText.IsChecked = lbSave (5) then warnlog "Allow Animated Text : => changes not saved!" + if AlwaysUseAutomaticFontColor.IsChecked = lbSave (6) then warnlog "Always Use Automatic Font Color : => changes not saved!" + 'if UseSystemFont.IsChecked = lbSave (7) then warnlog "Use System Font : => changes not saved!" + if UseTextSelectionCursor.IsChecked = lbSave (10) then warnlog "Use Text Selection Cursor : => changes not saved!" +' if SupportAssistiveTechnologyTools.Exists and SupportAssistiveTechnologyTools.IsVisible then +' if SupportAssistiveTechnologyTools.IsChecked = lbSave (8) then warnlog "Support Assistive Technology Tools : => changes not saved!" +' end if + + printlog " - second settings" +'///second changes + AutomaticDetectHC.UnCheck + ForPagePreviews.Check + HelpTips.Check + After.SetText "1" + AllowAnimatedGraphics.Uncheck + AllowAnimatedText.Check + AlwaysUseAutomaticFontColor.Uncheck + 'UseSystemFont.Check + UseTextSelectionCursor.UnCheck + if SupportAssistiveTechnologyTools.Exists and SupportAssistiveTechnologyTools.IsVisible then + SupportAssistiveTechnologyTools.Uncheck + end if + +'///press OK at the options dialog + printlog " - press OK at the options dialog" + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///check the changes + printlog " - check changes" +'///tools / options / staroffice / accessibility + ToolsOptions + hToolsOptions ( "StarOffice", "Accessibility" ) + + if AutomaticDetectHC.IsChecked <> FALSE then warnlog "Automatic Detect HC ... : => changes not saved!" + if ForPagePreviews.IsChecked <> TRUE then warnlog "For Page Previews : => changes not saved!" + if HelpTips.IsChecked <> TRUE then warnlog "Help Tips : => changes not saved!" + if After.GetText <> "1" then warnlog "After... : => changes not saved!" + if AllowAnimatedGraphics.IsChecked <> FALSE then warnlog "Allow Animated Graphics : => changes not saved!" + if AllowAnimatedText.IsChecked <> TRUE then warnlog "Allow Animated Text : => changes not saved!" + if AlwaysUseAutomaticFontColor.IsChecked <> FALSE then warnlog "Always Use Automatic Font Color : => changes not saved!" + 'if UseSystemFont.IsChecked <> TRUE then warnlog "Use System Font : => changes not saved!" + if UseTextSelectionCursor.IsChecked <> FALSE then warnlog "Use Text Selection Cursor : => changes not saved!" + if SupportAssistiveTechnologyTools.Exists and SupportAssistiveTechnologyTools.IsVisible then + if SupportAssistiveTechnologyTools.IsChecked <> FALSE then warnlog "Support Assistive Technology Tools : => changes not saved!" + end if + +'///reset to default + if lbSave (9) = TRUE then AutomaticDetectHC.Check else AutomaticDetectHC.UnCheck + if lbSave (2) = TRUE then ForPagePreviews.Check else ForPagePreviews.UnCheck + HelpTips.Check + After.SetText sSave + if lbSave (3) = TRUE then HelpTips.Check else HelpTips.UnCheck + if lbSave (4) = TRUE then AllowAnimatedGraphics.Check else AllowAnimatedGraphics.UnCheck + if lbSave (5) = TRUE then AllowAnimatedText.Check else AllowAnimatedText.UnCheck + if lbSave (6) = TRUE then AlwaysUseAutomaticFontColor.Check else AlwaysUseAutomaticFontColor.UnCheck + 'if lbSave (7) = TRUE then UseSystemFont.Check else UseSystemFont.UnCheck + if lbSave (10) = TRUE then UseTextSelectionCursor.Check else UseTextSelectionCursor.UnCheck + if SupportAssistiveTechnologyTools.Exists and SupportAssistiveTechnologyTools.IsVisible then + if lbSave (8) = TRUE then SupportAssistiveTechnologyTools.Check else SupportAssistiveTechnologyTools.UnCheck + end if + +'///press OK at the options dialog + printlog " - press OK at the options dialog" + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///check the reset + printlog " - check reset" +'///tools / options / staroffice / accessibility + ToolsOptions + hToolsOptions ( "StarOffice", "Accessibility" ) + + if AutomaticDetectHC.IsChecked <> lbSave (9) then warnlog "Automatic Detect HC ... : => changes not saved!" + if ForPagePreviews.IsChecked <> lbSave (2) then warnlog "For Page Previews : => changes not saved!" + if HelpTips.IsChecked <> lbSave (3) then warnlog "Help Tips : => changes not saved!" + HelpTips.Check + if After.GetText <> sSave then warnlog "After... : => changes not saved!" + if AllowAnimatedGraphics.IsChecked <> lbSave (4) then warnlog "Allow Animated Graphics : => changes not saved!" + if AllowAnimatedText.IsChecked <> lbSave (5) then warnlog "Allow Animated Text : => changes not saved!" + if AlwaysUseAutomaticFontColor.IsChecked <> lbSave (6) then warnlog "Always Use Automatic Font Color : => changes not saved!" + 'if UseSystemFont.IsChecked <> lbSave (7) then warnlog "Use System Font : => changes not saved!" + if UseTextSelectionCursor.IsChecked <> lbSave (10) then warnlog "Use Text Selection Cursor : => changes not saved!" + if SupportAssistiveTechnologyTools.Exists and SupportAssistiveTechnologyTools.IsVisible then + if SupportAssistiveTechnologyTools.IsChecked <> lbSave (8) then warnlog "Support Assistive Technology Tools : => changes not saved!" + end if +'///press OK at the options dialog + printlog " - press OK at the options dialog" + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +endcase + diff --git a/testautomation/framework/optional/includes/options_ooo_appearance.inc b/testautomation/framework/optional/includes/options_ooo_appearance.inc new file mode 100755 index 000000000000..f416ca28a1b0 --- /dev/null +++ b/testautomation/framework/optional/includes/options_ooo_appearance.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 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_ooo_appearance.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : Tools->Options: OpenOffice.org Appearance +'* +'\****************************************************************************** + +testcase tOOoAppearance + Dim iSchemes as Integer + Dim sSchemeNames (10) as String + Dim sCurScheme as String, sCurScheme2 as String + Dim bIsError as Boolean + dim i as integer + +'///check if all settings are saved in configuration ( StarOffice / Appearance ) + + printlog " - save settings" +'///save settings of schemes +'tools / options / staroffice / appearance + ToolsOptions + hToolsOptions ( "StarOffice", "Appearance" ) + +'get the number of schemes + iSchemes = Scheme.GetItemCount + sCurScheme = Scheme.GetSelText + if iSchemes > 10 then Warnlog "There are more than 10 schemes, please update the test for it!" +'get the name of schemes + for i=1 to iSchemes + ListAppend ( sSchemeNames(), Scheme.GetItemText (i) ) + next i + + printlog " - change settings" +'insert a new scheme ( press Save, insert TT-Scheme as name, and close all dialogs with OK ) + Save.Click + Kontext "SaveScheme" + SchemeName.SetText "TT-Scheme" + try + SaveScheme.OK() + catch + warnlog( "The newly created scheme cannot be saved (ok is disabled) -> #i26913") + bIsError=true + SaveScheme.Cancel() + endcatch + + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///exit and restart StarOffice + printlog " - exit/restart StarOffice" + ExitRestartTheOffice + +'///check the new scheme + printlog " - check settings" +'tools / options / staroffice / appearance + ToolsOptions + hToolsOptions ( "StarOffice", "Appearance" ) + +'try to select the TT-Scheme + try + Scheme.Select "TT-Scheme" + bIsError = FALSE + catch + if Scheme.GetItemCount <> iSchemes + 1 then + Warnlog "The new scheme 'TT-Scheme' is not saved!" + else + Warnlog "The new scheme 'TT-Scheme' has another name!" + end if + bIsError = TRUE + endcatch + + '///delete the new scheme ( if all works correctly until now ) + printlog " - delete the new scheme" + + 'select 'TT-Scheme' + if bIsError = FALSE then + try + Scheme.Select "TT-Scheme" + 'press delete and click 'no' + Delete.Click() + Kontext "Active" + Active.No() + catch + warnlog( "The scheme does not exist in the scheme-selector listbox") + endcatch + + Kontext "TabAppearance" + try + 'press delete and click 'yes' + Scheme.Select "TT-Scheme" + Delete.Click + + Kontext "Active" + Active.Yes + catch + Warnlog "Perhaps the Scheme is deleted! But the messagebox was left with 'NO'!" + endcatch + +'select the default-entry + Sleep (1) + Kontext "TabAppearance" + sCurScheme2 = Scheme.GetSelText + + printlog " - press OK for options dialog" +'press OK for options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///check if the scheme is deleted and the saved base state is current + printlog " - check if the scheme is deleted and the saved base state is current" + ToolsOptions + hToolsOptions ( "StarOffice", "Appearance" ) + + if Scheme.GetSelText <> sCurScheme2 then + Warnlog "The last selected entry after deleting is not selected after restart the options dialog!" + end if + if iSchemes <> Scheme.GetItemCount then Warnlog "There are not " + iSchemes + " items in the scheme list! There are " + Scheme.GetItemCount + for i = 1 to Scheme.GetItemCount + if Scheme.GetItemText(i) <> sSchemeNames(i) then + Warnlog "The " + i + " entry is not the same -> should : '" + sSchemeNames(i) + "' is '" + Scheme.GetItemText(i) + "'" + end if + next i + +'///set the selected scheme to default + printlog " - set the selected scheme to default" + Scheme.Select sCurScheme + +'///press OK at the options dialog + printlog " - press OK at the options dialog" + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///check if the default scheme is selected after restarting the options dialog + printlog " - check if the default setting is active, after deleting a scheme and a restart of the options dialog" + ToolsOptions + hToolsOptions ( "StarOffice", "Appearance" ) + + if Scheme.GetSelText <> sCurScheme then + Warnlog "The default scheme is not selected!" + end if + + end if + + '///press OK at the options dialog + printlog " - press OK at the options dialog" + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) +endcase + + diff --git a/testautomation/framework/optional/includes/options_ooo_colors.inc b/testautomation/framework/optional/includes/options_ooo_colors.inc new file mode 100755 index 000000000000..b9dd964be996 --- /dev/null +++ b/testautomation/framework/optional/includes/options_ooo_colors.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 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_ooo_colors.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : Tools->Options: OpenOffice.org Colors +'* +'\****************************************************************************** + + +testcase tOOoColors + dim USERCOLOR as String + dim myColor(4) as String + dim oldColor(4) as String + dim currentColor(4) as String + dim chColor(4) as String + dim iDefaultColorCount as Integer + dim iModifiedColorCount as Integer + dim iTemp as integer + dim i as integer + + USERCOLOR = "TT-Test" + iSprache + myColor(1) = USERCOLOR + myColor(2) = "255" + myColor(3) = "245" + myColor(4) = "200" + + printlog " testing Tools/Options -> colors" + '///check if all settings are saved in configuration ( StarOffice / Colors ) + '///open Tools / Options / StarOffice / Colors + printlog " - Save current settings and modify/add some colors" + ToolsOptions + hToolsOptions ( "StarOffice", "Colors" ) + + '///determine the number of currently registered colors + iDefaultColorCount = Farbe.GetItemCount() + for i = 1 to iDefaultColorCount + printlog "("+i+"/"+iDefaultColorCount +"): '"+Farbe.getItemText(i)+"'" + next i + printlog " - Currently colors are listed: '" + iDefaultColorCount + "'" + '///delete the userdefined color if it exists + call DeleteColor( USERCOLOR ) + '///determine the number of currently registered colors + Kontext "TabFarben" + iDefaultColorCount = Farbe.GetItemCount + printlog " - Colors after deleting: '" + iDefaultColorCount + "'" + '///select the last color in the list + printlog " - jump to the last color in the list." + Kontext "TabFarben" + Farbe.Select( iDefaultColorCount ) + '///get the settings for the current selected color + '(204,204,255) + call getColorRGB(oldColor()) + '///change settings for last color and press 'modify' + '(255,255,255) + call ModifyColorRGB_PGUP(iDefaultColorCount) + '///get the changed colors (Sun 4,255,255,255) + call GetColorRGB(chColor()) + '///change the settings again and save it as TT-Test (adding to the list) + '(255,245,200) + call CreateNewColor(myColor()) + '///get the current number of registered colors (should be 92) + Kontext "TabFarben" + iModifiedColorCount = Farbe.getItemCount + printlog " - Currently colors are listed: '" + iModifiedColorCount + "'" + '///close the options dialog with OK + printlog " - close extras/options" + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep(3) + + '///exit and restart the office + printlog " - exit/restart StarOffice" + ExitRestartTheOffice + '///check the changes + printlog " - first check of changes (modifications)" + '///open tools / options / StarOffice / Colors + ToolsOptions + hToolsOptions ( "StarOffice", "Colors" ) + '///check the number of colors ( is the new entry saved ) + '(92) + iTemp = Farbe.getItemCount + printlog "Current color count: '" + iTemp + "'" + if (iTemp <> iModifiedColorCount) then + Warnlog "The number of registered colors is incorrect. Should be: '" + iModifiedColorCount + "' is: '"+ iTemp + "'" + end if + '///select the changed color and check the changes + Kontext "TabFarben" + Farbe.Select(iDefaultColorCount) + call compareTwoColorsRGB(chColor()) + '///select the new color ( TT-Test ) and check the name and the settings + Kontext "TabFarben" + Farbe.Select(iModifiedColorCount) + call CompareTwoColorsRGB(myColor()) + + '///delete the new userdefined color + call deleteColor( USERCOLOR ) + '///reset the modified color to default + Kontext "TabFarben" + Farbe.Select(iDefaultColorCount) + call ModifyColorRGB(oldColor()) + '///close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep(3) + + '///reopen options dialog and check the reset + printlog " - Second check of changes (reset)" + ToolsOptions + hToolsOptions ( "StarOffice", "Colors" ) + '///check if the number of colors in the list has been restored + iTemp = Farbe.getItemCount + printlog "Current color count: '" + iTemp + "'" + if (iTemp <> iDefaultColorCount) then + Warnlog "The number of registered colors is incorrect. Should be: '" + iDefaultColorCount + "' is: '"+ iTemp + "'" + endif + '///check if the last color has been reset to defaults. + Kontext "TabFarben" + Farbe.Select(iDefaultColorCount) + call compareTwoColorsRGB(oldColor()) + '///close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK +endcase diff --git a/testautomation/framework/optional/includes/options_ooo_fontreplacement.inc b/testautomation/framework/optional/includes/options_ooo_fontreplacement.inc new file mode 100755 index 000000000000..8951a419b903 --- /dev/null +++ b/testautomation/framework/optional/includes/options_ooo_fontreplacement.inc @@ -0,0 +1,140 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_ooo_fontreplacement.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : Tools->Options: OpenOffice.org Fonts +'* +'\****************************************************************************** + +testcase tOOoFontReplacement + Dim i, il as Integer + +'///check if all settings are saved in configuration ( StarOffice / Font Replacement ) +'///creat a new document and open tools/options/staroffice/font replacement + ToolsOptions + hToolsOptions ( "StarOffice", "Fontreplacement" ) + +'///change settings + printlog " - change settings" +'///if 'Apply replacement table' is check as default => BUG + if Anwenden.IsChecked then + Warnlog "The default for this page is wrong. 'Apply replacement table' has top be unchecked!" + else + Anwenden.Check + end if + +'///check 'Apply replacement table' +'///insert 2 new replacements ( Font / Replace with : 4 / 6 and 10 / 5 ) + Schriftart.Select 4 + ErsetzenDurch.Select 6 + Uebernehmen.Click + sleep 1 'gh13 + Schriftart.Select 10 + ErsetzenDurch.Select 5 + Uebernehmen.Click + +'///close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + + printlog " - exit/restart StarOffice" +'///exit and restart StarOffice + ExitRestartTheOffice + + printlog " - check changes" +'///check changes +'///open tools/options/staroffice/font replacement + ToolsOptions + hToolsOptions ( "StarOffice", "Fontreplacement" ) + +'///if 'Apply replacement table' is not check => BUG + if Anwenden.IsChecked = FALSE then + Warnlog "Apply replacement table' => changes not saved!" + else + Anwenden.Check + end if + +'///check the 2 replacements + il = Liste.GetItemCount + if il <> 2 then Warnlog "Not all entries are saved!" + + for i=1 to il + if i=1 then + Liste.TypeKeys "<Down><Up>" + else + Liste.TypeKeys "<Down>" + end if + if i=1 then + if Schriftart.GetSelIndex <> 4 then Warnlog "Font : the first entrie is not correctly saved!" + if ErsetzenDurch.GetSelIndex <> 6 then Warnlog "Replace with : the first entrie is not correctly saved!" + end if + if i=2 then + if Schriftart.GetSelIndex <> 10 then Warnlog "Font : the first entrie is not correctly saved!" + if ErsetzenDurch.GetSelIndex <> 5 then Warnlog "Replace with : the first entrie is not correctly saved!" + end if + next i + +'///reset to defaut and delete the 2 new replacements + printlog " - reset to default" + for i=1 to il + Liste.TypeKeys "<Down><Up>" + Loeschen.Click + sleep 1 'gh13 + next i + Anwenden.Uncheck + +'///close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///check the reset + printlog " - check the default" + ToolsOptions + hToolsOptions ( "StarOffice", "Fontreplacement" ) + + if Anwenden.IsChecked = TRUE then + Warnlog "Apply replacement table' => changes not saved!" + else + Anwenden.Check + end if + if Liste.GetItemCount <> 0 then Warnlog "Not all deleted entries are realy deleted!" + Anwenden.UnCheck + +'///close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) +endcase diff --git a/testautomation/framework/optional/includes/options_ooo_general.inc b/testautomation/framework/optional/includes/options_ooo_general.inc new file mode 100755 index 000000000000..911486680a00 --- /dev/null +++ b/testautomation/framework/optional/includes/options_ooo_general.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 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_ooo_general.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : 1. test for general group userdata ... view) +'* +'\****************************************************************************** + + +testcase tOOoGeneral + + dim lsSave (4) as String + dim lbSave (3) as Boolean + + '///short test if 'StarOffice / General' is saved in configuration + '///<ul> + '///<li>open a new document</li> + hNewDocument + + '///<li>open options 'StarOffice' / 'General'</li> + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) + + '///<li>save old data</li> + printlog " - save old data" + lsSave ( 1 ) = Zweistellig.GetText + lbSave ( 1 ) = Aktivieren.IsChecked + Aktivieren.Check + if gPlatgroup = "w95" then + lbSave (2) = StarOfficeDialogeBenutzen.IsChecked + end if + lbSave ( 3 ) = DruckenStatus.IsChecked + lsSave ( 3 ) = StyleSheet.GetSelText + + '///<li>invert/change data</li> + printlog " - invert/change data" + Zweistellig.SetText "1950" + Zuruecksetzen.Click + if gPlatgroup = "w95" then + if lbSave (2) = TRUE then StarOfficeDialogeBenutzen.Uncheck else StarOfficeDialogeBenutzen.Check + end if + If lbSave ( 3 ) = TRUE then DruckenStatus.Uncheck else DruckenStatus.Check + StyleSheet.Select 3 + + '///<li>close options-dialog with OK</li> + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + + '///<li>close document</li> + hCloseDocument + + '///<li>exit/restart StarOffice</li> + printlog " - exit/restart StarOffice" + ExitRestartTheOffice + + '///<li>open options 'StarOffice' / 'General'</li> + printlog " - check data" + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) + + '///<li>check data</li> + if Zweistellig.GetText <> "1950" then Warnlog "Year ( 2 digits ) => changes not saved: '" + Zweistellig.GetText +"' #i29810" + if Aktivieren.IsChecked <> TRUE then Warnlog "Enable HelpAgent => changes not saved" + Zuruecksetzen.Click + if gPlatgroup = "w95" then + if StarOfficeDialogeBenutzen.IsChecked = lbSave (2) then Warnlog "Use StarOffice dialogs => changes not saved!" + end if + If DruckenStatus.IsChecked = lbSave ( 3 ) then Warnlog "Printing sets 'Document modified' status => changes not saved!" + + '///<li>make 2. changes</li> + printlog " - 2. change data" + Zweistellig.SetText "1800" + DruckenStatus.UnCheck + + '///<li>close options-dialog with OK</li> + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + + '/// Check Issue i52248 Modify flag is set after printing though option is not set ///' + 'It's a little tricky to reproduce. + if gPlatgroup = "unx" then + hNewDocument() + FilePrint + Kontext "DruckenDLG" + if DruckenDLG.exists(5) then + Eigenschaften.click + kontext + active.setPage TabSPAPaper + Kontext "TabSPAPaper" + if TabSPAPaper.exists (5) then + TabSPAPaper.OK + sleep 5 + else + qaErrorlog "Properties of Printer didn't come up." + endif + Kontext "DruckenDLG" + DruckenDLG.OK + ' check state + kontext + if active.exists(5) then + printlog "active: printing failed? '" + active.gettext + "'" + active.ok + endif + try + FileSave + qaErrorlog "#i52248# Modify flag is set after printing though option is not set." + kontext "SpeichernDlg" + if SpeichernDlg.exists(5) then + SpeichernDlg.cancel + endif + catch + printlog "#i52248# doesn't come up." + endcatch + else + qaErrorLog "No printer available - resuming." + kontext + if active.exists(5) then + printlog active.getText + active.ok + endif + endif + hCloseDocument + endif + + '///<li>open options 'StarOffice' / 'General'</li> + printlog " - check data" + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) + + '///<li>check data</li> + if Zweistellig.GetText <> "1800" then Warnlog "Year ( 2 digits ) => changes not saved : '" + Zweistellig.GetText +"'" + If DruckenStatus.IsChecked <> FALSE then Warnlog "Printing sets 'Document modified' status => changes not saved!" + if StyleSheet.GetSelIndex <> 3 then Warnlog "Style sheet for StarOffice Help => changes not saved!" + + '///<li>reset to saved data</li> + printlog " - reset to saved data" + Zweistellig.SetText lsSave ( 1 ) + Aktivieren.Check + Zuruecksetzen.Click + if lbSave (1) = TRUE then Aktivieren.Check else Aktivieren.Uncheck + if gPlatgroup = "w95" then + if lbSave (2) = TRUE then StarOfficeDialogeBenutzen.Check else StarOfficeDialogeBenutzen.UnCheck + end if + If lbSave(3)= TRUE then DruckenStatus.Check else DruckenStatus.UnCheck + StyleSheet.Select lsSave(3) + + '///<li>close options-dialog with OK</li> + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + + '///<li>open options 'StarOffice' / 'General'</li> + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) + + '///<li>check data</li> + printlog " - check the reset data" + if Zweistellig.GetText <> lsSave ( 1 ) then Warnlog "Year ( 2 digits ) => changes not saved" + if Aktivieren.IsChecked <> lbSave (1) then Warnlog "Enable HelpAgent => changes not saved" + Aktivieren.Check + Zuruecksetzen.Click + if lbSave (1) = TRUE then Aktivieren.Check else Aktivieren.Uncheck + if gPlatgroup = "w95" then + if StarOfficeDialogeBenutzen.IsChecked <> lbSave (2) then Warnlog "Use StarOffice dialogs => changes not saved!" + end if + If DruckenStatus.IsChecked <> lbSave(3) then Warnlog "Printing sets 'Document modified' status => changes not saved!" + if StyleSheet.GetSelText <> lsSave (3) then Warnlog "Style sheet for StarOffice Help => changes not saved!" + + '///<li>close options-dialog with OK</li> + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + + '///</ul> + +endcase + diff --git a/testautomation/framework/optional/includes/options_ooo_java.inc b/testautomation/framework/optional/includes/options_ooo_java.inc new file mode 100755 index 000000000000..e698ec1ed1a2 --- /dev/null +++ b/testautomation/framework/optional/includes/options_ooo_java.inc @@ -0,0 +1,142 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_ooo_java.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : Tools->Options: OpenOffice.org Java +'* +'\****************************************************************************** + +testcase tOOoJava + dim bJavaState as boolean + + '///Options test for Java settings + '///<ul> + ToolsOptions + hToolsOptions( "StarOffice", "Java" ) + + '///<li>Make sure Java is enabled. If it is not: Fix this</li> + printlog( "Verify that Java is enabled and configured" ) + if ( usejava.isChecked() = false ) then + warnlog( "Java should be enabled by default, checking and restarting" ) + bJavaState = hChangeJavaState( true ) + if ( bJavaState = false ) then + warnlog( "Java is still not enabled, aborting test." ) + kontext "OptionenDlg" + OptionenDlg.cancel() + goto endsub + endif + else + printlog( " Java is enabled. Good." ) + endif + + ' Needs a delay, it might take some time until the listbox gets populated + sleep( 3 ) + + ' There should be a java-runtime installed. If not -> leave test + '///<li>Make sure Java at least one Java runtime is installed</li> + printlog( "Make sure at least one Java runtime is installed" ) + if ( javalist.getitemcount() = 0 ) then + warnlog( "No java listed in listbox, the test will stop" ) + kontext "OptionenDlg" + OptionenDlg.cancel() + goto endsub + else + printlog( " Java is installed, good." ) + endif + + printlog( "Quickly test that all controls are active" ) + '///<li>Verify that all controls are active</li></ul> + if ( add.isEnabled() ) then + printlog( " 'Add...' is enabled" ) + else + warnlog( "The 'Add...' button is disabled" ) + endif + + if ( parameters.isEnabled() ) then + printlog( " 'Parameters...' is enabled" ) + else + warnlog( "The 'Parameters...' button is disabled" ) + endif + + if ( classpath.isEnabled() ) then + printlog( " 'Class Path...' is enabled" ) + else + warnlog( "The 'Class Path...' button is disabled" ) + endif + + if ( JavaList.isEnabled() ) then + printlog( " 'JavaList' is enabled" ) + else + warnlog( "The 'JavaList' button is disabled" ) + endif + + kontext "OptionenDlg" + OptionenDlg.ok +endcase + +'******************************************************************************* + +function hChangeJavaState( bEnable as boolean ) as boolean + ' this little fella switches Java support on and off including a restart of + ' the office to make the change active. The state is returned + + if ( bEnable ) then + printlog( " Enable Java" ) + usejava.check() + else + printlog( " Disable Java" ) + useJava.unCheck() + endif + + ' leave tools/options + printlog( " Leave Tools/Options" ) + kontext "OptionenDlg" + OptionenDlg.ok() + + ' restart the office to make the change take effect + printlog( " Restart the application" ) + call exitRestartTheOffice() + + ' return to java page + printlog( " Return to Tools/Options Java-page" ) + ToolsOptions + hToolsOptions( "StarOffice", "Java" ) + kontext "TabJava" + + if ( useJava.isChecked() ) then + hChangeJavaState() = true + else + hChangeJavaState() = false + endif +end function diff --git a/testautomation/framework/optional/includes/options_ooo_memory.inc b/testautomation/framework/optional/includes/options_ooo_memory.inc new file mode 100755 index 000000000000..41b06580e5c2 --- /dev/null +++ b/testautomation/framework/optional/includes/options_ooo_memory.inc @@ -0,0 +1,234 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_ooo_memory.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : 1. test for general group userdata ... view) +'* +'\****************************************************************************** + +testcase tOOoMemory + + Dim lsSave (7) as String + Dim lbSave as Boolean + Dim sValue as String + + dim bHasQuickstarter as boolean + + '///short test if 'StarOffice / Momory' is saved in configuration + '///open a new document + '///open options 'StarOffice' / 'Memory' + hNewDocument + ToolsOptions + hToolsOptions ( "StarOffice", "Memory" ) + + '///check platform dependences + '///- 'Load StarOffice at system-startup' has to exist + printlog " - check platform dependences " + + if ( LoadQuickstarter.exists() and LoadQuickstarter.isVisible() and LoadQuickstarter.isEnabled() ) then + bHasQuickstarter = TRUE + printlog( "Quickstarter is available" ) + else + bHasQuickstarter = FALSE + printlog( "Quickstarter is NOT available on this platform" ) + endif + + '///save old data + printlog " - save old data" + lsSave(1) = UndoSteps.GetText + lsSave(2) = StarOffice.GetText + lsSave(3) = MemoryPerObject.GetText + lsSave(4) = RemoveFromMemoryAfter.GetText + lsSave(5) = NumberOfObjects.GetText + if ( bHasQuickstarter ) then + lbSave = LoadQuickstarter.IsChecked + endif + + '///invert/change data + printlog " - invert/change data" + UndoSteps.SetText "80" + StarOffice.SetText "50" + if Instr ( lsSave(3), "," ) <> 0 then + sValue = "4,1" + else + sValue = "4.1" + end if + MemoryPerObject.SetText sValue + RemoveFromMemoryAfter.SetText "00:41" + NumberOfObjects.SetText "81" + if ( bHasQuickstarter ) then + LoadQuickstarter.UnCheck + endif + + '///close options-dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + + + '///close document + hCloseDocument + + '///exit/restart StarOffice + printlog " - exit/restart StarOffice" + ExitRestartTheOffice + + '///open options 'StarOffice' / 'Memory' + printlog " - check data" + ToolsOptions + hToolsOptions ( "StarOffice", "Memory" ) + + '///check data + if UndoSteps.GetText <> "80" then + Warnlog "Undo steps => changes not saved!" + endif + if StarOffice.GetText <> "50" then + Warnlog "Use For StarOffice => changes not saved!" + endif + if MemoryPerObject.GetText <> sValue then + Warnlog "Memory per object => changes not saved! => " + MemoryPerObject.GetText + endif + if RemoveFromMemoryAfter.GetText <> "00:41" then + Warnlog "Remove from memory after => changes not saved! =>" + RemoveFromMemoryAfter.GetText + endif + if NumberOfObjects.GetText <> "81" then + Warnlog "Number of objects => changes not saved!" + endif + if ( bHasQuickstarter ) then + if LoadQuickstarter.IsEnabled then + if LoadQuickstarter.IsChecked = TRUE then + Warnlog "Load StarOffice during system-startup => changes not saved!" + end if + end if + endif + + '///make 2. changes + printlog " - 2. change data" + UndoSteps.SetText "5" + StarOffice.SetText "11" + if Instr ( lsSave(3), "," ) <> 0 then + sValue = "1,9" + else + sValue = "1.9" + end if + MemoryPerObject.SetText sValue + RemoveFromMemoryAfter.SetText "01:32" + NumberOfObjects.SetText "2" + if ( bHasQuickstarter ) then + LoadQuickstarter.Check + endif + + '///close options-dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + + '///open options 'StarOffice' / 'Memory' + printlog " - check data" + ToolsOptions + hToolsOptions ( "StarOffice", "Memory" ) + + '///check data + if UndoSteps.GetText <> "5" then + Warnlog "Undo steps => changes not saved!" + endif + if StarOffice.GetText <> "11" then + Warnlog "Use For StarOffice => changes not saved!" + endif + if MemoryPerObject.GetText <> sValue then + Warnlog "Memory per object => changes not saved! => " + MemoryPerObject.GetText + endif + if RemoveFromMemoryAfter.GetText <> "01:32" then + Warnlog "Remove from memory after => changes not saved! => " + RemoveFromMemoryAfter.GetText + endif + if NumberOfObjects.GetText <> "2" then + Warnlog "Number of objects => changes not saved!" + endif + if ( bHasQuickstarter ) then + if LoadQuickstarter.IsChecked <> TRUE then + Warnlog "Load StarOffice during system-startup => changes not saved!" + end if + endif + + '///reset to saved data + printlog " - reset to saved data" + UndoSteps.SetText lsSave(1) + StarOffice.SetText lsSave(2) + MemoryPerObject.SetText lsSave(3) + RemoveFromMemoryAfter.SetText lsSave(4) + NumberOfObjects.SetText lsSave(5) + + if ( bHasQuickstarter ) then + if lbSave = TRUE then + LoadQuickstarter.Check else LoadQuickstarter.UnCheck + endif + endif + + '///close options-dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + + '///open options 'StarOffice' / 'Memory' + ToolsOptions + hToolsOptions ( "StarOffice", "Memory" ) + + '///check data + printlog " - check the reset data" + if UndoSteps.GetText <> lsSave(1) then + Warnlog "Undo steps => changes not saved!" + endif + if StarOffice.GetText <> lsSave(2) then + Warnlog "Use For StarOffice => changes not saved!" + endif + if MemoryPerObject.GetText <> lsSave(3) then + Warnlog "Memory per object => changes not saved! => " + MemoryPerObject.GetText + endif + if RemoveFromMemoryAfter.GetText <> lsSave(4) then + Warnlog "Remove from memory after => changes not saved! =>" + RemoveFromMemoryAfter.GetText + endif + if NumberOfObjects.GetText <> lsSave(5) then + Warnlog "Number of objects => changes not saved!" + endif + if ( bHasQuickstarter ) then + if LoadQuickstarter.IsChecked <> lbSave then + Warnlog "Load StarOffice during system-startup => changes not saved!" + endif + endif + + '///close options-dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + +endcase + + + diff --git a/testautomation/framework/optional/includes/options_ooo_paths.inc b/testautomation/framework/optional/includes/options_ooo_paths.inc new file mode 100755 index 000000000000..ee52b3532585 --- /dev/null +++ b/testautomation/framework/optional/includes/options_ooo_paths.inc @@ -0,0 +1,369 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_ooo_paths.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : Options - StarOffice - path settings +'* +'\****************************************************************************** + + +testcase tOOoPaths + Dim lsPathOptions(50) as String + Dim lsDialtype(50) as String + Dim lsPaths(10,50) as String + Dim lsEntry(50) as String + Dim i, j, a as Integer + Dim sTTInputPath as String + dim iTypeOfDialog as integer + dim sTyp as string + dim iPaths as integer + dim iTyp as integer + dim iCountOfDialogs(3) as integer + dim aPath() as string + dim i68646 as boolean + + i68646 = FALSE + '///check if all settings are saved in configuration ( StarOffice / Paths ) + sTTInputPath = ConvertPath ( gOfficePath + "user\work" ) + ' Name; which open dialog; Count of Paths +' call GetPathList ( lsPathOptions (), lsDialtype (), lsEntry () ) + ' which open dialog: 1: File Open; Else (2): Paths dialog + 'call DumpPathList( lsPathOptions (), lsDialtype (), lsEntry () ) + + '///open tools/options/staroffice/paths + ToolsOptions + hToolsOptions("StarOffice", "Paths") + + 'reset everything to default; changes made in master.inc are undone for this test. + Typ.TypeKeys("<down><HOME>") + iTyp = Typ.getItemCount + if iTyp <> 8 then + warnlog "Unexpected count of File Types: should: " + 8 + "; is: " + iTyp + else + printlog "Count of Path Types: " + iTyp + endif + for i = 1 to iTyp + try + standard.click + catch + qaerrorlog "Unexpected: No Standard" + endcatch + Typ.TypeKeys( "<DOWN>" ) + next i + + '///save all settings - not needed, since it was resetted to standard.... + printlog("save settings") + for i = 1 to iTyp + if i <> 1 then + Typ.TypeKeys "<Down>" + else + Typ.TypeKeys "<Down>" + Typ.TypeKeys "<Home>" + endif + sleep 1 + sTyp = Typ.getText + aPath() = split(Typ.getItemText(i,2),";") + lsPathOptions(i) = sTyp + + Bearbeiten.Click + kontext + if active.exists(5) then + qaerrorlog "Active: " + active.getText + active.ok + endif + kontext "OeffnenDlg" + if OeffnenDlg.Exists(5) then + iTypeOfDialog = 1 + inc(iCountOfDialogs(1)) + else + kontext "PfadeAuswaehlen" + if PfadeAuswaehlen.Exists(5) then + iTypeOfDialog = 2 + inc(iCountOfDialogs(2)) + else + ' EXIT CONDITION + warnlog "No kind of File Dialog is open - exiting test" + iTypeOfDialog = 0 + goto endsub + endif + endif + + lsDialtype(i) = iTypeOfDialog + select case iTypeOfDialog + case 1:' printlog( " - Dialogtype: FileOpen" ) + kontext "OeffnenDlg" + if OeffnenDlg.Exists(2) then + lsPaths(1,i) = Pfad.GetSelText + ' change Path + Pfad.SetText sTTInputPath + try + Auswaehlen.Click + catch + qaErrorlog "Catch -1-?" + OeffnenDlg.typekeys("<MOD+S>") + endcatch + printlog "" + i + "/1: " + right(lsPaths(1,i),10) + " : " + sTyp + " " + lsPaths(1,i) + else + warnlog "No Path dialog available" + end if + case 2:' printlog( " - Dialogtype: PathDialog" ) + kontext "PfadeAuswaehlen" + if PfadeAuswaehlen.Exists(2) then + try + iPaths = Pfade.GetItemCount + catch + qaErrorLog "#i68646# Path Multilistbox is invisible to TestTool application" + i68646 = TRUE + iPaths=0 + endcatch + lsEntry(i) = iPaths + if NOT i68646 then + if (2 <> iPaths) then + warnlog "Unexpected count of paths; Should: " + 2 + "; Is: " + iPaths + endif + endif + for j=1 to iPaths + lsPaths(j,i) = Pfade.GetItemtext(j) + next j + Hinzufuegen.Click + kontext "OeffnenDlg" + if OeffnenDlg.exists(5) then + Pfad.SetText sTTInputPath + lsPaths(iPaths+1,i) = sTTInputPath + Sleep (1) + try + Auswaehlen.Click + catch + OeffnenDlg.typekeys( "<MOD+S>" ) + endcatch + kontext + if active.exists(5) then + qaErrorLog "Active about already existsing path?: '" + active.getText + "' + '" + sTTInputPath + "'" + active.OK + endif + else + warnlog "No Path dialog available" + endif + kontext "PfadeAusWaehlen" + PfadeAuswaehlen.OK + printlog "" + i + "/"+iPaths+": " + right(lsPaths(1,i),10) + " : " + sTyp + printlog "" + i + "/-: " + right(lsPaths(2,i),10) + " : " + sTyp + else + warnlog "No Path dialog available" + endif + case else: warnlog "Unexpected kind of Path dialog available" + end select + Sleep(1) + ' double cross check of Paths in both dialogs + if (uBound(aPath()) <> (iTypeOfDialog-1)) then + qaErrorLog ("Sanity check failed.") + endif + kontext "tabpfade" + next i + printlog "Path changed to, or added: '" + sTTInputPath + "'" + + 'Check if count of kinds of dialogs match + if iCountOfDialogs(1) <> 4 then + warnlog "Unexpected count of File Open Dialogs: should: " + 4 + "; is: " + iCountOfDialogs(1) + else + printlog "Count of File Open Dialogs: " + iCountOfDialogs(1) + endif + if iCountOfDialogs(2) <> 4 then + warnlog "Unexpected count of File Open Dialogs: should: " + 4 + "; is: " + iCountOfDialogs(2) + else + printlog "Count of File Open Dialogs: " + iCountOfDialogs(2) + endif + + '///close the options dialog with OK + kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (4) + '///exit and restart StarOffice + printlog("Exit/restart StarOffice") + ExitRestartTheOffice + '///check if all changes are saved + printlog( "Check changes") + ToolsOptions + '///open tools/options/staroffice/paths and compare all entries + hToolsOptions ( "StarOffice", "Paths" ) + + for i = 1 to iTyp + ' It's a treelistbox with multiselection; + ' .select would select an additional item :-( + ' a lonely <home> wouldn't change the selction :-< + if i <> 1 then + Typ.typeKeys("<down>") + else + Typ.typeKeys("<down>") + Typ.typeKeys("<Home>") + endif + sleep(1) + + try + Bearbeiten.Click + catch + warnlog "Multiselection ?" + endcatch + kontext + if active.exists(5) then + warnlog "#i72017# '"+active.getText+"'" + active.ok + endif + select case lsDialtype(i) + case 1: + kontext "OeffnenDlg" + if OeffnenDlg.Exists(5) then + sTyp = Pfad.GetSelText + if (sTyp <> sTTInputPath) then + if (sTyp <> ( sTTInputPath + gPathSigne)) then + Warnlog "'" + lsPathOptions(i) + "' options is not saved! => must: '" + sTTInputPath + "' is: '" + sTyp +"'" + endif + end if + ' reset to default + ' compute path's that were changed in TestStartUp (work and temp) + if ((Right(lsPaths(1,i),5)="work"+gPathSigne) OR (Right(lsPaths(1,i),4)="work")) then + Pfad.SetText(lsPaths(1,i)) + Auswaehlen.Click + else + OeffnenDlg.Cancel + kontext "tabpfade" + if Standard.IsEnabled then + Standard.Click + else + warnlog "Can't reset to standard" + endif + endif + end if + case 2: + kontext "PfadeAuswaehlen" + if PfadeAuswaehlen.exists (5) then + try + iPaths = Pfade.GetItemCount + catch + printlog "failed" + iPaths=0 + endcatch + for j=1 to iPaths + if (lsPaths(j,i) <> Pfade.GetItemtext(j)) then + Warnlog "'" + lsPathOptions(i) + "': " + j + ". options is not saved! Path found: '" + Pfade.GetItemtext(j) + "'; expected: '" + lsPaths(j,i) +"'" + endif + next j + PfadeAuswaehlen.Cancel + end if + ' reset to default + kontext "tabpfade" + if Standard.IsEnabled then + Standard.Click + else + warnlog "Can't reset to standard" + endif + case else: warnlog "Unexpected kind of file open dialog" + end select + sleep 1 + kontext "tabpfade" + next i + + '///set all changes to default + printlog("Reset to default ( with default-button )") + '///select each entry and press 'Default' + if gPlatgroup = "unx" then + hToolsOptions ( "StarOffice", "General" ) + endif + Sleep (4) + '///close the options dialog with OK + kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK() + Sleep (4) + '///check the reset + printlog("Check the reset") + ToolsOptions + hToolsOptions ( "StarOffice", "Paths" ) + '///open tools/options/staroffice/paths and compare all entries with the saved default settings + for i = 1 to iTyp + if i <> 1 then + Typ.TypeKeys "<Down>" + else + Typ.TypeKeys "<Down>" + Typ.TypeKeys "<Home>" + end if + sleep(1) + Bearbeiten.Click + kontext + if active.exists(5) then + qaerrorlog active.getText + active.ok + endif + select case lsDialtype(i) + case 1: + kontext "OeffnenDlg" + if OeffnenDlg.Exists(5) then + sTyp = Pfad.GetSelText + if (sTyp <> lsPaths(1,i)) then + Warnlog "'" + lsPathOptions(i) + "' options is not saved! => must: '" + lsPaths(1,i) + "' is: '" + sTyp +"'" + endif + OeffnenDlg.Cancel + end if + case 2: + kontext "PfadeAuswaehlen" + if PfadeAuswaehlen.exists(5) then + try + iPaths = Pfade.GetItemCount + catch + printlog "failed" + iPaths = 0 + endcatch + for j=1 to iPaths + if (lsPaths(j,i) <> Pfade.GetItemtext(j)) then + Warnlog "'" + lsPathOptions(i) + "': " + j + ". options is not saved! Path found: '" + Pfade.GetItemtext(j) + "'; expected: '" + lsPaths(j,i) +"'" + endif + next j + PfadeAuswaehlen.Cancel + end if + case else: warnlog "Unexpected kind of file open dialog" + end select + sleep(1) + kontext "tabpfade" + next i + if gPlatgroup = "unx" then + hToolsOptions ( "StarOffice", "General" ) + endif + Sleep (4) + '///close the options dialog with OK + kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + '///exit and restart StarOffice IMPORTANT! to get the path's activated that have been changed! + printlog("Exit/restart StarOffice") + ExitRestartTheOffice +endcase + diff --git a/testautomation/framework/optional/includes/options_ooo_print.inc b/testautomation/framework/optional/includes/options_ooo_print.inc new file mode 100755 index 000000000000..ed0c757abe28 --- /dev/null +++ b/testautomation/framework/optional/includes/options_ooo_print.inc @@ -0,0 +1,479 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_ooo_print.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : Tools->Options: OpenOffice.org Print +'* +'\****************************************************************************** + + +testcase tOOoPrint + + Dim lbSave ( 3 ) as Boolean + Dim lsSavePrinter ( 3 ) as String + Dim lbSavePrinter ( 13 ) as Boolean + Dim lsSaveFile ( 3 ) as String + Dim lbSaveFile ( 13 ) as Boolean + +'///check if all settings are saved in configuration ( StarOffice / Print ) +'///open options 'StarOffice' / 'Print' + ToolsOptions + hToolsOptions ( "StarOffice", "Print" ) + +'///save old settings +'///- save the settings for printer-section + printlog " - save old settings" + printlog " - save settings for 'printer'" + Printer.Check + Sleep (2) + lbSavePrinter (1) = ReduceTransparency.IsChecked + ReduceTransparency.Uncheck + lbSave(3) = Transparency.IsChecked + ReduceTransparency.Check + lbSavePrinter (2) = Automatically.IsChecked + lbSavePrinter (3) = NoTransparency.IsChecked + + lbSavePrinter (4) = ReduceGradients.IsChecked + ReduceGradients.Check + lbSavePrinter (5) = GradientStripes.IsChecked + lbSavePrinter (6) = IntermediateColor.IsChecked + GradientStripes.Check + lsSavePrinter (1) = Stripes.GetText + + lbSavePrinter (7) = ReduceBitmaps.IsChecked + ReduceBitmaps.Check + lbSavePrinter (8) = GoodPrintQuality.IsChecked + lbSavePrinter (9) = NormalPrintQuality.IsChecked + lbSavePrinter (10) = Resolution.IsChecked + lbSavePrinter (11) = IncludeTransparentObjects.IsChecked + Resolution.Check + lsSavePrinter (2) = DPI.GetSelText + + lbSavePrinter (12) = ConvertColorsToGrayscale.IsChecked + +'///- save settings for 'print to file' + printlog " - save settings for 'print to file'" + PrintToFile.Check + Sleep (2) + lbSaveFile (1) = ReduceTransparency.IsChecked + ReduceTransparency.Check + lbSaveFile (2) = Automatically.IsChecked + lbSaveFile (3) = NoTransparency.IsChecked + + lbSaveFile (4) = ReduceGradients.IsChecked + ReduceGradients.Check + lbSaveFile (5) = GradientStripes.IsChecked + lbSaveFile (6) = IntermediateColor.IsChecked + GradientStripes.Check + lsSaveFile (1) = Stripes.GetText + + lbSaveFile (7) = ReduceBitmaps.IsChecked + ReduceBitmaps.Check + lbSaveFile (8) = GoodPrintQuality.IsChecked + lbSaveFile (9) = NormalPrintQuality.IsChecked + lbSaveFile (10) = Resolution.IsChecked + lbSaveFile (11) = IncludeTransparentObjects.IsChecked + Resolution.Check + lsSaveFile (2) = DPI.GetSelText + + lbSaveFile (12) = ConvertColorsToGrayscale.IsChecked + +'///- save general settings + printlog " - save general settings " + lbSave(1) = PaperOrientation.IsChecked + lbSave(2) = PaperSize.IsChecked + +'///invert/change settings +'///- changes for 'printer' + printlog " - invert/change settings" + printlog " - changes for 'printer'" + Printer.Check + Sleep (2) + if lbSavePrinter (1) = FALSE then ReduceTransparency.Check else ReduceTransparency.UnCheck + if ReduceTransparency.IsChecked then + NoTransparency.Check + else + if lbSave(3) = FALSE then Transparency.Check else Transparency.UnCheck + end if + + if lbSavePrinter (4) = FALSE then ReduceGradients.Check else ReduceGradients.UnCheck + if ReduceGradients.IsChecked then + IntermediateColor.Check + end if + + if lbSavePrinter (7) = FALSE then ReduceBitmaps.Check else ReduceBitmaps.UnCheck + if ReduceBitmaps.IsChecked then + Resolution.Check + DPI.select 1 + if lbSavePrinter (11) = FALSE then IncludeTransparentObjects.Check else IncludeTransparentObjects.UnCheck + end if + + if lbSavePrinter (12) = FALSE then ConvertColorsToGrayscale.Check else ConvertColorsToGrayscale.UnCheck + +'///- changes for 'print to file' + printlog " - changes for 'print to file'" + PrintToFile.Check + Sleep (2) + if lbSaveFile (1) = FALSE then ReduceTransparency.Check else ReduceTransparency.UnCheck + if ReduceTransparency.IsChecked then + Automatically.Check + end if + + if lbSaveFile (4) = FALSE then ReduceGradients.Check else ReduceGradients.UnCheck + if ReduceGradients.IsChecked then + GradientStripes.Check + Stripes.SetText "30" + end if + + if lbSaveFile (7) = FALSE then ReduceBitmaps.Check else ReduceBitmaps.UnCheck + if ReduceBitmaps.IsChecked then + GoodPrintQuality.Check + if lbSaveFile (11) = FALSE then IncludeTransparentObjects.Check else IncludeTransparentObjects.UnCheck + end if + + if lbSaveFile (12) = FALSE then ConvertColorsToGrayscale.Check else ConvertColorsToGrayscale.UnCheck + +'///- changes for general settings + printlog " - changes for general settings" + if lbSave(1) = FALSE then PaperOrientation.Check else PaperOrientation.UnCheck + if lbSave(2) = FALSE then PaperSize.Check else PaperSize.UnCheck + +'///close options-dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///exit/restart StarOffice + printlog " - exit/restart StarOffice" + ExitRestartTheOffice + +'///open options 'StarOffice' / 'Print' + printlog " - check invertation/changes" + ToolsOptions + hToolsOptions ( "StarOffice", "Print" ) + +'///check invertation/changes +'///- check for 'printer' + printlog " - check for 'printer'" + Printer.Check + Sleep (2) + if ReduceTransparency.IsChecked = lbSavePrinter (1) then Warnlog "Reduce transparency => changes not saved! => BugID 87446" + if ReduceTransparency.IsChecked then + if NoTransparency.IsChecked <> TRUE then Warnlog "No transparency => changes not saved!" + else + if Transparency.IsChecked = lbSave(2) then Warnlog "Transparency => changes not saved!" + end if + + + if ReduceGradients.IsChecked = lbSavePrinter (4) then Warnlog "ReduceGradients => changes not saved!" + if ReduceGradients.IsChecked then + if IntermediateColor.IsChecked <> TRUE then Warnlog "Intermediate color => changes not saved!" + end if + + if ReduceBitmaps.IsChecked = lbSavePrinter (7) then Warnlog "Reduce bitmaps => changes not saved!" + if ReduceBitmaps.IsChecked then + if Resolution.IsChecked <> TRUE then + Warnlog "Resolution => changes not saved!" + else + if DPI.GetSelIndex <> 1 then Warnlog "DPI => changes not saved!" + end if + if IncludeTransparentObjects.IsChecked = lbSavePrinter (11) then Warnlog "Include Transparent Objects => changes not saved!" + end if + + if ConvertColorsToGrayscale.IsChecked = lbSavePrinter (12) then Warnlog "Convert Colors To Grayscale => changes not saved!" + +'///- check for 'print to file' + printlog " - check for 'print to file'" + PrintToFile.Check + Sleep (2) + if ReduceTransparency.IsChecked = lbSaveFile (1) then Warnlog "Reduce transparency => changes not saved!" + if ReduceTransparency.IsChecked then + if Automatically.IsChecked <> TRUE then Warnlog "Automatically => changes not saved!" + end if + + if ReduceGradients.IsChecked = lbSaveFile (4) then Warnlog "Reduce gradients => changes not saved!" + if ReduceGradients.IsChecked then + if GradientStripes.IsChecked <> TRUE then Warnlog "GradientStripes => changes not saved!" + if GradientStripes.IsChecked then + if Stripes.GetText <> "30" then Warnlog "Stripes => changes not saved!" + end if + end if + + if ReduceBitmaps.IsChecked = lbSaveFile (7) then Warnlog "Reduce bitmaps => changes not saved!" + + if ReduceBitmaps.IsChecked then + if GoodPrintQuality.IsChecked <> TRUE then Warnlog "Good print quality => changes not saved!" + if IncludeTransparentObjects.IsChecked = lbSaveFile (11) then Warnlog "Include transparent objects = changes not saved!" + end if + + if ConvertColorsToGrayscale.IsChecked = lbSaveFile (12) then warnlog "Convert colors to grayscale => changes not saved!" + +'///check for general settings + printlog " - check for general settings" + if PaperOrientation.IsChecked = lbSave(1) then warnlog "Paper orientation => changes not saved! #i29960" + if PaperSize.IsChecked = lbSave(2) then Warnlog "Paper size => changes not saved! #i29960" + +'///2. changes +'///- changes for 'printer' + printlog " - 2. changes" + printlog " - 'printer'" + Printer.Check + Sleep (2) + ReduceTransparency.UnCheck + ReduceGradients.Check + GradientStripes.Check + Stripes.SetText "120" + ReduceBitmaps.Check + GoodPrintQuality.Check + IncludeTransparentObjects.Check + ConvertColorsToGrayscale.UnCheck + +'///- changes for 'print to file' + printlog " - 'print to file'" + PrintToFile.Check + ReduceTransparency.Check + NoTransparency.Check + ReduceGradients.Uncheck + ReduceBitmaps.UnCheck + ConvertColorsToGrayscale.Check + +'///- changes for general settings + printlog " - general settings" + PaperOrientation.UnCheck + PaperSize.Check + +'///close the options-dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///open options 'StarOffice' / 'Print' +'///check 2. changes + printlog " - check 2. changes" + ToolsOptions + hToolsOptions ( "StarOffice", "Print" ) + +'///- check for 'printer' + printlog " - check for 'printer'" + Printer.Check + Sleep (2) + if ReduceTransparency.IsChecked <> FALSE then Warnlog "Reduce transparency => changes not saved!" + if ReduceGradients.IsChecked <> TRUE then + Warnlog "ReduceGradients => changes not saved!" + else + if GradientStripes.IsChecked <> TRUE then + Warnlog "GradientStripes => changes not saved!" + else + if Stripes.GetText <> "120" then Warnlog "Stripes => changes not saved!" + end if + end if + if ReduceBitmaps.IsChecked <> TRUE then + Warnlog "Reduce bitmaps => changes not saved!" + else + if GoodPrintQuality.IsChecked <> TRUE then Warnlog "Good print quality => changes not saved!" + if IncludeTransparentObjects.IsChecked <> TRUE then Warnlog "Include Transparent Objects => changes not saved!" + end if + if ConvertColorsToGrayscale.IsChecked <> FALSE then Warnlog "Convert Colors To Grayscale => changes not saved!" + +'///- check 'print to file' + printlog " - check 'print to file'" + PrintToFile.Check + Sleep (2) + if ReduceTransparency.IsChecked <> TRUE then + Warnlog "Reduce transparency => changes not saved!" + else + if NoTransparency.IsChecked <> TRUE then Warnlog "No transpanency => changes not saved!" + end if + if ReduceGradients.IsChecked <> FALSE then Warnlog "Reduce gradients => changes not saved!" + if ReduceBitmaps.IsChecked <> FALSE then Warnlog "Reduce bitmaps => changes not saved!" + if ConvertColorsToGrayscale.IsChecked <> TRUE then Warnlog "Convert colors to grayscale => changes not saved!" + +'///- check for general settings + printlog " - check general settings" + if PaperOrientation.IsChecked <> FALSE then warnlog "Paper orientation => changes not saved!" + if PaperSize.IsChecked <> TRUE then Warnlog "Paper size => changes not saved! #i29960" + +'///reset to saved settings + printlog " - reset to saved settings" + printlog " - 'printer'" + Printer.Check + Sleep (2) + ReduceTransparency.Check + if lbSavePrinter (2) = TRUE then Automatically.Check + if lbSavePrinter (3) = TRUE then NoTransparency.Check + ReduceTransparency.UnCheck + if lbSave(3) = TRUE then Transparency.Check else Transparency.Uncheck + if lbSavePrinter (1) = TRUE then ReduceTransparency.check else ReduceTransparency.Uncheck + + ReduceGradients.Check + GradientStripes.Check + Stripes.SetText lsSavePrinter (1) + if lbSavePrinter (5) = TRUE then GradientStripes.Check + if lbSavePrinter (6) = TRUE then IntermediateColor.Check + if lbSavePrinter (4) = TRUE then ReduceGradients.Check else ReduceGradients.UnCheck + if lbSavePrinter (4) = TRUE then ReduceGradients.Check else ReduceGradients.UnCheck + + ReduceBitmaps.Check + Resolution.Check + DPI.Select lsSavePrinter (2) + if lbSavePrinter (8) = TRUE then GoodPrintQuality.Check + if lbSavePrinter (9) = TRUE then NormalPrintQuality.Check + if lbSavePrinter (10) = TRUE then Resolution.Check + if lbSavePrinter (11) = TRUE then IncludeTransparentObjects.Check else IncludeTransparentObjects.UnCheck + if lbSavePrinter (7) = TRUE then ReduceBitmaps.Check else ReduceBitmaps.UnCheck + + if lbSavePrinter (12) = TRUE then ConvertColorsToGrayscale.Check else ConvertColorsToGrayscale.UnCheck + + printlog " - 'print to file'" + PrintToFile.Check + Sleep (2) + ReduceTransparency.Check + if lbSaveFile (2) = TRUE then Automatically.Check + if lbSaveFile (3) = TRUE then NoTransparency.Check + if lbSaveFile (1) = TRUE then ReduceTransparency.Check else ReduceTransparency.UnCheck + + ReduceGradients.Check + GradientStripes.Check + Stripes.SetText lsSaveFile (1) + if lbSaveFile (5) = TRUE then GradientStripes.Check + if lbSaveFile (6) = TRUE then IntermediateColor.Check + if lbSaveFile (4) = TRUE then ReduceGradients.Check else ReduceGradients.UnCheck + + ReduceBitmaps.Check + Resolution.Check + DPI.Select lsSaveFile (2) + if lbSaveFile (8) = TRUE then GoodPrintQuality.Check + if lbSaveFile (9) = TRUE then NormalPrintQuality.Check + if lbSaveFile (10) = TRUE then Resolution.Check + if lbSaveFile (11) = TRUE then IncludeTransparentObjects.Check else IncludeTransparentObjects.UnCheck + if lbSaveFile (7) = TRUE then ReduceBitmaps.Check else ReduceBitmaps.Uncheck + + if lbSaveFile (12) = TRUE then ConvertColorsToGrayscale.Check else ConvertColorsToGrayscale.UnCheck + + printlog " - general settings" + if lbSave(1) = TRUE then PaperOrientation.check else PaperOrientation.Uncheck + if lbSave(2) = TRUE then PaperSize.Check else PaperSize.UnCheck + +'///close options-dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///open options 'StarOffice' / 'Print' +'///check changes + printlog " - check changes" + ToolsOptions + hToolsOptions ( "StarOffice", "Print" ) + +'///- check for 'printer' + printlog " - check for 'printer'" + Printer.Check + Sleep (2) + if ReduceTransparency.IsChecked <> lbSavePrinter (1) then Warnlog "Reduce transparency => changes not saved!" + ReduceTransparency.Check + if Automatically.IsChecked <> lbSavePrinter (2) then Warnlog "Automatically => changes not saved!" + if NoTransparency.IsChecked <> lbSavePrinter (3) then Warnlog "No transparency => changes not saved!" + ReduceTransparency.UnCheck + if Transparency.IsChecked <> lbSave(3) then Warnlog "Transparency => changes not saved!" + if lbSavePrinter (1) = TRUE then ReduceTransparency.Check else ReduceTransparency.UnCheck + + if ReduceGradients.IsChecked <> lbSavePrinter (4) then Warnlog "Reduce Gradients => changes not saved!" + ReduceGradients.Check + if GradientStripes.IsChecked <> lbSavePrinter (5) then Warnlog "GradientStripes => changes not saved!" + if IntermediateColor.IsChecked <> lbSavePrinter (6) then Warnlog "Intermediate color => changes not saved!" + GradientStripes.Check + if Stripes.GetText <> lsSavePrinter (1) then Warnlog "Stripes => changes not saved!" + if lbSavePrinter (5) = TRUE then GradientStripes.Check else IntermediateColor.Check + if lbSavePrinter (4) = TRUE then ReduceGradients.Check else ReduceGradients.UnCheck + + if ReduceBitmaps.IsChecked <> lbSavePrinter (7) then Warnlog "Reduce Bitmaps => changes not saved!" + ReduceBitmaps.Check + if GoodPrintQuality.IsChecked <> lbSavePrinter (8) then Warnlog "Good print quality => changes not saved!" + if NormalPrintQuality.IsChecked <> lbSavePrinter (9) then Warnlog "Normal print quality => changes not saved!" + if Resolution.IsChecked <> lbSavePrinter (10) then Warnlog "Resolution => changes not saved!" + if IncludeTransparentObjects.IsChecked <> lbSavePrinter (11) then Warnlog "Include transparent objects => changes not saved!" + Resolution.Check + if DPI.GetSelText <> lsSavePrinter (2) then Warnlog "DPI => changes not saved!" + if lbSavePrinter (8) = TRUE then GoodPrintQuality.Check + if lbSavePrinter (9) = TRUE then NormalPrintQuality.Check + if lbSavePrinter (10) = TRUE then Resolution.Check + if lbSavePrinter (7) = TRUE then ReduceBitmaps.Check else ReduceBitmaps.Uncheck + + if ConvertColorsToGrayscale.IsChecked <> lbSavePrinter (12) then Warnlog "Convert colors to grayscale => changes not saved!" + +'///- check for 'print to file' + printlog " - 'print to file'" + PrintToFile.Check + Sleep (2) + if ReduceTransparency.IsChecked <> lbSaveFile (1) then Warnlog "Reduce transparency => changes not saved!" + ReduceTransparency.Check + if Automatically.IsChecked <> lbSaveFile (2) then Warnlog "Automatically => changes not saved!" + if NoTransparency.IsChecked <> lbSaveFile (3) then Warnlog "No transparency => changes not saved!" + if lbSaveFile (1) = TRUE then ReduceTransparency.Check else ReduceTransparency.UnCheck + + if ReduceGradients.IsChecked <> lbSaveFile (4) then Warnlog "Reduce Gradients => changes not saved!" + ReduceGradients.Check + if GradientStripes.IsChecked <> lbSaveFile (5) then Warnlog "GradientStripes => changes not saved!" + if IntermediateColor.IsChecked <> lbSaveFile (6) then Warnlog "Intermediate color => changes not saved!" + GradientStripes.Check + if Stripes.GetText <> lsSaveFile (1) then Warnlog "Stripes => changes not saved!" + if lbSaveFile (5) = TRUE then GradientStripes.Check else IntermediateColor.Check + if lbSaveFile (4) = TRUE then ReduceGradients.Check else ReduceGradients.UnCheck + + if ReduceBitmaps.IsChecked <> lbSaveFile (7) then Warnlog "Reduce Bitmaps => changes not saved!" + ReduceBitmaps.Check + if GoodPrintQuality.IsChecked <> lbSaveFile (8) then Warnlog "Good print quality => changes not saved!" + if NormalPrintQuality.IsChecked <> lbSaveFile (9) then Warnlog "Normal print quality => changes not saved!" + if Resolution.IsChecked <> lbSaveFile (10) then Warnlog "Resolution => changes not saved!" + if IncludeTransparentObjects.IsChecked <> lbSaveFile (11) then Warnlog "Include transparent objects => changes not saved!" + Resolution.Check + if DPI.GetSelText <> lsSavePrinter (2) then Warnlog "DPI => changes not saved!" + if lbSaveFile (8) = TRUE then GoodPrintQuality.Check + if lbSaveFile (9) = TRUE then NormalPrintQuality.Check + if lbSaveFile (10) = TRUE then Resolution.Check + if lbSaveFile (7) = TRUE then ReduceBitmaps.Check else ReduceBitmaps.Uncheck + + if ConvertColorsToGrayscale.IsChecked <> lbSaveFile (12) then Warnlog "Convert colors to grayscale => changes not saved!" + +'///- check for general settings + printlog " - general settings" + if PaperOrientation.Ischecked <> lbSave(1) then Warnlog "Paper orientation => changes not saved!" + if PaperSize.IsChecked <> lbSave(2) then Warnlog "Paper size. => changes not saved!" + +'///close options-dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) +endcase + diff --git a/testautomation/framework/optional/includes/options_ooo_security.inc b/testautomation/framework/optional/includes/options_ooo_security.inc new file mode 100755 index 000000000000..36bc7d38d5cc --- /dev/null +++ b/testautomation/framework/optional/includes/options_ooo_security.inc @@ -0,0 +1,142 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_ooo_security.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : Tools->Options: OpenOffice.org Security +'* +'\****************************************************************************** + +testcase tOOoSecurity + '///Test the OpenOffice.org/Security-Tabpage in Tools/Options + '///<ul> + dim _file as string + + hNewDocument() + '///<li>check defaults</li> + _file = gTesttoolPath & "framework\options\input\ooo_security_defaults.ref" + checkSecurityPage( _file ) + + '///<li>change the settings</li> + _file = gTesttoolPath & "framework\options\input\ooo_security_changed.ref" + changeSecurityPage( _file ) + + '///<li>check the changes</li> + checkSecurityPage( _file ) + + '///<li>revert to default settings</li> + _file = gTesttoolPath & "framework\options\input\ooo_security_defaults.ref" + changeSecurityPage( _file ) + + '///<li>check the changes</li> + checkSecurityPage( _file ) + + '///</ul> + kontext "ExtrasOptionenDlg" + if ( ExtrasOptionenDlg.exists() ) then + ExtrasOptionenDlg.ok() + else + warnlog( "options dialog not available" + endif +endcase + +'******************************************************************************* + +sub checkSecurityPage( _file as string ) + _file = convertpath( _file ) + + printlog( " * Testing current settings against a reference list." ) + printlog( " * Using settings from file: " & _file ) + + ToolsOptions + call hToolsOptions("StarOffice", "Security") + + kontext "TabSecurity" + if ( TabSecurity.exists() ) then + + Options.click + + Kontext "TabSecurityOptionsAndWarnings" + if ( TabSecurityOptionsAndWarnings.exists( 2 ) ) then + checkCheckBox( _file , "*" , SavingOrSendingDocuments ) + checkCheckBox( _file , "*" , SigningDocuments ) + checkCheckBox( _file , "*" , PrintingDocuments ) + checkCheckBox( _file , "*" , CreatingPDFfiles ) + checkCheckBox( _file , "*" , RemovePersonalInformationOnSaving ) + checkCheckBox( _file , "*" , RecommendPasswordProtectionOnSaving ) + TabSecurityOptionsAndWarnings.cancel + else + warnlog( "Failed to open Security options" ) + endif + + Kontext "TabSecurity" + if ( TabSecurity.exists() ) then + checkCheckBox( _file , "*" , RecommendToOpenDocumentReadOnly ) + checkCheckBox( _file , "*" , RecordChanges ) + else + warnlog( "Could not return to Security Tabpage" ) + endif + else + warnlog( "Security Tabpage not available" ) + endif +end sub + +'******************************************************************************* + +sub changeSecurityPage( _file as string ) + _file = convertpath( _file ) + + printlog( " * Changing current settings according to the reference list." ) + printlog( " * Using settings from file: " & _file ) + + Options.click + Kontext "TabSecurityOptionsAndWarnings" + setCheckBox( _file , "*" , SavingOrSendingDocuments ) + setCheckBox( _file , "*" , SigningDocuments ) + setCheckBox( _file , "*" , PrintingDocuments ) + setCheckBox( _file , "*" , CreatingPDFfiles ) + setCheckBox( _file , "*" , RemovePersonalInformationOnSaving ) + setCheckBox( _file , "*" , RecommendPasswordProtectionOnSaving ) + TabSecurityOptionsAndWarnings.cancel + Kontext "TabSecurity" + setCheckBox( _file , "*" , RecommendToOpenDocumentReadOnly ) + setCheckBox( _file , "*" , RecordChanges ) + + Kontext "OptionenDLG" + OptionenDLG.OK + + sleep(2) + call exitRestartTheOffice() +end sub + + diff --git a/testautomation/framework/optional/includes/options_ooo_userdata.inc b/testautomation/framework/optional/includes/options_ooo_userdata.inc new file mode 100755 index 000000000000..1de0fc8118e7 --- /dev/null +++ b/testautomation/framework/optional/includes/options_ooo_userdata.inc @@ -0,0 +1,224 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_ooo_userdata.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : Tools->Options: OpenOffice.org User Data +'* +'\****************************************************************************** + + +testcase tOOoUserData + Dim lsSave ( 20 ) as String + +'///short test if 'StarOffice / User data' is saved in configuration +'///Start the test again, and you do not get the error. If you get the warning again, you have to check this.</FONT> + +'///open a new document + hInitSingleDoc() + ToolsOptions + hToolsOptions ( "StarOffice", "UserData" ) + +'///save old data + printlog " - save old data" + lsSave ( 1 ) = Firma.GetText + lsSave ( 2 ) = VorName.GetText + lsSave ( 3 ) = ZuName.GetText + lsSave ( 4 ) = Kuerzel.GetText + lsSave ( 5 ) = Strasse.GetText + lsSave ( 6 ) = Land.GetText + lsSave ( 7 ) = Titel.GetText + lsSave ( 8 ) = Position.GetText + lsSave ( 9 ) = TelPriv.GetText + lsSave ( 10 ) = TelGe.GetText + lsSave ( 11 ) = Fax.GetText + lsSave ( 12 ) = EMail.GetText + + if iSprache = 01 then + lsSave ( 13 ) = City.GetText + lsSave ( 14 ) = State.GetText + lsSave ( 15 ) = Zip.GetText + else + lsSave ( 16 ) = PLZ.GetText + lsSave ( 17 ) = Ort.GetText + end if + if Apartmentnummer.IsVisible then lsSave ( 18 ) = Apartmentnummer.GetText + if iSprache = 07 then lsSave ( 19 ) = NameDesVaters.GetText + +'///change all data + printlog " - change data" + Firma.SetText "Company name" + VorName.SetText "First name" + ZuName.SetText "Last name" + Kuerzel.SetText "FnLn" + Strasse.SetText "Street name" + Land.SetText "Land name" + Titel.SetText "Title name" + Position.SetText "Position name" + TelPriv.SetText "TelHome number" + TelGe.SetText "TelWork number" + Fax.SetText "Fax number" + EMail.SetText "eMail-adress" + + if iSprache = 01 then + City.SetText "City name" + State.SetText "State name" + Zip.SetText "Zip code" + else + PLZ.SetText "PLZ name" + Ort.SetText "Ort name" + end if + if Apartmentnummer.IsVisible then Apartmentnummer.SetText "Appart number" + if iSprache = 07 then NameDesVaters.SetText "Farthers name" + +'///close the options-dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///close the document + hCloseDocument + +'///exit / restart StarOffice + printlog " - exit/restart StarOffice" + ExitRestartTheOffice + +'///open options 'StarOffice' / 'Userdata' + printlog " - check changes" + ToolsOptions + hToolsOptions ( "StarOffice", "UserData" ) + +'///check changes + if Firma.GetText <> "Company name" then Warnlog "Company => changes not saved" + if VorName.GetText <> "First name" then Warnlog "First name => changes not saved" + if ZuName.GetText <> "Last name" then Warnlog "Last name => changes not saved" + if Kuerzel.GetText <> "FnLn" then Warnlog "Initials => changes not saved" + if Strasse.GetText <> "Street name" then Warnlog "Street => changes not saved" + if Land.GetText <> "Land name" then Warnlog "Land => changes not saved" + if Titel.GetText <> "Title name" then Warnlog "Title => changes not saved" + if Position.GetText <> "Position name" then Warnlog "Position => changes not saved" + if TelPriv.GetText <> "TelHome number" then Warnlog "Tel-home => changes not saved" + if TelGe.GetText <> "TelWork number" then Warnlog "tel-work => changes not saved" + if Fax.GetText <> "Fax number" then Warnlog "Fax => changes not saved" + if EMail.GetText <> "eMail-adress" then Warnlog "eMail => changes not saved" + + if iSprache = 01 then + if City.GetText <> "City name" then Warnlog "City => changes not saved" + if State.GetText <> "State name" then Warnlog "State => changes not saved" + if Zip.GetText <> "Zip code" then Warnlog "Zip => changes not saved" + else + if PLZ.GetText <> "PLZ name" then Warnlog "PLZ => changes not saved" + if Ort.GetText <> "Ort name" then Warnlog "Ort => changes not saved" + end if + if Apartmentnummer.IsVisible then + if Apartmentnummer.GetText <> "Appart number" then Warnlog "Appartment => changes not saved" + end if + if iSprache = 07 then + if NameDesVaters.GetText <> "Farthers name" then Warnlog "Farthers name => changes not saved" + end if + +'///reset to saved data + printlog " - reset to saved data" + + Firma.SetText lsSave ( 1 ) + VorName.SetText lsSave ( 2 ) + ZuName.SetText lsSave ( 3 ) + Kuerzel.SetText lsSave ( 4 ) + Strasse.SetText lsSave ( 5 ) + Land.SetText lsSave ( 6 ) + Titel.SetText lsSave ( 7 ) + Position.SetText lsSave ( 8 ) + TelPriv.SetText lsSave ( 9 ) + TelGe.SetText lsSave ( 10 ) + Fax.SetText lsSave ( 11 ) + EMail.SetText lsSave ( 12 ) + + if iSprache = 01 then + City.SetText lsSave ( 13 ) + State.SetText lsSave ( 14 ) + Zip.SetText lsSave ( 15 ) + else + PLZ.SetText lsSave ( 16 ) + Ort.SetText lsSave ( 17 ) + end if + if Apartmentnummer.IsVisible then Apartmentnummer.SetText lsSave ( 18 ) + if iSprache = 07 then NameDesVaters.SetText lsSave ( 19 ) + +'///close the options-dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +'///open options 'StarOffice' / 'Userdata' + printlog " - check data" + + ToolsOptions + hToolsOptions ( "StarOffice", "UserData" ) + +'///check data + if Firma.GetText <> lsSave ( 1 ) then Warnlog "Company => changes not saved" + if VorName.GetText <> lsSave ( 2 ) then Warnlog "First name => changes not saved" + if ZuName.GetText <> lsSave ( 3 ) then Warnlog "Last name => changes not saved" + if Kuerzel.GetText <> lsSave ( 4 ) then Warnlog "Initials => changes not saved" + if Strasse.GetText <> lsSave ( 5 ) then Warnlog "Street => changes not saved" + if Land.GetText <> lsSave ( 6 ) then Warnlog "Land => changes not saved" + if Titel.GetText <> lsSave ( 7 ) then Warnlog "Title => changes not saved" + if Position.GetText <> lsSave ( 8 ) then Warnlog "Position => changes not saved" + if TelPriv.GetText <> lsSave ( 9 ) then Warnlog "Tel-home => changes not saved" + if TelGe.GetText <> lsSave ( 10 ) then Warnlog "tel-work => changes not saved" + if Fax.GetText <> lsSave ( 11 ) then Warnlog "Fax => changes not saved" + if EMail.GetText <> lsSave ( 12 ) then Warnlog "eMail => changes not saved" + + if iSprache = 01 then + if City.GetText <> lsSave ( 13 ) then Warnlog "City => changes not saved" + if State.GetText <> lsSave ( 14 ) then Warnlog "State => changes not saved" + if Zip.GetText <> lsSave ( 15 ) then Warnlog "Zip => changes not saved" + else + if PLZ.GetText <> lsSave ( 16 ) then Warnlog "PLZ => changes not saved" + if Ort.GetText <> lsSave ( 17 ) then Warnlog "Ort => changes not saved" + end if + if Apartmentnummer.IsVisible then + if Apartmentnummer.GetText <> lsSave ( 18 ) then Warnlog "Appartment => changes not saved" + end if + if iSprache = 07 then + if NameDesVaters.GetText <> lsSave ( 19 ) then Warnlog "Farthers name => changes not saved" + end if + +'///close the options-dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (3) + +endcase + + diff --git a/testautomation/framework/optional/includes/options_ooo_view.inc b/testautomation/framework/optional/includes/options_ooo_view.inc new file mode 100755 index 000000000000..f6749e2cc6c8 --- /dev/null +++ b/testautomation/framework/optional/includes/options_ooo_view.inc @@ -0,0 +1,223 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_ooo_view.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : Tools->Options: OpenOffice.org View +'* +'\****************************************************************************** + +testcase tOOoView + + '///Verify that all settings on the Tools/Options -> OpenOffice.org/View are saved + + dim sFile as string + + '///<ul><li>Check if the defaults are correct</li> + printlog "Check if the defaults are correct" + sFile = gTesttoolPath + "framework\optional\input\options\ooo_view_defaults.ref" + call checkPage( sFile , false ) + + '///<li>Change all settings to something different to the default</li> + printlog "Change all settings to something different to the default" + sFile = gTesttoolPath + "framework\optional\input\options\ooo_view_changed.ref" + call changePage( sFile , true, 1 ) + + '///<li>Verify that all changes persist after a restart</li> + printlog "Verify that all changes persist after a restart" + sFile = gTesttoolPath + "framework\optional\input\options\ooo_view_changed.ref" + call checkPage( sFile , true, 1 ) + + '///<li>Re-apply the defaults to all controls and restart the application</li> + printlog "Re-apply the defaults to all controls and restart the application" + sFile = gTesttoolPath + "framework\options\input\ooo_view_defaults.ref" + call changePage( sFile , false ) + + '///<li>Verify that all settings have indeed been reset to defaults</li></ul> + printlog "Verify that all settings have indeed been reset to defaults" + sFile = gTesttoolPath + "framework\optional\input\options\ooo_view_defaults.ref" + call checkPage( sFile , false ) + +endcase + +'******************************************************************************* + +sub checkPage( sFile as string , bDisabled as boolean, optional iMiddleMouseButtonControl as integer) + dim iMiddleMouseButton as integer + dim iMiddleMouseButtonExtern as integer + dim iTemp as integer + + ' depends on if defaults or chnges are checked; + ' changes : 1 + ' defaults: 0 + if isMissing(iMiddleMouseButtonControl) then + iMiddleMouseButtonExtern = 0 + else + iMiddleMouseButtonExtern = iMiddleMouseButtonControl + endif + sFile = convertpath( sFile ) + + printlog( " * Testing current settings against a reference list." ) + printlog( " * Using settings from file: " & sFile ) + + ToolsOptions + call hToolsOptions( "StarOffice" , "View" ) + sleep( 2 ) + + ' Antialiasing settings only exist for Linux and Solaris + if ( gPlatgroup() <> "w95" ) then + if ( bDisabled ) then + checkCheckBox( sFile , "*" , FontAntiAliasing) + checkEntryField( sFile , "state_aapixel" , AAPixel) + else + checkEntryField( sFile , "*" , AAPixel) + checkCheckBox( sFile , "*" , FontAntiAliasing) + endif + else + if ( FontAntiAliasing.exists() ) then + warnlog( "Antialiasing controls not expected on Windows" ) + endif + if ( AAPixel.exists() ) then + warnlog( "Antialiasing controls not expected on Windows" ) + endif + endif + + checkEntryField( sFile , "*" , FontScale) + checkListBox( sFile , "*" , IconScale ) + checkCheckBox( sFile , "*" , IconsInMenueAnzeigen ) + checkCheckBox( sFile , "*" , VorschauInSchriftlisten ) + checkCheckBox( sFile , "*" , SchriftenHistorie ) + + if ( bDisabled ) then + checkCheckBox( sFile , "*" , OptimierteAusgabe ) + checkCheckBox( sFile , "*" , OpenGL ) + else + checkCheckBox( sFile , "*" , OpenGL ) + 'checkCheckBox( sFile , "state_optimierteausgabe" , OptimierteAusgabe ) + endif + + + checkCheckBox( sFile , "*" , Dithering ) + checkCheckBox( sFile , "*" , Volldarstellung ) + checkListBox( sFile , "*" , MousePositioning) + ' needs to get handled differently on platforms! + iMiddleMouseButton = MausAktion.getSelIndex + if iMiddleMouseButtonExtern = 1 then + checkListBox( sFile , "*" , MausAktion) + else + if gPlatGroup = "unx" then + iTemp = 3 ' Paste clipboard + else + iTemp = 2 ' Automatic scrolling + endif + if Itemp = iMiddleMouseButton then + printlog " * Middle mouse button: OK" + else + warnlog "Middle mouse button: expected: '" + iTemp + "' '" + MausAktion.getItemText(iTemp) + "'; is: '" + iMiddleMouseButton + "' '" + MausAktion.getItemText(iMiddleMouseButton) + "'" + endif + endif + + Kontext "OptionenDLG" + OptionenDLG.OK + sleep( 2 ) + call exitRestartTheOffice +end sub + +'******************************************************************************* + +sub changePage( sFile as string , bInverted as boolean, optional iMiddleMouseButtonControl as integer ) + dim iMiddleMouseButtonExtern as integer + + ' depends on if defaults or chnges are checked; + ' changes : 1 + ' defaults: 0 + if isMissing(iMiddleMouseButtonControl) then + iMiddleMouseButtonExtern = 0 + else + iMiddleMouseButtonExtern = iMiddleMouseButtonControl + endif + + sFile = convertpath( sFile ) + printlog( " * Changing current settings according to the reference list." ) + printlog( " * Using settings from file: " & sFile ) + + ToolsOptions + call hToolsOptions( "StarOffice" , "View" ) + sleep( 2 ) + + ' Antialiasing settings only exist for Linux and Solaris + if ( gPlatGroup <> "w95" ) then + if ( bInverted ) then + setEntryField( sFile , "*" , AAPixel ) + setCheckBox( sFile , "*" , FontAntiAliasing ) + else + setCheckBox( sFile , "*" , FontAntiAliasing ) + setEntryField( sFile , "*" , AAPixel ) + endif + endif + + setEntryField( sFile , "*" , FontScale ) + setListBox( sFile , "*" , IconScale ) + setCheckBox( sFile , "*" , IconsInMenueAnzeigen ) + setCheckBox( sFile , "*" , VorschauInSchriftlisten ) + setCheckBox( sFile , "*" , SchriftenHistorie ) + + if ( bInverted ) then + setCheckBox( sFile , "*" , OpenGL ) + setCheckBox( sFile , "*" , OptimierteAusgabe ) + else + setCheckBox( sFile , "*" , OptimierteAusgabe ) + setCheckBox( sFile , "*" , OpenGL ) + endif + + setCheckBox( sFile , "*" , Dithering ) + setCheckBox( sFile , "*" , Volldarstellung ) + setListBox( sFile , "*" , MousePositioning ) + ' needs to get handled differently on platforms! + if iMiddleMouseButtonExtern = 1 then + setListBox( sFile , "*" , MausAktion ) + else + if gPlatGroup = "unx" then + MausAktion.select(3) ' Paste clipboard + else + MausAktion.select(2) ' Automatic scrolling + endif + endif + + Kontext "OptionenDLG" + OptionenDLG.OK + sleep( 2 ) + call exitRestartTheOffice +end sub + + diff --git a/testautomation/framework/optional/includes/options_so_4.inc b/testautomation/framework/optional/includes/options_so_4.inc new file mode 100755 index 000000000000..9c723e35cfee --- /dev/null +++ b/testautomation/framework/optional/includes/options_so_4.inc @@ -0,0 +1,845 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_so_4.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : options test (General/Memory/View) +'* +'\****************************************************************************** + +testcase func_StarOfficeGeneral_1 + gApplication = "WRITER" + Dim sSave as String + Dim ClipText as String + +'///StarOffice / General => 'Years ( two digits )' - functionality test + + printlog " - other" + printlog " - years two digits => 1899" +'///+open tools/option/StarOffice/general +'///+save the default settings + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) + sSave = Zweistellig.GetText +'///+insert 1899 in 'Interpret as years between' and click OK for the options dialog + Zweistellig.SetText "1899" + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+open a calc-doc and insert 04.03.00 <Return> + gApplication = "CALC" + hNewDocument + DocumentCalc.TypeKeys "04.03.00<return>" + DocumentCalc.TypeKeys "<up>" + DocumentCalc.TypeKeys "<F2><Home><Shift End>" + Sleep (1) + EditCopy + DocumentCalc.TypeKeys "<Escape>" +'///+select the cell and press F2 => now the correct date in the cell must be 04/03/1900 + + ClipText = GetClipboardText + if ClipText <> "04.03.1900" AND ClipText <> "04/03/1900" then Warnlog "Wrong date not 04.03.1900 or 04/03/1900 : => '" + ClipText + "'" + +'///+close the calc doc + hCloseDocument + + printlog " - years two digits => 2050" +'///open tools/option/StarOffice/general + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) +'///+insert 2050 in 'Interpret as years between' and click OK for the options dialog + Zweistellig.SetText "2050" + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+open a calc-doc and insert 04.03.00 <Return> + gApplication = "CALC" + hNewDocument + DocumentCalc.TypeKeys "05.03.68<return>" + DocumentCalc.TypeKeys "<up>" + DocumentCalc.TypeKeys "<F2><Home><Shift End>" + Sleep (1) + EditCopy + DocumentCalc.TypeKeys "<Escape>" + +'///+select the cell and press F2 => now the correct date in the cell must be 04/03/1900 + ClipText = GetClipboardText + if ClipText <> "05.03.2068" AND ClipText <> "05/03/2068" then Warnlog "Wrong date not 05.03.2068 or 05/03/2068 : => '" + ClipText + "'" + +'///+close the calc doc + hCloseDocument + +'///open tools/option/StarOffice/general and reset all to the default data ( 1930 ) + printlog " - reset to default" + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) + Zweistellig.SetText sSave + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + + gApplication = "WRITER" +endcase + +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +testcase func_StarOfficeGeneral_2 + Dim bSave as Boolean + Dim sSave as String + Dim i as Integer, iTime as Integer + + gApplication = "WRITER" + +'///StarOffice / General => 'Help Agent' +'///check the maximum and the minimum of display duration ( 60sec and 5sec ) +'///+save the data for help agent +'///+tools / options / staroffice / general -> help agent + printlog "tools / options / staroffice / general -> help agent" + printlog "- check the minimum and the maximum of display duration for help agent ( 60sec and 5sec )" + printlog " activate the help agent options-dialog -> OK" + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) + bSave = Aktivieren.IsChecked + Aktivieren.Check + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///working with activated HelpAgent +'///+open a new writer-doc + printlog "- working with activated HelpAgent" + printlog " - check display duration of 10sec" + printlog " new writer-doc" + gApplication = "Writer" + hNewDocument + +'///+tools / options / staroffice / general -> help agent +'///+activate the help agent for 10 seconds ( click reset to delete the ignore-list for helpagent ) + printlog " tools / options / staroffice / general -> help agent -> duration to 10 -> " + printlog " click also reset to delete the ignore-list for help-agent -> options-dialog OK" + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) + Zuruecksetzen.Click + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+open Format/Character - Font-Tabpage => help-agent must be activated ( 10seconds ) +'///+check if agent closed after ~10sec + printlog " Format/Character - Font-Tabpage => help-agent must be activated" + printlog " check if agent closed after ~10sec" + FormatCharacter + Kontext + active.SetPage TabFont + + Kontext "HelpAgent" + if HelpAgent.Exists(1) <> TRUE then + Warnlog "The help agent wasn't activated for autocorrection!" + else + for i=1 to 20 + if HelpAgent.Exists then + Sleep 1 + else + iTime = i + i=21 + end if + next i + if iTime < 9 then Warnlog "The help agent is closed faster than 9 seconds!" + if iTime > 12 then Warnlog "The help agent isn't closed after 12 seconds!" + if HelpAgent.Exists then + Warnlog "The help agent isn't closed after 20 seconds, the test close it!" + HelpAgent.Close + end if + end if + + Kontext "TabFont" + TabFont.Cancel +'///+close the options-dialog and close the writer-doc + printlog " close options-dialog and close the writer-doc" + hCloseDocument + +'///check display duration of 40sec +'///+new writer-doc +'///+tools / options / staroffice / general -> help agent +'///+activate the help agent for 40 seconds + printlog " - check another display duration of 40sec" + printlog " new writer-doc" + hNewDocument + printlog " tools / options / staroffice / general -> help agent -> duration to 40 -> options-dialog OK" + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) + Aktivieren.Check + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) +'///+open Format/Character - Font-Tabpage => help-agent must be activated ( 40seconds ) +'///+check if agent closed after ~40sec + printlog " Format/Character - Font-Tabpage => help-agent must be activated" + printlog " check if agent closed after ~40sec" + FormatCharacter + Kontext + active.SetPage TabFont + + Kontext "HelpAgent" + if HelpAgent.Exists(1) <> TRUE then + Warnlog "The help agent wasn't activated for autocorrection!" + else + for i=1 to 60 + if HelpAgent.Exists then + Sleep 1 + else + iTime = i + i=61 + end if + next i + if iTime < 35 then Warnlog "The help agent is closed faster than 35 seconds!" + if iTime > 45 then Warnlog "The help agent isn't closed after 45 seconds!" + if HelpAgent.Exists then + Warnlog "The help agent isn't closed after 40 seconds, the test close it!" + HelpAgent.Close + end if + end if + Kontext "TabFont" + TabFont.Cancel + +'///+close the options-dialog and close the writer-doc + printlog " close options-dialog and close the writer-doc" + hCloseDocument + +'///check another display duration of 60sec +'///+ new writer-doc +'///+tools / options / staroffice / general -> help agent +'///+activate the help agent for 60 seconds + printlog " - check another display duration of 60sec" + printlog " new writer-doc" + hNewDocument + printlog " tools / options / staroffice / general -> help agent -> duration to 60 -> options-dialog OK" + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) + Aktivieren.Check + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) +'///+open Format/Character - Font-Tabpage => help-agent must be activated ( 60seconds ) +'///+check if agent closed after ~60sec + printlog " Format/Character - Font-Tabpage => help-agent must be activated" + FormatCharacter + Kontext + active.SetPage TabFont + + Kontext "HelpAgent" + if HelpAgent.Exists(1) <> TRUE then + Warnlog "The help agent wasn't activated for autocorrection!" + else + for i=1 to 80 + if HelpAgent.Exists then + Sleep 1 + else + iTime = i + i=81 + end if + next i + if iTime < 55 then Warnlog "The help agent is closed faster than 55 seconds!" + if iTime > 65 then Warnlog "The help agent isn't closed after 65 seconds!" + if HelpAgent.Exists then + Warnlog "The help agent isn't closed after 60 seconds, the test close it!" + HelpAgent.Close + end if + end if + + Kontext "TabFont" + TabFont.Cancel + +'///+close the options-dialog and close the writer-doc + printlog " close options-dialog and close the writer-doc" + hCloseDocument + +'///check if the help agent isn't active, when you ignore it 3 times ( inserted in the ignore-list ) +'///+ new writer-doc +'///+tools / options / staroffice / general -> help agent +'///+activate the help agent for 10 seconds + printlog " - check if the help agent isn't active, when you ignore it 3 times ( inserted in the ignore-list )" + printlog " new writer-doc" + hNewDocument + printlog " tools / options / staroffice / general -> help agent -> duration to 10 -> options-dialog OK" + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) + Aktivieren.Check + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) +'///+open Format/Character - Font-Tabpage => help-agent should not be activated + printlog " Format/Character - Font-Tabpage => help-agent should not be activated" + FormatCharacter + Kontext + active.SetPage TabFont + + Kontext "HelpAgent" + if HelpAgent.Exists then + Warnlog "Ignore HelpAgent 3 time for the same slot does not work, HelpAgent is active!" + HelpAgent.Close + end if + Kontext "TabFont" + TabFont.Cancel + +'///+close the options-dialog and close the writer-doc + printlog " close options-dialog and close the writer-doc" + hCloseDocument + +'///check if ignore-list can be deleted +'///+ new writer-doc +'///+tools / options / staroffice / general -> help agent +'///+activate the help agent for 10 seconds and reset the ignore-list + printlog " - check if ignore-list can be deleted" + printlog " new writer-doc" + hNewDocument + printlog " tools / options / staroffice / general -> help agent -> click on reset -> options-dialog OK" + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) + Aktivieren.Check + Zuruecksetzen.Click + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) +'///+open Format/Character - Font-Tabpage => help-agent should not be activated + printlog " Format/Character - Font-Tabpage => help-agent should not be activated" + FormatCharacter + Kontext + active.SetPage TabFont + + Kontext "HelpAgent" + if HelpAgent.Exists(2) <> TRUE then + Warnlog "Ignore-list isn't reset, the HelpAgent is not active" + else + HelpAgent.Close + end if + Kontext "TabFont" + TabFont.Cancel + +'///+close the options-dialog and close the writer-doc + printlog " close options-dialog and close the writer-doc" + hCloseDocument + +'///working with deactivated HelpAgent +'///+create a new writer-doc +'///+tools / options / staroffice / general -> help agent +'///+deactivate the help agent + printlog " - working with deactivated the help agent" + printlog " new writer-doc" + hNewDocument + printlog " tools / options / staroffice / general -> deactivate help agent -> options-dialog OK" + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) + Aktivieren.UnCheck + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+open Format/Character - Font-Tabpage => help-agent ust be activated ( 10seconds ) + printlog " Format/Character - Font-Tabpage => help-agent ust be activated" + FormatCharacter + Kontext + active.SetPage TabFont + + Kontext "HelpAgent" + if HelpAgent.Exists(1) = TRUE then + Warnlog "The help agent was active!" + HelpAgent.Close + end if + Kontext "TabFont" + TabFont.Cancel + +'///+close the options-dialog and close the writer-doc + printlog " close options-dialog and close the writer-doc" + hCloseDocument + +'///reset help-agent-options + printlog " - reset help-agent-options" + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) + Aktivieren.Check + Zuruecksetzen.Click + if bSave = TRUE then Aktivieren.Check else Aktivieren.UnCheck + + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) +endcase + +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +testcase func_StarOfficeGeneral_3 + Dim bStatus as Boolean + + gApplication = "WRITER" + +'///StarOffice / General => 'printing sets 'document modified' status' +'///+open a new writer-doc and save it + + printlog "StarOffice / General => 'printing sets 'document modified' status'" + printlog "save a writer-doc" + hNewDocument + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "This is a file, for options test: <return> Tools / Options / StarOffice / General -> 'Printing sets 'document modified' status'" + DocumentWriter.TypeKeys "<Return><Return>This file is created by an automated test. It can be trashed after one day!<Return>Today is " + Date + hFileSaveAsKill ( gOfficePath + "user\work\opt.sxw" ) + + printlog "- open tools/option/StarOffice/general and save the state of the checkbox" + printlog "- check it" +'///+ open tools/option/StarOffice/general +'///+'printing sets 'document modified' status' => checked + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) + bStatus = DruckenStatus.IsChecked + DruckenStatus.Check + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) +'///+ close options dialog with OK + + printlog "- file/print and click OK at the print-dialog" +'///+file / print and click OK at the print-dialog + FilePrint + + Kontext "Active" + if Active.Exists() then + warnlog( "Unexpected dialog, no default printer found (#108776?)" ) + Active.OK() + else + Kontext "DruckenDlg" + DruckenDlg.OK + Sleep (5) + endif + + printlog "- file/close" +'///+file / close => a messagebox must warn about changes in the document + FileClose + Kontext "Active" + if Active.Exists(2) <> TRUE then + Warnlog "No warning, when this options is checked!" + else +'///+- cancel the messagebox + Active.Cancel + end if + + printlog "- file/save" +'///+file / save + FileSave + + printlog "- uncheck the checkbox" +'///'printing sets 'document modified' status' => unchecked + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) + DruckenStatus.UnCheck + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + + printlog "- file/print" +'///+file / print + FilePrint + Kontext "DruckenDlg" + DruckenDlg.OK + Sleep (5) + + printlog "- file/close" +'///+file / close => no modify of the document => no messagebox for warning + FileClose + Kontext "Active" + if Active.Exists(2) then + Warnlog "The document is modified, a messagebox came up at closing" + Active.Yes + end if + + printlog "- reset this option" +'///set this option to default + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) + if bStatus = TRUE then DruckenStatus.Check else DruckenStatus.UnCheck + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +endcase + +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +testcase func_StarOfficeGeneral_4 + Dim bStatus as Boolean + + gApplication = "WRITER" + +'///StarOffice / General => 'use StarOffice dialogs' ( only on windows systems ) + +'///check that system dialogs are used => state of the checkbox is unchecked +'///+open a new writer-doc + hNewDocument + printlog "StarOffice / General => 'use StarOffice dialogs'" + if gPlatgroup = "unx" then + printlog "This feature is only available on windows systems" + else +'///+open tools/options/staroffice/general + printlog "- open tools/options/staroffice/general and uncheck 'use StarOffice dialogs'" + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) +'///+save state of 'use StarOffice dialogs' and uncheck it + bStatus = StarOfficeDialogeBenutzen.IsChecked + StarOfficeDialogeBenutzen.UnCheck + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+file/open and check if the file-dialog is a system-dialog + printlog "- file/open and check if the file-dialog is a system-dialog" + FileOpen + if ExistsSysDialog ( FilePicker ) = FALSE then + Warnlog "The file-open-dialog is no system dialog" + Kontext "OeffnenDlg" + OeffnenDlg.Cancel + else + CloseSysDialog ( FilePicker ) + end if + +'///check that StarOffice dialogs are used => state of the checkbox is checked +'///+open tools/options/staroffice/general + printlog Chr(13) + "check that StarOffice dialogs are used => state of the checkbox is checked" + printlog "- open tools/options/staroffice/general" + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) +'///+save state of 'use StarOffice dialogs' and uncheck it + StarOfficeDialogeBenutzen.Check + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+file/open and check if the file-dialog is a StarOffice-dialog + printlog "- open tools/options/staroffice/general and check 'use StarOffice dialogs'" + FileOpen + Kontext "OeffnenDlg" + if OeffnenDlg.Exists (1) <> TRUE then + Warnlog "StarOffice dialogs are not used!" + if ExistsSysDialog ( FilePicker ) then CloseSysDialog ( FilePicker ) + else + OeffnenDlg.Cancel + end if + +'///reset the state of 'use StarOffice dialogs' to default +'///+open tools/options/staroffice/general + printlog Chr(13) + "reset the state of 'use StarOffice dialogs' to default" + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) +'///+save state of 'use StarOffice dialogs' and uncheck it + if bStatus = TRUE then StarOfficeDialogeBenutzen.Check else StarOfficeDialogeBenutzen.UnCheck + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + end if + + hCloseDocument + +endcase + + +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +testcase func_StarOfficeMemory_1 + Dim sSave as String + Dim i, ilast as Integer + gApplication = "WRITER" + +'///StarOffice / Memory => 'Undo steps' + + printlog " - save" + printlog " - undo" + printlog " - set number of steps => 1" + +'///<b>undo-step = 1</b> +'///+open a new writer-doc and tools/options/staroffice/memory + hNewDocument + ToolsOptions + hToolsOptions ( "StarOffice", "Memory" ) +'///+save the default setting for 'Undo Steps' and set it to 1 + sSave = UndoSteps.GetText + UndoSteps.SetText "1" +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+write two words in the writer doc + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "Hello " + DocumentWriter.TypeKeys "friends " + +'///+try edit/undo more than 1 times, after the first click the menu-item must be inactiv and the undo-button in the function bar too + EditUndo + try + EditUndo + Warnlog "More than 1 undo was possible!" + catch + endcatch + +'///<b>undo-step = 15</b> +'///+open tools/options/staroffice/memory + printlog " - set number of steps => 15" + ToolsOptions + hToolsOptions ( "StarOffice", "Memory" ) +'///+set 'Undo Steps' to 15 + UndoSteps.SetText "15" +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+write a short text with more than 20 words + Kontext "DocumentWriter" + for i=1 to 20 + DocumentWriter.TypeKeys "Hello<return>" + next i + Sleep (2) + +'///+check if you can use 'edit/undo' more than 15 times + for i=1 to 20 + if i<16 then + try + EditUndo + catch + iLast = i-1 + Warnlog "The 15th undo was impossible! The test can do only " + iLast + " undos! => BugID 83891" + endcatch + else + try + EditUndo + Warnlog "More than 15 undo was possible!" + catch + endcatch + end if + next i + +'///<b>undo-step = 99</b> +'///+open tools/options/staroffice/memory + printlog " - set number of steps => 99" + ToolsOptions + hToolsOptions ( "StarOffice", "Memory" ) +'///+set 'Undo Steps' to 99 + UndoSteps.SetText "99" + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+write a short text with more than 100 words + Kontext "DocumentWriter" + for i=1 to 102 + DocumentWriter.TypeKeys "Hello<return>" + next i + +'///+check if you can use 'edit/undo' more than 99 times + for i=1 to 102 + if i<100 then + try + EditUndo + catch + iLast = i-1 + Warnlog "The 99th undo was impossible! The test can do only " + iLast + " undos! => BugID 83891" + i=105 + endcatch + else + try + EditUndo + Warnlog "More than 99 undo are possible!" + catch + i=105 + endcatch + end if + next i + +'///close the document + hCloseDocument + +'///set this option to default + printlog " - reset the number of steps" + ToolsOptions + hToolsOptions ( "StarOffice", "Memory" ) + UndoSteps.SetText sSave + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +endcase + +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +testcase func_StarOfficeView_1 + Dim bSave as Boolean + Dim iSave as Integer + Dim sSave as String + +'///StarOffice / View => 'Display : Look & Feel' and 'Scaling' + +'///+open tools/options/staroffice/view + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) + printlog " - view" + printlog " - display" +'///scaling + printlog " - scaling" +'///+save the default setting for scaling + sSave = FontScale.GetText +'///+set Scaling to 50 + FontScale.SetText "50" + FontScale.More + FontScale.Less + printlog " - " + FontScale.GetText +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+open some dialogs/tab dialogs and flyer to have a look at it ( testtool only can test, if this feature doesn't crash ) + Call DialogTestForViewOptions + +'///+open tools/options/staroffice/view + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) +'///+set Scaling to 150 + FontScale.SetText "150" + FontScale.More + FontScale.Less + printlog " - " + FontScale.GetText +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+open some dialogs/tab dialogs and flyer to have a look at it ( testtool only can test, if this feature doesn't crash ) + Call DialogTestForViewOptions + +'///+open tools/options/staroffice/view + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) +'///+set Scaling to default setting + FontScale.SetText(sSave) + FontScale.More + FontScale.Less + printlog " - " + FontScale.GetText +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) +endcase + +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +testcase func_StarOfficeView_2 + Dim iSave as Integer + + printlog " - view" + printlog " - mouse positioning" + +'///StarOffice / View => 'mouse positioning' +'///+open a new writer doc + hNewDocument + +'///+open tools/options/staroffice/view + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) +'///+save the default setting for 'mouse positioning' + iSave = MousePositioning.GetSelIndex +'///+select the 1st entry for 'mouse positioning' + MousePositioning.Select 1 + printlog " - " + MousePositioning.GetSelText +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+move the mouse to position 1,1 on the writer doc + Kontext "DocumentWriter" + DocumentWriter.MouseMove 1, 1 + +'///+open some dialogs/tab dialogs and flyer to have a look at the mouse position ( testtool only can test, if this feature doesn't crash ) + DialogTestForViewOptions + +'///+open tools/options/staroffice/view + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) +'///+select the 2nd entry for 'mouse positioning' + MousePositioning.Select 2 + printlog " - " + MousePositioning.GetSelText +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+move the mouse to position 1,1 on the writer doc + Kontext "DocumentWriter" + DocumentWriter.MouseMove 1, 1 + +'///+open some dialogs/tab dialogs and flyer to have a look at the mouse position ( testtool only can test, if this feature doesn't crash ) + DialogTestForViewOptions + +'///+open tools/options/staroffice/view + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) +'///+select the 3rd entry for 'mouse positioning' + MousePositioning.Select 3 + printlog " - " + MousePositioning.GetSelText +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+move the mouse to position 1,1 on the writer doc + Kontext "DocumentWriter" + DocumentWriter.MouseMove 1, 1 + +'///+open some dialogs/tab dialogs and flyer to have a look at the mouse position ( testtool only can test, if this feature doesn't crash ) + DialogTestForViewOptions + +'///+open tools/options/staroffice/view + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) +'///+select the default setting for 'mouse positioning' + MousePositioning.Select iSave +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+close the writer doc + hCloseDocument +endcase + + diff --git a/testautomation/framework/optional/includes/options_so_5.inc b/testautomation/framework/optional/includes/options_so_5.inc new file mode 100755 index 000000000000..4bc53666a2f0 --- /dev/null +++ b/testautomation/framework/optional/includes/options_so_5.inc @@ -0,0 +1,795 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: options_so_5.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : general option test +'* +'\****************************************************************************** + + +testcase func_StarOfficeView_3 + + Dim bSave as Boolean + Dim iSave as Integer + Dim xPos, yPos as Integer + + '///StarOffice / View => 'Buttons' ( flat/3D-buttons, large/normal ) + printlog " - view" + printlog " - buttons" + + '///+open a new writer doc + hNewDocument + + '///+save the sizes of the writer doc + Kontext "DocumentWriter" + xPos = DocumentWriter.getSizeX + yPos = DocumentWriter.getSizeY + + '///+open tools/options/staroffice/view + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) + + '///+save the default settings for 'large buttons' and 'flat buttons' + iSave = IconScale.getSelIndex() + + '///+select 'large buttons' + printlog " - set buttonsize to 'large'" + IconScale.Select( 3 ) + + '///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + + '///+check if the buttons in the toolbars are bigger ( testtool : comparison between the sizes before and after the changes ) + Kontext "DocumentWriter" + if DocumentWriter.getSizeX = xPos AND DocumentWriter.getSizeY = yPos then + warnlog "Perhaps the buttons are not large!" + endif + + '///+open tools/options/staroffice/view + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) + + '///+select buttonsize 'small' + printlog " - set buttonsize to 'small'" + IconScale.Select( 2 ) + + '///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + + '///+check if the buttons in the toolbars are normal ( testtool : comparison between the saved sizes before the changes ) + Kontext "DocumentWriter" + if DocumentWriter.getSizeX <> xPos OR DocumentWriter.getSizeY <> yPos then + warnlog "Perhaps the buttons are not small!" + endif + + '///+open tools/options/staroffice/view + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) + + '///+set 'Icon Size' back to the default + printlog " - large buttons => default" + if iSave <> 1 then + IconScale.Select( iSave ) + endif + + '///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + + '///+close the writer doc + hCloseDocument +endcase + +'******************************************************************************* + +testcase func_StarOfficeView_4 + Dim bSave ( 10 ) as Boolean + Dim i as Integer, iCount as Integer + +'///StarOffice / View => 'Options' + printlog " - view" + printlog " - options" + +'///open a new writer doc + hNewDocument + +'///+open tools / options / StarOffice / View +'///+save settings for all 'options' + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) + bSave(4) = VorschauInSchriftlisten.IsChecked + bSave(5) = InaktiveMenueeintraege.IsChecked + bSave(6) = SchriftenHistorie.IsChecked + +'///<b>inactive menu items</b> + printlog " - inactive menu items : => check" +'///+check 'Inactive menu items' + InaktiveMenueeintraege.Check +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+open the context menu on a writer doc and save the number of menu items + Kontext "DocumentWriter" + DocumentWriter.OpenContextMenu + iCount = hMenuItemGetCount + Sleep (2) + hMenuClose + +'///+open tools / options / StarOffice / View + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) + printlog " - inactive menu items : => uncheck" +'///+uncheck 'Inactive menu items' + InaktiveMenueeintraege.UnCheck +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+open the context menu on a writer doc and compare the number of menu items with the numbers before +'///+ the behaviour changed: the checkbox in the options does not affect the context menu! ///' + Kontext "DocumentWriter" + DocumentWriter.OpenContextMenu + if hMenuItemGetCount <> iCount then + Warnlog "The number of entries at the context menu on a writer doc is NOT the same at 'show inactive' is checked or not => BUG!" + end if + Sleep (2) + hMenuClose + +'///<b>single line tab headings</b> +'///+open tools / options / StarOffice / View + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) +'///+set 'Inactive menu items' to default + if bSave(5) = TRUE then InaktiveMenueeintraege.Check else InaktiveMenueeintraege.UnCheck + printlog " - preview in fontlist : => Uncheck" +'///check 'preview in fontlist' + VorschauInSchriftlisten.Check +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+select all Fonts in the fontlist in object bar => testtool cannot check if the preview is shown + Kontext "OL_SW" + for i=1 to Schriftart.GetItemCount + Schriftart.Select i + next i + +'///+open tools / options / StarOffice / View + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) + printlog " - preview in fontlist : => check" +'///uncheck 'preview in fontlist' + VorschauInSchriftlisten.UnCheck +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+select all Fonts in the fontlist in object bar => testtool cannot check if the preview is not shown + Kontext "OL_SW" + for i=1 to Schriftart.GetItemCount + Schriftart.Select i + next i + +'///<b>font history</b> +'///+open tools / options / StarOffice / View + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) + if bSave(4) = TRUE then VorschauInSchriftlisten.Check else VorschauInSchriftlisten.UnCheck +'///reset 'preview in fontlist' to default + printlog " - font history : => Uncheck" +'///check 'font history' + SchriftenHistorie.Check +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+select all Fonts in the fontlist in object bar => testtool cannot check if font history is not shown + Kontext "OL_SW" + for i=1 to Schriftart.GetItemCount + Schriftart.Select i + next i + +'///+open tools / options / StarOffice / View + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) + printlog " - font history : => check" +'///uncheck 'font history' + SchriftenHistorie.UnCheck +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+select all Fonts in the fontlist in object bar => testtool cannot check if font history is not shown + Kontext "OL_SW" + for i=1 to Schriftart.GetItemCount + Schriftart.Select i + next i + +'///+open tools / options / StarOffice / View + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) +'///reset 'font history' to default + if bSave(6) = TRUE then SchriftenHistorie.Check else SchriftenHistorie.UnCheck +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///close the writer document + hCloseDocument + +endcase + +'******************************************************************************* + +testcase func_StarOfficeView_5 + + '///StarOffice / View => '3D' + Dim bSave ( 5 ) as Boolean + Dim i as Integer + + printlog " - view" + printlog " - 3D-view" + + '///<b>disable OpenGL</b> + '///+open tools / options / StarOffice / View + '///+save all settings for OpenGL + printlog " - use OpenGL => Uncheck" + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) + bSave (1) = OpenGL.IsChecked + bSave (2) = OptimierteAusgabe.IsChecked + + '///+uncheck OpenGL + OpenGL.Uncheck + '///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + + '///+open a impress-doc, create cube and close the document => testtool can only test if this feature does not crash + Call Make3D + + printlog " - use OpenGL => Check + optimized output => UnCheck" + '///<b>enable OpenGL and disable optimized output</b> + '///+open tools / options / StarOffice / View + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) + '///+check 'OpenGL' and uncheck 'optimized output' + OpenGL.Check + OptimierteAusgabe.Uncheck + '///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + + '///+open a impress-doc, create cube and close the document => testtool can only test if this feature does not crash + Call Make3D + + printlog " - use OpenGL => Check + optimized output => Check" + '///<b>enable OpenGL and enable optimized output</b> + '///+open tools / options / StarOffice / View + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) + '///+check 'OpenGL' and check 'optimized output' + OpenGL.Check + OptimierteAusgabe.Check + '///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+open a impress-doc, create cube and close the document => testtool can only test if this feature does not crash + Call Make3D + + printlog " - use dithering => uncheck" +'///<b>disable 'use dithering'</b> +'///+open tools / options / StarOffice / View + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) +'///+set 'OpenGL' and 'optimized output' to default and uncheck 'dithering' + if bSave(2) = TRUE then OptimierteAusgabe.Check else OptimierteAusgabe.Check + if bSave(1) = TRUE then OpenGL.Check else OpenGL.UnCheck + bSave (3) = Dithering.IsChecked + Dithering.Uncheck +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+open a impress-doc, create cube and close the document => testtool can only test if this feature does not crash + Call Make3D + +'///<b>enable 'use dithering'</b> + printlog " - use dithering => Check" +'///+open tools / options / StarOffice / View + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) +'///+check 'dithering' + Dithering.Check +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+open a impress-doc, create cube and close the document => testtool can only test if this feature does not crash + Call Make3D + + printlog " - use OpenGL => UnCheck + Dithering => UnCheck!" +'///<b>disable 'OpenGL' and 'use dithering'</b> +'///+open tools / options / StarOffice / View + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) +'///+uncheck 'OpenGL' and 'dithering' + OpenGL.Uncheck + Dithering.UnCheck +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+open a impress-doc, create cube and close the document => testtool can only test if this feature does not crash + Call Make3D + + printlog " - Object refresh after interaction => check!" +'///<b>enable 'Object refresh after interaction'</b> +'///+open tools / options / StarOffice / View + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) +'///+set 'OpenGL' and 'Dithering' to default + if bSave(1) = TRUE then OpenGL.check else OpenGL.UnCheck + if bSave(3) = TRUE then Dithering.Check else Dithering.UnCheck + bSave (4) = Volldarstellung.IsChecked +'///+check 'Object refresh after interaction' + Volldarstellung.Check +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+open a impress-doc, create cube and close the document => testtool can only test if this feature does not crash + Call Make3D + + printlog " - use OpenGL => UnCheck + Object refresh after interaction => check!" +'///<b>disable OpenGL and enable 'Object refresh after interaction'</b> +'///+open tools / options / StarOffice / View + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) +'///+uncheck 'OpenGL' and check 'Object refresh after interaction' + OpenGL.Uncheck + Volldarstellung.Check +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+open a impress-doc, create cube and close the document => testtool can only test if this feature does not crash + Call Make3D + + printlog " - Object refresh after interaction => UnCheck!" +'///<b>disable 'Object refresh after interaction'</b> +'///+open tools / options / StarOffice / View + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) + if bSave(1) = TRUE then OpenGL.check else OpenGL.UnCheck +'///+set 'OpenGL' to default and uncheck 'Object refresh after interaction' + Volldarstellung.UnCheck +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+open a impress-doc, create cube and close the document => testtool can only test if this feature does not crash + Call Make3D + + printlog " - reset to default" +'///<b>reset all 3D-Options to default</b> +'///+open tools / options / StarOffice / View + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) +'///+set all settings back to default + if bSave(4) = TRUE then Volldarstellung.check else Volldarstellung.UnCheck +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + + gApplication = "WRITER" +endcase + +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +testcase func_StarOfficeView_6 +'///StarOffice / View => Anti Aliasing - only on UNIX + Dim bSave as Boolean + Dim sSave as String + Dim i as Integer + + if gPlatgroup <> "unx" then + printlog "No test for 'anti aliasing' fonts on windows platforms!" + goto endsub + end if + +'///open a new writer-document + printlog "open a new writer-document" + gApplication = "Writer" + hNewDocument + + printlog " - view" + printlog " - anti aliasing" + +'///+open tools / options / StarOffice / view + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) + +'///+save the raw data for 'Font anti aliasing' + bSave = FontAntiAliasing.IsChecked + FontAntiAliasing.Check + sSave = AAPixel.GetText + +'///+activate 'font anti aliasing' and change pixelsize to 5 + printlog " change pixelsize to 5" + AAPixel.SetText "5" + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + +'///+open all menus for the writer doc + for i=1 to 8 + Kontext "DocumentWriter" + DocumentWriter.UseMenu + hMenuSelectNr i + Sleep (2) + hMenuClose + next i + +'///open tools / options / StarOffice / view + printlog " change pixelsize to 15" + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) +'///+activate 'font anti aliasing' and change pixelsize to 15 + AAPixel.SetText "15" + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + +'///+open all menus for the writer doc + for i=1 to 8 + Kontext "DocumentWriter" + DocumentWriter.UseMenu + hMenuSelectNr i + Sleep (2) + hMenuClose + next i + +'///open tools / options / StarOffice / view + printlog " change pixelsize to 25" + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) +'///+activate 'font anti aliasing' and change pixelsize to 25 + AAPixel.SetText "25" + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + +'///+open all menus for the writer doc + for i=1 to 8 + Kontext "DocumentWriter" + DocumentWriter.UseMenu + hMenuSelectNr i + Sleep (2) + hMenuClose + next i + +'///open tools / options / StarOffice / view + printlog " reset all changes to raw data" + ToolsOptions + hToolsOptions ( "StarOffice", "View" ) +'///+reset all changes + AAPixel.SetText sSave + if bSave = TRUE then FontAntiAliasing.Check else FontAntiAliasing.UnCheck + +'///+close options dialog with OK + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + +'///+close the writer doc + hCloseDocument + +endcase + +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * +testcase func_StarOfficePrint_1 + Dim bSave as Boolean, bSave2 as Boolean + Dim i as Integer + + gApplication = "DRAW" + +'///StarOffice / Print => Printer Warnings + printlog " - printer warnings" + +'///<b>check 'printer size'</b> + printlog " - Paper size => active" + +'///+open tools / options / StarOffice / print + ToolsOptions + hToolsOptions ( "StarOffice", "Print" ) + +'///+save settings for 'paper size' + bSave = PaperSize.IsChecked +'///+check 'paper size' + PaperSize.Check + +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+open a new drawing document + hNewDocument +'///+open format / page + FormatSlideDraw +'///+select the page tabpage and select the first entry out of the Format list ( A0 ) + Kontext + Active.Setpage TabSeite + Kontext "TabSeite" + Papierformat.Select 1 ' select the format A0 +'///+click OK + TabSeite.OK + +'///+file / print + FilePrint + Kontext "DruckenDlg" +'///+click OK in the print-dialog + if DruckenDlg.Exists then + DruckenDlg.OK + Sleep 5 +'///+wait a little bit => then you have to get a warning about the size of your document + Kontext "WarningPrintOptions" + if WarningPrintOptions.Exists(3) then + WarningPrintOptions.Cancel + else + Warnlog "The warning-message for papersize does not turn up!" + end if + else + Kontext "Active" + if Active.Exists then Warnlog Active.GetText + Active.OK + end if +'///+click cancel => the document shouldn't be printed + +'///close the document + hCloseDocument + +'///<b>uncheck 'printer size'</b> + printlog " - Paper size => disabled" +'///+open tools / options / StarOffice / print + ToolsOptions + hToolsOptions ( "StarOffice", "Print" ) + +'///+uncheck 'paper size' + PaperSize.uncheck + +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+open a new drawing document + hNewDocument +'///+open format / page + FormatSlideDraw +'///+select the page tabpage and select the first entry out of the Format list ( A0 ) + Kontext + Active.Setpage TabSeite + Kontext "TabSeite" + Papierformat.Select 1 ' select the format A0 +'///+click OK + TabSeite.OK + +'///+file / print + FilePrint + Kontext "DruckenDlg" +'///+click OK in the print-dialog + if DruckenDlg.Exists then + DruckenDlg.OK + Sleep 5 +'///+wait a little bit => the document should be printed without a warning + Kontext "WarningPrintOptions" + if WarningPrintOptions.Exists(3) then + WarningPrintOptions.Cancel + Printlog "The warning-message for papersize does exist => not realy a BUG" + end if + else + Kontext "Active" + if Active.Exists then Warnlog Active.GetText + Active.OK + end if + +'///close the document + hCloseDocument + +'///<b>check 'transparency'</b> + printlog " - Transparency => active" +'///+open tools / options / StarOffice / print + ToolsOptions + hToolsOptions ( "StarOffice", "Print" ) + +'///+save settings for 'trancparency' + bSave2 = Transparency.IsChecked +'///+uncheck 'paper size' + PaperSize.Uncheck +'///+check 'tranceparency' + Transparency.Check + +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+open a new drawing document + hNewDocument +'///+create a rectangle + hRechteckErstellen ( 30, 30, 60, 60 ) + +'///+format/area => transparency => check transparency + FormatArea + Kontext + Active.Setpage TabTransparenz + Kontext "TabTransparenz" + LineareTransparenz.Check +'///+click OK + TabTransparenz.OK + +'///+file / print + FilePrint + Kontext "DruckenDlg" +'///+click OK in the print-dialog + if DruckenDlg.Exists then + DruckenDlg.OK + Sleep 5 +'///+wait a little bit => then you have to get a warning about the printing trancparency + Kontext "WarningPrintTransparency" + if WarningPrintTransparency.Exists(3) then + WarningPrintTransparency.Cancel + else + Warnlog "The warning-message for papersize does not turn up!" + end if + else + Kontext "Active" + if Active.Exists then Warnlog Active.GetText + Active.OK + end if +'///+click cancel => the document shouldn't be printed + +'///close the document + hCloseDocument + +'///<b>uncheck 'transparency'</b> + printlog " - Transparency => disabled" +'///+open tools / options / StarOffice / print + ToolsOptions + hToolsOptions ( "StarOffice", "Print" ) + +'///+uncheck 'tranceparency' + Transparency.Uncheck + +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +'///+open a new drawing document + hNewDocument +'///+create a rectangle + hRechteckErstellen ( 30, 30, 60, 60 ) + +'///+format/area => transparency => check transparency + FormatArea + Kontext + Active.Setpage TabTransparenz + Kontext "TabTransparenz" + LineareTransparenz.Check +'///+click OK + TabTransparenz.OK + +'///+file / print + FilePrint + Kontext "DruckenDlg" +'///+click OK in the print-dialog + if DruckenDlg.Exists then + DruckenDlg.OK + Sleep 5 +'///+wait a little bit => then you have to get a warning about the printing trancparency + Kontext "WarningPrintTransparency" + if WarningPrintTransparency.Exists(3) then + WarningPrintTransparency.Cancel + Warnlog "The warning-message for papersize does exist => BUG!" + end if + else + Kontext "Active" + if Active.Exists then Warnlog Active.GetText + Active.OK + end if +'///+click cancel => the document shouldn't be printed + +'///close the document => perhaps it take some time, before you can close the document + for i=1 to 100 + FileClose + Sleep 2 + Kontext "Active" + if Active.Exists then + try + Active.OK + Sleep ( 5 ) + catch + Active.No + i=101 + endcatch + end if + next i + +'///reset the printing options + printlog " - reset the printing options" + +'///+open tools / options / StarOffice / print + ToolsOptions + hToolsOptions ( "StarOffice", "Print" ) +'///+reset 'paper size' and 'trancparency' to default + if bSave = TRUE then PaperSize.Check else PaperSize.Uncheck + if bSave2 = TRUE then Transparency.Check else Transparency.Uncheck + +'///+click OK for the options dialog + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Sleep (2) + +endcase + diff --git a/testautomation/framework/optional/includes/scripting_basics.inc b/testautomation/framework/optional/includes/scripting_basics.inc new file mode 100755 index 000000000000..a5045c149a10 --- /dev/null +++ b/testautomation/framework/optional/includes/scripting_basics.inc @@ -0,0 +1,89 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: scripting_basics.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Quick short test for the scripting framework +'* +'\****************************************************************************** + +testcase tScripting + + '///<h1>Very short test to verify that the scripting framework is present</h1> + '///<i>Additionally we verify that the document "Untitled1" is present + '///+ in the organizers</i><br><br> + '///<ul> + + const ORGANIZER_ITEMS = 2 + + '///+<li>Make sure we are on the backing window</li> + hInitBackingMode() + + '///+<li>Open Script Organizer for Beanshell</li> + ToolsMacrosOrganizeMacrosBeanShell + + '///+<li>Access the TreeList and close the dialog with cancel</li> + Kontext "ScriptOrganizer" + if ( ScriptOrganizer.exists( 5 ) ) then + printlog( "Beanshell Script Organizer is present. Good" ) + if ( ScriptTreeList.getItemCount() <> ORGANIZER_ITEMS ) then + warnlog( "The Treelist does not contain the expected number " & _ + "of items. Please verify that exactly three top-nodes exist" ) + endif + ScriptOrganizer.cancel() + else + warnlog( "Script Organizer for Beanshell is missing" ) + endif + + '///+<li>Open Script Organizer for JavaScript</li> + ToolsMacrosOrganizeMacrosJavaScript + + '///+<li>Access the TreeList and close the dialog with cancel</li> + Kontext "ScriptOrganizer" + if ( ScriptOrganizer.exists( 5 ) ) then + printlog( "JavaScript Script Organizer is present. Good" ) + if ( ScriptTreeList.getItemCount() <> ORGANIZER_ITEMS ) then + warnlog( "The Treelist does not contain the expected number " & _ + "of items. Please verify that exactly three top-nodes exist" ) + endif + ScriptOrganizer.cancel() + else + warnlog( "Script Organizer for JavaScript is missing" ) + endif + + '///</ul> + +endcase + + + diff --git a/testautomation/framework/optional/includes/scripting_organizers.inc b/testautomation/framework/optional/includes/scripting_organizers.inc new file mode 100755 index 000000000000..60ba71bb500c --- /dev/null +++ b/testautomation/framework/optional/includes/scripting_organizers.inc @@ -0,0 +1,347 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: scripting_organizers.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Test scripting-organizers / document-attached scripts +'* +'\****************************************************************************** + +testcase tScriptingOrganizers( iDialog as integer ) + + '///<H1>Test scripting-organizers</H1> + ' 1 = BeanShell (.bsh) + ' 2 = JavaScript (.js) + + const IDOCPOS = 3 + + dim cFileName as string + cFileName = "sftest" & hGetSuffix( "current" ) + dim cCompare as string + + dim cFilePath as string + cFilePath= hGetWorkPath() & cFileName + cFilePath= convertpath( cFilePath ) + + dim iPos as integer ' position of the workdocument in treelist + dim brc as boolean ' boolean return code used to determine the status + + dim cLibName as string + cLibName = "TTLib" + dim cModName as string + cModName = "TTMod" + dim cScriptName as string + + dim iItemCount as integer + + '///<ul> + '///+<li>Set macro security level to low</li> + printlog( "" ) + printlog( "Test init: set macro security level to low" ) + hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_LOW ) + + '///+<li>For both script organizers (javascript/beanshell) do</li> + '///<ul> + '///+<li>Create a script name of type TTMod.(.bsh|js)</li> + select case iDialog + case 1 : cScriptName = cModName & ".bsh" + case 2 : cScriptName = cModName & ".js" + end select + + '///+<li>Delete the workfile in case it has been left over by prior run</li> + brc = hDeleteFile( cFilePath ) + + '///+<li>Open a new document</li> + printlog( "Test init: Create and prepare document" ) + brc = hCreateDocument() + + '///+<li>Modify the document</li> + call hChangeDoc() + + '///+<li>Save the document (Menu File->Save As...)</li> + brc = hFileSaveAsKill( cFilePath ) + + '///+<li>Open the ScriptOrganizer</li> + printlog( "" ) + printlog( "Test 1: ScriptOrganizer/Documents" ) + brc = hOpenScriptOrganizer( iDialog ) + if ( not brc ) then + warnlog( "Could not open the script Organizer, aborting" ) + brc = hDestroyDocument() + goto endsub + endif + + '///+<li>Count the objects in the collapsed treelist</li> + kontext "ScriptOrganizer" + iItemCount = hGetNodeCount( ScriptTreeList ) + + '///+<li>Verify that there are exactly three items in the treelist</li> + if ( ScriptTreeList.getItemCount() <> IDOCPOS ) then + warnlog( "Incorrect number of documents listed in treelist, aborting" ) + kontext "ScriptOrganizer" + ScriptOrganizer.cancel() + brc = hDestroyDocument() + goto endsub + endif + + '///+<li>Select the document at pos. 3</li> + kontext "ScriptOrganizer" + ScriptTreeList.select( IDOCPOS ) + + '///+<li>Test status of Buttons</li> + '///<ul> + '///+<li>"Create" should be enabled</li> + if ( not PBCreate.isEnabled() ) then + warnlog( "Create button should be enabled" ) + endif + + '///+<li>"Edit" should be disabled</li> + if ( PBEdit.isEnabled() ) then + warnlog( "Edit button should be disabled" ) + endif + + '///+<li>"Rename" should be disabled</li> + if ( PBRename.isEnabled() ) then + warnlog( "Rename button should be disabled" ) + endif + + '///+<li>"Delete" should be disabled</li> + if ( PBDelete.isEnabled() ) then + qaerrorlog( "#i50527# - Delete button should be disabled" ) + endif + '///</ul> + + + printlog( "" ) + printlog( "Test 2: Libraries/Scripts create/rename" ) + + '///+<li>Create a new library</li> + brc = hCreateScriptingObject( "initial_lib" ) + + '///+<li>Rename the library</li> + brc = hRenameScriptingObject( cLibName ) + + '///+<li>Verify that renaming worked</li> + brc = hVerifyNodeName( ScriptTreeList , cLibName ) + if ( not brc ) then + qaerrorlog( "#i50526# Renaming failed: " & cLibName ) + endif + + '///+<li>Remember name of the library, it is deleted later</li> + cLibName = ScriptTreeList.getSelText() + + '///+<li>Test status of Buttons</li> + '///<ul> + '///+<li>"Create" should be enabled</li> + if ( not PBCreate.isEnabled() ) then + warnlog( "Create button should be enabled" ) + endif + + '///+<li>"Edit" should be disabled</li> + if ( PBEdit.isEnabled() ) then + warnlog( "Edit button should be disabled" ) + endif + + '///+<li>"Rename" should be enabled</li> + if ( not PBRename.isEnabled() ) then + warnlog( "Rename button should be enabled" ) + endif + + '///+<li>"Delete" should be enabled</li> + if ( not PBDelete.isEnabled() ) then + warnlog( "Delete button should be enabled" ) + endif + '///</ul> + + '///+<li>Create a new script</li> + brc = hCreateScriptingObject( "initial_mod" ) + + '///+<li>Rename the script</li> + brc = hRenameScriptingObject( cModName ) + + '///+<li>Verify that renaming worked</li> + brc = hVerifyNodeName( ScriptTreeList , cScriptName ) + if ( not brc ) then + qaerrorlog( "#i50526# Renaming failed: " & cScriptName ) + endif + + '///+<li>Remember the module name, it is deleted later</li> + cModName = ScriptTreeList.getSelText() + + '///+<li>Test status of Buttons</li> + '///<ul> + '///+<li>"Create" should be disabled</li> + if ( PBCreate.isEnabled() ) then + warnlog( "Create button should not be enabled" ) + endif + + '///+<li>"Edit" should be enabled</li> + if ( not PBEdit.isEnabled() ) then + warnlog( "Edit button should be enabled" ) + endif + + '///+<li>"Rename" should be enabled</li> + if ( not PBRename.isEnabled() ) then + warnlog( "Rename button should be enabled" ) + endif + + '///+<li>"Delete" should be enabled</li> + if ( not PBDelete.isEnabled() ) then + warnlog( "Delte button should be enabled" ) + endif + '///</ul> + + '///+<li>Exit the scriptorganizer (cancel)</li> + kontext "ScriptOrganizer" + brc = hCloseScriptOrganizer() + + '///+<li>Save the file</li> + printlog( "" ) + printlog( "Test 3: Script storage in documents (save/load)" ) + try + hFileSave + catch + warnlog( "Document Changed status not set" ) + hChangeDoc() + hFileSave + endcatch + + '///+<li>Close the document</li> + brc = hDestroyDocument() + + '///+<li>Reload the document.</li> + brc = hFileOpen( cFilePath ) + + '///+<li>Open the ScriptOrganizer</li> + brc = hOpenScriptOrganizer( iDialog ) + + '///+<li>Select the document</li> + ScriptTreeList.select( 3 ) + + '///+<li>Expand the node</li> + iPos = hExpandNode( ScriptTreeList , 0 ) + + '///+<li>Select the module</li> + ScriptTreeList.select( 4 ) + + '///+<li>Select the script</li> + iPos = hExpandNode( ScriptTreeList , 0 ) + ScriptTreeList.select( 5 ) + + + printlog( "" ) + + '///+<li>Delete the script (should work)</li> + printlog( "Test 4: Script removal / Document changed" ) + brc = hDeleteScript( cModName , true ) + if ( not brc ) then + warnlog( "Bad rc: hDelteScript()" ) + endif + + '///+<li>Delete the module (should work)</li> + brc = hDeleteScript( cLibName , true ) + if ( not brc ) then + warnlog( "Bad rc: hDelteScript()" ) + endif + + '///+<li>Delete the document (which should not work)</li> + brc = hDeleteScript( cFileName , false ) + if ( not brc ) then + qaerrorlog( "#i50527# Delete enabled for document object" ) + endif + + '///+<li>Exit all dialogs (close the script organizer)</li> + kontext "ScriptOrganizer" + brc = hCloseScriptOrganizer() + + '///+<li>Save the file via File Save button on standardbar</li> + try + hFileSave + catch + warnlog( "Document Changed status expected after script deletion" ) + brc = hChangeDoc() + hFileSave + endcatch + + '///+<li>Close the document</li> + brc = hDestroyDocument() + + '///+<li>Reload the document.</li> + printlog( "Reload the document." ) + brc = hFileOpen( cFilePath ) + if ( brc ) then + qaerrorlog( "#i50530# Macros not completely removed from doc when deleted" ) + endif + + '///+<li>Open the ScriptOrganizer, look for the library</li> + printlog( "" ) + printlog( "Test 5: Verification of script removal" ) + brc = hOpenScriptOrganizer( iDialog ) + kontext "ScriptOrganizer" + iItemCount = hGetNodeCount( ScriptTreeList ) + if ( iItemCount <> IDOCPOS ) then + warnlog( "Treelist not populated, the test cannot continue" ) + brc = hCloseScriptOrganizer() + brc = hDestroyDocument() + goto endsub + endif + + '///+<li>Verify that all libraries/scripts have been removed</li> + iPos = hExpandNode( ScriptTreeList , IDOCPOS ) + if ( iPos <> 3 ) then + warnlog( "Not all libraries/scripts have been deleted" ) + endif + + '///+<li>Test Exit: Cleanup - close all dialogs</li> + brc = hCloseScriptOrganizer() + + '///+<li>Close the navigator if it is open</li> + brc = hCloseNavigator() + + '///+<li>Close the document</li> + brc = hDestroyDocument() + + '///+<li>Delete the workfile</li> + brc = hDeleteFile( cFilePath ) + if ( not brc ) then + warnlog( "Could not delete: " & cFilePath & " - do so manually!" ) + endif + + '///</ul> + + '///+<li>Set macro security level to default</li> + hSetmacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT ) + + '///</ul> + +endcase diff --git a/testautomation/framework/optional/includes/security_broken_signature.inc b/testautomation/framework/optional/includes/security_broken_signature.inc new file mode 100755 index 000000000000..925d9509ad40 --- /dev/null +++ b/testautomation/framework/optional/includes/security_broken_signature.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 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: security_broken_signature.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Load documents containing hidden BASIC scripts +'* +'\****************************************************************************** + +testcase tBrokenSignature() + + '///<h1>Allow macro execution/Security set to medium</h1> + '///<ul> + + dim acFile( 1 ) as string + + acFile( 1 ) = "framework\optional\input\security\test_macro (signed).odt" + acFile( 1 ) = gTesttoolPath & acFile( 1 ) + acFile( 1 ) = convertpath( acFile( 1 ) ) + + dim iCurrentFile as integer ' increment variable + dim cMsg as string ' string from messagebox + dim brc as boolean ' some returnvalue + + + '///+<li>Do following for each document to be tested:</li> + '///<ul> + + for iCurrentFile = 1 to ubound( acFile() ) + + printlog( "" ) + printlog( "File: " & acFile( iCurrentFile ) ) + + '///+<li>Click FileOpen or go to the dialog via menu</li> + FileOpen + + '///+<li>Enter the name of the file</li> + kontext "OeffnenDlg" + Dateiname.setText( acFile( iCurrentFile ) ) + + '///+<li>Click "Open"</li> + Oeffnen.click() + + '///+<li>Test for Broken Signature Messagebox:</li> + '///<ul> + Kontext "Active" + if ( active.exists( 3 ) ) then + cMsg = active.getText() + cMsg = hRemoveLineBreaks( cMsg ) + + '///+<li>Make sure that we do not have the macro</li> + if ( cMsg = "Hello from StarBasic!" ) then + warnlog( "Macro was executed without any warning" ) + else + '///+<li>Guess the dialog by Ressource Type</li> + if ( active.getRT() = 304 ) then + printlog( "Broken signature message: " & cMsg ) + else + warnlog( "Unknown messagebox: " & cMsg ) + endif + endif + + '///+<li>Close dialog with OK</li> + active.ok() + + endif + '///</ul> + + '///+<li>Test for the macro again</li> + kontext "Active" + if ( active.exists() ) then + cMsg = active.getText() + cMsg = hRemoveLineBreaks( cMsg ) + warnlog( "Unexpected messagebox: " & cMsg ) + active.ok() + endif + + '///+<li>Close the document</li> + call hCloseDocument() + + next iCurrentFile + + '///</ul> + '///</ul> + +endcase + diff --git a/testautomation/framework/optional/includes/security_certification_dialogs.inc b/testautomation/framework/optional/includes/security_certification_dialogs.inc new file mode 100755 index 000000000000..65df7c8f4d58 --- /dev/null +++ b/testautomation/framework/optional/includes/security_certification_dialogs.inc @@ -0,0 +1,105 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: security_certification_dialogs.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Walk through a number of dialogs related to digital signatures +'* +'\****************************************************************************** + +testcase tCertificationDialogs + + '///<H1>Walk through a number of dialogs related to digital signatures</H1> + + dim brc as boolean + const CFN = "tCertificationDialogs::" + const SVERSION = "680" + + dim sFile as string + sFile = gOfficePath & "user\work\certdlg" & hGetSuffix( SVERSION ) + sFile = convertpath( sFile ) + + hDeleteFile( sFile ) + + call hNewDocument() + + call hChangeDoc() + + brc = hOpenDigitalSignaturesDialog() + + kontext "active" + if ( active.exists( 1 ) ) then + printlog( "MSGBOX: " & active.getText() ) + active.yes() + printlog( CFN & "Allow to save the document" ) + else + if ( gApplication <> "MASTERDOC" ) then + warnlog( CFN & "No message that the file must be saved to be signed" ) + else + printlog( CFN & "OK - No save-message for Masterdoc." ) + endif + endif + + kontext "SpeichernDlg" + if ( SpeichernDlg.exists( 1 ) ) then + DateiName.setText( sFile ) + if AutomatischeDateinamenserweiterung.Exists then + AutomatischeDateinamenserweiterung.Uncheck + endif + Speichern.click() + else + if ( gApplication <> "MASTERDOC" ) then + warnlog( CFN & "Save As Dialog is not open" ) + else + printlog( CFN & "OK - No filesave for Masterdoc." ) + endif + endif + + kontext "DigitalSignature" + if ( DigitalSignature.exists( 2 ) ) then + printlog( CFN & "Digital signatures is open" ) + DigitalSignature.cancel() + else + if ( gApplication <> "MASTERDOC" ) then + warnlog( CFN & "Digital Signatures Dialog is not open" ) + else + printlog( CFN & "OK - No signature dialog for Masterdoc." ) + endif + endif + + call hCloseDocument() + + + +endcase + diff --git a/testautomation/framework/optional/includes/security_certified_docs.inc b/testautomation/framework/optional/includes/security_certified_docs.inc new file mode 100755 index 000000000000..6c05ad884f06 --- /dev/null +++ b/testautomation/framework/optional/includes/security_certified_docs.inc @@ -0,0 +1,170 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: security_certified_docs.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.co +'* +'* short description : Load certified documents and verify the certificate +'* +'\****************************************************************************** + +testcase tLoadCertifiedFile( cBuildID as string ) + + '///<H1>Load certified documents and verify the certificate</H1> + '///This test loads a document which has been signed with a digital + '///signature (dummy certificate) and verifies, that the certificate + '///remains with the document through looking at the "digital signatures" + '///dialog. + '///<ul> + + ' Build the path to the file we want to work with + dim cFile as string + cFile = gTesttoolpath & "framework\optional\input\security\DigitalSignature" + cFile = cFile & hGetSuffix( cBuildId ) + cFile = convertpath( cFile ) + printlog( "Using file: " & cFile ) + + dim cSigName as string + dim sCertData( 20 ) as string + + dim sFileIn as string + sFileIn = gTesttoolPath & "framework\optional\input\security\certificate_data.txt" + sFileIn = convertpath( sFileIn ) + + dim sFileOut as string + sFileOut = hGetWorkPath() & "certificate_data.txt" + + ' Variable to store boolean returncodes from functions + dim brc as boolean + brc = true + + ' the number of certificates attached to the current document + dim iCertCount as integer + + '///<li>Load a file that has been signed with a certificate</li> + printlog( "Load the file" ) + brc = hFileOpen( cFile ) + brc = hHandleActivesOnLoad( 0 , 2 ) + + ' in case the file did not get loaded, handle the problem by aborting the test + if ( not brc ) then + warnlog( "The requested file could not be loaded, aborting test" ) + goto endsub + endif + + brc = hOpenDigitalSignaturesDialog() + + ' If the menuitem should not be available, clicking it will fail. In + ' this case we must assume that the file has been loaded but the certificate + ' does not exist. So we close the document and abort the test here. + if ( not brc ) then + warnlog( "The requested menuitem is not available, the test ends" ) + call hCloseDocument() + goto endsub + endif + + ' second line of defense: If something was opened but this is not the + ' digital signatures dialog, we abort as well. + ' If no mozill a profile exists, we don't have the means to verify + ' certificates, so the test aborts here as well. We get a messagebox then. + Kontext "DigitalSignature" + if ( not DigitalSignature.exists( 2 ) ) then + Kontext "active" + if ( active.exists() ) then + qaerrorlog( "#i48252# Mozilla profile missing?: " & active.getText() ) + active.OK() + else + warnlog( "The current dialog is not <Digital Signatures>. Aborting" ) + endif + call hCloseDocument() + goto endsub + endif + + '///<li>Verify that exactly one certificate exists</li> + ' If we have zero or more than one certificate, this is probably a bug + ' introduced by the test maintainer. However, we warn but the test can + ' continue + Kontext "DigitalSignature" + + '///+<li>Click on "View Certificate"</li> + ViewCertificate.click() + + '///+<li>Switch to the "Certification Path"</li> + hSelectXMLSecTab( "PATH" ) + + qaerrorlog( "Skipping EditBrowseBox: Not implemented in Testtool yet" ) + goto SkipEditBrowseBox + + '///+<li>Read the name of the certificate from the treelist, verify</li> + kontext "TabXMLSecCertPath" + XMLSecViewSigTree.select( 1 ) + cSigName = XMLSecViewSigTree.getSelText() + if ( cSigName <> "Dummy Certificate for Testing" ) then + warnlog( "The certificate at pos. 1 is not the dummy certificate: " & cSigName ) + else + printlog( "Found correct certificate name: " & cSigName ) + endif + + '///+<li>Switch to the second tabpage (Details)</li> + hSelectXMLSecTab( "DETAILS" ) + + kontext "TabXMLSecDetails" + hGetListItems( XMLSecDetailsListBox, sCertData() ) + + '///+<li>Verify that the data in the listbox is correct (reference file)</li> + brc = hManageComparisionList( sFileIn, sFileOut, sCertData() ) + if ( not brc ) then + warnlog( "The data of the certificate appears to be incorrect" ) + else + printlog( "Verification of the certificate succeeded" ) + endif + + SkipEditBrowseBox: + + '///+<li>Switch to the first page (General)</li> + hSelectXMLSecTab( "GENERAL" ) + kontext "TabXMLSecGeneral" + + '///+<li>Close the dialog with OK</li> + TabXMLSecGeneral.ok() + + '///<li>Close the certication dialog with OK</li> + printlog( "Close the dialog with OK" ) + Kontext "DigitalSignature" + DigitalSignature.OK() + + '///<li>Close the document</li> + printlog( "Close the document" ) + call hCloseDocument() + +endcase + diff --git a/testautomation/framework/optional/includes/security_evilmacro1.inc b/testautomation/framework/optional/includes/security_evilmacro1.inc new file mode 100755 index 000000000000..9b45bd40b14a --- /dev/null +++ b/testautomation/framework/optional/includes/security_evilmacro1.inc @@ -0,0 +1,121 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: security_evilmacro1.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Load documents containing hidden BASIC scripts +'* +'\****************************************************************************** + +testcase tSecurityEvilMacro1() + + '///<h1>Level 1 test: Allow macro execution/Security set to medium</h1> + '///<ul> + + dim acFile( 2 ) as string + + acFile( 1 ) = gTesttoolPath & "framework\optional\input\security\test_macro.html" + acFile( 1 ) = convertpath( acFile( 1 ) ) + + acFile( 2 ) = gTesttoolPath & "framework\optional\input\security\test_macro.odt" + acFile( 2 ) = convertpath( acFile( 2 ) ) + + dim iCurrentFile as integer ' increment variable + dim cMsg as string ' string from messagebox + dim brc as boolean ' some returnvalue + + + '///+<li>Do following for each document to be tested:</li> + '///<ul> + + for iCurrentFile = 1 to ubound( acFile() ) + + printlog( "" ) + printlog( "File: " & acFile( iCurrentFile ) ) + + '///+<li>Click FileOpen or go to the dialog via menu</li> + FileOpen + + '///+<li>Enter the name of the file</li> + kontext "OeffnenDlg" + Dateiname.setText( acFile( iCurrentFile ) ) + + '///+<li>Click "Open"</li> + Oeffnen.click() + + '///+<li>Verify that the security warning comes up, confirm to run macro.<br> + '///+ There should be no warning for security levels other than medium!</li> + brc = hAllowMacroExecution() + if ( not brc ) then + warnlog( "Macro security dialog not triggered by document with macro" ) + endif + + '///+<li>Wait a moment for the document to get loaded</li> + + '///+<li>Check for a messagebox to come up on load. This might only<br> + '///+ after a security warning has been displayed!</li> + kontext "Active" + if ( active.exists( 5 ) ) then + + ' warn if macro runs without security warning + if ( not brc ) then + cMsg = active.getText() + cMsg = hRemoveLineBreaks( cMsg ) + if ( cMsg = "Hello from StarBasic" ) then + warnlog( "The macro was executed without asking for permission" ) + else + printlog( "Messagebox: " & cMsg ) + endif + endif + + ' get the string on the messagebox + cMsg = active.getText() + cMsg = hRemoveLineBreaks( cMsg ) + if ( cMsg = "Hello from StarBasic!" ) then + printlog( "Macro was executed: " & cMsg ) + else + warnlog( "Unknown dialog is open. This is not the macro" ) + endif + active.ok() + endif + + '///+<li>Close the document</li> + call ExitRestartTheOffice() + + next iCurrentFile + + '///</ul> + '///</ul> + +endcase + diff --git a/testautomation/framework/optional/includes/security_evilmacro2.inc b/testautomation/framework/optional/includes/security_evilmacro2.inc new file mode 100755 index 000000000000..b1a949b155a1 --- /dev/null +++ b/testautomation/framework/optional/includes/security_evilmacro2.inc @@ -0,0 +1,110 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: security_evilmacro2.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Load documents containing hidden BASIC scripts +'* +'\****************************************************************************** + +testcase tSecurityEvilMacro2() + + '///<h1>Level 1 test: Deny macro execution/Security level set to medium</h1> + '///<ul> + + dim acFile( 2 ) as string + + acFile( 1 ) = gTesttoolPath & "framework\optional\input\security\test_macro.html" + acFile( 1 ) = convertpath( acFile( 1 ) ) + + acFile( 2 ) = gTesttoolPath & "framework\optional\input\security\test_macro.odt" + acFile( 2 ) = convertpath( acFile( 2 ) ) + + dim iCurrentFile as integer ' increment variable + dim cMsg as string ' string from messagebox + dim brc as boolean ' some returnvalue + + + '///+<li>Do following for each document to be tested:</li> + '///<ul> + + for iCurrentFile = 1 to ubound( acFile() ) + + printlog( "" ) + printlog( "File: " & acFile( iCurrentFile ) ) + + '///+<li>Click FileOpen or go to the dialog via menu</li> + FileOpen + + '///+<li>Enter the name of the file</li> + kontext "OeffnenDlg" + Dateiname.setText( acFile( iCurrentFile ) ) + + '///+<li>Click "Open"</li> + Oeffnen.click() + + '///+<li>Verify that the security warning comes up, confirm to run macro.<br> + '///+ There should be no warning for security levels other than medium!</li> + brc = hDenyMacroExecution() + if ( not brc ) then + warnlog( "Macro security dialog not triggered by document with macro" ) + endif + + '///+<li>Wait a moment for the document to get loaded</li> + '///+<li>Check for a messagebox to come up on load. This might only<br> + '///+ after a security warning has been displayed!</li> + kontext "Active" + if ( active.exists( 5 ) ) then + + ' warn if macro runs without security warning + warnlog( "A macro was executed without permission" ) + + ' get the string on the messagebox + cMsg = active.getText() + cMsg = hRemoveLineBreaks( cMsg ) + warnlog( "Macro was executed: " & cMsg ) + active.ok() + else + printlog( "Macro has not been executed" ) + endif + + '///+<li>Close the document</li> + call ExitRestartTheOffice() + + next iCurrentFile + + '///</ul> + '///</ul> + +endcase + diff --git a/testautomation/framework/optional/includes/security_evilmacro3.inc b/testautomation/framework/optional/includes/security_evilmacro3.inc new file mode 100755 index 000000000000..8f3f077346d5 --- /dev/null +++ b/testautomation/framework/optional/includes/security_evilmacro3.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 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: security_evilmacro3.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Load documents containing hidden BASIC scripts +'* +'\****************************************************************************** + +testcase tSecurityEvilMacro3() + + '///<h1>Level 1 test: Macros not executed/Security level set to High or Very High</h1> + '///<ul> + + dim acFile( 2 ) as string + + acFile( 1 ) = gTesttoolPath & "framework\optional\input\security\test_macro.html" + acFile( 1 ) = convertpath( acFile( 1 ) ) + + acFile( 2 ) = gTesttoolPath & "framework\optional\input\security\test_macro.odt" + acFile( 2 ) = convertpath( acFile( 2 ) ) + + dim iCurrentFile as integer ' increment variable + dim cMsg as string ' string from messagebox + dim brc as boolean ' some returnvalue + + + '///+<li>Do following for each document to be tested:</li> + '///<ul> + + for iCurrentFile = 1 to ubound( acFile() ) + + printlog( "" ) + printlog( "File: " & acFile( iCurrentFile ) ) + + '///+<li>Click FileOpen or go to the dialog via menu</li> + FileOpen + + '///+<li>Enter the name of the file</li> + kontext "OeffnenDlg" + Dateiname.setText( acFile( iCurrentFile ) ) + + '///+<li>Click "Open"</li> + Oeffnen.click() + + + '///+<li>We expect a message that macros exist but that they will not be executed</li> + kontext "Active" + if ( active.exists() ) then + cMsg = active.getText() + cMsg = hRemoveLineBreaks( cMsg ) + printlog( "Messagebox: " & cMsg ) + active.ok() + else + warnlog( "Missing messagebox: Document contains macros ..." ) + endif + + '///+<li>Wait a moment for the document to get loaded</li> + '///+<li>Check for a messagebox to come up on load. This might only<br> + '///+ after a security warning has been displayed!</li> + kontext "Active" + if ( active.exists( 5 ) ) then + + ' warn if macro runs without security warning + warnlog( "A macro was executed without permission" ) + + ' get the string on the messagebox + cMsg = active.getText() + cMsg = hRemoveLineBreaks( cMsg ) + warnlog( "Macro was executed: " & cMsg ) + active.ok() + else + printlog( "Macro was not executed" ) + endif + + '///+<li>Close the document</li> + call ExitRestartTheOffice() + + next iCurrentFile + + '///</ul> + '///</ul> + +endcase + diff --git a/testautomation/framework/optional/includes/security_incorrect_password.inc b/testautomation/framework/optional/includes/security_incorrect_password.inc new file mode 100755 index 000000000000..995841f33e8d --- /dev/null +++ b/testautomation/framework/optional/includes/security_incorrect_password.inc @@ -0,0 +1,165 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: security_incorrect_password.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Password protect files +'* +'\****************************************************************************** + +testcase tIncorrectPassword( filetypeID as string ) + + '///<H1>Save and load files with incorrect password</H1> + '///This test saves a file from each application with a password. Then the + '///document is closed and reloaded. When prompted an icorrect password is + '///entered. The document will not be loaded then, an error is displayed. + + const WORKFILE = "password" + dim suffix as string + dim workpath as string + + dim rc as integer + dim brc as boolean + dim iCurrentFilter as integer + dim cCurrentFilter as string + + const PASSWORD_VALID = "MyPasswd09#+1" + const PASSWORD_FALSE = "MyPasswd00#+1" + const DOC_ID = "f_sec_incorrect_password.bas testdocument" + + '///<ul> + '///+<li>Get the workpath from configuration</li> + workpath = hGetWorkPath() + + '///+<li>Get the suffix for the current filetype</li> + suffix = hGetSuffix( filetypeID ) + + '///+<li>Delete the workfile (just in case it still exists from prior run)</li> + printlog( "Delete the workfile - if it was left over by a former testrun" ) + hDeleteFile( workpath & WORKFILE & suffix ) + + '///+<li>Ensure that we have exactly one open document</li> + printlog( "Make sure we have exactly one single document open" ) + do while( getDocumentCount > 0 ) + hDestroyDocument() + loop + hCreateDocument() + + '///+<li>Change the document so the 'save' button becomes active</li> + printlog( "Change the document" ) + hChangeDoc() + + '///+<li>Click on FileSave</li> + printlog( "Click on FileSave" ) + FileSave + + Kontext "SpeichernDlg" + '///+<li>Check the password-checkbox, name the file and click 'Save'</li> + printlog( "Check the password checkbox" ) + Passwort.check() + + '///+<li>Enter a name for the file, click on "Save"</li> + printlog( "Name the file as " & workpath & WORKFILE ) + Dateiname.settext( workpath & WORKFILE ) + + '///+<li>Adjust the filter if it differs from "curren"</li> + if ( filetypeID <> "current" ) then + for iCurrentFilter = 1 to DateiTyp.getItemCount() + + DateiTyp.select( iCurrentFilter ) + cCurrentFilter = DateiTyp.getSelText() + if ( instr( cCurrentFilter , suffix ) > 0 ) then + printlog( "Using custom filter: " & cCurrentFilter ) + exit for + endif + next iCurrentFilter + else + printlog( "Using default filter: " & DateiTyp.getSelText() ) + endif + + printlog( "Click on the Save-Button" ) + Speichern.click() + + '///+<li>On the password-dialog enter a password and confirm it (confirm with + '///+ incorrect password on first attempt), close warning, reenter correct pair + '///+ of passwords.</li> + brc = hSecurityEnterPasswordOnSave( PASSWORD_VALID ) + + '///+<li>Close the document, verify that only one document remains open</li> + if ( brc ) then + + kontext "AlienWarning" + if ( AlienWarning.exists( 3 ) ) then + AlienWarning.ok() + if ( filetypeID <> "current" ) then + printlog( "Accepted to save in alien format" ) + else + warnlog( "Alien warning not expected for default file format" ) + endif + endif + + printlog( "Close the document" ) + brc = hDestroyDocument() + if ( not brc ) then + warnlog( "Something went wrong while closing the document. please check" ) + endif + + else + warnlog( "Something went wrong setting the password for the docuemnt" ) + endif + + '///+<li>Load the file again, when prompted enter incorrect password</li> + printlog( "Load the file again" ) + hFileOpen( workpath & WORKFILE & suffix ) + brc = hSecurityEnterPasswordOnLoad( PASSWORD_FALSE , false ) + if ( not brc ) then + warnlog( "Something went wrong while using the password dialog" ) + endif + + '///+<li>Close the current document</li> + hDestroyDocument() + + '///+<li>Verify that we have no open documents</li> + printlog( "Verify that we have no open documents" ) + if ( getDocumentCount <> 0 ) then + warnlog( "No documents should be open at this point" ) + endif + + '///+<li>Delete the workfile</li> + printlog( "Delete the workfile" ) + hDeleteFile( workpath & WORKFILE & suffix ) + + '///</ul> + +endcase + diff --git a/testautomation/framework/optional/includes/security_macrosecurity.inc b/testautomation/framework/optional/includes/security_macrosecurity.inc new file mode 100755 index 000000000000..a13d1499367c --- /dev/null +++ b/testautomation/framework/optional/includes/security_macrosecurity.inc @@ -0,0 +1,189 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: security_macrosecurity.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Macros with all security-levels +'* +'\****************************************************************************** + +sub tMacroSecurityLevelsControlModule + + dim iApplication as integer + + for iApplication = 1 to 6 + + printlog( "" ) + printlog( hNumericDocType( iApplication ) ) + call tMacroSecurityLevels( "current" ) + call tMacroSecurityLevels( "645" ) + + next iApplication + +end sub + +'******************************************************************************* + +testcase tMacroSecurityLevels( cFileFormat ) + + '///<H1>Macro execution in all security levels</H1> + '///<ul> + + dim cWorkFile as string + cWorkFile = gTesttoolPath & "framework\optional\input\BasicDocs\" + cWorkFile = cWorkFile & "basic" & hGetSuffix( cFileFormat ) + cWorkFile = convertpath( cWorkFile ) + cWorkFile = convertToURL( cWorkFile ) + + dim iSecLevel as integer + dim brc as boolean + + ' We have quite a bunch of possible combinations here. Some trigger a security warning + ' others do not. Depending on the security level we either get no warning at all, the + ' "classic" Security Warning or a message that the macros will not be executed (Blocked) + + ' |---------------------------------------------------------| + ' | Trusted | Security Level / Warning displayed | + ' | Path | Low | Medium | High | Very High | + ' |---------------------------------------------------------| + ' | Yes*) | No | No | No | No | + ' |---------------------------------------------------------| + ' | No | No | Yes | Blocked | Blocked | + ' |---------------------------------------------------------| + ' *) Covered by test "f_sec_trusted_path.bas" + + '///+<li>Cycle through all four security levels and load a document with macro</li> + '///<ul> + for iSecLevel = 0 to 3 + + '///+<li>Set the macro security level</li> + printlog( "" ) + hSetMacroSecurityAPI( iSecLevel ) + + '///+<li>Load a file from ..\framework\optional\input\BasicDocs\</li> + '///<ul> + select case iSecLevel + '///+<li>For security level &eq; 0: Macro should be executed</li> + case 0 : FileOpen( "URL", cWorkFile, "FrameName", "_default" ) + brc = hIdentifyExecutedMacro() + if ( not brc ) then + if ( gApplication = "MATH" ) then + qaerrorlog( "#i68291# Math document forgets eventbinding" ) + else + qaerrorlog( "#i53711# Macro was not found/executed" ) + endif + endif + + '///+<li>For security level &eq; 1: Macro should be executed after security warning</li> + case 1 : FileOpen( "URL", cWorkFile, "FrameName", "_default" ) + brc = hAllowMacroExecution() + if ( not brc ) then + warnlog( "Macro execution warning missing, chek the file/security settings" ) + endif + brc = hIdentifyExecutedMacro() + if ( not brc ) then + if ( gApplication = "MATH" ) then + qaerrorlog( "#i68291# Math document forgets eventbinding" ) + else + qaerrorlog( "#i53711# Macro was not found/executed" ) + 'warnlog( "#i65885# - CWS Warnings01/Macro not executed on load" ) + endif + endif + + '///+<li>For security level &eq; 2: Macro should *not* be executed (it is not in trusted path)</li> + case 2 : FileOpen( "URL", cWorkFile, "FrameName", "_default" ) + brc = hHandleActivesOnLoad( 1 , 1 ) + if ( not brc ) then + qaerrorlog( "#i53710# unexpected second messagebox" ) + endif + brc = hIdentifyExecutedMacro() + if ( brc ) then + warnlog( "Macro was executed" ) + endif + + '///+<li>For security level &eq; 3: Macro should *never* be executed</li> + case 3 : FileOpen( "URL", cWorkFile, "FrameName", "_default" ) + brc = hHandleActivesOnLoad( 1 , 0 ) + brc = hIdentifyExecutedMacro() + if ( brc ) then + warnlog( "Macro was executed" ) + endif + end select + '///</ul> + + brc = hDestroyDocument() + + next iSecLevel + '///</ul> + + '///+<li>Reset macro security level to default (High)</li> + hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT ) + '///</ul> + +endcase + +'******************************************************************************* + +function hIdentifyExecutedMacro() as boolean + + '///<h3>Function to identify the macro just being executed</h3> + '///This is a tiny helper function that compares the string from the message- + '///+box with a reference - TTMacro3 - and returns TRUE if the macro is the + '///+ correct one. FALSE in any other case. + + dim cMessage as string + const CFN = "hIdentifyExecutedMacro::" + + kontext "active" + if ( active.exists( 3 ) ) then + + cMessage = active.getText() + + if ( cMessage = "TTMacro3" ) then + printlog( CFN & "The Macro has been executed" ) + hIdentifyExecutedMacro() = true + active.ok() + else + warnlog( CFN & "The WRONG macro/dialog is open" ) + hIdentifyExecutedMacro() = false + hHandleActivesOnLoad( 0 , 2 ) + endif + + else + + printlog( CFN & "No macro/dialog is open" ) + hIdentifyExecutedMacro() = false + + endif + +end function diff --git a/testautomation/framework/optional/includes/security_recommend_password.inc b/testautomation/framework/optional/includes/security_recommend_password.inc new file mode 100755 index 000000000000..b0b3c3644bda --- /dev/null +++ b/testautomation/framework/optional/includes/security_recommend_password.inc @@ -0,0 +1,147 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: security_recommend_password.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Password settings in Tools/Options +'* +'\****************************************************************************** + +testcase tRecommendPassword( filetypeID as string ) + + '///<H1>Recommend password protection when saving</H1> + '///<p>This test verifies that the global option to recommend password + '/// protection is transported to the file-save dialog. Before saving + '/// password protection will be unchecked in order to verify that the + '/// global option overrides the individual setting.</p> + + dim workfile as string + workfile = "password" & hGetSuffix( filetypeID ) + printlog( " * Name of workfile: " & workfile ) + + dim workpath as string + workpath = convertpath( gOfficePath & "user\work\" ) + printlog( " * Save file to....: " & workpath ) + + dim rc as integer + + '///<ul> + '///<li>Open a new document</li> + printlog( "Open a new document" ) + call hNewDocument() + + '///<li>change the content (document modified status)</li> + printlog( "Change the document" ) + call hChangeDoc() + + '///<li>Open File-Save-dialog</li> + printlog( "Open filesave" ) + FileSave + kontext "SpeichernDlg" + if ( SpeichernDlg.exists( 2 ) ) then + printlog( "File Open dialog is open. Good" ) + else + warnlog( "File Open dialog is not open." ) + goto endsub + endif + + '///<li>Verify that 'Save with password' is enabled</li> + printlog( "Verify that the password-checkbox is enabled" ) + if ( passwort.isenabled() ) then + printlog( " * Password checkbox is enabled. Good." ) + + if ( passwort.ischecked() ) then + printlog( " * Password checkbox is checked. Good." ) + rc = 0 + else + warnlog( "Password checkbox is not checked, the option " & _ + "has not been transported from tools/options " & _ + "to the dialog -> bug" ) + rc = 1 + endif + else + warnlog( "#i36663# Password checkbox is disabled" ) + rc = 2 + endif + + if ( rc = 0 ) then + + if AutomatischeDateinamenserweiterung.Exists then + QAErrorLog "OBSOLETE: Check-box Automatic file extension in file dialog will be removed soon!" + AutomatischeDateinamenserweiterung.Uncheck + endif + + + '///<li>name the file and select filter</li> + printlog( "Name the file" ) + Dateiname.settext( workpath & workfile ) + + '///<li>uncheck password-protection</li> + printlog( "Uncheck password-protection" ) + passwort.uncheck() + + '///<li>save the file</li> + printlog( "Save the file" ) + Speichern.click() + + '///<li>handle possoble overwrite-warning</li> + Kontext "active" + if ( active.exists( 2 ) ) then + printlog( " - handle overwrite warning (if any)" ) + active.yes() + endif + + '///<li>handle unexpected password-dialog</li> + Kontext "passwordDlg" + if ( passwordDlg.exists( 2 ) ) then + warnlog( "Password dialog comes up, this is not expected at this " & _ + "point. Trying to handle the error gracefully" ) + Password.settext( workfile ) + PasswordConfirm.settext( workfile ) + PasswordDlg.ok() + else + printlog( " * No password dialog is displayed. Good." ) + endif + + '///<li>Delete the workfile</li> + hDeleteFile( workpath & workfile ) + + endif + + '///<li>close the document</li> + printlog( "Close the current document" ) + call hCloseDocument() + + '///</ul> + +endcase diff --git a/testautomation/framework/optional/includes/security_trusted_path.inc b/testautomation/framework/optional/includes/security_trusted_path.inc new file mode 100755 index 000000000000..2a769dc8e37f --- /dev/null +++ b/testautomation/framework/optional/includes/security_trusted_path.inc @@ -0,0 +1,102 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: security_trusted_path.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Execute macros from trusted path +'* +'\****************************************************************************** + +testcase tSecTrustedPath( cWorkFile as string, iSecLevel as integer ) + + '///<h1>Execute macros from a trusted path</h1> + '///<i>This testcase takes parameters and requires a number of settings + '///+ to run. See the calling .bas-file for details. <br> + '///+ Furthermore a number of + '///+ workfiles are used that have a documentbound macro as payload which is + '///+ executed at the "On document load" event.<br> + '///<ul> + + dim brc as boolean + dim cMsg as string + + '///+<li>Click "FileOpen" or go to the dialog via menu</li> + '///+<li>Enter the path to a file with macros within the trusted path</li> + '///+<li>Open the file</li> + hFileOpen( cWorkFile ) + + ' We have quite a bunch of possible combinations here. Some trigger a security warning + ' others do not. Files within a trusted path should never prompt. + + ' |---------------------------------------------------------| + ' | Trusted | Security Level / Warning displayed | + ' | Path | Low | Medium | High | Very High | + ' |---------------------------------------------------------| + ' | Yes | No | No | No | No | + ' |---------------------------------------------------------| + ' | No*) | No | Yes | Blocked | Blocked | + ' |---------------------------------------------------------| + ' *) Covered by test "f_sec_macrosecurity.bas" + + + '///+<li>Test for security-warning, warn if it pops up</li> + brc = hAllowMacroExecution() + if ( brc ) then + warnlog( "Macro Security Warning was not expected at this point" ) + endif + + '///+<li>Verify that the macro is executed</li> + printlog( "Verify that the macro is executed" ) + kontext "Active" + if ( active.exists() ) then + cMsg = active.getText() + cMsg = hRemoveLineBreaks( cMsg ) + if ( cMsg = "TTMacro3" ) then + printlog( "Macro was executed" ) + else + warnlog( "Invalid messagebox is open, please check" ) + endif + + '///+<li>Close the macro</li> + active.ok() + + endif + + '///+<li>Close the document</li> + hDestroyDocument() + + '///</ul> + + +endcase + diff --git a/testautomation/framework/optional/includes/standardbar2.inc b/testautomation/framework/optional/includes/standardbar2.inc new file mode 100755 index 000000000000..d1742f5eccd4 --- /dev/null +++ b/testautomation/framework/optional/includes/standardbar2.inc @@ -0,0 +1,196 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: standardbar2.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:16 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : global update test (Standardbar) +'* +'\*************************************************************************** + +testcase tStandardBar_2 + + if ( gtSysName = "Solaris x86" ) then + qaerrorlog( "#i62423# - New Database crashes office (Evolution)" ) + goto endsub + endif + + + '///<h1>Update test: Create all documenttypes from all applications via + '///+ "New-Button" on Standard Bar</h1> + + dim iCurrentApplication as Integer + dim iNewButtonItem as Integer + dim iPresentItemCount as integer + + '///<u>Note</u>: The "New-Button" has 12 items in a FULL office + '///+ installation. The test will not handle partial installations! + '///<ol> + '///+<li>Writer Document</li> + '///+<li>Calc Document</li> + '///+<li>Impress Document</li> + '///+<li>Draw Document</li> + '///+<li>Database Wizard</li> + '///+<li>HTML Document</li> + '///+<li>XML Form</li> + '///+<li>Master Document</li> + '///+<li>Math Document</li> + '///+<li>Labels</li> + '///+<li>Cards</li> + '///+<li>Templates and documents</li> + '///</ol> + + '///<i>Do this for all 12 applications</i> + '///<ul> + + '///+<li>Create exactly one single unmodified document<li> + hInitSingleDoc() + + '///+<li>Verify that this is a full installations (12 items on "New-Button")</li> + kontext "standardbar" + + kontext "standardbar" + try + Neu.openMenu() + iPresentItemCount = hMenuItemGetCount() + catch + warnlog( "Failed to access New-Button, skipping test" ) + goto endsub + endcatch + + if ( iPresentItemCount <> 12 ) then + warnlog( "Items missing on New-Button, Expected: 12, Found: " & _ + iPresentItemCount & " -> Running limited test!" ) + iPresentItemCount = 8 ' the first eight usually work (no guarantee) + endif + + for iCurrentApplication = 1 to 7 + + '///+<li>Create a new document</li> + printlog( "" ) + printlog ( hNumericDoctype( iCurrentApplication ) ) + hCreateDocument() + + '///+<li>Click the "New-Button" - all 12 items</li> + for iNewButtonItem = 1 to iPresentItemCount + + ' If Unix platform and application is Impress, get the focus of + ' the document in each loop. + + if ( iCurrentApplication = 3 AND gPlatgroup = "unx" ) then + kontext "documentimpress" + DocumentImpress.MouseDoubleClick ( 50, 50 ) + endif + + printlog " click on the " + iNewButtonItem + ". item on the new-button" + + kontext "standardbar" + try + Neu.openMenu() + sleep( 1 ) + iPresentItemCount = hMenuItemGetCount() + catch + warnlog( "Failed to access New-Button, skipping test" ) + goto endsub + endcatch + + sleep (1) + hMenuselectNr ( iNewButtonItem ) + sleep (3) + + '///+<li>Check if all applications or dialogs are opened correctly</li> + '///+<li>Close the document or dialog</li> + + select case iNewButtonItem + case 1 : Kontext "DocumentWriter" + DocumentWriter.TypeKeys( "Hallo" ) + hDestroyDocument() + case 2 : Kontext "DocumentCalc" + DocumentCalc.TypeKeys( "Hallo" ) + hDestroyDocument() + case 3 : Kontext "AutoPilotPraesentation1" + if ( AutoPilotPraesentation1.exists( 2 ) ) then + Startwithwizard.unCheck() + AutopilotPraesentation1.ok() + endif + Kontext "DocumentImpress" + DocumentImpress.MouseDoubleClick ( 50, 50 ) + hDestroyDocument() + case 4 : Kontext "DocumentDraw" + DocumentDraw.MouseDoubleClick ( 50, 50 ) + hDestroyDocument() + case 5 : Kontext "DatabaseWizard" + CancelBtn.click() + case 6 : Kontext "DocumentWriter" ' HTML Document + DocumentWriter.TypeKeys( "Hallo" ) + hDestroyDocument() + case 7 : Kontext "DocumentWriter" ' XML Form + DocumentWriter.TypeKeys( "Hallo" ) + hDestroyDocument() + case 8 : Kontext "DocumentWriter" ' Master Document + DocumentWriter.TypeKeys( "Hallo" ) + + kontext "navigator" + if Navigator.Exists( 5 ) then + Navigator.Close() + endif + hDestroyDocument() + case 9 : SchreibenInMathdok "a over b" + hDestroyDocument() + case 10 : Kontext + Active.SetPage( TabEtiketten ) + + kontext "tabetiketten" + TabEtiketten.Cancel() + case 11 : Kontext + Active.SetPage() + + kontext "tabetikettenmedium" + TabEtikettenMedium.Cancel() + case 12 : Kontext "TemplateAndDocuments" + TemplateAndDocuments.cancel() + end select + + sleep(2) + + next iNewButtonItem + + '///+<li>Close the document</li> + hDestroyDocument() + + next iCurrentApplication + '///</ul> + '///</ul> + +endcase + + diff --git a/testautomation/framework/optional/includes/toolbar_behavior.inc b/testautomation/framework/optional/includes/toolbar_behavior.inc new file mode 100755 index 000000000000..684cbe2d91ad --- /dev/null +++ b/testautomation/framework/optional/includes/toolbar_behavior.inc @@ -0,0 +1,172 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: toolbar_behavior.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:16 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : Resource test of toolbar behavior +'* +'\************************************************************************ + +testcase tToolbarBehavior +'/// context sensitive ///' + hNewDocument() + sleep (5) +'/// presupposion recover ///' +'/// if enabled: view->toolbars->reset ///' + 'ViewToolbarsReset + hUseMenu() + printlog hMenuSelectNr(3) + printlog hMenuSelectNr(3) + printlog hMenuSelectNr(-1) + kontext + if active.exists(5) then + active.setPage TabCustomizeMenu + if TabCustomizeMenu.exists(5) then + printlog "All Tooolbars are available." + TabCustomizeMenu.cancel + else + printlog "Resetet Toolbars." + endif + else + printlog "Toolbars resetet" + endif +'/// writer with table ///' + '/// check, that toolbar is not available ///' + kontext "TableObjectBar" + if TableObjectBar.exists(5) then + warnlog "Toolbar is already available?" + else + printlog "Toolbar is not available" + endif + InsertTableWriter + kontext "TabelleEinfuegenWriter" + if TabelleEinfuegenWriter.exists (5) then + TabelleEinfuegenWriter.ok + sleep (2) + else + warnlog "no table" + endif +'/// toolbar is available now ///' + kontext "TableObjectBar" + if TableObjectBar.exists(5) then + printlog "Toolbar is available." + else + warnlog "Toolbar is not available" + endif + +'/// close via toolbar->contextmenu->Close Toolbar ///' + if NOT TableObjectBar.isDocked then + TableObjectBar.dock + printlog "Toolbar got docked, to use thier kontext menu" + endif + TableObjectBar.openContextMenu + printlog hMenuSelectNr(-1) + kontext "TableObjectBar" + if TableObjectBar.exists(5) then + warnlog "Toolbar is still available" + else + printlog "Toolbar is not available" + endif +'/// leave table ///' + hTypeKeys("<mod1 end><mod1 end>") + kontext "TableObjectBar" + if TableObjectBar.exists(5) then + warnlog "Toolbar is still available" + else + printlog "Toolbar is not available" + endif +'/// enter table again -> toolbar is available again ///' + hTypeKeys("<mod1 home>") + kontext "TableObjectBar" + if TableObjectBar.exists(5) then + printlog "Toolbar is available." + else + warnlog "Toolbar is not available" + endif + + '/// close toolbar permanently ///' + Call hToolbarSelect ( "Table", false ) + kontext "TableObjectBar" + if TableObjectBar.exists(5) then + warnlog "Toolbar is still available" + else + printlog "Toolbar is not available" + endif + + '/// leave table ///' + hTypeKeys("<mod1 end><mod1 end>") + kontext "TableObjectBar" + if TableObjectBar.exists(5) then + warnlog "Toolbar is available again" + else + printlog "Toolbar is not available" + endif + + '/// enter table again: still no toolbar ///' + hTypeKeys("<mod1 home>") + kontext "TableObjectBar" + if TableObjectBar.exists(5) then + warnlog "Toolbar is available again" + else + printlog "Toolbar is not available" + endif + +'/// choose view->toolbars->reset ///' + 'ViewToolbarsReset + hUseMenu() + printlog hMenuSelectNr(3) + printlog hMenuSelectNr(3) + printlog hMenuSelectNr(-1) + kontext + if active.exists(5) then + active.setPage TabCustomizeMenu + if TabCustomizeMenu.exists(5) then + warnlog "Can't reset toolbars" + TabCustomizeMenu.cancel + else + printlog "Resetet Toolbars." + endif + else + printlog "Toolbars resetet" + endif +'/// toolbar is visible again ///' + kontext "TableObjectBar" + if TableObjectBar.exists(5) then + printlog "Toolbar is available." + else + warnlog "Toolbar is not available" + endif + + hCloseDocument() +endcase + diff --git a/testautomation/framework/optional/includes/w_grid_layout1.inc b/testautomation/framework/optional/includes/w_grid_layout1.inc new file mode 100755 index 000000000000..7c7cd46f1059 --- /dev/null +++ b/testautomation/framework/optional/includes/w_grid_layout1.inc @@ -0,0 +1,576 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: w_grid_layout1.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:16 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : Grid Layout for CJK test in Writer +'* +'\*********************************************************************** + +testcase tTextGridDialog_1 + +'/// Check if tabpage 'Text Grid' disappears when "Asian Language support" is NOT checked + if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then + Call CheckAsianLanguageSupport("Off") + hNewDocument() + FormatPageWriter + try + Kontext + Active.SetPage TabGrid + Kontext "TabGrid" + TabGrid.Cancel + warnlog "Shouldn't get Tabpage: Grid Text" + catch + Kontext + Active.SetPage TabSeite + Kontext "TabSeite" + TabSeite.Cancel + endcatch + end if + +'/// Check if tabpage 'Text Grid' appears when "Asian Language support" is checked + Call CheckAsianLanguageSupport("On") + + sleep 5 + FormatPageWriter + Kontext + if Active.exists (10) then + try + Kontext + Active.SetPage TabGrid + Kontext "TabGrid" + TabGrid.Cancel + catch + Kontext + Active.SetPage TabSeite + Kontext "TabSeite" + TabSeite.Cancel + warnlog "Couldn't get Tabpage: Grid Text" + endcatch + else + warnlog "FormatPageWriter didn't bring up ndialog" + endif + hCloseDocument() +endcase + +'------------------------------------------------------------------------- + +testcase tTextGridDialog_2 +'/// No grid is active, no changes to existing version + Dim testFile , sCorrectResult as String + + testFile = "gridtest.sxw" + sCorrectResult = "1" + + Call hNewDocument + + '/// open a test file , and check No Grid checkbox + Call hFileOpen ( gTesttoolPath + "framework\level2\CJK\input\" + testFile ) + + FormatPageWriter + Kontext + if active.exists(5) then + Active.SetPage TabGrid + endif + Kontext "TabGrid" + NoGrid.Check + Sleep 1 + TabGrid.OK + Sleep 1 + + '/// Active navigator dialogue , set page to '2' and wait for a while + Kontext + EditNavigator + Kontext "NavigatorWriter" + + Seitennummer.SetText "2" + Sleep 5 + fCloseNavigator + + '/// In No Grid mode, there should be only 1 page, the focus is before the first line + Kontext "DocumentWriter" + Call DocumentWriter.TypeKeys "<End>" + Sleep 1 + Call DocumentWriter.TypeKeys "<Shift Left>" + Editcopy + + if GetClipboardText <> sCorrectResult then Warnlog "Something wrong when choosing NoGrid option!" + + Call hCloseDocument +endcase + +'------------------------------------------------------------------------- + +testcase tTextGridDialog_3 +'/// Grid (lines only): The page is set up with a defined number of lines + Dim testFile , sCorrectResult , sLinesPerPage as String + + testFile = "gridtest.sxw" + sCorrectResult = "G" + sLinesPerPage = "10" + + Call hNewDocument + + '/// open a test file and check Grid(lines onle) checkbox , + '/// + set 10 line/page + Call hFileOpen ( gTesttoolPath + "framework\level2\CJK\input\" + testFile ) + + FormatPageWriter + Kontext + if active.exists(5) then + Active.SetPage TabGrid + endif + Kontext "TabGrid" + LinesGrid.Check + LinesPerPage.SetText sLinesPerPage + Sleep 1 + TabGrid.OK + Sleep 1 + + '/// Active navigator dialogue , set page to '2' and wait for a while + Kontext + EditNavigator + Kontext "NavigatorWriter" + + Seitennummer.SetText "2" + Sleep 5 + fCloseNavigator + + Kontext "DocumentWriter" + Call DocumentWriter.TypeKeys "<End>" + Sleep 1 + Call DocumentWriter.TypeKeys "<Shift Left>" + Editcopy + + if GetClipboardText <> sCorrectResult then Warnlog "Something wrong when choosing Grid(lines only) option!" + + Call hCloseDocument +endcase + +'------------------------------------------------------------------------- + +testcase tTextGridDialog_4 +'/// Grid (lines and characters): The page is set up with a defined number of lines and a defined number of characters in each line + Dim testFile , sCorrectResult as String + Dim sLinesPerPage , sCharsPerLine as String + + testFile = "gridtest.sxw" + sCorrectResult = "E" + sLinesPerPage = "10" + sCharsPerLine = "9" + + Call hNewDocument + + '/// open a test file and check Grid(lines and characters) checkbox + '/// + set 10 line/page and 9 characters/line + Call hFileOpen ( gTesttoolPath + "framework\level2\CJK\input\" + testFile ) + + FormatPageWriter + Kontext + if active.exists(5) then + Active.SetPage TabGrid + endif + Kontext "TabGrid" + CharsGrid.Check + LinesPerPage.SetText sLinesPerPage + CharsPerLine.SetText sCharsPerLine + Sleep 1 + TabGrid.OK + Sleep 1 + + '/// Active navigator dialogue , set page to '2' and wait for a while + Kontext + EditNavigator + Kontext "NavigatorWriter" + + Seitennummer.SetText "2" + Sleep 5 + fCloseNavigator + + Kontext "DocumentWriter" + Call DocumentWriter.TypeKeys "<End>" + Sleep 1 + Call DocumentWriter.TypeKeys "<Shift Left>" + Editcopy + + if GetClipboardText <> sCorrectResult then Warnlog "Something wrong when choosing Grid(lines and characters) option!" + + Call hCloseDocument +endcase + +'------------------------------------------------------------------------- + +testcase tGridDisplay_1 +'/// Print grid: The grid lines will be printed. Inactive if "Display grid" is inactive. + Call hNewDocument + + '/// format / page / tabpage Text grid + '/// + check "display grid" and check "print grid" + FormatPageWriter + Kontext + if active.exists(5) then + Active.SetPage TabGrid + endif + Kontext "TabGrid" + CharsGrid.Check + Display.Check + Sleep 1 + PrintGrid.Check + Sleep 1 + TabGrid.OK + Sleep 1 + + '/// Print to printer + FilePrint + Kontext "Active" + if Active.Exists(5) then + if Active.GetRT = 304 then + Active.Ok + QAErrorLog "No Default-Printer!" + Kontext "DruckenDlg" + Sleep 1 + DruckenDlg.Cancel + end if + else + Kontext "DruckenDlg" + Sleep 1 + DruckenDlg.OK + Sleep 5 + kontext + if active.exists(5) then + qaErrorLog active.getText + active.ok + end if + end if + + '/// format / page / tabpage Text grid + '/// + check "display grid" and uncheck "print grid" + FormatPageWriter + Kontext + if active.exists(5) then + Active.SetPage TabGrid + endif + Kontext "TabGrid" + CharsGrid.Check + Display.Check + Sleep 1 + PrintGrid.UnCheck + Sleep 1 + TabGrid.OK + Sleep 1 + + '/// Print to printer + FilePrint + Kontext "Active" + if Active.Exists(5) then + if Active.GetRT = 304 then + Active.Ok + QAErrorLog "No Default-Printer!" + Kontext "DruckenDlg" + Sleep 1 + DruckenDlg.Cancel + end if + else + Kontext "DruckenDlg" + Sleep 1 + DruckenDlg.OK + Sleep 5 + kontext + if active.exists(5) then + qaErrorLog active.getText + active.ok + end if + end if + + Call hCloseDocument +endcase + +'------------------------------------------------------------------------- + +testcase tUserDefineLayout_1 +'/// Decrease characters per line will cause lines per page decrease accordingly + Dim sLinesPerPage , sCharsPerLine as String + Dim sExpectLinesPerPage , sExpectLinesPerPage1 as String + + sLinesPerPage = "20" + sCharsPerLine = "2" + sExpectLinesPerPage = "2" + sExpectLinesPerPage1 = "3" + + Call hNewDocument + + '/// Format/page , set lines per page to 20, and set charsets per line to 2 + '/// + wait for a moment , then check the the number of lines per page. + FormatPageWriter + Kontext + if active.exists(5) then + Active.SetPage TabGrid + endif + Kontext "TabGrid" + CharsGrid.Check + + LinesPerPage.SetText sLinesPerPage + Sleep 2 + CharsPerLine.SetText sCharsPerLine + Sleep 2 + + 'This step is no use, just let the LinesPerPage change the number + CharsGrid.Check + + if LinesPerPage.GetText <> sExpectLinesPerPage AND LinesPerPage.GetText <> sExpectLinesPerPage1 then + Warnlog "The lines per page should be" + sExpectLinesPerPage + " OR " + sExpectLinesPerPage1 +" but get " +LinesPerPage.GetText + end if + + TabGrid.Cancel + + Call hCloseDocument +endcase + +'------------------------------------------------------------------------- + +testcase tFontSizeChanges_1 +'/// Change the font size to bigger enough will change the layout + Dim testFile , sCorrectResult as String + Dim sLinesPerPage , sCharsPerLine as String + dim sTemp as string + + testFile = "FontSizeChanges_1.sxw" + sCorrectResult = "1" + sLinesPerPage = "2" + sCharsPerLine = "9" + + '/// open a test file + Call hFileOpen ( gTesttoolPath + "framework\level2\CJK\input\" + testFile ) + + Kontext "DocumentWriter" + Call DocumentWriter.TypeKeys "<Shift Right>" + + '/// set font size to 60 + Kontext "FormatObjectbar" + Schriftgroesse.Select "60" + Schriftgroesse.TypeKeys "<Return>" + Sleep 1 + + '/// Check if lines per page and charsets per line is still right + Kontext "DocumentWriter" + FormatPageWriter + Kontext + if active.exists(5) then + Active.SetPage TabGrid + endif + Kontext "TabGrid" + if TabGrid.exists(5) then + sTemp = LinesPerPage.GetText + if sTemp <> sLinesPerPage then + Warnlog "The lines per page should be: '" + sLinesPerPage + "'; but get: '" + sTemp + "'" + endif + sTemp = CharsPerLine.GetText + if sTemp <> sCharsPerLine then + Warnlog "The chars per line should be: '" + sCharsPerLine + "'; but get: '" +sTemp + "'" + endif + TabGrid.Cancel + else + warnlog "TabGrid is not available." + endif + + '/// Active navigator dialogue , set page to '2' and wait for a while + Kontext + EditNavigator + Kontext "NavigatorWriter" + if NavigatorWriter.exists(5) then + Seitennummer.SetText "2" + Sleep 5 + else + warnlog "Navigator not available" + endif + fCloseNavigator + + Kontext "DocumentWriter" + sleep 3 + Call DocumentWriter.TypeKeys "<Shift Right>" + sleep 3 + Editcopy + sTemp = GetClipboardText + if sTemp <> sCorrectResult then + Warnlog "Don't get the expected result , hope to be: '" + sCorrectResult + "'; but get: '" + sTemp + "'" + endif + + Call hCloseDocument +endcase + +'------------------------------------------------------------------------- + +testcase tRubyText_1 +'/// If Ruby Text is applied and longer than its Base Text it will stretch over more grid cells than the base text itself. + Dim testFile , sRubyText as String + + testFile = "rubytest.sxw" + sRubyText = "Ruby Test Text ....................." + + Call hNewDocument + + '/// open a test file , and insert long ruby test text + Call hFileOpen ( gTesttoolPath + "framework\level2\CJK\input\" + testFile ) + + Kontext "DocumentWriter" + Call DocumentWriter.TypeKeys "<Shift Right>" + Sleep 1 + + FormatRuby + Kontext "RubyDialog" + Sleep 3 + RubyText1.setText sRubyText + Sleep 2 + RubyDialog.OK + Sleep 2 + DialogClose.Click + Sleep 1 + + Kontext "DocumentWriter" + FormatAutoformatApply + Sleep 2 + Call DocumentWriter.TypeKeys "<End>" + Sleep 2 + Call DocumentWriter.TypeKeys "<Shift Left>" + Editcopy + + if NOT(GetClipboardText = "5" OR GetClipboardText = "6") then + Warnlog "Don't get the correct result after inserting ruby text! Get " + GetClipboardText + end if + + Call hCloseDocument +endcase + +'------------------------------------------------------------------------- + +testcase tIndentsTest_1 + '/// Indents should work and always indenting as close as possible to their measurements by snapping to the appropriate grid cell. Tabs therefore will be ignored. + Dim testFile , sCorrectPage1 , sCorrectPage2 as String + + testFile = "IndentsTest.sxw" + sCorrectPage1 = "1" + sCorrectPage2 = "2" + + Call hNewDocument + + '/// open a test file , and press TAB in second line + Call hFileOpen ( gTesttoolPath + "framework\level2\CJK\input\" + testFile ) + + Kontext "DocumentWriter" + Call DocumentWriter.TypeKeys "<Down>" + Sleep 1 + Call DocumentWriter.TypeKeys "<Tab>" + Sleep 1 + Call DocumentWriter.TypeKeys "<End>" + Sleep 1 + + '/// Active navigator dialogue , check if the page number is 1 + Kontext + EditNavigator + Kontext "NavigatorWriter" + if Seitennummer.GetText <> sCorrectPage1 then Warnlog "First test :Something wrong in indents test!" + fCloseNavigator + + '/// press TAB in second line again + Kontext "DocumentWriter" + Call DocumentWriter.TypeKeys "<Home>" + Sleep 1 + Call DocumentWriter.TypeKeys "<Tab>" + Sleep 1 + Call DocumentWriter.TypeKeys "<End>" + Sleep 1 + + '/// Active navigator dialogue , check if the page number is 2 + Kontext + EditNavigator + Kontext "NavigatorWriter" + if Seitennummer.GetText <> sCorrectPage2 then Warnlog "Second test :Something wrong in indents test!" + fCloseNavigator + + Call hCloseDocument +endcase + +'------------------------------------------------------------------------- + +testcase tObjectsTest_1 + '/// If objects are anchored to text they will "wander" with its surrounding text. + '/// If they are anchored as character they will snap to the appropriate grid cell (since they are a character). + Dim testFile , sCorrectPage1 , sCorrectPage2 as String + + testFile = "objectsTest.sxw" + sCorrectPage1 = "1" + sCorrectPage2 = "2" + + Call hNewDocument + + '/// open a test file , and press TAB in second line + Call hFileOpen ( gTesttoolPath + "framework\level2\CJK\input\" + testFile ) + + '/// If object is anchored as Character , check if it will snap to the appropriate grid cell + fStartupNavigator( "OLEObject" , 1 ) + Sleep 1 + Auswahlliste.TypeKeys "<Return>" + Sleep 1 + fCloseNavigator + Sleep 2 + + Kontext + FormatAnchorAsCharacter + Sleep 1 + + EditNavigator + Kontext "NavigatorWriter" + Seitennummer.SetText sCorrectPage2 + Sleep 5 + if Seitennummer.GetText <> sCorrectPage2 then Warnlog "Something wrong when object is anchored as Character!" + fCloseNavigator + + '/// If object is anchored to Character , check if it will NOT snap to the appropriate grid cell + fStartupNavigator( "OLEObject" , 1 ) + Auswahlliste.TypeKeys "<Return>" + fCloseNavigator + + Kontext + FormatAnchorToCharacter + + EditNavigator + Kontext "NavigatorWriter" + Seitennummer.SetText sCorrectPage2 + Sleep 5 + if Seitennummer.GetText <> sCorrectPage1 then Warnlog "Something wrong when object is anchored to Character!" + fCloseNavigator + Kontext + + Call hCloseDocument +endcase + |