diff options
Diffstat (limited to 'testautomation/writer/optional/includes/table')
-rwxr-xr-x | testautomation/writer/optional/includes/table/w_204_.inc | 1157 | ||||
-rwxr-xr-x | testautomation/writer/optional/includes/table/w_204a_.inc | 1163 | ||||
-rwxr-xr-x | testautomation/writer/optional/includes/table/w_204b_.inc | 100 |
3 files changed, 2420 insertions, 0 deletions
diff --git a/testautomation/writer/optional/includes/table/w_204_.inc b/testautomation/writer/optional/includes/table/w_204_.inc new file mode 100755 index 000000000000..a5a94662c350 --- /dev/null +++ b/testautomation/writer/optional/includes/table/w_204_.inc @@ -0,0 +1,1157 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : helge.delfs@oracle.com +'* +'* short description : Writer Table Test +'* +'************************************************************************* +'* +'* tTableOption +'* tTableInsert1 +'* tTableInsert2 +'* tTableInsert3 +'* tTableInsert4 +'* tTableInsert5 +'* tTableNumberFormat +'* tTableDelete +'* tTableText +'* tTableCalculate +'* tTableEdit +'* +'\*********************************************************************** + +sub w_204_ + Call tTableOption + Call tTableInsert1 + Call tTableInsert2 + Call tTableInsert3 + Call tTableInsert4 + Call tTableInsert5 + Call tTableNumberFormat + Call tTableDelete + Call tTableText + Call tTableCalculate + Call tTableEdit +end sub + +testcase tTableOption + '/// Check Tables' default Option /// + printlog "/// Check Tables' default Option ///" + + Call hNewDocument + + '/// TOOLS->OPTIONS->StarOffice Writer->Table ///" + '/// Number recognition should be OFF by default///" + '/// two boxes below are checked but disabled ///" + + ToolsOptions + Call hToolsOptions ("WRITER","Table") + if AutomatischeZahlenerkennung.IsChecked then + warnlog "The default for 'Number recognition' should be OFF => 114166 " + AutomatischeZahlenerkennung.UnCheck + else + if AutomatischeAusrichtung.IsChecked then + try + AutomatischeAusrichtung.UnCheck + warnlog "'Number format recognition' should be disabled => 114166 " + catch + endcatch + else + warnlog "'Number format recognition' should be checked => 114166 " + end if + if Zahlenformaterkennung.IsChecked then + try + Zahlenformaterkennung.UnCheck + warnlog "'Alignment' should be disabled => 114166 " + catch + endcatch + else + warnlog "'Alignment' should be checked => 114166 " + end if + end if + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.Cancel + + Call hCloseDocument + +endcase + +' -------------------------------------------------------------------- + +testcase tTableInsert1 + dim i as integer + + Call hNewDocument + Kontext "DocumentWriter" + + Printlog "'/// 1. Insert Toolbox -> Insert Table ///" + Call hToolbarSelect ( "Insert", True ) + Kontext "InsertBar" + Tabelle.Click + Kontext "TabelleEinfuegenWriter" + TabellenName.SetText "one" + Spalten.Settext "5" + TabelleEinfuegenWriter.OK + Call wTypeKeys "one<down>" + + Printlog "'///+ ... play with number recognition in TOOLS->OPTIONS->TextDoc->Table ///" + Printlog "'///+ ... Number recognition OFF ///" + ToolsOptions + Call hToolsOptions ("WRITER","Table") + AutomatischeZahlenerkennung.UnCheck + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + + ' insert test row + Call hToolbarSelect ( "Table", true ) + ZeileEinfuegen.Click + Call wTypeKeys "<down>11111<Tab>1"+cSep+"116111<Tab>1"+cDecSep+"116111<Tab>abcd<shift tab><shift tab><shift tab>" + ' check format + for i=1 to 4 + FormatNumberFormat + Kontext "Zahlenformat" + if (Kategorie.GetSelText <> fLocaleString("LocaleText")) then + warnlog "wrong format; is: "+Kategorie.GetSelText+" should: "+fLocaleString("LocaleText") ' Text + end if + Zahlenformat.Cancel + FormatParagraph + Kontext + Active.SetPage tabAusrichtungAbsatz + Kontext "tabAusrichtungAbsatz" + if (links.isChecked <> true) then warnlog "wrong alignment of tablefield: "+i + TabAusrichtungAbsatz.Cancel + Call wTypeKeys "<Tab>" + next i + ' go back to start of table + Call wTypeKeys "<Mod1 Home><Down>" + + Printlog "'///+ ... Number recognition ON - ///" + ToolsOptions + Call hToolsOptions ("WRITER","Table") + AutomatischeZahlenerkennung.Check ' even with that, everything is a TEXT :-(???? + Zahlenformaterkennung.UnCheck ' much better with that! everything with numbers&decimalsep is number with 2 decimal places displayed, but all kept!!! + AutomatischeAusrichtung.UnCheck ' just the allignment does change too! + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + + Call hToolbarSelect ( "Table", true ) + ZeileEinfuegen.Click + Call wTypeKeys "<down>11111<Tab>1"+cSep+"116111<Tab>1"+cDecSep+"116111<Tab>abcd<shift tab><shift tab><shift tab>" + for i=1 to 4 + FormatNumberFormat + Kontext "Zahlenformat" + if (Kategorie.GetSelText <> fLocaleString("LocaleText")) then + warnlog "wrong format; is: "+Kategorie.GetSelText+" should: "+fLocaleString("LocaleText") ' Text + end if + Zahlenformat.Cancel + FormatParagraph + Kontext + Active.SetPage tabAusrichtungAbsatz + Kontext "TabAusrichtungAbsatz" + if (Links.IsChecked = false) then warnlog "wrong alignment of tablefield: "+i + TabAusrichtungAbsatz.Cancel + Call wTypeKeys "<Tab>" + next i + Call wTypeKeys "<Mod1 Home><Down>" + + Printlog "'///+ ... Number recognition ON - Number format recognition ///" + ToolsOptions + Call hToolsOptions ("WRITER","Table") + AutomatischeZahlenerkennung.Check ' even with that, everything is a TEXT :-(???? + Zahlenformaterkennung.Check ' much better with that! everything with numbers&decimalsep is number with 2 decimal places displayed, but all kept!!! + AutomatischeAusrichtung.UnCheck ' just the allignment does change too! + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Call hToolbarSelect ( "Table", true ) + ZeileEinfuegen.Click + Call wTypeKeys "<down>11111<Tab>1"+cSep+"116111<Tab>1"+cDecSep+"116111<Tab>abcd<shift tab><shift tab><shift tab>" + ' number, text, number, text + for i=1 to 4 + FormatNumberFormat + Kontext "Zahlenformat" + Select Case i + Case 1,2,3 + if (Kategorie.GetSelText <> fLocaleString("LocaleNumber")) then + warnlog "wrong format; "+ i +"; is: "+Kategorie.GetSelText+" should: "+fLocaleString("LocaleNumber") ' Number + end if + Case 4 + if (Kategorie.GetSelText <> fLocaleString("LocaleText")) then + warnlog "wrong format; "+ i +"; is: "+Kategorie.GetSelText+" should: "+fLocaleString("LocaleText") ' Text + end if + end select + Zahlenformat.Cancel + Call wTypeKeys "<Tab>" + next i + Call wTypeKeys "<Mod1 Home><Down>" + + Printlog "'///+ ... Number recognition ON - Number format recognition - Alignment ///" + ToolsOptions + Call hToolsOptions ("WRITER","Table") + AutomatischeZahlenerkennung.Check ' even with that, everything is a TEXT :-(???? + Zahlenformaterkennung.Check ' much better with that! everything with numbers&decimalsep is number with 2 decimal places displayed, but all kept!!! + AutomatischeAusrichtung.Check ' just the allignment does change too! + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Call hToolbarSelect ( "Table", true ) + ZeileEinfuegen.Click + Call wTypeKeys "<down>11111<Tab>1"+cSep+"116111<Tab>1"+cDecSep+"116111<Tab>abcd<shift tab><shift tab><shift tab>" + ' number-right, text-left, number-right, text-left + for i=1 to 4 + Select Case i + Case 1,2,3 + FormatNumberFormat + Kontext "Zahlenformat" + if (Kategorie.GetSelText <> fLocaleString("LocaleNumber")) then + warnlog "wrong format; "+ i +"; is: "+Kategorie.GetSelText+" should: "+fLocaleString("LocaleNumber") ' number + end if + Zahlenformat.Cancel + formatparagraph + Kontext + Active.SetPage tabAusrichtungAbsatz + Kontext "tabAusrichtungAbsatz" + if (rechts.isChecked <> true) then warnlog "wrong alignment of tablefield: "+i +"; should: right" + tabausrichtungabsatz.Cancel + Case 4 + FormatNumberFormat + Kontext "Zahlenformat" + if (Kategorie.GetSelText <> fLocaleString("LocaleText")) then + warnlog "wrong format; is: "+ i +"; "+Kategorie.GetSelText+" should: "+fLocaleString("LocaleText") ' Text + end if + Zahlenformat.Cancel + formatparagraph + Kontext + Active.SetPage TabAusrichtungAbsatz + Kontext "TabAusrichtungAbsatz" + if (links.isChecked <> true) then warnlog "wrong alignment of tablefield: "+i+"; should: left" + TabAusrichtungAbsatz.Cancel + end select + Call wTypeKeys "<Tab>" + next i + + Call hCloseDocument + +endcase + +' -------------------------------------------------------------------- + +testcase tTableInsert2 + + Call hNewDocument + Printlog "'/// 2. Insert Toolbox -> Insert Table -> Autoformat ///" + ' using autoformat + Call hToolbarSelect ( "Insert", True ) + Kontext "InsertBar" + Tabelle.Click + Kontext "TabelleEinfuegenWriter" + Spalten.Settext "5" + Zeilen.SetText "20" + Autoformat.Click + Kontext "AutoformatTabelle" + AutoFormatTabelle.OK + Kontext "TabelleEinfuegenWriter" + TabellenName.SetText "two" + TabelleEinfuegenWriter.OK + Call wTypeKeys "two" + + Call hCloseDocument + +endcase + +' -------------------------------------------------------------------- +testcase tTableInsert3 + dim i as integer + dim sTemp as string + dim itemp(3) as integer + + Call hNewDocument + Printlog "'/// 3. Menu: Insert -> Table (Shortcut): {strg} + {F12} ///" + Printlog "'///+ Test Options on 'Insert Table' ///" + Printlog "'///+ Header ON ///" + ' table heading active + ' Don't split table INactive + ' table border unchecked + Call wTypeKeys "<Mod1 F12>" + Kontext "TabelleEinfuegenWriter" + + TabellenName.SetText "three" + Spalten.Settext "5" + Ueberschrift.Check + Umrandung.Uncheck + TabelleEinfuegenWriter.OK + Call wTypeKeys "three" + + ' -------------check if heading 1 + ' if checked: heading; else: contents !! SystemLanguage dependent !! :-( + Printlog "'///+ check if Header ON ///" + Kontext "TextObjectbar" + sleep (1) + sTemp = Vorlage.GetSelText + if (sTemp <> fLocaleString("LocaleTableHeading")) then + Warnlog "--- table heading did not work!" + warnlog "--- is:" + sTemp + ", should :" + fLocaleString("LocaleTableHeading") + end if + '---------------------------------- + Call wTypeKeys "<down>" + ' -------------check if splitting; it HAS TO split + Printlog "'///+ check if Table gets splitted - it HAS TO split ///" + + InsertFieldsPagenumbers ' get pagenumber & leave it for next calculation + Call wTypeKeys "<Mod1 A>" + ToolsCalculate + itemp(1) = val(GetClipboardText) + Call hToolbarSelect ( "Table", true ) + for i=1 to 60 + ZeileEinfuegen.Click ' inserted below the current row + wait 200 + next i + ToolsUpdateUpdateAll ' update field & get pagenumber & clear + Call wTypeKeys "<Left><Right>" ' Seems there are focus problems on Solaris...workaround + Call wTypeKeys "<Mod1 A>" + ToolsCalculate + itemp(2) = val(GetClipboardText) + if (itemp(1)+1 = itemp(2)) then warnlog "--- Table moved to seconde page" + EditCut + Call wTypeKeys "got start3" + + Call wTypeKeys "<Mod1 end>" ' move to last cell in table + InsertFieldsPagenumbers ' get pagenumber & clear + Call wTypeKeys "<Mod1 A>" + ToolsCalculate + itemp(3) = val(GetClipboardText) + if (itemp(2) <> itemp(3)) then + printlog "--- Table splitted" + itemp(3) + else + warnlog "put some more rows in!!!" + end if + + Call hCloseDocument +endcase + +' -------------------------------------------------------------------- +testcase tTableInsert4 + dim i as integer + dim stemp as string + + '/// Open a new writer document + Call hNewDocument + '/// Insert some dummy text + if wBlindTextEinfuegen() = false then + Call hCloseDocument + goto endsub + end if + '/// Insert a table with parameters: + InsertTableWriter + Kontext "TabelleEinfuegenWriter" + + '/// - Set table name: four + TabellenName.SetText "four" + '/// - number of columns: 5 + Spalten.Settext "5" + '/// - number of rows: 16 + Zeilen.Settext "16" + '/// - Header: uncheck + Ueberschrift.UnCheck + '/// - Don't split table: check + TabelleNichtTrennen.Check + '/// - Border: check + Umrandung.check + TabelleEinfuegenWriter.OK + + '/// check if table has no header + Printlog "check if Header OFF" + Kontext "TextObjectbar" + sleep (1) + if wStyleGet(fLocaleString("LocaleTableHeading")) = true then + Warnlog "Seems tableheader is activated though header is off" + end if + + '/// Cursor leaves table with <Up> and <End> + Printlog "check if Table gets splitted" + Call wTypeKeys "<Up><End><SPACE>" + '/// Insert dummy text again 3 times + Call wBlindtextEinfuegen +' wait 500 + Call wBlindtextEinfuegen +' wait 500 + Call wBlindtextEinfuegen + '/// check if table has been moved to Page 2 + + Call wTypeKeys "<Mod1 End>" ' jump to documents end + Call wTypeKeys "<Up>" ' move cursor into table + Call wTypeKeys "<Mod1 Home>" ' move cursor to first cell + + '/// Insert / Fields / Pagenumbers to check on which page table is + InsertFieldsPagenumbers + Call wTypeKeys "<shift home>" + ToolsCalculate + + if (GetClipboardText = "2") or (GetClipboardText = "3") then + printlog "Table has been moved correctly" + else + warnlog " It seems table has been splitted" + end if + + '/// <B>Table should split if table is bigger than one page</B> + Call wTypeKeys "<Up>" + Call wTypeKeys "<shift mod1 home>" + Call wTypeKeys "<delete>" + Call wBlindtextEinfuegen + Call wTypeKeys "<mod1 End>" + Call wTypeKeys "<up>" + Call wTypeKeys "<mod1 Home>" + + Printlog "Table should split" + Call hToolbarSelect ( "Table", true ) + for i=1 to 25 + ZeileEinfuegen.Click ' inserted below the current row + next i + Call wTypeKeys "<shift end>" + ToolsCalculate + stemp = GetClipboardText + Call wTypeKeys "<ESCAPE>" + Call wTypeKeys "<mod1 End>" + InsertFieldsPagenumbers + Call wTypeKeys "<shift home>" + ToolsCalculate + if (GetClipboardText <> stemp) then + printlog "Table has been splitted" + else + warnlog " It seems table has not been splitted" + end if + + Call hCloseDocument +endcase + +' -------------------------------------------------------------------- +testcase tTableInsert5 + + Call hNewDocument + '/// Insert Text with delimeter & call Tools -> Text<->Table + Printlog "'/// Insert Text with delimeter & call Tools -> Text<->Table ///" + Call wTypeKeys "five;2;3;4;5;<return>" + Call wTypeKeys "a;b;c;d;e;<return>" + Call wTypeKeys "A;B;C;D;E;" + Call wTypeKeys "<shift home>" + Call wTypeKeys "<shift up>" + Call wTypeKeys "<shift up>" + + ToolsTextInTable + Kontext "TextInTabelleUmwandeln" + Semikolon.Check + + TextInTabelleUmwandeln.OK + Call wTypeKeys "<end><Mod1 end><down><return>" + + Call hCloseDocument +endcase + +' -------------------------------------------------------------------- + +testcase tTableNumberFormat + + Call hNewDocument + Printlog "'/// Fill table with content: Tools->Options->TextDoc->Number formating/recognition check ALL ///" + '/// use table 5x10; and try to get every entry from format->numberFormat->Categorie ///' + + Call TBOhTabelleEinfuegen ("six",0, 0, 0, 1,"5", "10" ) + Call wTypeKeys "six<down>" + + ToolsOptions ' set options for this test + Call hToolsOptions ("WRITER","Table") + AutomatischeZahlenerkennung.Check + Zahlenformaterkennung.Check + AutomatischeAusrichtung.Check + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + + printlog "Checking numberformater" + '///+ - Currency + printlog " - Currency" + call wTypeKeys(fLocaleString("LocaleCurrencyValue")) + call wTypeKeys "<Tab><shift tab>" + FormatNumberFormat + Kontext "Zahlenformat" + if (Kategorie.GetSelIndex <> 5) then + warnlog "The value is not recognized as currency, it is " & Kategorie.GetSelText + else + printlog " - Value is correctly recognized as currency" + end if + Zahlenformat.Cancel + formatparagraph + Kontext + Active.SetPage tabAusrichtungAbsatz + Kontext "tabAusrichtungAbsatz" + if (rechts.isChecked <> true) then + warnlog "wrong alignment of number" + else + printlog " - Currencyvalue is correctly alligned" + end if + TabAusrichtungAbsatz.Cancel + Call wTypeKeys "<home><shift end>" + EditCopy + if (GetClipboardText <> fLocaleString("LocaleCurrencyValue")) then + warnlog "The number is not correctly formated. It is: " & GetClipboardText & " but should be: " & fLocaleString("LocaleCurrencyValue") + else + printlog " - Currencyvalue is correctly formated" + end if + + '///+ - Unknown currency + printlog " - Unknown currency" + call wTypeKeys("10.78 §") + call wTypeKeys "<Tab><shift tab>" + FormatNumberFormat + + Kontext "Zahlenformat" + if (Kategorie.GetSelIndex <> 11) then + warnlog "The value is not recognized as string, it is " & Kategorie.GetSelText + else + printlog " - Value is correctly recognized as string" + end if + Zahlenformat.Cancel + formatparagraph + Kontext + Active.SetPage tabAusrichtungAbsatz + Kontext "tabAusrichtungAbsatz" + if (links.isChecked <> true) then + warnlog "wrong alignment of number" + else + printlog " - Value is correctly alligned" + end if + TabAusrichtungAbsatz.Cancel + Call wTypeKeys "<home><shift end>" + EditCopy + if (GetClipboardText <> "10.78 §") then + warnlog "The number is not correctly formated: should be 10.78 §, but is " & GetClipboardText + else + printlog " - Value is correctly formated" + end if + + '///+ - Date + printlog " - Date" + call wTypeKeys(fLocaleString("LocaleDateValue")) + call wTypeKeys "<Tab><shift tab>" + FormatNumberFormat + + Kontext "Zahlenformat" + if (Kategorie.GetSelIndex <> 6) then + warnlog "The value is not recognized as date, it is " & Kategorie.GetSelText + else + printlog " - Value is correctly recognized as date" + end if + Zahlenformat.Cancel + Formatparagraph + Kontext + Active.SetPage tabAusrichtungAbsatz + Kontext "tabAusrichtungAbsatz" + if (rechts.isChecked <> true) then + warnlog "wrong alignment of number" + else + printlog " - Datevalue is correctly alligned" + end if + TabAusrichtungAbsatz.Cancel + Call wTypeKeys "<home><shift end>" + EditCopy + if (GetClipboardText <> fLocaleString("LocaleDateOutput")) then + warnlog "The number is not correctly formated: should be " & fLocaleString("LocaleDateOutput") & ", but is " & GetClipboardText + else + printlog " - Datevalue is correctly formated" + end if + + '///+ - Time + printlog " - Time" + call wTypeKeys(fLocaleString("LocaleTimeInput")) + call wTypeKeys "<Tab><shift tab>" + FormatNumberFormat + + Kontext "Zahlenformat" + if (Kategorie.GetSelIndex <> 7) then + warnlog "The value is not recognized as time, it is " & Kategorie.GetSelText + else + printlog " - Value is correctly recognized as date" + end if + Zahlenformat.Cancel + Formatparagraph + Kontext + Active.SetPage tabAusrichtungAbsatz + Kontext "tabAusrichtungAbsatz" + if (rechts.isChecked <> true) then + warnlog "wrong alignment of number" + else + printlog " - Timevalue is correctly alligned" + end if + TabAusrichtungAbsatz.Cancel + Call wTypeKeys "<home><shift end>" + EditCopy + if (GetClipboardText <> fLocaleString("LocaleTimeValue")) then + warnlog "The number is not correctly formated: should be " & fLocaleString("LocaleTimeValue") & ", but is " & GetClipboardText + else + printlog " - Timevalue is correctly formated" + end if + + '///+ - Percent + printlog " - Percent" + call wTypeKeys(fLocaleString("LocalePercentValue")) + call wTypeKeys "<Tab><shift tab>" + FormatNumberFormat + + Kontext "Zahlenformat" + if (Kategorie.GetSelIndex <> 4) then + warnlog "The value is not recognized as percent, it is " & Kategorie.GetSelText + else + printlog " - Value is correctly recognized as percent" + end if + Zahlenformat.Cancel + Formatparagraph + Kontext + Active.SetPage tabAusrichtungAbsatz + Kontext "tabAusrichtungAbsatz" + if (rechts.isChecked <> true) then + warnlog "wrong alignment of number" + else + printlog " - Percentvalue is correctly alligned" + end if + TabAusrichtungAbsatz.Cancel + Call wTypeKeys "<home><shift end>" + EditCopy + if (GetClipboardText <> fLocaleString("LocalePercentValue")) then + warnlog "The number is not correctly formated: should be " & fLocaleString("LocalePercentValue") & ", but is " & GetClipboardText + else + printlog " - Percentvalue is correctly formated" + end if + + '///+ - Scientific + printlog " - Scientific" + call wTypeKeys(fLocaleString("LocaleScientificValue")) + call wTypeKeys "<Tab><shift tab>" + FormatNumberFormat + + Kontext "Zahlenformat" + if (Kategorie.GetSelIndex <> 8) then + warnlog "The value is not recognized as scientific, it is " & Kategorie.GetSelText + else + printlog " - Value is correctly recognized as scientific" + end if + Zahlenformat.Cancel + Formatparagraph + Kontext + Active.SetPage tabAusrichtungAbsatz + Kontext "tabAusrichtungAbsatz" + if (rechts.isChecked <> true) then + warnlog "wrong alignment of number" + else + printlog " - Scientificvalue is correctly alligned" + end if + TabAusrichtungAbsatz.Cancel + Call wTypeKeys "<home><shift end>" + EditCopy + if (GetClipboardText <> fLocaleString("LocaleScientificValue")) then + warnlog "The number is not correctly formated: should be " & fLocaleString("LocaleScientificValue") & ", but is " & GetClipboardText + else + printlog " - Scientificvalue is correctly formated" + end if + + '///+ - Fraction + printlog " - Fraction" + call wTypeKeys("58 11/4") + call wTypeKeys "<Tab><shift tab>" + FormatNumberFormat + + Kontext "Zahlenformat" + if (Kategorie.GetSelIndex <> 9) then + warnlog "The value is not recognized as fraction, it is " & Kategorie.GetSelText + else + printlog " - Value is correctly recognized as fraction" + end if + Zahlenformat.Cancel + Formatparagraph + Kontext + Active.SetPage tabAusrichtungAbsatz + Kontext "tabAusrichtungAbsatz" + if (rechts.isChecked <> true) then + warnlog "wrong alignment of number" + else + printlog " - Fractionvalue is correctly alligned" + end if + TabAusrichtungAbsatz.Cancel + Call wTypeKeys "<home><shift end>" + EditCopy + if (GetClipboardText <> "60 3/4") then + warnlog "The number is not correctly formated: should be 60 3/4, but is " & GetClipboardText + else + printlog " - Fractionvalue is correctly formated" + end if + + '///+ - Boolean + printlog " - Boolean" + call wTypeKeys(fLocaleString("LocaleBooleanValue")) + call wTypeKeys "<Tab><shift tab>" + FormatNumberFormat + + Kontext "Zahlenformat" + + if (Kategorie.GetSelIndex = 10) then + printlog " - Value is correctly recognized as boolean" + elseif iSprache = 86 or iSprache = 82 or iSprache =88 then + warnlog "Boolean value in chinese and korean not recognized" + else + warnlog "The value " & fLocaleString("LocaleBooleanValue") & "is not recognized as boolean, it is " & Kategorie.GetSelText + end if + + Zahlenformat.Cancel + Formatparagraph + Kontext + Active.SetPage tabAusrichtungAbsatz + Kontext "tabAusrichtungAbsatz" + if (rechts.isChecked = true) then + printlog " - Booleanvalue is correctly alligned" + elseif iSprache = 86 or iSprache = 82 or iSprache = 88 then + warnlog "Boolean value in chinese and korean not recognized" + else + warnlog "wrong alignment of number" + end if + + TabAusrichtungAbsatz.Cancel + Call wTypeKeys "<home><shift end>" + EditCopy + if (GetClipboardText <> fLocaleString("LocaleBooleanValue")) then + warnlog "The number is not correctly formated: should be " & fLocaleString("LocaleBooleanValue") & ", but is " & GetClipboardText + else + printlog " - Booleanvalue is correctly formated" + end if + + '///+ - String + printlog " - String" + call wTypeKeys("testtext") + call wTypeKeys "<Tab><shift tab>" + FormatNumberFormat + + Kontext "Zahlenformat" + if (Kategorie.GetSelIndex <> 11) then + warnlog "The value is not recognized as string, it is " & Kategorie.GetSelText + else + printlog " - Value is correctly recognized as string" + end if + Zahlenformat.Cancel + Formatparagraph + Kontext + Active.SetPage tabAusrichtungAbsatz + Kontext "tabAusrichtungAbsatz" + if (links.isChecked <> true) then + warnlog "wrong alignment of string" + else + printlog " - String is correctly alligned" + end if + TabAusrichtungAbsatz.Cancel + Call wTypeKeys "<home><shift end>" + EditCopy + if (GetClipboardText <> "Testtext") then + warnlog "The string is not correctly formated: should be Testtext, but is " & GetClipboardText + else + printlog " - String is correctly formated" + end if + + '/// finished the file, now some hardwired tests ///' + '///+ check, if all decimals are saved, even if not displayed ///' + Call wTypeKeys "123" & cDecSep & "123456789" + Call wTypeKeys "<Tab><shift tab>" + Call wTypeKeys "<home><shift end>" + wait 500 + EditCopy + if (GetClipboardText <> "123" & cDecSep & "12") then warnlog "wrong reformating of text tablefield 1; should: " & "123" & cDecSep & "12 is: "+GetClipboardText + EditUndo + Call wTypeKeys "<home><shift end>" + EditCopy + if (GetClipboardText <> "123" & cDecSep & "123456789") then warnlog "wrong reformating of text tablefield 2; should: 123" & cDecSep & "123456789 is: "+GetClipboardText + + Call hCloseDocument () +endcase + +' -------------------------------------------------------------------- + +testcase tTableDelete + dim i as integer + + Call hNewDocument + Printlog "'/// delete rows/columns in a table ///" + + Call TBOhTabelleEinfuegen ("seven",0, 0, 0, 1,"20", "20" ) + ' Point cursor to upper left cell + Call wTypeKeys "<Mod1 Home>", 2 + Call wTypeKeys "1" + For i = 2 to 20 + Call wTypeKeys "<down><right>" + Call wTypeKeys CStr(i) + next i + Call wTypeKeys "<Mod1 Home>", 2 + + Printlog "'/// via keys {alt delete} {cursor} -> delete row/column ///" + ' delete some rows/columns using shortcuts del 2rows 2cols + Call wTypeKeys "<mod2 delete><right>" + Call wTypeKeys "<right>" + Call wTypeKeys "<mod2 delete><left>" + Call wTypeKeys "<left>" + Call wTypeKeys "<mod2 delete><down>" + Call wTypeKeys "<down>" + Call wTypeKeys "<mod2 delete><up>" + Call wTypeKeys "<up>" + Call SpaltenTesten ( 18 ) + Call wTypeKeys "<Mod1 Home>", 2 + Call wTypeKeys "<Mod1 A>" + EditCopy + if GetClipboardtext <> "2" then + Warnlog "Deleting rows/columns via keys has not been worked as accepted! -> Test failed!" + Call hCloseDocument + exit sub + end if + + Printlog "'/// via menue Format[Zeile|Spalte]Loeschen ///" + for i = 1 to 17 ' delete some rows/columns + FormatZeileLoeschen + wait 500 + FormatSpalteLoeschen + wait 500 + next i + Call wTypeKeys "<Mod1 A>" + EditCopy + if GetClipboardtext <> "20" then + Warnlog "Deleting rows/columns via keys has not been worked as accepted! -> Test failed!" + Call hCloseDocument + exit sub + end if + + Printlog "'/// via keys {alt insert} {cursor} -> insert row/column ///" + Call wTypeKeys "<ESCAPE>" + Call wTypeKeys "<mod2 insert><left>" + Call wTypeKeys "<mod2 insert><right>" + Call wTypeKeys "<mod2 insert><down>" + Call wTypeKeys "<mod2 insert><up>" + Call SpaltenTesten ( 3 ) + Call wTypeKeys "<Mod1 Home>", 2 + Call wTypeKeys "<Shift End>" + try + EditCopy + Warnlog "Maybe no columns have been inserted!" + catch + Call wTypeKeys "<Right>", 2 + Call wTypeKeys "<Shift End>" + try + EditCopy + if GetClipboardtext <> "20" then + Warnlog "Maybe no columns have been inserted!" + end if + catch + Warnlog "Maybe no columns have been inserted!" + endcatch + endcatch + + Printlog "'/// delete whole table ///" + Call wTypeKeys "<mod1 home>", 2 ' delete hole table + Call wTypeKeys "<Mod1 A>" + try + Call wTypeKeys "<MOD1 SHIFT DELETE>" 'EditCut + Call wTypeKeys "<return>" + catch + Warnlog "Unable to delete table!" + endcatch + Call hCloseDocument +endcase + +'-------------------------------------------------------------------------------------------------------- + +testcase tTableText + dim i as integer + + Call hNewDocument + Printlog "'/// +++ table to text ///" + + Call TBOhTabelleEinfuegen ("seven",0, 0, 0, 1,"10", "10" ) + + for i = 1 to 99 ' fill every cell + Call wTypeKeys CStr(i) + Call wTypeKeys "<Tab>" + next i + + ToolsTextInTable ' convert with '+' seperator + Kontext "TextInTabelleUmwandeln" + Andere.Check + AndereText.settext "+" + TextInTabelleUmwandeln.OK + + Call wTypeKeys "<home>" ' calculate every row + for i = 1 to 10 + Call wTypeKeys "<shift end>" + ToolsCalculate + Call wTypeKeys "<shift insert>" + Call wTypeKeys "+<delete>" + next i + Call wTypeKeys "<backspace>0<shift home>" + ToolsCalculate + if (GetClipboardText <> "12645") then warnlog "wrong table converting table<->text " + Call wTypeKeys "<shift insert><return>" + + Call hCloseDocument () +endcase + +'------------------------------------------------------------------------------------------- + +testcase tTableCalculate + Printlog "'/// calculating in table ///" + Call hNewDocument + + Call TBOhTabelleEinfuegen () + Call wTypeKeys "1<Tab>2<Tab>3<Tab>4<Tab>5<Tab>6<Tab>7<Tab>8<Tab>" + Call wTypeKeys "<end><Mod1 end><down><return>" + Call TBOhTabelleEinfuegen ("eight",0, 0, 0, 1,"5", "5" ) + + '///' should look like: <pre> /// + '///+ a b c d e /// + '///+1 1,.1 2,.2 =3,.3 4,.4 =summe<:4,.4 /// + '///+2 1 2 =3 4 =summe<:4 /// + '///+3 =2,.1 =18,.9 =2 =-0,31 =32,.6926671... <1.check> /// + '///+4 =14 =16 gone =<2.check> = ...table1 ?? /// + '///+5 </pre> /// + + '/// this table gets generated one by one ///' + + Call wTypeKeys "1"+cDecSep+"1<Tab>" ' insert input A1 + Call wTypeKeys "2"+cDecSep+"2<Tab>" + Call wTypeKeys "=" ' + Kontext "OL_SW_Rechenleiste" ' C1 + Eingabefeld.SetText "<A1>+<B1>" + Uebernehmen.click + Call wTypeKeys "<Tab>" + Call wTypeKeys "4"+cDecSep+"4<Tab>" + Call wTypeKeys "<Tab>" + + Call wTypeKeys "1<Tab>" ' A2 + Call wTypeKeys "2<Tab>" + Call wTypeKeys "<Tab>" + Call wTypeKeys "4<shift tab>" + Call wTypeKeys "=" ' + Kontext "OL_SW_Rechenleiste" ' C2 + Eingabefeld.SetText "<D2>-<A2>" + Uebernehmen.click + Call wTypeKeys "<Tab>" + Call wTypeKeys "<Tab>" + + ' automatic sum works only to next formula :-< ///' + Call hToolbarSelect ( "Table", true ) + formeleingeben.click + Kontext "OL_SW_Rechenleiste" + Uebernehmen.click + Call wTypeKeys "<up>" + + Call hToolbarSelect ( "Table", true ) + formeleingeben.click + Kontext "OL_SW_Rechenleiste" + Uebernehmen.click + Call wTypeKeys "<down><Tab>" + + Call wTypeKeys "=" ' slip into calculation area + Kontext "OL_SW_Rechenleiste" ' A3 + Eingabefeld.SetText "sum <A1:A2>" + Uebernehmen.click + Call wTypeKeys "<Tab>" + Call wTypeKeys "<F2>" ' + Kontext "OL_SW_Rechenleiste" + Eingabefeld.SetText "sum <D2:B1>" + Uebernehmen.click + Call wTypeKeys "<Tab>" + Call wTypeKeys "<F2>" ' + Kontext "OL_SW_Rechenleiste" + Eingabefeld.SetText "sqrt <E2>" + Uebernehmen.click + Call wTypeKeys "<Tab>" + Call wTypeKeys "<F2>" ' + Kontext "OL_SW_Rechenleiste" + Eingabefeld.SetText "cos <E1>" + Uebernehmen.click + Call wTypeKeys "<Tab>" + + Call wTypeKeys "<F2>" ' E3 check this out :-) + Kontext "OL_SW_Rechenleiste" + Eingabefeld.SetText "sum <A2:D3>" + Uebernehmen.click + Call wTypeKeys "<shift home>" + EditCopy + if (GetClipboardText <> "32" & cDecSep & "69") then warnlog "wrong calculation should: 32" & cDecSep & "69 is: "+GetClipboardText + Call wTypeKeys "<end><Tab>" + + Call wTypeKeys "<F2>" ' A4 + Kontext "OL_SW_Rechenleiste" + Eingabefeld.SetText "2+3*4" + Uebernehmen.click + Call wTypeKeys "<shift home>" + EditCopy + if (GetClipboardText <> "14") then warnlog "wrong calculation should: "+"14"+" is: "+GetClipboardText + Call wTypeKeys "<end><Tab>" + + Call wTypeKeys "<F2>" ' B4 + Kontext "OL_SW_Rechenleiste" + Eingabefeld.SetText "2*2 pow 3" + Uebernehmen.click + Call wTypeKeys "<shift home>" + EditCopy + if (GetClipboardText <> "16") then warnlog "wrong calculation should: "+"16"+" is: "+GetClipboardText + Call wTypeKeys "<end><Tab>" + Call wTypeKeys "<shift tab>" + sleep (1) + Call wTypeKeys "<Tab>" + sleep (1) + + '/// one row gets deleted///' + FormatSpalteLoeschen ' grumel: have to find a cell :-( + Call wTypeKeys "<F2>" ' C4 + Kontext "OL_SW_Rechenleiste" + Eingabefeld.SetText "sum <A1:D3>" + Uebernehmen.click + Call wTypeKeys "<shift home>" + EditCopy + if (GetClipboardText <> "58" & cDecSep & "89") then warnlog "wrong calculation should: " & "58" & cDecSep & "89" & " is: " & GetClipboardText + Call wTypeKeys "<end><Tab>" + Call wTypeKeys "<F2>" ' C4 + Kontext "OL_SW_Rechenleiste" + Eingabefeld.SetText "sum <"+fLocaleString("LocaleTable")+"1.B1:E1> / <A2:D2>" + sleep (2) + Uebernehmen.click + Call wTypeKeys "<shift home>" + EditCopy + if (GetClipboardText <> "1" & cDecSep & "27") then warnlog "wrong calculation should: 1" & cDecSep & "27 is: " & GetClipboardText + Call wTypeKeys "<end><Tab>" + + Call wTypeKeys "<end><Mod1 end><down><return>" + Call hCloseDocument () +endcase + +'------------------------------------------------------------------------------------------- + +testcase tTableEdit + dim itemp(5) as integer + + Call hNewDocument + Printlog "'/// edit table ///" + + Call TBOhTabelleEinfuegen ("nine-dumy",0, 0, 0, 1,"5", "3" ) + Call wTypeKeys "<end><Mod1 end><Mod1 end><return>" + Call TBOhTabelleEinfuegen ("nine",0, 0, 0, 1,"5", "3" ) + Call wTypeKeys "nine<Tab>" + + Printlog "'/// insert Frame & Graphic in heading ///" + InsertFrame + sleep (5) + Kontext "tabtype" + sleep (5) + TabType.ok + sleep (5) + Call wTypeKeys "<escape>" + sleep (5) + Call hGrafikEinfuegen (gTesttoolPath +"writer\optional\input\options\ga000907.gif") + sleep (5) + Call wTypeKeys "<escape>" + sleep (5) + Call wTypeKeys "<mod1 end><up><up>" + sleep (5) + + Printlog "'/// insert Frame & Graphic in body ///" + InsertFrame + sleep (5) + Kontext "tabtype" + sleep (5) + TabType.ok + sleep (5) + Call wTypeKeys "<escape>" + sleep (5) + Call hGrafikEinfuegen (gTesttoolPath +"writer\optional\input\options\ga000907.gif") + sleep (5) + Call wTypeKeys "<escape>" + sleep (5) + Call wTypeKeys "<mod1 end><up><up><Tab>" + + Printlog "'/// insert Frame & Table in body ///" + InsertFrame + sleep (5) + Kontext "tabtype" + sleep (5) + TabType.ok + sleep (5) + Call wTypeKeys "<return>" + sleep (5) + try + Call hTabelleEinfuegen () + Call wTypeKeys "<mod1 end><mod1 end><up><up><Tab><Tab>" + catch + Warnlog "Hit <Enter>-Key should enable edit mode for selected frames! (srx642z or greater)" + Call wTypeKeys "<escape>" + Call wTypeKeys "<down>" + endcatch + sleep (5) + + Printlog "'/// insert PageBreak ///" + '/// TBO: check test / insert dummy table ' doesn't work, if the first 'stuff' in a document is the table ///' + InsertFieldsPagenumbers + Call wTypeKeys "<shift home>" + EditCopy + ToolsCalculate + sleep (5) + itemp(1) = val(GetClipboardText) + EditCut + InsertManualBreak + sleep (5) + Kontext "UmbruchEinfuegen" + Seitenumbruch.check + UmbruchEinfuegen.OK + sleep (5) + InsertFieldsPagenumbers + Call wTypeKeys "<shift home>" + EditCopy + ToolsCalculate + sleep (5) + itemp(3) = val(GetClipboardText) + if (itemp(1) <> itemp(3)) then + printlog "--- Pagebreak works in Table, that's good :-)" + else + warnlog " Pagebreak doesn't work in Table, that's not good :-("+itemp(1) +" "+ itemp(3) + end if + + sleep (5) + Call wTypeKeys "<end><Mod1 end><down><return>" + + Printlog "'/// the following may not be possible ///" + Printlog "'///+ Insert table in footnote ///" + InsertFootnote + Kontext "FussnoteEinfuegen" + FussnoteEinfuegen.OK + try + InsertTableWriter + warnlog " Table in Footnote is possible, that's not good :-(" + catch + endcatch + + Call wTypeKeys "<end><Mod1 end><return>" + Call hCloseDocument +endcase diff --git a/testautomation/writer/optional/includes/table/w_204a_.inc b/testautomation/writer/optional/includes/table/w_204a_.inc new file mode 100755 index 000000000000..0132f14ebe5d --- /dev/null +++ b/testautomation/writer/optional/includes/table/w_204a_.inc @@ -0,0 +1,1163 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : helge.delfs@oracle.com +'* +'* short description : Test the table functionality in Writer +'* +'\*********************************************************************** + +sub w_204a_ + + Call sTableName + Call sTableAlignment + Call sTableMergeCell + Call TableSplit_copy_heading + Call TableSplit_custom_heading + Call TableSplit_custom_heading_apply_style + Call TableSplit_no_heading + Call sTableMerge + Call sTablePagebreak + Call sTableBorder + Call sTableIndent + Call sTableSort + +end sub + +' ---------------------------------------------------------------------- + +testcase sTableName + dim temp(10) as string + Call hNewDocument + + Call TBOhTabelleEinfuegen ("dummy" ,0,1,0,1,"1",tHeight:="1") ' insert table + Call wTypeKeys "<mod1 end><mod1 end>" + temp (1) = "Garfield" + Call TBOhTabelleEinfuegen (temp (1) ,0,1,0,1,"10",tHeight:="7") ' insert table + + printlog "'/// Format table via Format->Table ///" + Printlog "'/// change tablename ///" + TableTableProperties ' get into existing table + Sleep (2) + Kontext "TabelleEinfuegenWriter" + sleep (2) + Kontext + Active.SetPage TabTabelle + Kontext "TabTabelle" + + ' 0. right table ?? ///' + if (TabellenName.GetText <> temp (1) ) then warnlog " --- wrong table? schould be : "+temp (1)+ ", is : "+TabellenName.GetText + + '/// 1. try: space included ///' + temp (1) = "Gar field" + try + TabellenName.SetText temp (1) + catch + printlog " - couldn't insert : " + temp (1) + endcatch + if (TabellenName.GetText = temp (1) ) then warnlog " --- ups, could insert smth. with space? : "+TabellenName.GetText + + '/// 2. try: dot included ///' + temp (1) = "Gar.field" + try + TabellenName.SetText temp (1) + catch + printlog " - couldn't insert : "+temp (1) + endcatch + if (TabellenName.GetText = temp (1) ) then warnlog " --- ups, could insert smth. with dot? : "+TabellenName.GetText + + TabTabelle.cancel + Call hCloseDocument +endcase + +' ---------------------------------------------------------------------- + +testcase sTableAlignment + dim temp(10) as string + dim PAGEWIDTH as double + dim ac as integer, fc as integer + dim i as integer + dim sBug as string + + Call hNewDocument + Call TBOhTabelleEinfuegen ("dummy" ,0,1,0,1,"1",tHeight:="1") ' insert table + Call wTypeKeys "<mod1 end><mod1 end>" + temp (1) = "Garfield" + Call TBOhTabelleEinfuegen (temp (1) ,0,1,0,1,"10",tHeight:="7") ' insert table + + ' ' get text to init some constances for this test + ' temp(2) = NachOben.GetText '---------------------------------------------------- + ' initialisation of some constantzen for this test '------------------------------ + PAGEWIDTH = hGetPageWidth() + printlog "--- Pagewidth is: " + PAGEWIDTH + 'MEASUNIT = GetMeasUnit (temp(2)) + 'DECSEP = GetDecimalSeperator(temp(2)) + + Printlog "'/// set alignment of table ///" + TableTableProperties + Kontext + Active.SetPage TabTabelle + Kontext "TabTabelle" + Printlog "'/// Left ///" + Links.check + sleep (1) + if ((Breite.IsWritable AND NachRechts.IsWritable) <> TRUE) then warnlog "edit field not active " + if (LiberalMeasurement(PAGEWIDTH ,(StrToDouble (Breite.GetText) + StrToDouble (NachRechts.GetText))) <> TRUE) then + if PAGEWIDTH < 0 then + warnlog "Cdbl returns wrong values" + else + warnlog "measurement value error "+ "is: "+(StrToDouble (Breite.GetText) + StrToDouble (NachRechts.GetText))+" should: " + PAGEWIDTH + end if + end if + NachRechts.SetText "2" + sleep (1) + temp(1) = NachRechts.GetText + TabTabelle.OK + TableTableProperties + Kontext + Active.SetPage TabTabelle + Kontext "TabTabelle" + if (Links.Ischecked <> TRUE) then warnlog "links state changed" + if ((Breite.IsWritable AND NachRechts.IsWritable) <> TRUE) then warnlog "edit field not active" + if (temp(1) <> NachRechts.GetText) then warnlog "value changed" + if (LiberalMeasurement(PAGEWIDTH ,(StrToDouble (Breite.GetText) + StrToDouble (NachRechts.GetText))) <> TRUE) then + if PAGEWIDTH < 0 then + warnlog "Cdbl returns wrong values" + else + warnlog "measurement value error "+ "is: "+(StrToDouble (Breite.GetText) + StrToDouble (NachRechts.GetText))+" should: "+PAGEWIDTH + end if + end if + '-------------------------------- + NachRechts.SetText "0" + sleep (1) + Printlog "'/// FromLeft ///" + VonLinks.check + sleep (1) + if ((Breite.IsWritable AND NachLinks.IsWritable) <> TRUE) then warnlog "edit field not active " + if (LiberalMeasurement(PAGEWIDTH ,StrToDouble (Breite.GetText) + StrToDouble(NachLinks.GetText)) <> TRUE) then + if PAGEWIDTH < 0 then + warnlog "Cdbl returns wrong values" + else + warnlog "measurement value error "+ "is: "+(StrToDouble (Breite.GetText) + StrToDouble (NachLinks.GetText))+" should: "+PAGEWIDTH + end if + end if + NachLinks.SetText "2" + sleep (1) + temp(1) = NachLinks.GetText + TabTabelle.OK + sleep 1 + TableTableProperties + Kontext "TabelleEinfuegenWriter" + Kontext + Active.SetPage TabTabelle + Kontext "TabTabelle" + if (VonLinks.Ischecked <> TRUE) then warnlog "VonLinks state changed" + 'sBug = NachLinks.GetText + if ((Breite.IsEnabled AND NachLinks.IsEnabled) <> TRUE) then warnlog "edit field not active " + 'if (NachLinks.IsWritable <> TRUE) then warnlog "edit field not active " + 'if sBug <> NachLinks.GetText then warnlog "TESTOOL BUG; is writable loescht feld " + if (temp(1) <> NachLinks.GetText) then warnlog "value changed"+" should: "+temp(1)+" is: "+ NachLinks.GetText + if (LiberalMeasurement(PAGEWIDTH ,StrToDouble (Breite.GetText) + StrToDouble(NachLinks.GetText)) <> TRUE) then + if PAGEWIDTH < 0 then + warnlog "Cdbl returns wrong values" + else + warnlog "measurement value error "+ "is: "+(StrToDouble (Breite.GetText) + StrToDouble (NachLinks.GetText))+" should: "+PAGEWIDTH + end if + end if + '-------------------------------- + NachLinks.SetText "0" + Printlog "'/// Right ///" + rechts.check + sleep (1) + if ((Breite.IsWritable AND NachLinks.IsWritable) <> TRUE) then warnlog "edit field not active " + if (LiberalMeasurement(PAGEWIDTH ,StrToDouble (Breite.GetText) + StrToDouble(NachLinks.GetText)) <> TRUE) then + if PAGEWIDTH < 0 then + warnlog "Cdbl returns wrong values" + else + warnlog "measurement value error "+ "is: "+(StrToDouble (Breite.GetText) + StrToDouble (NachLinks.GetText))+" should: "+PAGEWIDTH + end if + end if + NachLinks.SetText "2" + sleep (1) + temp(1) = NachLinks.GetText + TabTabelle.OK + TableTableProperties + Kontext + Active.SetPage TabTabelle + Kontext "TabTabelle" + if (rechts.Ischecked <> TRUE) then warnlog "rechts state changed" + if ((Breite.IsWritable AND NachLinks.IsWritable) <> TRUE) then warnlog "edit field not active " + if (temp(1) <> NachLinks.GetText) then warnlog "value changed" + if (LiberalMeasurement(PAGEWIDTH ,StrToDouble (Breite.GetText) + StrToDouble(NachLinks.GetText)) <> TRUE) then + if PAGEWIDTH < 0 then + warnlog "Cdbl returns wrong values" + else + warnlog "measurement value error "+ "is: "+(StrToDouble (Breite.GetText) + StrToDouble (NachLinks.GetText))+" should: "+PAGEWIDTH + end if + end if + '-------------------------------- + NachLinks.SetText "0" + Printlog "'/// center ///" + Zentriert.check + sleep (1) + if ((Breite.IsWritable AND NachLinks.IsWritable) <> TRUE) then warnlog "edit field not active " + if (LiberalMeasurement(PAGEWIDTH ,StrToDouble (Breite.GetText) + (2 * StrToDouble (NachLinks.GetText))) <> TRUE) then + if PAGEWIDTH < 0 then + warnlog "Cdbl returns wrong values" + else + warnlog "measurement value error "+ "is: "+(StrToDouble (Breite.GetText) + StrToDouble (NachLinks.GetText))+" should: "+PAGEWIDTH + end if + end if + NachLinks.SetText "2" + sleep (1) + temp(1) = NachLinks.GetText + TabTabelle.OK + TableTableProperties + Kontext + Active.SetPage TabTabelle + Kontext "TabTabelle" + if (Zentriert.Ischecked <> TRUE) then warnlog "state changed" + if ((Breite.IsWritable AND NachLinks.IsWritable) <> TRUE) then warnlog "edit field not active " + if (temp(1) <> NachLinks.GetText) then warnlog "value changed" + if (LiberalMeasurement(PAGEWIDTH ,StrToDouble (Breite.GetText) + (2 * StrToDouble (NachLinks.GetText))) <> TRUE) then + if PAGEWIDTH < 0 then + warnlog "Cdbl returns wrong values" + else + warnlog "measurement value error "+ "is: "+(StrToDouble (Breite.GetText) + StrToDouble (NachLinks.GetText))+" should: "+PAGEWIDTH + end if + end if + '-------------------------------- + NachLinks.SetText "0" + Printlog "'/// manual ///" + Manuell.check + sleep (1) + if ((Breite.IsWritable AND NachLinks.IsWritable AND NachRechts.IsWritable) <> TRUE) then warnlog "edit field not active " + if (LiberalMeasurement(PAGEWIDTH ,StrToDouble (Breite.GetText) + StrToDouble (NachLinks.GetText) + StrToDouble (NachRechts.GetText)) <> TRUE) then + if PAGEWIDTH < 0 then + warnlog "Cdbl returns wrong values" + else + warnlog "measurement value error "+ "is: "+(StrToDouble (Breite.GetText) + StrToDouble (NachLinks.GetText)+ StrToDouble (NachRechts.GetText))+" should: "+PAGEWIDTH + end if + end if + NachLinks.SetText "2" + NachRechts.SetText "2" + sleep (1) + temp(1) = NachLinks.GetText + temp(2) = NachRechts.GetText + TabTabelle.OK + TableTableProperties + Kontext + Active.SetPage TabTabelle + Kontext "TabTabelle" + if (Manuell.Ischecked <> TRUE) then warnlog "state changed" + if ((Breite.IsWritable AND NachLinks.IsWritable) <> TRUE) then warnlog "edit field not active " + if (temp(1) <> NachLinks.GetText) then warnlog "value changed" + if (temp(2) <> NachRechts.GetText) then warnlog "value changed" + if (LiberalMeasurement(PAGEWIDTH ,StrToDouble (Breite.GetText) + StrToDouble (NachLinks.GetText) + StrToDouble (NachRechts.GetText)) <> TRUE) then + if PAGEWIDTH < 0 then + warnlog "Cdbl returns wrong values" + else + warnlog "measurement value error "+ "is: "+(StrToDouble (Breite.GetText) + StrToDouble (NachLinks.GetText)+ StrToDouble (NachRechts.GetText))+" should: "+PAGEWIDTH + end if + end if + '-------------------------------- + NachLinks.SetText "0" + NachRechts.SetText "0" + TabTabelle.OK + Printlog "'/// <font color=#FF0000>TODO TBO automatical ---------- MISSING yet </FONT> ///" + Call hCloseDocument +endcase + +' ---------------------------------------------------------------------- + +testcase sTablePagebreak + Dim temp(10) as string + + Call hNewDocument + Call TBOhTabelleEinfuegen ("dummy" ,0,1,0,1,"1",tHeight:="1") ' insert table + Call wTypeKeys "<mod1 end><mod1 end>" + temp (1) = "Garfield" + Call TBOhTabelleEinfuegen (temp (1) ,0,1,0,1,"10",tHeight:="7") ' insert table + + Printlog "'/// Check TextFlow: pagebreak ///" + + InsertFieldsPagenumbers ' get pagenumber & leave it for next calculation + Call wTypeKeys "<shift home>" + ToolsCalculate + temp(1) = val(GetClipboardText) + + TableTableProperties + Kontext "TabelleEinfuegenWriter" + Kontext + Active.SetPage TabTextFlusstabelle + Kontext "TabTextFlusstabelle" + Umbruch.Check + if ((Seite.IsChecked AND Davor.IsChecked) <> TRUE) then + printlog "--- defaultvalue changed..." + Seite.Check + Davor.Check + end if + TabTextFlusstabelle.OK + + ToolsUpdateUpdateAll ' update field & get pagenumber & clear + Call wTypeKeys "<shift end>" + ToolsCalculate + temp(2) = val(GetClipboardText) + if ((val(temp(1))+1) <> temp(2)) then + warnlog "--- Table didn't move, that's not good "+ "from: "+val(temp(1))+" to: "+ temp(2) +" 1+1= "+(val(temp(1))+1) + else + printlog " works , moved, ok!" + end if + + Call wTypeKeys "<mod1 end><mod1 end><return>" + + Call hCloseDocument +endcase + +' ---------------------------------------------------------------------- + +testcase sTableMergeCell + dim temp(10) as string + + dim PAGEWIDTH as double + dim ac as integer, fc as integer + dim i as integer + + Call hNewDocument + + temp (1) = "Table1" + printlog "Insert a table with 10 columns and 7 rows" + Call TBOhTabelleEinfuegen (temp (1) ,0,1,0,1,"10",tHeight:="7") ' insert table + printlog "Point cursor out of the table" + Call wTypeKeys "<MOD1 END>", 2 + + printlog "Insert a table with 10 columns and 10 rows" + temp (1) = "Table2" + Call TBOhTabelleEinfuegen (temp (1) ,0,0,1,1,"10",tHeight:="10") ' insert table + + Printlog "merging of cells & undo" + temp (2) = hGetTableName() + if (temp(2) <> temp(1)) then warnlog " --- wrong table? schould be : "+temp (1)+ ", is : "+temp(2) + + Printlog " - merging of cells" + ac=0 ' ActionCount + fc=100 ' FieldCount + Call wTypeKeys "<down><shift right>" ' 2 horizontal (0,1) & (1,1) (x,y) + TableMergeCells : inc ac : dec fc ' FormatZelleVerbinden + Call wTypeKeys "<down><shift down>" ' 2 vertical (1,2) & (1,3) + TableMergeCells : inc ac : dec fc + Call wTypeKeys "<down><up><shift down><shift up>" ' merge again + TableMergeCells + + printlog "Go to top of table" + Call wTypeKeys "<mod1 home>" + printlog "Undo all cell mergers (3 times)" + for i=1 to ac + try + EditUndo + wait 500 + catch + Warnlog "Edit / Undo disabled on Undo step: " & i + endcatch + next i + + printlog "Close document" + Call hCloseDocument +endcase + +' ---------------------------------------------------------------------- + +testcase sTableBorder + dim temp(10) as string + temp(1) = "bloed" + + dim PAGEWIDTH as double + dim ac as integer, fc as integer + dim i as integer + Call hNewDocument + + ' set marks to find + Call wTypeKeys "<mod1 end><mod1 end>" + Call wTypeKeys "NULL<return>" + Call wTypeKeys "Start<return>" + Call wTypeKeys "End<return>" + Call wTypeKeys "NULL<return><up><up>" + + Call TBOhTabelleEinfuegen (temp (1) ,0,1,0,1,"10",tHeight:="7") ' insert table + + Printlog "'/// set border & undo ///" + ' assign border to whole table + Call wTypeKeys "<shift mod1 end>" + TableTableProperties ' get into existing table + Sleep (1) + Kontext "TabelleEinfuegenWriter" + sleep (1) + Kontext + if active.exists (5) then + Active.SetPage TabUmrandung + Sleep (1) + Kontext "TabUmrandung" + Sleep (1) + Vorgaben.Typekeys "<end>" ' set border + StilFarbe.Select StilFarbe.GetItemCount + + 'links.IsWriteable 'si checkable, but not now!... + Position.TypeKeys "<home><right><right><right>" ' 3. from the left + if (groesse.IsEnabled <> TRUE) then warnlog "position of shadow is not changeable " + SchattenFarbe.Select SchattenFarbe.GetItemCount - 1 + else + TableTableProperties ' get into existing table + Kontext "TabelleEinfuegenWriter" + sleep (1) + Kontext + warnlog "2.trie" + if active.exists (5) then + Active.SetPage TabUmrandung + Sleep (1) + Kontext "TabUmrandung" + Sleep (1) + Vorgaben.Typekeys "<end>" ' set border + StilFarbe.Select StilFarbe.GetItemCount + + 'links.IsWriteable 'si checkable, but not now!... + Position.TypeKeys "<home><right><right><right>" ' 3. from the left + if (groesse.IsEnabled <> TRUE) then warnlog "position of shadow is not changeable " + SchattenFarbe.Select SchattenFarbe.GetItemCount - 1 + else + warnlog "baeh!" + end if + end if + Kontext + Active.SetPage TabHintergrund + Sleep (1) + Kontext "TabHintergrund" + Sleep (1) + Hintergrundfarbe.TypeKeys "<home><down><right><down><right><down><right><down><right>" + TabHintergrund.OK + ' just an idea of checking this type of control + i=0 + TableTableProperties ' get into existing table + Sleep (1) + Kontext "TabelleEinfuegenWriter" + sleep (1) + Kontext + Active.SetPage TabUmrandung + Sleep (1) + Kontext "TabUmrandung" + Sleep (1) + while (groesse.IsEnabled) + Position.TypeKeys "<left>" + inc i + wend + TabUmrandung.cancel + if (i <> 3) then warnlog "wrong shadow selected should be 3, was: "+i + + ' undo & check where we are ///' + EditUndo + temp (2) = hGetTableName() + if (temp(2) <> temp(1)) then warnlog " --- wrong table? schould be : "+temp (1)+ ", is : "+temp(2) + EditUndo ' go one step further + Call wTypeKeys "<up><shift end>" + EditCopy + temp(2) = GetClipboardText + Call wTypeKeys "<down><shift home>" + EditCopy + temp(3) = GetClipboardText + if ((temp(2) <> "Start") AND (temp(3) <> "End")) then + warnlog "there is smth. wrong with the undo stuff !!!" + print "whats wrong with the undo stuff" + end if + EditRedo ' and back again + Call wTypeKeys "<up><mod1 home>" ' now we are in (0,0) + Call hCloseDocument +endcase + +' ---------------------------------------------------------------------- + +testcase sTableIndent + dim temp(10) as string + dim ac as integer, fc as integer + + Call hNewDocument + ' set marks to find + Call wTypeKeys "NULL<return>" + Call wTypeKeys "Start<return>" + Call wTypeKeys "End<return>" + Call wTypeKeys "NULL<return><up><up>" + + temp (1) = "Garfield" + Call TBOhTabelleEinfuegen (temp (1) ,0,1,0,1,"10",tHeight:="7") ' insert table + + Printlog "'/// tab, paragraph indent & UNDO ///" + + ac=0 ' ActionCount + fc=100 ' FieldCount + ' : inc ac : dec fc + FormatParagraph + Kontext + Active.SetPage TabTabulator + Sleep (1) + Kontext "TabTabulator" + Sleep (1) + Position.SetText "1" + TypZentriert.Check + Fuellzeichen5.Check + FuellzeichenZeichen.SetText "%" + Neu.Click + Kontext + Active.SetPage TabEinzuegeUndAbstaende + Sleep (1) + Kontext "TabEinzuegeUndAbstaende" + Sleep (1) + Vonlinks.SetText "-1" + VonRechts.SetText "-1" + TabEinzuegeUndAbstaende.OK + + + Printlog "'/// text attributes ///" + Call wTypeKeys "John" : inc ac + Call wTypeKeys "<shift home>" + FormatCharacter + Kontext + Active.SetPage TabFontEffects + Sleep (1) + Kontext "TabFontEffects" + Sleep (1) + FontColor.Select FontColor.GetItemCount - 1 + Kontext + Active.SetPage TabFontPosition + Sleep (1) + Kontext "TabFontPosition" + Sleep (1) + Super.Check + n90Degree.Check + TabFontPosition.OK + + EditUndo + EditUndo + + Printlog "'/// cell protection ///" + Call wTypeKeys "<LEFT><UP>", 10 + Call wTypeKeys "<DOWN>", 3 + Call wTypeKeys "<down><shift down><shift right><Right><Left><Shift right><Shift left>" + TableCellProtect + Call wTypeKeys "<LEFT>" + Call wTypeKeys "x" + Kontext + if (Active.Exists <> TRUE) then + Call wTypeKeys "<LEFT><UP>", 10 + Call wTypeKeys "<DOWN>", 3 + Call wTypeKeys "<down><shift down><shift right><Right><Left><Shift right><Shift left>" + try + EditCopy + catch + endcatch + if GetClipboardtext <> "" then + QAErrorLog "#110549#Protection of cell does not work correct!" + end if + ' If protection fails, reselect table with Navigator! + Call wNavigatorAuswahl(2,1) + else + Active.OK + EditUndo + Call wTypeKeys "x" + Kontext + if (Active.Exists = TRUE) then + Warnlog "ReProtection of table does not work!" + Active.GetText + active.OK + end if + + EditUndo + EditUndo + 'Printlog "undoCheck is here" + temp (2) = hGetTableName() + if (temp(2) <> temp(1)) then warnlog " --- wrong table? schould be : "+temp (1)+ ", is : "+temp(2) + EditUndo ' go one step further + Call wTypeKeys "<up><shift end>" + EditCopy + temp(2) = GetClipboardText + Call wTypeKeys "<down><shift home>" + EditCopy + temp(3) = GetClipboardText + if ((temp(2) <> "Start") AND (temp(3) <> "End")) then + warnlog "there is smth. wrong with the undo stuff !!! is: "+temp(2)+" should: Start; is: "+temp(3)+" should: End;" + end if + EditRedo ' and back again + Call wTypeKeys "<up><mod1 home>" ' now we are in (0,0) + end if + + Printlog "'/// Set graphic in table as background ///" + try + TableTableProperties + catch + Warnlog "Dialog 'Insert Table' not up!" + Call hCloseDocument + goto endsub + endcatch + + try + Kontext + Active.SetPage TabHintergrund + Sleep (1) + Kontext "TabHintergrund" + Sleep (1) + Fuer.Select(2) ' Zeile + Als.Select(2) ' Grafik + Durchsuchen.Click + Kontext "GrafikEinfuegenDlg" + Dateiname.SetText convertPath(gTesttoolPath +"writer\optional\input\options\ga000907.gif") + Oeffnen.Click + Kontext "TabHintergrund" + TabHintergrund.OK + + FormatColumnWidthWriter ' thre is a bigger test in the option test + Kontext "SpaltenBreite" + Spalte.SetText "2" + Breite.SetText "2" + SpaltenBreite.OK + FormatRowHeight + Kontext "ZellenHoehe" + Hoehe.SetText "2" + ZellenHoehe.OK + EditUndo + EditUndo + + EditUndo + + ' Printlog "undoCheck is here" + sleep (3) + temp (2) = hGetTableName() + if (temp(2) <> temp(1)) then warnlog " --- wrong table? schould be : "+temp (1)+ ", is : "+temp(2) + EditUndo ' go one step further + Call wTypeKeys "<up><shift end>" + EditCopy + temp(2) = GetClipboardText + Call wTypeKeys "<down><shift home>" + EditCopy + temp(3) = GetClipboardText + if ((temp(2) <> "Start") AND (temp(3) <> "End")) then + warnlog "there is smth. wrong with the undo stuff !!! is: "+temp(2)+" should: Start; is: "+temp(3)+" should: End;" + end if + EditRedo ' and back again + Call wTypeKeys "<mod1 end>" ' go to end of doc + catch + Warnlog "Dialog 'Insert Table' not up!" + endcatch + Call hCloseDocument +endcase + +' ---------------------------------------------------------------------- + +testcase sTableSort + dim temp(10) as string + dim PAGEWIDTH as double + dim ac as integer, fc as integer + dim i as integer + + Call hNewDocument + ' Kontext "DocumentWriter" + Call TBOhTabelleEinfuegen ("dummy" ,0,1,0,1,"1",tHeight:="1") ' insert table + Call wTypeKeys "<mod1 end><mod1 end>" + temp (1) = "Sort" + Call TBOhTabelleEinfuegen (temp (1) ,0,1,0,1,"10",tHeight:="10") ' insert table + + fc = 99 + randomize() + for i=1 to fc + Call wTypeKeys str(rnd()) + "<right>" + next i + Call wTypeKeys "<shift mod1 home>" + ToolsSort '-----------------------------------------------------------11111111111111111 + Kontext "Sortieren" + Spalten.Check 'direction 1 + for i = 1 to Schluesseltyp1.GetItemCount + Schluesseltyp1.select i + printlog "possible values for sorting :" + Schluesseltyp1.Getseltext + next i + Sortieren.OK + Kontext + if active.exists (5) then printlog "active1: "+active.gettext + Call wTypeKeys "<shift mod1 end>",2 + try + ToolsSort '-----------------------------------------------------------22222222222222222 + catch + printlog "WorkAround only seen on linux, can't select immediately, cursor movement needed " + Call wTypeKeys "<right><left>" + Call wTypeKeys "<shift mod1 end>",2 + ToolsSort + endcatch + Kontext + if active.exists (5) then + printlog "active2: "+active.gettext + active.ok + end if + Kontext "Sortieren" + Zeilen.Check + Sortieren.OK + Kontext + if active.exists (5) then + printlog "active3: "+active.gettext + active.ok + end if + + 'Schluessel1 + 'Spalte1 + 'Schluesseltyp1 + 'Aufsteigend1 + 'Absteigend1 + ' + 'Schluessel2 + 'Spalte2 + 'Schluesseltyp2 + 'Aufsteigend2 + 'Absteigend2 + ' + 'Schluessel3 + 'Spalte3 + 'Schluesseltyp3 + 'Aufsteigend3 + 'Absteigend3 + ' + 'Tabulator + 'Zeichen + 'Zeichentext + 'Sonderzeichen + 'Sprache + 'ExakterVergleich + Call hCloseDocument +endcase + +' ---------------------------------------------------------------------- + +testcase TableSplit_copy_heading + printlog "'/// Splitting Tables & UNDO ///" + printlog "'/// check 'copy heading' ///" + dim temp(10) as string + dim PAGEWIDTH as double + dim ac as integer, fc as integer + dim i as integer + + Call hNewDocument + ' Kontext "DocumentWriter" + Call TBOhTabelleEinfuegen ("dummy" ,0,1,0,1,"1",tHeight:="1") ' insert table + Call wTypeKeys "<mod1 end><mod1 end>" + temp (1) = "Split" + Call TBOhTabelleEinfuegen (temp (1) ,1,1,0,1,"10",tHeight:="10") ' insert table + + Printlog "'/// Splitting Tables & UNDO ///" + Printlog "'/// check 'copy heading' ///" + temp(2) = "Jon" + Call wTypeKeys temp(2)+"<down>" + FormatSplitTable + Kontext "TabelleAuftrennen" + UeberschriftKopieren.Check '<------------- this is the key + TabelleAuftrennen.OK + ' check where am i + temp (6) = hGetTableName () + if (temp(6) <> (fLocaleString("LocaleTable")+"1")) then warnlog "Split table didn't work! is: "+temp(6)+"; should: "+(fLocaleString("LocaleTable")+"1") +' if (temp(6) <> (fLocaleString("LocaleTable")+"2")) then warnlog "Split table didn't work! is: "+temp(6)+"; should: "+(fLocaleString("LocaleTable")+"2") + + Call wTypeKeys "<up>" ' im in the content of the table + Sleep 1 + ' -------------check if heading (style) + Kontext "TextObjectbar" + if (Vorlage.GetSelText <> fLocaleString("LocaleTableHeading")) then + Warnlog "tabel heading did not work!is: " & Vorlage.GetSelText & ", should " & fLocaleString("LocaleTableHeading") + end if + '---------------------------------- + Call wTypeKeys "<end><shift home>" ' check heading in 'new' table (content) + EditCopy + temp(3) = GetClipboardText + if (temp(2) <> temp(3)) then warnlog "wrong heading! Is: "+temp(3)+" Should: "+temp(2) + Call wTypeKeys "<up><up>" + if (hGetTableName () <> (temp(1))) then warnlog "Split table didn't work?" + Call wTypeKeys "<end><shift home>" ' check heading in 'old' table + EditCopy + temp(3) = GetClipboardText + if (temp(2) <> temp(3)) then warnlog "wrong heading! is: "+temp(3)+" should: "+temp(2) + EditUndo + EditUndo + + Printlog "'/// check 'custom heading (apply style)' ///" + ' splitting headers doesn't work -> move down 1 line + temp(2) = temp(1) + Call wTypeKeys temp(2) + ' set some style to verify + FormatParagraph + Kontext + Active.SetPage TabEinzuegeUndAbstaende + Sleep (1) + Kontext "TabEinzuegeUndAbstaende" + Sleep (1) + Vonlinks.SetText "-1" + VonRechts.SetText "-1" + temp (4) = Vonlinks.GetText + temp (5) = Vonrechts.GetText + TabEinzuegeUndAbstaende.OK + Call wTypeKeys "<down>",2 + FormatSplitTable + Kontext "TabelleAuftrennen" + EigeneMitVorlage.Check '<------------- this is the key + TabelleAuftrennen.OK + ' check where am i + temp (6) = hGetTableName () + if (temp(6) <> (fLocaleString("LocaleTable")+"1")) then + warnlog "Split table didn't work! is: "+temp(6)+"; should: "+(fLocaleString("LocaleTable")+"1") + end if + ' -------------check if heading + Kontext "TextObjectbar" + if (Vorlage.GetSelText <> fLocaleString("LocaleTableHeading")) then + Warnlog "Table heading did not work!" + Warnlog "is: " & Vorlage.GetSelText & ", should " & fLocaleString("LocaleTableHeading") + Call wTypeKeys "<Escape>" + end if + '---------------------------------- + + FormatParagraph ' check style + Kontext + Active.SetPage TabEinzuegeUndAbstaende + Sleep (1) + Kontext "TabEinzuegeUndAbstaende" + Sleep (1) + ' if ((Vonlinks.GetText <>temp (4) ) OR (Vonrechts.GetText <>temp (5) )) then warnlog "style didn't get inherited. is: "+Vonlinks.GetText+"; should: "+temp (4) +";; is: "+Vonrechts.GetText+"; should: "+temp (5) +";;" + TabEinzuegeUndAbstaende.OK + Call wTypeKeys "<up><up><up>" ' goto old table + if (hGetTableName () <> (temp(1))) then warnlog "Split table didn't work? " + Call wTypeKeys "<end><shift home>" ' check heading in 'old' table + EditCopy + temp(3) = GetClipboardText + if (temp(2) <> temp(3)) then warnlog "wrong heading! is: "+temp(3)+"; should: "+temp(2) + + sleep (3) + Call hCloseDocument +endcase + +' ---------------------------------------------------------------------- + +testcase TableSplit_custom_heading + dim temp(10) as string + dim PAGEWIDTH as double + dim ac as integer, fc as integer + dim i as integer + + Call hNewDocument + Call TBOhTabelleEinfuegen ("dummy" ,0,1,0,1,"1",tHeight:="1") ' insert table + Call wTypeKeys "<mod1 end><mod1 end>" + temp (1) = "Header" + Call TBOhTabelleEinfuegen (temp (1) ,1,1,0,1,"10",tHeight:="10") ' insert table + Printlog "'/// check 'custom heading' ///" + Call wTypeKeys "Header" + FormatStylesCatalog ' set a style to verify + Kontext "Vorlagenkatalog" + Ansicht.TypeKeys "<up><up><up><up>" + temp (4) = Ansicht.GetText + Vorlagenkatalog.OK + ' set some style to verify + FormatParagraph + Kontext + Active.SetPage TabEinzuegeUndAbstaende + Sleep (1) + Kontext "TabEinzuegeUndAbstaende" + Sleep (1) + Vonlinks.SetText "-1" + VonRechts.SetText "-1" + temp (2) = Vonlinks.GetText + temp (3) = Vonrechts.GetText + TabEinzuegeUndAbstaende.OK + Call wTypeKeys ("<down>") + FormatSplitTable + Kontext "TabelleAuftrennen" + Eigene.Check '<------------- this is the key + TabelleAuftrennen.OK + ' check where am i + temp (5) = hGetTableName () + if (temp(5) <> ( fLocaleString("LocaleTable") + "1" )) then warnlog "Split table didn't work! is: "+ temp(5) + "; should: "+(fLocaleString("LocaleTable") + "1") + ' -------------check if NO heading (would be a custom style...)) + Call wTypeKeys "<Up>",2 + Call wTypeKeys "<mod1 a>" + EditCopy + temp(6) = GetClipboardText + FormatParagraph ' check style + Kontext + Active.SetPage TabEinzuegeUndAbstaende + Sleep (1) + Kontext "TabEinzuegeUndAbstaende" + Sleep (1) + if temp (2) <> Vonlinks.GetText then Warnlog "Indent 'Before text' has been changed!" + if temp (3) <> Vonrechts.GetText then Warnlog "Indent 'After text' has been changed!" + TabEinzuegeUndAbstaende.OK + FormatStylesCatalog ' verify + Kontext "Vorlagenkatalog" + if Ansicht.Gettext <> temp(4) then Warnlog "Style in Header has been changed!" + Vorlagenkatalog.Cancel + if (hGetTableName () <> temp(1)) then warnlog "Split table didn't work? is: "+hGetTableName () +"; should: "+temp(1) + if (temp(6) <> temp(1)) then warnlog "wrong heading! is: " + temp(6) + " should: " + temp(1) + Call hCloseDocument +endcase + +' ---------------------------------------------------------------------- + +testcase TableSplit_custom_heading_apply_style + ' SHOULD BE EASIER TO WORK ON ODIE TOOOOOO + dim temp(10) as string + dim PAGEWIDTH as double + dim ac as integer, fc as integer + dim i as integer + + Call hNewDocument + Call TBOhTabelleEinfuegen ("dummy" ,0,1,0,1,"1",tHeight:="1") ' insert table + Call wTypeKeys "<mod1 end><mod1 end>" + temp (1) = "Split" + TBOhTabelleEinfuegen (temp (1) ,1,1,0,1,"10",tHeight:="10") ' insert table + + Printlog "'/// Splitting Tables & UNDO ///" + Printlog "'/// check 'custom heading (apply style)' ///" + temp(2) = temp(1) + Call wTypeKeys temp(2) + ' set some style to verify + FormatParagraph + Kontext "TabTabulator" + Kontext + Active.SetPage TabEinzuegeUndAbstaende + Sleep (1) + Kontext "TabEinzuegeUndAbstaende" + Sleep (1) + Vonlinks.SetText "-1" + VonRechts.SetText "-1" + temp (4) = Vonlinks.GetText + temp (5) = Vonrechts.GetText + TabEinzuegeUndAbstaende.OK + Call wTypeKeys "<down>",2 + FormatSplitTable + Kontext "TabelleAuftrennen" + EigeneMitVorlage.Check '<------------- this is the key + TabelleAuftrennen.OK + ' check where am i + temp (6) = hGetTableName () + if (temp(6) <> (fLocaleString("LocaleTable")+"1")) then + warnlog "Split table didn't work! is: "+temp(6)+"; should: "+(fLocaleString("LocaleTable")+"1") + end if + ' -------------check if heading + Kontext "TextObjectbar" + if (Vorlage.GetSelText <> fLocaleString("LocaleTableHeading")) then + Warnlog "table heading did not work!" + warnlog "is: " & Vorlage.GetSelText & ", should " & fLocaleString("LocaleTableHeading") + 'GetSelText bleibt in der box + Call wTypeKeys "<Escape>" + end if + '---------------------------------- + FormatParagraph ' check style + Kontext "TabTabulator" + Kontext + Active.SetPage TabEinzuegeUndAbstaende + Sleep (1) + Kontext "TabEinzuegeUndAbstaende" + Sleep (1) + TabEinzuegeUndAbstaende.OK + Call wTypeKeys "<up><up><up>" ' goto old table + if (hGetTableName () <> (temp(1))) then warnlog "Split table didn't work? " + Call wTypeKeys "<end><shift home>" ' check heading in 'old' table + EditCopy + temp(3) = GetClipboardText + if (temp(2) <> temp(3)) then warnlog "wrong heading! is: "+temp(3)+"; should: "+temp(2) + sleep (3) + Call hCloseDocument +endcase + +' ---------------------------------------------------------------------- + +testcase TableSplit_no_heading + ' SHOULD BE EASIER TO WORK ON ODIE TOOOOOO + dim temp(10) as string + dim PAGEWIDTH as double + dim ac as integer, fc as integer + dim i as integer + + Call hNewDocument + Call TBOhTabelleEinfuegen ("dummy" ,0,1,0,1,"1",tHeight:="1") ' insert table + Call wTypeKeys "<mod1 end><mod1 end>" + temp (1) = "Split" + Call TBOhTabelleEinfuegen (temp (1) ,1,1,0,1,"10",tHeight:="10") ' insert table + + Printlog "'/// Splitting Tables & UNDO ///" + Printlog "'/// check 'no heading' ///" + temp(2) = "Header" + temp(3) = "Content" + Call wTypeKeys ( temp(2) ) + Call wTypeKeys ( "<down>" ) + Call wTypeKeys ( temp(3) ) + Call wTypeKeys ( "<Home>" ) + ' set some style to verify + FormatParagraph + Kontext + Active.SetPage TabEinzuegeUndAbstaende + Sleep (1) + Kontext "TabEinzuegeUndAbstaende" + Sleep (1) + Vonlinks.SetText "-1" + VonRechts.SetText "-1" + temp (4) = Vonlinks.GetText + temp (5) = Vonrechts.GetText + TabEinzuegeUndAbstaende.OK + FormatSplitTable + Kontext "TabelleAuftrennen" + Keine.Check + TabelleAuftrennen.OK + ' check where am i + temp (6) = hGetTableName () + if (temp(6) <> ( fLocaleString("LocaleTable") + "1" )) then warnlog "Split table didn't work! is: " + temp(6) + "; should: " + (fLocaleString("LocaleTable") + "1" ) + ' -------------check if NO heading (would be a custom style...)) + Kontext "TextObjectbar" + Call wTypeKeys "<end><shift home>" ' check heading in 'new' table + try + EditCopy + ' Should be 'Content' + if (GetClipboardText <> temp(3)) then warnlog "wrong content! is: " + GetClipboardText + " should: " + temp(3) + catch + Warnlog "Unable to copy content! Maybe not selected!" + endcatch + FormatParagraph ' check style + Kontext + Active.SetPage TabEinzuegeUndAbstaende + Sleep (1) + Kontext "TabEinzuegeUndAbstaende" + Sleep (1) + if ((Vonlinks.GetText <>temp (4) ) OR (Vonrechts.GetText <>temp (5) )) then warnlog "style didn't get inherited" + TabEinzuegeUndAbstaende.OK + Call wTypeKeys "<up><up>" ' goto header + if (hGetTableName () <> (temp(1))) then warnlog "Split table didn't work? " + Call wTypeKeys "<Mod1 A>" ' check heading in 'old' table + try + EditCopy + catch + Warnlog "Unable to copy content! Maybe not selected!" + endcatch + if (GetClipboardText <> temp(2)) then warnlog "wrong heading! is: " + GetClipboardText + " should: " + temp(2) + Call hCloseDocument +endcase + +' ---------------------------------------------------------------------- + +testcase sTableMerge + dim temp(10) as string + + Call hNewDocument + Call wTypeKeys "<return><mod1 end><mod1 end>" + Call wTypeKeys "<mod1 end><mod1 end>" + + temp(2) = "Arlene" + temp(3) = "Pooky" + temp(4) = "Nermal" + + Call TBOhTabelleEinfuegen (temp (2) ,0,1,0,1,"10",tHeight:="7") ' insert table Arlene + sleep (3) + Call wTypeKeys "<mod1 end><mod1 end>" + Call TBOhTabelleEinfuegen (temp (3) ,0,1,0,1,"10",tHeight:="7") ' insert table Pooky + sleep (3) + Call wTypeKeys "<mod1 end><mod1 end>" + Call TBOhTabelleEinfuegen (temp (4) ,0,1,0,1,"10",tHeight:="7") ' insert table Nermal + sleep (3) + + Printlog "'/// Join tables & UNDO///" + Printlog "'/// insert 3 tables: 'Arlene' 'Pooky' 'Nermal' ///" + + ' usually lowwer to upper one... + ' update formulars .... + Printlog "'/// join Nermal with pooky -> Nermal has to be under Arlene -> undo ///" + FormatMergeTables + if (hGetTableName () <> temp(4)) then warnlog "Merge table didn't work? 1 " + Call wTypeKeys "<mod1 home><up>" + if (hGetTableName () <> temp(2)) then warnlog "Merge table didn't work? 1+ " + EditUndo + Call wTypeKeys "<up><mod1 home>" + + Printlog "'/// join Nermal with pooky -> choose lowerTable -> Nermal has to be under Arlene again -> undo ///" + FormatMergeTables + Kontext "TabellenVerbinden" + if TabellenVerbinden.exists (5) <> TRUE then + warnlog "there is only one table around no question for which table should be connected " + end if + MitNachfolgenderTabelleVerbinden.Check + TabellenVerbinden.OK + temp (5) = hGetTableName () + if (temp (5) <> temp(3)) then warnlog "Merge table didn't work? 2 is:"+temp (5)+" should: "+temp(3) + Call wTypeKeys "<up>" + if (hGetTableName () <> temp(2)) then warnlog "Merge table didn't work? 2+ " + EditUndo + Call wTypeKeys "<up><mod1 home>" + + Printlog "'/// join Pooky with Arlene -> choose upperTable -> Pooky is now above Nermal -> undo ///" + FormatMergeTables + Kontext "TabellenVerbinden" + MitVorherigerTabelleVerbinden.Check + TabellenVerbinden.OK + temp (5) = hGetTableName () + if (temp (5) <> temp(3)) then warnlog "Merge table didn't work? 3 is:"+temp (5)+" should: "+temp(3) + Call wTypeKeys "<up>" + if (hGetTableName () <> temp(3)) then warnlog "Merge table didn't work? 3+ " + EditUndo + Call wTypeKeys "<up><mod1 home>" + + Printlog "'/// join Arlene with Pooky -> Pooky is above Nermal -> undo ///" + FormatMergeTables + Kontext "TabellenVerbinden" + if TabellenVerbinden.exists then + warnlog "tzhere shouldn't be a table connect dialog; yust one table to connect to available " + TabellenVerbinden.cancel + end if + sleep (2) + temp (5) = hGetTableName () + if (temp (5) <> temp(2)) then warnlog "Merge table didn't work? 4 is:"+temp (5)+" should: "+temp(2) + sleep (2) + Call wTypeKeys "<mod1 end><down>" + sleep (3) + if (hGetTableName () <> temp(4)) then warnlog "Merge table didn't work? 4+ " + sleep (3) + EditUndo + sleep (3) + Call hCloseDocument +endcase + +' ---------------------------------------------------------------------- + +function hGetPageWidth() as double + Dim tWidth as double + try + FormatPageWriter + catch + warnlog ":couldn't get menuentry: FormatPageWriter" + exit function + endcatch + Kontext + Active.SetPage TabSeite + Kontext "TabSeite" + printlog "Test: "+ Breite.GetText +" " +Links.GetText +" " +Rechts.GetText + tWidth = (StrToDouble(Breite.GetText) - ( StrToDouble(Links.GetText) + StrToDouble(Rechts.GetText)) ) + hGetPageWidth = tWidth + TabSeite.cancel +end function + diff --git a/testautomation/writer/optional/includes/table/w_204b_.inc b/testautomation/writer/optional/includes/table/w_204b_.inc new file mode 100755 index 000000000000..56b6e8781b2b --- /dev/null +++ b/testautomation/writer/optional/includes/table/w_204b_.inc @@ -0,0 +1,100 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : helge.delfs@oracle.com +'* +'* short description : Writer Table test +'* +'\*********************************************************************** + +sub w_204b_ + Call wSplittingTableCellsIntoEqualProportions +end sub + + +testcase wSplittingTableCellsIntoEqualProportions + Dim i as integer + Dim DaRowHeight as string + Dim SetRowHeight as boolean + + SetRowHeight = True + printlog "Based on feature ID: 103485" + printlog " Open a new writer document" + Call hNewDocument + printlog "Insert a table with 4 rows and 4 lines" + Call TBOhTabelleEinfuegen("SplittingTable", 0, 1, 0, 1, "4", "4") + printlog "Select the table ( Strg + A )" + Call wTypeKeys ( "<Mod1 A>" ) + printlog "Format / Row / Height" + Kontext "ZellenHoehe" + TableAutoFitSetRowHeight + printlog "In upcoming dialog (Row Height) set height to 1,2cm and check 'Fit to size'" + if iSystemSprache = 01 or iSystemSprache = 48 or iSystemSprache = 07 then + Hoehe.Settext "1.20" + else + Hoehe.Settext "1,20" + end if + Dynamisch.Check + DaRowHeight = Hoehe.Gettext + printlog "Close 'Row Height' with 'OK'" + ZellenHoehe.Ok + printlog "Point cursor to first cell in first row ( Strg + Home )" + Call wTypeKeys ( "<Mod1 Home>" ) + For i = 1 to 4 + if wCheckRowHeight( DaRowHeight ) = False then SetRowHeight = False + Call wTypeKeys ( "<Down>" ) + next i + if SetRowHeight = True then + Call wTypeKeys ( "<Up>", 4 ) + printlog "Select 1st and 2nd column" + Call wTypeKeys ( "<Shift Down>", 3 ) + Call wTypeKeys ( "<Shift Right>" ) + printlog "Format / Cell / Merge to merge all cells" + TableMergeCells + printlog "Now split previous merged cell into 4 pieces ( horizontally )" + printlog "Format / Cell / Split" + TableSplitCell + Kontext "ZellenTeilen" + printlog "In 'Split Cells' Dialog set 'Split cell into' to 4" + Anzahl.Settext "4" + printlog "Check 'Horizontally' and 'Into equal proportions'" + Horizontal.Check + GleichmaessigTeilen.Check + printlog "Close dialog with 'OK'" + ZellenTeilen.Ok + printlog "Now the cell has to be splitted into 4 rows of height 1,2cm" + For i = 1 to 4 + if wCheckRowHeight( DaRowHeight ) = False then SetRowHeight = False + Call wTypeKeys ( "<Down>" ) + next i + else + Warnlog "Error setting the row height !" + end if + + Call hCloseDocument + +endcase |