1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: w_section_4.inc,v $
13 '* last change: $Author: vg $ $Date: 2008-08-18 12:35:27 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : helge.delfs@sun.com
36 '* short description : Functional-Test for Section.
38 '************************************************************************
40 ' #1 tSectionInTables_1
41 ' #1 tSectionInTables_2
42 ' #1 tSectionInTables_3
43 ' #1 tSectionInTables_4
44 ' #1 tSectionInTables_5
45 ' #1 tSectionInTables_6
46 ' #1 tSectionInTables_7
47 ' #1 tSectionInFootnotes_1
48 ' #1 tSectionInFootnotes_2
54 ' #1 tParagraphSection_1
55 ' #1 tParagraphSection_2
56 ' #1 tParagraphSection_3
57 ' #1 tScenarioSection_1
58 ' #1 tScenarioSection_2
62 '\***********************************************************************
66 printLog Chr(13) + "- Sections in special areas -"
68 printLog Chr(13) + "--- Sections in tables ---"
69 Call tSectionInTables_1 'insert section in empty cell
70 Call tSectionInTables_2 'select text in a cell and insert section
71 Call tSectionInTables_3 'insert multicolumn-section into cell
72 Call tSectionInTables_4 'insert footnote into section which is in table
73 Call tSectionInTables_5 'hide section in cell, resize cell via key shortcuts, make section visible again
74 Call tSectionInTables_6 'insert a section when you have a multi-selection in a table must be impossible
75 Call tSectionInTables_7 'insert a section when cells are selected must be impossible
77 printLog Chr(13) + "--- Sections in footnote areas ---"
78 Call tSectionInFootnotes_1 'insert a simple section over some words or lines
79 Call tSectionInFootnotes_2 'insert section into footnote that spreads over several pages
81 printLog Chr(13) + "- Edit sections later on (via Format - Sections...) -"
82 Call tEditSection_1 'uncheck "Autowidth" and vary width manually
83 Call tEditSection_2 'hide section
84 Call tEditSection_3 'protect section
85 Call tEditSection_4 'remove link(s), also via Edit - Links
86 Call tEditSection_5 'Remove section
88 printLog Chr(13) + "- section breaks (several following sections) -"
89 Call tParagraphSection_1 'Keep paragraphs together
90 Call tParagraphSection_2 'paragraph spacing
91 Call tParagraphSection_3 'paragraph borders
93 printLog Chr(13) + "- Test scenarios -"
94 Call tScenarioSection_1 'create Masterdocument from another document that also contains sections
95 Call tScenarioSection_2 'create Masterdocument from another document that also contains sections and footnotes
97 printLog Chr(13) + "- CTL specials -"
98 Call tCTLSection_1 'CTL specials -- insert/sections /Columns
99 Call tCTLSection_2 'CTL specials -- format/section/options /Columns
103 '***********************************************************************
105 testcase tSectionInTables_1
107 Dim tableName as String
108 Dim columnNumber as String
109 Dim rowNumber as String
110 Dim sectionName as String
112 tableName = "testTable"
116 sectionName = "tableSection"
118 '/// insert section in empty cell ///
119 PrintLog " - insert section in empty cell "
124 Call fInsertTable(tableName , columnNumber, rowNumber)
126 '/// insert section in empty cell
128 Call fInsertSection(sectionName)
130 ' Check the section name is correct or NOT (Format/Section)
133 Kontext "BereicheBearbeiten"
134 if BereichsName.GetText <> sectionName then warnlog "The section Name is wrong : " & BereichsName.Gettext
135 BereicheBearbeiten.Cancel
137 Warnlog "insert section in empty cell failed"
144 '-------------------------------------------------------------
146 testcase tSectionInTables_2
148 Dim tableName as String
149 Dim columnNumber as String
150 Dim rowNumber as String
151 Dim testText as String
152 Dim sectionName as String
154 tableName = "testTable"
157 testText = "Table-Section"
159 sectionName = "tableSection"
161 '/// select text in a cell and insert section ///
162 PrintLog " - select text in a cell and insert section "
167 Call fInsertTable(tableName , columnNumber, rowNumber)
169 '/// input some test text in the table
170 Call wTypeKeys testText
173 Call wTypeKeys "<Shift Home>"
175 '/// insert section include select text
177 Call fInsertSection(sectionName)
179 ' Check the section name is correct or NOT (Format/Section)
182 Kontext "BereicheBearbeiten"
183 if BereichsName.GetText <> sectionName then warnlog "The section Name is wrong : " & BereichsName.Gettext
184 BereicheBearbeiten.Cancel
186 ' Check the content in section is correct or NOT
187 Call wTypeKeys "<Home>"
188 Call wTypeKeys "<Shift End>"
190 if GetClipBoardText <> testText then Warnlog "The content in section is NOT right : " +GetClipBoardText
193 Warnlog "insert section which include text failed"
200 '---------------------------------------------------------------
202 testcase tSectionInTables_3
204 Dim tableName as String
205 Dim columnNumber as String
206 Dim rowNumber as String
207 Dim sectionName as String
208 Dim columnInSection as String
210 tableName = "testTable"
213 sectionName = "tableSection"
214 columnInSection = "3"
216 '/// insert multicolumn-section into cell ///
217 PrintLog " - insert multicolumn-section into cell "
222 Call fInsertTable(tableName , columnNumber, rowNumber)
224 '/// insert section with column = columnInSection in empty cell
230 Active.Setpage TabBereiche
231 Kontext "TabBereiche"
232 Bereichsliste.Settext sectionName
235 Active.Setpage TabSpalten
237 Anzahl.Settext columnInSection
241 ' Check the section name is correct or NOT (Format/Section)
244 Kontext "BereicheBearbeiten"
245 if BereichsName.GetText <> sectionName then warnlog "The section Name is wrong : " & BereichsName.Gettext
247 ' Check the section column is correct or NOT (options button)
250 Active.Setpage TabSpalten
252 if Anzahl.Gettext <> columnInSection then Warnlog "The volumn should be " +columnInSection +" but get " + Anzahl.Gettext
256 Kontext "BereicheBearbeiten"
257 BereicheBearbeiten.Cancel
259 Warnlog "insert section in empty cell failed"
266 '------------------------------------------------------------------------
268 testcase tSectionInTables_4
270 Dim tableName as String
271 Dim columnNumber as String
272 Dim rowNumber as String
273 Dim sectionName as String
274 Dim footNote as String
275 Dim endNote as String
277 tableName = "testTable"
281 sectionName = "tableSection"
285 '///insert footnote into section which is in table ///
286 PrintLog " - insert footnote into section which is in table "
291 Call fInsertTable(tableName , columnNumber, rowNumber)
295 Call fInsertSection(sectionName)
297 Call wTypeKeys "<Up>"
299 '/// insert a footnote
300 Call fInsertFootnote("character",footNote)
302 Call wTypeKeys "<PageUp>"
304 '/// insert a endnote
305 fInsertEndnote("character",endNote)
307 Call wTypeKeys "<PageUp>"
309 '/// Check the section name is correct or NOT (Format/Section)
312 Kontext "BereicheBearbeiten"
313 if BereichsName.GetText <> sectionName then warnlog "The section Name is wrong : " & BereichsName.Gettext
314 BereicheBearbeiten.Cancel
316 '/// Check the footnote and endnote are correct or NOT
317 Call wTypeKeys "<Shift Home>"
319 if GetClipBoardText <> footNote+endNote then Warnlog "The footnote/endnote are NOt inserted into section correctly!"
321 Warnlog "insert section in empty cell failed"
328 '-----------------------------------------------------------------------------
330 testcase tSectionInTables_5
331 Dim tableName as String
332 Dim columnNumber as String
333 Dim rowNumber as String
334 Dim testText as String
335 Dim sectionName as String
337 tableName = "testTable"
340 testText = "Hide-Section"
341 sectionName = "tableSection"
343 '/// Hide section in cell, resize cell via key shortcuts, make section visible again ///
344 printlog " - hide section in cell, resize cell via key shortcuts, make section visible again"
348 Call wTypeKeys "<RETURN>"
349 Call fInsertTable(tableName , columnNumber, rowNumber)
350 '/// input some test text , select text and insert a section with hide option
351 Call wTypeKeys testText
352 Call wTypeKeys "<SHIFT HOME>"
356 Active.Setpage TabBereiche
357 Kontext "TabBereiche"
358 Bereichsliste.Settext sectionName
362 '/// Check the content in section is hidden or NOT
364 Call wTypeKeys "<LEFT><DOWN>"
365 Call wTypeKeys "<SHIFT END>"
369 printlog "There is no text in the document. Good."
371 if GetClipboardText = "" then
372 '/// Resize cell via key shortcuts
373 Call wTypeKeys "<MOD1 MOD2 RIGHT>" , 2
374 '/// UnCheck hide option (Format/Section)
377 Kontext "BereicheBearbeiten"
379 BereicheBearbeiten.OK
381 Call wTypeKeys "<LEFT><HOME>"
382 Call wTypeKeys "<SHIFT END>"
384 if GetClipBoardText <> testText then warnlog "The content in section should be visible but get : " & GetClipBoardText
386 QAErrorLog "#99460# The content in section is NOT hidden!"
389 warnlog "insert section which include text failed"
395 '------------------------------------------------------------------
397 testcase tSectionInTables_6
399 Dim tableName as String
400 Dim columnNumber as String
401 Dim rowNumber as String
402 Dim testText as String
403 Dim selectedString as String
404 Dim sectionName as String
406 tableName = "testTable"
409 testText = "Mul-s-Mul"
410 selectedString = "Mul"
412 sectionName = "tableSection"
414 '/// insert a section when you have a multi-selection in a table must be impossible ///
415 PrintLog " - insert a section when you have a multi-selection in a table must be impossible"
420 Call fInsertTable(tableName , columnNumber, rowNumber)
422 '/// input some words and do multi-selection
423 Call wTypeKeys testText
424 fMultiSelection(selectedString)
428 Call fInsertSection(sectionName)
429 Warnlog "Create section should be impossible!"
437 '---------------------------------------------------------------
439 testcase tSectionInTables_7
441 Dim tableName as String
442 Dim columnNumber as String
443 Dim rowNumber as String
444 Dim sectionName as String
446 tableName = "testTable"
450 sectionName = "tableSection"
452 '/// insert a section when cells are selected must be impossible ///
453 PrintLog " - insert a section when cells are selected must be impossible"
458 Call fInsertTable(tableName , columnNumber, rowNumber)
460 '/// more than one cell are selected
461 Call wTypeKeys "<Shift Right>",2
465 Call fInsertSection(sectionName)
466 Warnlog "Create section should be impossible!"
474 '----------------------------------------------------------------
476 testcase tSectionInFootnotes_1
478 Dim sectionName as String
480 sectionName = "footnoteSection"
482 '/// insert a simple section over some words or lines ///
483 PrintLog " - insert a simple section over some words or lines "
487 '/// + insert footnote
488 Call fInsertFootnote("automatic")
490 '/// + insert some dummy text in the footnote area
495 '/// + insert a section for selected words
497 Call fInsertSection(sectionName)
499 ' Check the section name is correct or NOT (Format/Section)
502 Kontext "BereicheBearbeiten"
503 if BereichsName.GetText <> sectionName then warnlog "The section Name is wrong : " & BereichsName.Gettext
504 BereicheBearbeiten.Cancel
506 Warnlog "insert a section failed !"
513 '--------------------------------------------------------------------
515 testcase tSectionInFootnotes_2
517 Dim sectionName as String
519 sectionName = "footnoteSection"
521 '/// insert section into footnote that spreads over several pages ///
522 PrintLog " - insert section into footnote that spreads over several pages "
527 Call fInsertFootnote("automatic")
529 '/// insert some dummy text that spreads over several pages in the footnote area
530 Call wBlindtextEinfuegen
531 Call wBlindtextEinfuegen
532 Call wBlindtextEinfuegen
533 Call wBlindtextEinfuegen
534 Call wBlindtextEinfuegen
535 Call wBlindtextEinfuegen
536 Call wBlindtextEinfuegen
541 Kontext "NavigatorWriter"
543 '/// Check if dummy text is enough in footnote area
544 if Seitennummer.GetText > "1" then
547 '/// + insert a section for selected words
549 Call fInsertSection(sectionName)
550 ' Check the section name is correct or NOT (Format/Section)
553 Kontext "BereicheBearbeiten"
554 if BereichsName.GetText <> sectionName then warnlog "The section Name is wrong : " & BereichsName.Gettext
555 BereicheBearbeiten.Cancel
557 Warnlog "insert a section failed !"
560 QAErrorLog "Not enough dummy text in the footnote area!"
566 '-----------------------------------------------------------
568 testcase tEditSection_1
570 Dim columnNumber as String
571 Dim sectionName as String
575 sectionName = "MultiColumnSection"
578 '/// uncheck "Autowidth" and vary width manually ///
579 PrintLog " - Create multi-column section from format/section - options (TabPage Columns)"
583 '/// insert a section with only 1 culumn, that means a normal section
584 Call fInsertSection(sectionName)
585 Call wTypeKeys "<Up>"
587 '/// change the column number (format/section) with
588 '/// + TabPage "Columns", set column to $columnNumber
591 Kontext "BereicheBearbeiten"
595 Active.Setpage TabSpalten
598 '/// + Set column number
599 Anzahl.Settext columnNumber
602 'This step is useless , but must be done ! Because after the aboved step, all control are NOT actived !
604 Active.Setpage TabHintergrund
605 Kontext "TabHintergrund"
608 Active.Setpage TabSpalten
611 '/// uncheck "Autowidth" and vary width manually
614 width1 = "4" + gSeperator + "00" + gMeasurementUnit
615 width2 = "3" + gSeperator + "00" + gMeasurementUnit
617 Spaltenbreite1.Settext width1
619 Spaltenbreite2.Settext width2
621 TabSpalten.TypeKeys "<Tab>"
627 Kontext "BereicheBearbeiten"
628 BereicheBearbeiten.OK
630 Call wTypeKeys "<Up>"
631 '/// Check the column's width
634 Kontext "BereicheBearbeiten"
638 Active.Setpage TabSpalten
641 if Spaltenbreite1.Gettext <> width1 then Warnlog "column1 width is NOT correct , hope to get " + width1 + " but get " +Spaltenbreite1.Gettext
642 if Spaltenbreite2.Gettext <> width2 then Warnlog "column2 width is NOT correct , hope to get " + width2 + " but get " +Spaltenbreite2.Gettext
647 Kontext "BereicheBearbeiten"
648 BereicheBearbeiten.Cancel
654 '------------------------------------------------------
656 testcase tEditSection_2
658 Dim sectionName as String
659 Dim testText as String
661 sectionName = "HideSection"
662 testText = "Hide Section"
664 '/// hide section in format/section ///
665 printlog " - hide section in format/section"
669 '/// insert a normal section, and input some words
670 Call wTypeKeys "<RETURN>"
671 Call wTypeKeys testText
672 Call wTypeKeys "<SHIFT HOME>"
673 Call fInsertSection(sectionName)
674 '/// Edit section with Format/Section and choose 'Hide'
677 Kontext "BereicheBearbeiten"
679 BereicheBearbeiten.OK
681 '/// check the section and its contents
682 printlog " -- check the section and its contents "
686 warnlog "'Edit / Copy' is usable but if there is nothing in the document (hidden section) it should be disabled!"
688 printlog "Clipboard should be and is empty."
693 '-------------------------------------------------------------------
695 testcase tEditSection_3
697 Dim sectionName as String
698 Dim testText as String
700 sectionName = "ProtectSection"
701 testText = "Protect Section"
703 '/// protect section in format/section ///
704 PrintLog " - protect section in format/section"
708 '/// Open options and check 'Direct-Cursor' in options ///
711 '/// insert a normal section, and input some words
712 Call wTypeKeys testText
713 Call wTypeKeys "<Shift Home>"
715 Call fInsertSection(sectionName)
717 '/// Edit section with Format/Section and choose 'Protect'
720 Kontext "BereicheBearbeiten"
722 BereicheBearbeiten.OK
725 Call wTypeKeys "<Home>"
726 Call wTypeKeys "<Space>"
728 If Active.Exists then
731 Warnlog "- No warning when trying to write in protected area!"
738 '--------------------------------------------------------
740 testcase tEditSection_4
742 Dim sectionName as String
743 Dim testText as String
745 sectionName = "LinkSection"
746 testText = "Link Section"
748 if Dir (gOfficePath + "user\work\tEditSection_4.odt") <> "" then kill (gOfficePath + "user\work\tEditSection_4.odt")
750 '/// remove link(s), also via Edit - Links ///
751 PrintLog " - remove link(s), also via Edit - Links "
753 '/// edit a test file and save it
755 Call wTypeKeys testText
756 Call hFileSaveAsKill (gOfficePath + "user\work\tEditSection_4.odt")
761 '/// insert a section and link the test file
765 Active.Setpage TabBereiche
766 Kontext "TabBereiche"
767 Bereichsliste.Settext sectionName
770 DateiVerknuepfung.Settext ConvertPath(gOfficePath + "user\work\tEditSection_4.odt")
774 '/// Edit section with Format/Section and unCheck 'link'
777 Kontext "BereicheBearbeiten"
779 BereicheBearbeiten.OK
782 '/// the test file's content should be reserved after
783 '/// + unlinking the test file
786 if GetClipBoardText <> testText then Warnlog "the test file's content should be reserved after unlinking the test file"
788 '/// check if the unlink is taken effect
791 Kontext "BereicheBearbeiten"
792 If Verknuepfung.IsChecked = TRUE then Warnlog "The link option should be UnChecked!"
793 BereicheBearbeiten.Cancel
799 '-------------------------------------------------------
801 testcase tEditSection_5
803 Dim sectionName as String
804 Dim testText as String
806 sectionName = "RemoveSection"
807 testText = "Remove Section Test"
809 '/// remove section via Edit - undo ///
810 PrintLog " - remove section via Edit - undo"
814 '/// insert a normal section, and input some words
815 Call wTypeKeys testText
816 Call wTypeKeys "<Shift Home>"
817 Call fInsertSection(sectionName)
819 '/// remove section with Format/Section and click undo button
822 Kontext "BereicheBearbeiten"
827 BereicheBearbeiten.OK
830 'check if section is still existed
834 Kontext "BereicheBearbeiten"
835 BereicheBearbeiten.Cancel
836 Warnlog "There are should be no section existed!"
840 '/// the test file's content should be reserved after removing the section
843 if GetClipBoardText <> testText then Warnlog "the test file's content should be reserved after removing the section"
849 '------------------------------------------------
851 testcase tParagraphSection_1
853 Dim documentName as String
854 Dim sectionName as String
855 Dim hopeResult as String
857 documentName = ConvertPath(gTesttoolpath + "writer\optional\input\section\tParagraphSection_1.sxw")
858 sectionName = "ParagraphSection"
861 '/// Keep paragraphs together ///
862 PrintLog " - Keep paragraphs together"
864 '/// Open a file with 4 paragraphs, the 4th paragraph is crossing the page
865 Call hFileOpen(documentName)
866 Call sMakeReadOnlyDocumentEditable
869 Call fInsertSection(sectionName)
870 Call wTypeKeys "<MOD1 End>"
871 Call wTypeKeys "<Up>",3
875 active.SetPage TabTextfluss
876 kontext "TabTextfluss"
878 '/// Check option "Do not split paragraphs"
879 AbsatzNichtTrennen.Check
883 Call wTypeKeys "<MOD1 Home>"
885 'Set the focus to the head of second page
888 Kontext "NavigatorWriter"
889 Seitennummer.SetText "2"
893 Call wTypeKeys "<Shift MOD1 Right>"
896 if GetClipBoardText <> hopeResult then Warnlog "Something wrong in Keep paragraphs together test!"
902 '-------------------------------------------------------
904 testcase tParagraphSection_2
906 Dim sectionName as String
907 Dim beforeTextIntent1 as String
908 Dim afterTextIntent1 as String
909 Dim firstTextIntent1 as String
910 Dim beforeTextSpace1 as String
911 Dim afterTextSpace1 as String
912 Dim beforeTextIntent2 as String
913 Dim afterTextIntent2 as String
914 Dim firstTextIntent2 as String
915 Dim beforeTextSpace2 as String
916 Dim afterTextSpace2 as String
918 sectionName = "ParagraphSection"
920 '/// paragraph spacing ///
921 PrintLog " - paragraph spacing "
925 '/// insert first paragraph , and do some configurations
926 if wBlindtextEinfuegen() = false then
931 if iSprache = 82 then
932 Call wTypeKeys "<Return>"
934 Call wTypeKeys "<Up>"
938 active.SetPage TabEinzuegeUndAbstaende
939 kontext "TabEinzuegeUndAbstaende"
941 beforeTextIntent1 = "0" + gSeperator + "10" + gMeasurementUnit
942 afterTextIntent1 = "0" + gSeperator + "20" + gMeasurementUnit
943 firstTextIntent1 = "0" + gSeperator + "30" + gMeasurementUnit
944 beforeTextSpace1 = "0" + gSeperator + "40" + gMeasurementUnit
945 afterTextSpace1 = "0" + gSeperator + "50" + gMeasurementUnit
947 Vonlinks.SetText beforeTextIntent1
948 VonRechts.SetText afterTextIntent1
949 ErsteZeile.SetText firstTextIntent1
950 Oben.SetText beforeTextSpace1
951 Unten.SetText afterTextSpace1
953 Registerhaltigkeit.UnCheck
954 TabEinzuegeUndAbstaende.OK
956 call wTypeKeys "<Down>"
957 call wTypeKeys "<RETURN>"
959 '/// insert second paragraph , and do some configurations which is different from the first one
961 Call wTypeKeys "<Up>"
965 active.SetPage TabEinzuegeUndAbstaende
966 kontext "TabEinzuegeUndAbstaende"
968 beforeTextIntent2 = "0" + gSeperator + "60" + gMeasurementUnit
969 afterTextIntent2 = "0" + gSeperator + "70" + gMeasurementUnit
970 firstTextIntent2 = "0" + gSeperator + "80" + gMeasurementUnit
971 beforeTextSpace2 = "0" + gSeperator + "90" + gMeasurementUnit
972 afterTextSpace2 = "0" + gSeperator + "10" + gMeasurementUnit
974 Vonlinks.SetText beforeTextIntent2
975 VonRechts.SetText afterTextIntent2
977 ErsteZeile.SetText firstTextIntent2
978 Oben.SetText beforeTextSpace2
979 Unten.SetText afterTextSpace2
980 Registerhaltigkeit.Check
981 TabEinzuegeUndAbstaende.OK
984 Call fInsertSection(sectionName)
986 'Check the first paragraph's configuration
987 Call wTypeKeys "<MOD1 Home>"
990 active.SetPage TabEinzuegeUndAbstaende
991 kontext "TabEinzuegeUndAbstaende"
993 if Automatisch.IsChecked <> TRUE then Warnlog "Something wrong with the checkbox 'Automatic' in first paragraph!"
994 if Registerhaltigkeit.IsChecked = TRUE then Warnlog "Something wrong with the checkbox 'Register' in first paragraph!"
996 if Vonlinks.GetText <> beforeTextIntent1 then Warnlog "Something wrong with the before-text-intent-area in the first paragraph"
997 if VonRechts.GetText <> afterTextIntent1 then Warnlog "Something wrong with the after-text-intent-area in the first paragraph"
998 if ErsteZeile.GetText <> firstTextIntent1 then Warnlog "Something wrong with the first-text-intent-area in the first paragraph"
999 if Oben.GetText <> beforeTextSpace1 then Warnlog "Something wrong with the before-sparcing area in the first paragraph"
1000 if Unten.GetText <> afterTextSpace1 then Warnlog "Something wrong with the after-sparcing area in the first paragraph"
1002 TabEinzuegeUndAbstaende.Cancel
1004 Call wTypeKeys "<MOD1 End>"
1005 Call wTypeKeys "<Up>",3
1007 'Check the second paragraph's configuration
1010 active.SetPage TabEinzuegeUndAbstaende
1011 kontext "TabEinzuegeUndAbstaende"
1013 if Automatisch.IsChecked = TRUE then Warnlog "Something wrong with the checkbox 'Automatic' in the second paragraph!"
1014 if Registerhaltigkeit.IsChecked <> TRUE then Warnlog "Something wrong with the checkbox 'Register' in the second paragraph!"
1016 if Vonlinks.GetText <> beforeTextIntent2 then Warnlog "Something was wrong with the before-text-intent in the second paragraph!"
1017 if VonRechts.GetText <> afterTextIntent2 then Warnlog "Something wrong with the after-text-intent in the second paragraph!"
1018 if ErsteZeile.GetText <> firstTextIntent2 then Warnlog "Something wrong with the first-text-intent in the second paragraph!"
1019 if Oben.GetText <> beforeTextSpace2 then Warnlog "Something wrong with the before-text-sparcing area in the second paragraph!"
1020 if Unten.GetText <> afterTextSpace2 then Warnlog "Something wrong with the after-text-sparcing area in the second paragraph!"
1022 TabEinzuegeUndAbstaende.Cancel
1028 '-------------------------------------------------------
1030 testcase tParagraphSection_3
1032 Dim sectionName as String
1034 Dim right1 as String
1036 Dim bottom1 as String
1037 Dim distance1 as String
1039 Dim distance2 as String
1040 Dim COMPAREvar1 as String
1041 Dim COMPAREvar2 as String
1042 Dim COMPAREvar3 as String
1043 Dim COMPAREvar4 as String
1045 sectionName = "ParagraphSection"
1047 '/// paragraph borders ///
1048 PrintLog " - paragraph borders "
1052 '/// insert first paragraph , and do some configurations
1053 if wBlindtextEinfuegen() = false then
1057 if iSprache = 82 then
1058 Call wTypeKeys "<Return>"
1060 Call wTypeKeys "<Up>"
1064 active.SetPage TabUmrandung
1065 kontext "TabUmrandung"
1067 Vorgaben.Typekeys "<home><right>" ' 2nd from the left
1068 synchronisieren.UnCheck
1070 left1 = "0" + gSeperator + "1"
1071 right1 = "0" + gSeperator + "2"
1072 top1 = "0" + gSeperator + "3"
1073 bottom1 = "0" + gSeperator + "4"
1074 distance1 = "4" + gSeperator + "2"
1077 Rechts.SetText right1
1079 Unten.SetText bottom1
1081 Position.TypeKeys "<home><right>" ' 2nd. from the left
1082 Groesse.SetText distance1
1083 SchattenFarbe.Select 2
1086 Call wTypeKeys "<Down>",2
1088 '/// insert second paragraph , and do some configurations
1089 '/// + which is different from the first one
1091 Call wTypeKeys "<Up>"
1095 active.SetPage TabUmrandung
1096 kontext "TabUmrandung"
1098 Vorgaben.Typekeys "<home><right><right>" ' 3nd from the left
1099 synchronisieren.Check
1101 left2 = "0" + gSeperator + "6"
1102 distance2 = "4" + gSeperator + "7"
1106 Position.TypeKeys "<home><right><right>" ' 3nd. from the left
1107 Groesse.SetText distance2
1108 SchattenFarbe.Select 5
1112 Call fInsertSection(sectionName)
1114 '<<< Check the FIRST paragraph's configuration >>>
1115 Call wTypeKeys "<MOD1 Home>"
1119 active.SetPage TabUmrandung
1120 kontext "TabUmrandung"
1122 ' if synchronisieren.IsChecked = TRUE then Warnlog "The Synchronize option should NOT be checked in first paragraph!"
1123 COMPAREvar1 = Links.GetText
1124 COMPAREvar2 = Rechts.GetText
1125 COMPAREvar3 = Oben.GetText
1126 COMPAREvar4 = Unten.GetText
1128 printlog (InStr( COMPAREvar1, left1 ) = false)
1129 if InStr( COMPAREvar1, left1 ) = false then Warnlog "Something wrong with the Left -space to contents area in first paragraph"
1130 if InStr( COMPAREvar2, right1 ) = false then Warnlog "Something wrong with the Right -space to contents area in first paragraph"
1131 if InStr( COMPAREvar3, top1 ) = false then Warnlog "Something wrong with the Top -space to contents area in first paragraph"
1132 if InStr( COMPAREvar4, bottom1 ) = false then Warnlog "Something wrong with the Bottom -space to contents area in first paragraph"
1134 if InStr( Groesse.GetText, distance1 ) = false then Warnlog "Something wrong with the size in first paragraph"
1135 ' Groesse.GetText <> distance1 then Warnlog "Something wrong with the size in first paragraph"
1136 if SchattenFarbe.GetSelIndex <> 2 then Warnlog "Something wrong in shadow color in the first paragraph"
1140 Call wTypeKeys "<MOD1 End>"
1141 Call wTypeKeys "<Up>",3
1143 '<<<Check the SECOND paragraph's configuration>>>
1146 active.SetPage TabUmrandung
1147 kontext "TabUmrandung"
1149 ' if synchronisieren.IsChecked <> TRUE then Warnlog "The Synchronize option should be checked in second paragraph!"
1151 if InStr( Links.GetText, left2 ) = false OR InStr( Rechts.GetText, left2 ) = false OR InStr( Oben.GetText, left2 ) = false OR InStr( Unten.GetText, left2 ) = false then
1152 Warnlog "Something wrong in space to contents area in second paragraph"
1155 if InStr( Groesse.GetText, distance2 ) = false then Warnlog "Something wrong with the size in first paragraph"
1156 if SchattenFarbe.GetSelIndex <> 5 then Warnlog "Something wrong in shadow style area in the first paragraph"
1164 '-------------------------------------------------------
1166 testcase tScenarioSection_1
1168 Dim SectionName() as String
1169 Dim tempFile as String
1170 DIM sectionInMasterDoc
1171 Dim MasterDoc as String
1172 DIM ContentInMasterDoc() as String
1177 Dim LinkFile as String
1179 '/// create Masterdocument from another document that also contains sections ///
1180 PrintLog " - create Masterdocument from another document that also contains sections"
1182 MasterDoc = Convertpath( gOfficePath + "user\work\tScenarioSection_1.odm" )
1184 SectionName = Array( _
1185 "tScenarioSection_11.odt", _
1186 "tScenarioSection_12.odt", _
1187 "tScenarioSection_13.odt", _
1190 ContentInMasterDoc = Array( _
1191 "This is scenario Section test" , _
1192 "The content in hide section" , _
1193 "The content in protect section", _
1197 j = UBound(SectionName)
1199 if hFileExists ( MasterDoc ) then app.kill ( MasterDoc )
1202 tempFile = Convertpath( gOfficePath + "user\work\" + SectionName(i) )
1203 if hFileExists ( tempFile ) then app.kill ( tempFile )
1206 '/// open testdocument (tScenarioSection_1.sxw) ///
1207 Call hFileOpen ( gTesttoolpath + "writer\optional\input\section\tScenarioSection_1.sxw")
1208 Call sMakeReadOnlyDocumentEditable
1210 '/// Select 'File /Send -> Create Masterdocument ///
1211 FileSendCreateMasterdocument
1213 '/// the 'Save as...' dialog has to appear ///
1214 Kontext "SendMasterDocument"
1215 if SendMasterDocument.NotExists then Warnlog "Save As - Dialog didn't appear!"
1217 '/// Select as template 'Default' ///
1220 '/// Save document as 'tScenarioSection_1.odm' ///
1221 Dateiname.SetText Convertpath( gOfficePath + "user\work\tScenarioSection_1" )
1227 if Active.Exists then
1230 Warnlog "- No messagebox asking for the actualizationing of the master document !"
1235 if Navigator.Exists then
1238 Warnlog "Navigator in Master document isn't up!"
1241 Call wTypeKeys "<Up>" , 3
1243 '/// Check the sections in MasterDoc
1244 '/// 1) check the content is section
1245 '/// 2) check the section name
1246 '/// 3) check if the section is hidden (should NOT be hidden)
1247 '/// 4) check if the section is protected (should be protected)
1248 '/// 5) check if the section is linked and linked file is correct or not (should be linked)
1252 Call wTypeKeys "<Home><Shift End>"
1255 if GetClipboardText = ContentInMasterDoc(i) then
1258 Kontext "BereicheBearbeiten"
1260 if BereichsName.GetText <> SectionName(i) then
1261 Warnlog "The first section's name is wrong !"
1262 Warnlog "We hope it is " + SectionName(i) + " but get: " +BereichsName.GetText
1264 if Ausblenden.IsChecked = TRUE then Warnlog "The section should NOT be hidden"
1265 if Geschuetzt.IsChecked <> TRUE then Warnlog "The section should be protected"
1266 if Verknuepfung.IsChecked = TRUE then
1267 temp1 = LCase("user/work/" & SectionName(i))
1268 temp2 = LCase(Dateiname.GetText)
1270 if Instr(temp2, temp1) = 0 then Warnlog "The linked file is NOT correct!"
1272 Warnlog "The section should be linked"
1274 BereicheBearbeiten.Cancel
1276 Warnlog "The content in first section in Master file is wrong!"
1279 Call wTypeKeys "<Down>"
1286 '-------------------------------------------------------
1288 testcase tScenarioSection_2
1290 Dim SectionName() as String
1291 Dim tempFile as String
1292 DIM sectionInMasterDoc as String
1293 Dim MasterDoc as String
1294 DIM ContentInMasterDoc() as String
1298 Dim sValue as String
1300 '/// create Masterdocument from another document that also contains sections and footnotes
1301 PrintLog " - create Masterdocument from another document that also contains sections and footnotes"
1303 MasterDoc = Convertpath( gOfficePath + "user\work\tScenarioSection_2.sxg" )
1305 SectionName = Array( _
1306 "tScenarioSection_21.odt", _
1307 "tScenarioSection_22.odt", _
1308 "tScenarioSection_23.odt", _
1311 ContentInMasterDoc = Array( _
1312 "This is scenario Section test" , _
1313 "FootNote1The content in hide sectionEndNote1" , _
1314 "FootNote2The content in protect sectionEndNote2", _
1317 j = UBound(SectionName)
1319 if hFileExists ( MasterDoc ) then app.kill ( MasterDoc )
1322 tempFile = Convertpath( gOfficePath + "user\work\" + SectionName(i) )
1323 if hFileExists ( tempFile ) then app.kill ( tempFile )
1326 '/// open testdocument (tScenarioSection_2.sxw) ///
1327 Call hFileOpen ( gTesttoolpath + "writer\optional\input\section\tScenarioSection_2.sxw")
1328 Call sMakeReadOnlyDocumentEditable
1330 '/// Select 'File -> Send -> Create Masterdocument ///
1331 FileSendCreateMasterdocument
1333 '/// the 'Save as...' dialog has to appear ///
1334 Kontext "SendMasterDocument"
1335 if SendMasterDocument.NotExists then Warnlog "Save As - Dialog didn't appear!"
1337 '/// Select as template 'Default' ///
1340 '/// Save document as 'masterdoc.odm' ///
1341 Dateiname.SetText Convertpath( gOfficePath + "user\work\tScenarioSection_2" )
1347 if Active.Exists then
1350 Warnlog "- No messagebox asking for the actualizationing of the master document !"
1355 if Active.Exists(5) then
1360 if Navigator.Exists then
1363 Warnlog "Navigator in Master document isn't up!"
1366 Call wTypeKeys "<Up>" , 3
1368 '/// Check the sections in MasterDoc
1369 '/// 1) check the content is section
1370 '/// 2) check the section name
1371 '/// 3) check if the section is hidden (should NOT be hidden)
1372 '/// 4) check if the section is protected (should be protected)
1373 '/// 5) check if the section is linked and linked file is correct or not (should be linked)
1377 Call wTypeKeys "<Home><Shift End>"
1380 if GetClipboardText = ContentInMasterDoc(i) then
1383 Kontext "BereicheBearbeiten"
1385 if BereichsName.GetText <> SectionName(i) then
1386 Warnlog "The first section's name is wrong !"
1387 Warnlog "We hope it is " + SectionName(i) + " but get: " +BereichsName.GetText
1390 if Ausblenden.IsChecked = TRUE then Warnlog "The section should NOT be hidden"
1391 if Geschuetzt.IsChecked <> TRUE then Warnlog "The section should be protected"
1392 if Verknuepfung.IsChecked = TRUE then
1393 sValue = ConvertPath ( gOfficePath & "user/work/" + SectionName(i) )
1394 if Instr( ConvertPath(Dateiname.Gettext), sValue) = false then
1395 Warnlog "The linked file is NOT correct!"
1398 Warnlog "The section should be linked"
1400 BereicheBearbeiten.Cancel
1402 Warnlog "The content in first section in Master file is wrong!"
1405 Call wTypeKeys "<Down>"
1413 '----------------------------------------------
1415 testcase tCTLSection_1
1417 '/// CTL specials Check -- insert/sections ///
1418 PrintLog " - CTL specials -- insert/sections "
1422 '/// 1)Switch on "Complex scripts support" in Tools/Options/Language Settings/Languages
1423 ActiveDeactivateCTLSupport(True)
1425 '/// 2)Insert/sections / Columns
1429 Active.Setpage TabSpalten
1430 Kontext "TabSpalten"
1432 '/// 3)Check if text direction listbox is visible
1433 if (TextDirection.Exists) then
1435 '/// 4)Check the default name
1436 if TextDirection.GetSelIndex <> 3 then
1437 Warnlog "The default name we hope is :" + TextDirection.GetItemText(3) +" but get: "+TextDirection.GetSelText
1440 '/// 5)Check the available values ( Should 3 items )
1441 if TextDirection.GetItemCount <> 3 then
1442 Warnlog "The values in TextDirection should be 3, but get " +TextDirection.GetItemCount
1446 Warnlog "the textdirection listbox doesn't exist!"
1452 ActiveDeactivateCTLSupport(False)
1458 '-------------------------------------------------------
1460 testcase tCTLSection_2
1462 Dim SectionName as String
1464 SectionName = "CTLSection"
1466 '/// CTL specials -- format/section/options /Columns ///
1467 PrintLog " - CTL specials -- format/section/options /Columns "
1471 '/// 1)Switch on "Complex scripts support" in Tools/Options/Language Settings/Languages
1472 ActiveDeactivateCTLSupport(True)
1474 '/// 2)Insert a section
1475 Call fInsertSection(SectionName)
1477 '/// 3)format/section/options /Columns
1480 Kontext "BereicheBearbeiten"
1484 Active.Setpage TabSpalten
1485 Kontext "TabSpalten"
1487 '/// 4)Check if text direction listbox is visible
1488 if (TextDirection.Exists) then
1490 '/// 5)Check the default name
1491 if TextDirection.GetSelIndex <> 3 then
1492 Warnlog "The default name we hope is :" + TextDirection.GetItemText(3) +" but get: "+TextDirection.GetSelText
1495 '/// 6)Check the available values ( Should 3 items )
1496 if TextDirection.GetItemCount <> 3 then
1497 Warnlog "The values in TextDirection should be 3, but get " +TextDirection.GetItemCount
1501 Warnlog "the textdirection listbox doesn't exist!"
1507 Kontext "BereicheBearbeiten"
1508 BereicheBearbeiten.Cancel
1511 ActiveDeactivateCTLSupport(False)