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_3.inc,v $
13 '* last change: $Author: vg $ $Date: 2008-08-18 12:35:16 $
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 : Hide section /Protect section / Display of dialogues
38 '************************************************************************
40 ' #1 tBookmarkSection_1
41 ' #1 tBookmarkSection_2
42 ' #1 tFootnoteEndnoteSection_1
43 ' #1 tFootnoteEndnoteSection_2
44 ' #1 tFootnoteEndnoteSection_3
45 ' #1 tFootnoteEndnoteSection_4
46 ' #1 tFootnoteEndnoteSection_5
47 ' #1 tFootnoteEndnoteSection_6
48 ' #1 tMultiColumnSection_1
49 ' #1 tMultiColumnSection_2
50 ' #1 tMultiColumnSection_3
51 ' #1 tOperationSection_1
52 ' #1 tOperationSection_2
53 ' #1 tOperationSection_3
54 ' #1 tPasswordProtectSection_1
55 ' #1 tPasswordProtectSection_2
56 ' #1 tPasswordProtectSection_3
57 ' #1 tPasswordProtectSection_4
58 ' #1 tWrappedSections_1
59 ' #1 tWrappedSections_2
60 ' #1 tWrappedSections_3
61 ' #1 tWrappedSections_4
62 ' #1 tWrappedSections_5
63 ' #1 tWrappedSections_6
64 ' #1 tWrappedSections_7
66 '\***********************************************************************
70 printLog Chr(13) + "--------- Insert bookmarks into sections ----------"
71 Call tBookmarkSection_1 'Insert bookmarks into section, jump to
72 Call tBookmarkSection_2 'Insert bookmarks into a protect section, jump to
74 printLog Chr(13) + "--------- Footnotes/Endnotes in sections ----------"
75 Call tFootnoteEndnoteSection_1 'select Text, that contains foot-/endnotes, insert section
76 Call tFootnoteEndnoteSection_2 'insert footnote into text of an existing section
77 Call tFootnoteEndnoteSection_3 'footnote text must be protected in a protected section
78 Call tFootnoteEndnoteSection_4 'linked sections, where source section contains footnotes , footnote text must be also protected
79 Call tFootnoteEndnoteSection_5 'footnotes in hidden areas 1 footnote text must also be hidden
80 Call tFootnoteEndnoteSection_6 'ALL footnotes appear before the endnotes
82 printLog Chr(13) + "--------- Multi-column sections ----------"
83 Call tMultiColumnSection_1 'Create multi-column section directly when inserting via dialogue (TabPage "Columns")
84 Call tMultiColumnSection_2 'Create multi-column section from format/section - options (TabPage "Columns")
85 Call tMultiColumnSection_3 'Fill columns balanced -- Active
87 printLog Chr(13) + "--------- Cut/copy/paste/move/delete sections ----------"
88 Call tOperationSection_1 'Cut/copy/paste/move/delete sections -- Shortcut
89 Call tOperationSection_2 'Cut/copy/paste/move/delete sections -- function bar
90 Call tOperationSection_3 'when inserting from clipboard the sections have to be named automatically with the correct number
92 printLog Chr(13) + "--------- Password protect sections ----------"
93 Call tPasswordProtectSection_1 'Format - Section: check "Password protected" PW-Dialogue has to appear two times
94 Call tPasswordProtectSection_2 'reload document, Format-section 1 PW-Dialog has to appear
95 Call tPasswordProtectSection_3 'try wrong password ,Error massage should appear, sections-dialogue not accessible
96 Call tPasswordProtectSection_4 'Remove password protection by unchecking, reload document, Format-sections 'PW-dialogue' should NOT appear
98 printLog Chr(13) + "--------- Wrapping and Wrapped sections ----------"
99 Call tWrappedSections_1 'select Text inside a section and insert a section
100 Call tWrappedSections_2 'select text across a section an insert a section
101 Call tWrappedSections_3 'wrapped sections are following properties of the wrapping section - write protection
102 Call tWrappedSections_4 'wrapped sections are following properties of the wrapping section - visibility
103 Call tWrappedSections_5 'wrapped sections are following properties of the wrapping section - Foot-/endnote position
104 Call tWrappedSections_6 'The formatting of columns of sectionWrapping and sectionWrapped can be configured separately
105 Call tWrappedSections_7 'The background graphic of sectionWrapping and sectionWrapped can be configured separately
109 '***********************************************************************
111 testcase tBookmarkSection_1
113 Dim sectionName as String
114 Dim testText as String
115 Dim bookmarkName as String
117 sectionName = "bookmarkSection"
118 bookmarkName = "myBookmark"
119 testText = "Hello World"
121 PrintLog " - Insert bookmarks into a section, jump to"
125 PrintLog " insert a section , and input Text"
126 Call wTypeKeys testText
127 Call wTypeKeys "<Shift Home>"
128 fInsertSection(sectionName)
130 PrintLog " insert a bookmark in front of Text"
132 fInsertBookmark(bookmarkName)
134 Warnlog " Insert a bookmark into a section failed"
137 printlog "set the focus end of Text, make sure no text is marked."
138 Call wTypeKeys "<End><SPACE><BACKSPACE>"
140 PrintLog " active Navigator, double click the bookmark which be inserted,"
141 PrintLog " + then the focus should be in front of $testText"
142 Call wNavigatorAuswahl(6,1, true)
143 Auswahlliste.TypeKeys "<return>"
145 ' Call wTypeKeys "<Shift End>" 'Outcommented since the bookmark also selects the text. Just like it was when it got bookmarked.
149 if GetClipboardText <> testText then Warnlog "The focus is NOT in front of " +testText
151 printlog "Close Navigator before close the document"
157 '--------------------------------------------------
159 testcase tBookmarkSection_2
161 Dim sectionName as String
162 Dim testText as String
163 Dim bookmarkName as String
165 sectionName = "bookmarkSection"
166 bookmarkName = "myBookmark"
167 testText = "Hello World"
169 PrintLog " - Jump to for bookmarks in a protect section"
173 PrintLog " Open options and check 'Direct-Cursor' in options"
174 Call fCheckDirectCursor
176 PrintLog " insert a bookmark in front of Text"
177 Call fInsertBookmark(bookmarkName)
179 PrintLog " insert Text"
180 Call wTypeKeys testText
181 Call wTypeKeys "<Shift Home>"
183 PrintLog " insert a section with protect option"
187 Active.Setpage TabBereiche
188 Kontext "TabBereiche"
189 Bereichsliste.Settext sectionName
194 PrintLog " set the focus end of Text"
195 Call wTypeKeys "<End>"
197 PrintLog " active Navigator, double click the bookmark which be inserted,"
198 PrintLog " + then the focus should be in front of Text"
199 Call wNavigatorAuswahl(6,1, true)
201 Auswahlliste.TypeKeys "<down><return>"
203 Call wTypeKeys "<Shift End>"
207 if GetClipboardText <> testText then Warnlog "The focus is NOT in front of " & testText
208 printlog "Close Navigator before close the document"
214 '----------------------------------------------------------
216 testcase tFootnoteEndnoteSection_1
218 Dim sectionName as String
219 Dim testText as String
220 Dim preMessage as String
222 sectionName = "FootnoteEndnoteSection"
223 testText = "This is footnotes/endnotes test"
225 PrintLog " - Insert a section that contains foot-/endnotes"
229 PrintLog " insert footnote in front of Text"
230 fInsertFootnote("automatic")
231 Call wTypeKeys "<PageUp>"
233 PrintLog " insert some test words"
234 Call wTypeKeys testText
236 PrintLog " insert endnote at end of Text"
237 fInsertEndnote("automatic")
238 Call wTypeKeys "<PageUp>"
244 preMessage = GetClipBoardtext
246 PrintLog " insert a section which include Text, foot-/endnotes"
248 fInsertSection(sectionName)
253 if GetClipboardText <> preMessage then Warnlog "There is something changed aftering inserting the section which include Text, foot-/endnotes"
255 Warnlog " Could NOT insert a section which include Text, foot-/endnotes"
261 '----------------------------------------------------------
263 testcase tFootnoteEndnoteSection_2
265 Dim sectionName as String
266 Dim testText as String
267 Dim preMessage as String
269 sectionName = "FootnoteEndnoteSection"
270 testText = "This is footnotes/endnotes test"
272 PrintLog " - insert footnote/endnote into text of an existing section "
276 PrintLog " insert some test words"
277 Call wTypeKeys testText
278 Call wTypeKeys "<Shift Home>"
280 PrintLog " insert a section which include Text"
281 fInsertSection(sectionName)
283 Call wTypeKeys "<Home>"
285 PrintLog " insert footnote into the section"
287 fInsertFootnote("automatic")
289 Warnlog " Could NOT insert a footnote into the section"
292 Call wTypeKeys "<PageUp><End>"
294 PrintLog " insert endnote into the section"
296 fInsertEndnote("automatic")
298 Warnlog " Could NOT insert a endnote into the section"
304 '----------------------------------------------------------
306 testcase tFootnoteEndnoteSection_3
308 Dim sectionName as String
309 Dim preMessage as String
311 sectionName = "FootnoteEndnoteSection"
313 PrintLog " - footnote text must be protected in a protected section"
317 PrintLog " Open options and check 'Direct-Cursor' in options"
320 PrintLog " insert a footnote"
321 fInsertFootnote("automatic")
322 Call wTypeKeys "<PageUp>"
324 PrintLog " insert a endnote"
325 fInsertEndnote("automatic")
326 Call wTypeKeys "<PageUp>"
333 preMessage = GetClipBoardtext
335 PrintLog " insert a section with protect option"
339 Active.Setpage TabBereiche
340 Kontext "TabBereiche"
341 Bereichsliste.Settext sectionName
351 if GetClipBoardtext = preMessage then
352 Call wTypeKeys "<Space>"
354 if Active.Exists then
357 Warnlog "- No warning when trying to write in protected area!"
360 Warnlog "Testtool couldn't find the protected area!"
366 '----------------------------------------------------------
368 testcase tFootnoteEndnoteSection_4
370 Dim sectionName as String
371 Dim sourceSectionName as String
372 Dim testText as String
373 Dim preMessage as String
375 sectionName = "FootnoteEndnoteSection"
376 sourceSectionName = "NormalSection"
377 testText = "The test is in source section"
379 if Dir (gOfficePath + "user\work\tFootnoteEndnoteSection_4.odt") <> "" then kill (gOfficePath + "user\work\tFootnoteEndnoteSection_4.odt")
381 PrintLog " - linked sections, where source section contains footnotes , footnote text must be also protected "
383 PrintLog " insert a footnote in a section, then save the file"
386 fInsertFootnote("automatic")
387 Call wTypeKeys "<PageUp>"
389 Call wTypeKeys testText
391 fInsertEndnote("automatic")
392 Call wTypeKeys "<PageUp>"
394 Call wTypeKeys "<Shift Home>"
395 fInsertSection(sourceSectionName)
401 preMessage = GetClipBoardtext
403 Call hFileSaveAsKill (gOfficePath + "user\work\tFootnoteEndnoteSection_4.odt")
408 PrintLog " Open options and check 'Direct-Cursor' in options"
411 PrintLog " insert a section with link option"
415 Active.Setpage TabBereiche
416 Kontext "TabBereiche"
417 Bereichsliste.Settext sectionName
420 DateiVerknuepfung.Settext ConvertPath(gOfficePath + "user\work\tFootnoteEndnoteSection_4.odt")
429 PrintLog " the footnote should be protected"
430 if GetClipBoardtext = preMessage then
431 Call wTypeKeys "<Space>"
433 if Active.Exists then
436 Warnlog "- No warning when trying to write in protected area!"
439 Warnlog "Testtool couldn't find the protected area!"
445 '----------------------------------------------------------
447 testcase tFootnoteEndnoteSection_5
448 Dim sectionName as String
449 sectionName = "FootnoteEndnoteSection"
450 printlog " - Footnotes in hidden areas 1 footnote text must also be hidden"
453 PrintLog " Insert a footnote"
454 fInsertFootnote("automatic")
455 Call wTypeKeys "<PAGEUP>"
456 PrintLog " Insert a endnote"
457 fInsertEndnote("automatic")
458 Call wTypeKeys "<PAGEUP>"
459 Call wTypeKeys "<HOME>"
460 Call wTypeKeys "<RETURN>"
461 Call wTypeKeys "<SHIFT END>"
462 PrintLog " Insert a section with hide option"
466 Active.Setpage TabBereiche
467 Kontext "TabBereiche"
468 Bereichsliste.Settext sectionName
477 warnlog "'Edit / Copy' is usable but if there is nothing in the document (hidden section in footnote) it should be disabled!"
479 printlog "Clipboard should be and is empty."
485 '----------------------------------------------------------
487 testcase tFootnoteEndnoteSection_6
489 Dim sectionName as String
491 sectionName = "FootnoteEndnoteSection"
493 PrintLog " - ALL footnotes appear before the endnotes "
497 fInsertSection(sectionName)
498 Call wTypeKeys "<Up>"
500 PrintLog " insert the first footnote"
501 fInsertFootnote("automatic")
502 Call wNavigatorAuswahl(7,1, true)
503 if Seitennummer.GetText <> "1" then warnlog "The first footnote should be in the first page"
505 Call wTypeKeys "<PageUp>"
507 PrintLog " insert a endnote"
508 fInsertEndnote("automatic")
509 Call wNavigatorAuswahl(7,1, true)
510 if Seitennummer.GetText <> "2" then warnlog "The first endnote should be in the second page"
512 Call wTypeKeys "<PageUp>"
514 PrintLog " insert the second footnote"
515 fInsertFootnote("automatic")
516 Call wNavigatorAuswahl(7,1, true)
517 if Seitennummer.GetText <> "1" then warnlog "The second footnote should be in the first page"
523 '----------------------------------------------------------
525 testcase tMultiColumnSection_1
527 Dim columnNumber as String
531 PrintLog " - Create multi-column section directly when inserting via dialogue (TabPage 'Columns')"
535 PrintLog " insert a section(insert/section with TabPage 'Columns',"
536 PrintLog " + set column to $columnNumber"
541 Active.Setpage TabSpalten
543 Anzahl.Settext columnNumber
549 Kontext "BereicheBearbeiten"
553 Active.Setpage TabSpalten
557 if Anzahl.Gettext <> columnNumber then Warnlog "The volumn we hope is " +columnNumber +" but get " + Anzahl.Gettext
560 if Spaltenbreite1.Gettext <> Spaltenbreite2.Gettext OR Spaltenbreite1.Gettext <> Spaltenbreite3.Gettext then Warnlog "column width is NOT Balance"
565 Kontext "BereicheBearbeiten"
566 BereicheBearbeiten.Cancel
572 '----------------------------------------------------------
574 testcase tMultiColumnSection_2
576 Dim columnNumber , sectionName as String
578 sectionName = "MultiColumnSection"
581 PrintLog " - Create multi-column section from format/section - options (TabPage Columns)"
585 PrintLog " insert a section with only 1 culumn, that means a normal section"
586 fInsertSection(sectionName)
588 PrintLog " change the volumn number (format/section) with"
589 PrintLog " + TabPage 'Columns', set column to $columnNumber"
592 Kontext "BereicheBearbeiten"
596 Active.Setpage TabSpalten
600 Anzahl.Settext columnNumber
604 Kontext "BereicheBearbeiten"
605 BereicheBearbeiten.OK
607 PrintLog " Check the volumn number"
610 Kontext "BereicheBearbeiten"
614 Active.Setpage TabSpalten
618 if Anzahl.Gettext <> columnNumber then Warnlog "The volumn we hope is " +columnNumber +" but get " + Anzahl.Gettext
623 Kontext "BereicheBearbeiten"
624 BereicheBearbeiten.Cancel
629 '----------------------------------------------------------
631 testcase tMultiColumnSection_3
633 Dim columnNumber as String
634 Dim testText1 as String
635 Dim testText2 as String
639 testText1 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV"
642 PrintLog " fill columns balanced -- Active"
644 PrintLog " when text inserted into a section, the columns have"
645 PrintLog " + to be filled equally"
647 PrintLog " - fill columns balanced -- Active"
651 PrintLog " input some text , less 1 line"
652 Call wTypeKeys testText1
655 PrintLog " insert a section ,set column to $columnNumber"
660 Active.Setpage TabSpalten
662 Anzahl.Settext columnNumber
666 Call wTypeKeys "<Escape>"
668 PrintLog " input '-' in the end of the text check if"
669 PrintLog " + the '-' will appare to second colum"
671 Call wTypeKeys testText2
672 Call wTypeKeys "<Shift Home>"
676 if GetClipboardText = testText2 then goto GoON
677 Call wTypeKeys "<Escape>"
678 Call wTypeKeys "<End>"
680 Warnlog "We can't get " +hopeResult2 +" in second column"
686 '----------------------------------------------------------
688 testcase tOperationSection_1
689 Dim testText1 as String
690 Dim testText2 as String
691 Dim testText3 as String
692 Dim sectionName as String
694 sectionName = "OperationSection"
695 testText1 = "The operation CUT for Section test"
696 testText2 = "The operation COPY for Section test"
697 testText3 = "The operation DELETE for Section test"
699 PrintLog " - Cut/copy/paste/move/delete sections - Via key shortcuts"
703 PrintLog " insert a section"
704 Call wTypeKeys "<Return>"
705 fInsertSection(sectionName)
706 Call wTypeKeys "<Up>"
707 Call wTypeKeys testText1
708 Call wTypeKeys "<Up>"
711 PrintLog " Cut section"
712 Call wTypeKeys "<Mod1 x>"
716 Kontext "BereicheBearbeiten"
717 BereicheBearbeiten.Cancel
718 Warnlog "Cut section is failed!"
722 PrintLog " Paste section"
723 Call wTypeKeys "<Mod1 v>"
726 Call wNavigatorAuswahl(7,1, true)
727 PrintLog " 1)check section name"
728 if Auswahlliste.GetSelText = sectionName then
729 PrintLog " 2)check the content in section"
730 Call wTypeKeys "<home><Shift End>"
734 if GetClipboardText <> testText1 then Warnlog "The content is the section is NOT right in cut/paste section!"
736 warnlog "The Section Name is wrong, should be " + sectionName +" but get " +Auswahlliste.GetSelText
739 'Close Navigator before close the document
747 PrintLog " insert a section"
748 Call wTypeKeys "<Return>"
749 Call fInsertSection(sectionName)
750 Call wTypeKeys "<Up>"
751 Call wTypeKeys testText2
752 Call wTypeKeys "<Up>"
755 PrintLog " Copy section"
756 Call wTypeKeys "<Mod1 c>"
763 Call wTypeKeys "<Mod1 v>"
766 Call wNavigatorAuswahl(7,1, true)
768 PrintLog " 1)check section name"
769 if Auswahlliste.GetSelText = sectionName then
770 PrintLog " 2)check the content in section"
772 Call wTypeKeys "<home><Shift End>"
776 if GetClipboardText <> testText2 then Warnlog "The content is the section is NOT right in copy/paste section!"
778 warnlog "The Section Name is wrong, should be " + sectionName +" but get " +Auswahlliste.GetSelText
781 printlog "'Close Navigator before close the document"
788 PrintLog " insert a section"
789 Call wTypeKeys "<Return>"
790 Call fInsertSection(sectionName)
791 Call wTypeKeys "<Up>"
792 Call wTypeKeys testText3
793 Call wTypeKeys "<Up>"
796 PrintLog " delete the section"
797 Call wTypeKeys "<Delete>"
799 PrintLog " check if section exists or not"
802 Kontext "BereicheBearbeiten"
803 BereicheBearbeiten.Cancel
804 Warnlog "Delete section is failed!"
811 '----------------------------------------------------------
813 testcase tOperationSection_2
815 Dim testText1 as String
816 Dim testText2 as String
817 Dim testText3 as String
818 Dim sectionName as String
820 sectionName = "OperationSection"
821 testText1 = "The operation CUT for Section test"
822 testText2 = "The operation COPY for Section test"
823 testText3 = "The operation DELETE for Section test"
825 PrintLog " - Cut/copy/paste/move/delete sections - Via function bar"
829 PrintLog " insert a section"
830 Call wTypeKeys "<Return>"
831 Call fInsertSection(sectionName)
832 Call wTypeKeys "<Up>"
833 Call wTypeKeys testText1
834 Call wTypeKeys "<Up>"
837 PrintLog " Cut section"
838 Kontext "Standardbar"
843 Kontext "BereicheBearbeiten"
844 BereicheBearbeiten.Cancel
845 Warnlog "Cut section is failed!"
849 PrintLog " Paste section"
850 Kontext "Standardbar"
854 Call wNavigatorAuswahl(7,1, true)
856 PrintLog " 1)check section name"
857 if Auswahlliste.GetSelText = sectionName then
858 PrintLog " 2)check the content in section"
859 Call wTypeKeys "<home><Shift End>"
863 if GetClipboardText <> testText1 then Warnlog "The content is the section is NOT right in cut/paste section!"
865 warnlog "The Section Name is wrong, should be " + sectionName +" but get " +Auswahlliste.GetSelText
868 printlog "Close Navigator before close the document"
873 PrintLog " insert a section"
874 Call wTypeKeys "<Return>"
875 Call fInsertSection(sectionName)
876 Call wTypeKeys "<Up>"
877 Call wTypeKeys testText2
878 Call wTypeKeys "<Up>"
882 PrintLog " Copy section"
883 Kontext "Standardbar"
890 PrintLog " Paste section"
891 Kontext "Standardbar"
895 Call wNavigatorAuswahl(7,1, true)
897 PrintLog " 1)check section name"
898 if Auswahlliste.GetSelText = sectionName then
899 PrintLog " 2)check the content in section"
901 Call wTypeKeys "<home><Shift End>"
905 if GetClipboardText <> testText2 then Warnlog "The content is the section is NOT right in copy/paste section!"
907 warnlog "The Section Name is wrong, should be " + sectionName +" but get " +Auswahlliste.GetSelText
914 '----------------------------------------------------------
916 testcase tOperationSection_3
918 Dim sectionName as String
920 PrintLog " when inserting from clipboard the sections have to be named automatically"
921 PrintLog " + with the correct number, means:"
922 PrintLog " + when copying 1 section inside a document, the new section must be"
923 PrintLog " + named 'Section2' automatically, if the copied section is named Section1"
925 PrintLog " - when inserting from clipboard the sections have to be named automatically with the correct number"
927 sectionName = gDefaultSectionName + 2
929 PrintLog " New document"
931 Call wTypeKeys "<Return>"
933 PrintLog " Insert a section with default name"
937 Kontext "TabBereiche"
941 PrintLog " Copy and Paste the section into the document"
946 Call wTypeKeys "<Escape>"
953 Kontext "BereicheBearbeiten"
954 Bereich.TypeKeys "<Up>",2
955 Bereich.TypeKeys "<Down>"
957 if BereichsName.GetText <> sectionName then warnlog "We hope the section name is " & sectionName & " but get " & BereichsName.GetText
958 BereicheBearbeiten.Cancel
960 PrintLog " Close document"
964 '----------------------------------------------------------
966 testcase tPasswordProtectSection_1
968 Dim Password as String
969 Dim newPassword as String
971 Password = "protectedarea"
972 newPassword = "newProtectedArea"
974 PrintLog " - Format - Section: check 'Password protected' 1 PW-Dialogue has to appear two times "
978 PrintLog " Insert a section with password"
982 Active.Setpage TabBereiche
983 Kontext "TabBereiche"
988 Kontext "BereicheSchuetzen"
989 PasswortName.Settext Password
990 PasswortBestaetigen.Settext Password
994 Kontext "TabBereiche"
998 Kontext "BereicheBearbeiten"
1003 Kontext "BereicheSchuetzen"
1005 PrintLog " PassWord-Dialogue should appear first time"
1006 if BereicheSchuetzen.NotExists then
1007 Warnlog "Unable to enter passwort for section, because dialog is not up!"
1009 PasswortName.Settext Password
1010 BereicheSchuetzen.Ok
1013 PrintLog " + PW-Dialogue should appear second time"
1014 if BereicheSchuetzen.NotExists then
1015 Warnlog "Unable to enter passwort for section, because dialog is not up!"
1017 PasswortName.Settext newPassword
1018 PasswortBestaetigen.Settext newPassword
1019 BereicheSchuetzen.Ok
1022 Kontext "BereicheBearbeiten"
1023 PrintLog " + 'Password protected' checkbox must be checked after inputing new password"
1024 if Passwort.IsChecked <> TRUE then Warnlog "The 'password protected' checkbox should be checked"
1029 Kontext "BereicheBearbeiten"
1030 BereicheBearbeiten.OK
1035 '----------------------------------------------------------
1037 testcase tPasswordProtectSection_2
1039 Dim Password as String
1041 Password = "protectedarea"
1043 if Dir (gOfficePath + "user\work\tPasswordProtectSection_2.odt") <> "" then
1044 kill (gOfficePath + "user\work\tPasswordProtectSection_2.odt")
1046 PrintLog " - reload document, Format-section 1 PW-Dialog has to appear "
1050 PrintLog " Insert a section with password , and save the file"
1054 Active.Setpage TabBereiche
1055 Kontext "TabBereiche"
1060 Kontext "BereicheSchuetzen"
1061 PasswortName.Settext Password
1062 PasswortBestaetigen.Settext Password
1063 BereicheSchuetzen.Ok
1065 Kontext "TabBereiche"
1068 Call hFileSaveAsKill (gOfficePath + "user\work\tPasswordProtectSection_2.odt")
1072 PrintLog " Reload the file"
1073 Call hFileOpen (gOfficePath + "user\work\tPasswordProtectSection_2.odt")
1076 Kontext "BereicheBearbeiten"
1080 Kontext "BereicheSchuetzen"
1081 PrintLog " PassWord-Dialogue should appear when clicking 'option' button"
1082 if BereicheSchuetzen.NotExists then
1083 Warnlog "Unable to enter passwort for section, because dialog is not up!"
1085 BereicheSchuetzen.Cancel
1088 Kontext "BereicheBearbeiten"
1089 BereicheBearbeiten.Cancel
1094 '----------------------------------------------------------
1096 testcase tPasswordProtectSection_3
1098 Dim Password as String
1099 Dim wrongPassword as String
1101 Password = "protectedarea"
1102 wrongPassword = "wrongPW"
1104 PrintLog " - Input wrong password ,Error massage should appear, sections-dialogue not accessible "
1108 PrintLog " Insert a section with password"
1112 Active.Setpage TabBereiche
1113 Kontext "TabBereiche"
1118 Kontext "BereicheSchuetzen"
1119 PasswortName.Settext Password
1120 PasswortBestaetigen.Settext Password
1121 BereicheSchuetzen.Ok
1123 Kontext "TabBereiche"
1127 Kontext "BereicheBearbeiten"
1131 Kontext "BereicheSchuetzen"
1133 PasswortName.Settext wrongPassword
1135 BereicheSchuetzen.Ok
1140 if Active.Exists then
1141 if Active.GetRT <> 304 then warnlog "Error message box is NOT up! The active box is " +Active.GetRT
1144 Warnlog "Error message box is NOT up!"
1148 Kontext "BereicheBearbeiten"
1149 BereicheBearbeiten.Cancel
1153 '----------------------------------------------------------
1155 testcase tPasswordProtectSection_4
1157 Dim Password as String
1159 Password = "protectedarea"
1161 if Dir (gOfficePath + "user\work\tPasswordProtectSection_4.odt") <> "" then
1162 kill (gOfficePath + "user\work\tPasswordProtectSection_4.odt")
1165 PrintLog " - Remove password protection by unchecking, reload document, Format-sections 'PW-dialogue' may not appear"
1169 PrintLog " Insert a section with password"
1173 Active.Setpage TabBereiche
1174 Kontext "TabBereiche"
1179 Kontext "BereicheSchuetzen"
1180 PasswortName.Settext Password
1181 PasswortBestaetigen.Settext Password
1182 BereicheSchuetzen.Ok
1184 Kontext "TabBereiche"
1187 PrintLog " Remove the password protection and save the file"
1189 Kontext "BereicheBearbeiten"
1192 Kontext "BereicheSchuetzen"
1193 PrintLog " PassWord-Dialogue should appear when clicking 'option' button"
1194 if BereicheSchuetzen.NotExists then
1195 Warnlog "Unable to uncheck password for section, because dialog is not up!"
1197 PasswortName.Settext Password
1198 BereicheSchuetzen.OK
1201 Kontext "BereicheBearbeiten"
1202 BereicheBearbeiten.OK
1204 Call hFileSaveAsKill (gOfficePath + "user\work\tPasswordProtectSection_4.odt")
1208 PrintLog " Reload the file"
1209 Call hFileOpen (gOfficePath + "user\work\tPasswordProtectSection_4.odt")
1211 PrintLog " In format/section, PW-Dialogue should appear when clicking 'option' button"
1213 Kontext "BereicheBearbeiten"
1217 Kontext "BereicheSchuetzen"
1219 if BereicheSchuetzen.Exists then
1220 Warnlog "Unable to enter passwort for section, because dialog is not up!"
1221 PasswortName.Settext Password
1222 BereicheSchuetzen.OK
1226 Active.Setpage TabSpalten
1227 Kontext "TabSpalten"
1230 Kontext "BereicheBearbeiten"
1231 BereicheBearbeiten.Cancel
1238 '****************************************************************************
1239 '** After the Wrapping section and Wrapped section are generated, the display
1242 '** This is <----|--------------------
1243 '** wrapped <---- Wrapped section <----| Wrapping section
1244 '** sections test <----|--------------------
1245 '*****************************************************************************
1246 testcase tWrappedSections_1
1248 Dim wrappingSection as String
1249 Dim wrappedSection as String
1250 Dim testText as String
1252 wrappingSection = "wrappingSection"
1253 wrappedSection = "wrappedSection"
1254 testText = "This is wrapped section test"
1256 PrintLog " - select Text inside a section and insert a section "
1260 PrintLog " insert wrapping section"
1261 Call wTypeKeys testText
1263 fInsertSection(wrappingSection)
1265 Call wTypeKeys "<Home>"
1266 Call wTypeKeys "<Mod1 Right>",2
1267 Call wTypeKeys "<Mod1 Shift Right>"
1270 PrintLog " insert wrapped section"
1271 fInsertSection(wrappedSection)
1275 Kontext "BereicheBearbeiten"
1276 Bereich.TypeKeys "<Up>"
1278 if BereichsName.GetText <> wrappingSection then Warnlog "The wrapping section names is wrong : " +BereichsName.GetText
1279 Bereich.TypeKeys "<Down>"
1280 if BereichsName.GetText <> wrappedSection then Warnlog "The wrapped section names is wrong : " +BereichsName.GetText
1282 BereicheBearbeiten.Cancel
1284 Warnlog "Can't generate wrapped section"
1291 '----------------------------------------------------------
1293 testcase tWrappedSections_2
1295 Dim wrappingSection as String
1296 Dim wrappedSection as String
1297 Dim testTextInFirstline as String
1298 Dim testTextInSecondline as String
1300 wrappingSection = "wrappingSection"
1301 wrappedSection = "wrappedSection"
1302 testTextInFirstline = "This is wrapped section test in first line"
1303 testTextInSecondline = "This is wrapped section test in second line"
1305 printlog " - select text across a section an insert a section "
1308 PrintLog " Insert wrapped section"
1309 Call wTypeKeys "<Return>"
1310 Call wTypeKeys(testTextInFirstline)
1311 Call wTypeKeys "<Return>"
1312 Call wTypeKeys(testTextInSecondline)
1313 Call wTypeKeys "<MOD1 HOME><SHIFT END>"
1314 Call fInsertSection(wrappedSection)
1318 PrintLog " Insert wrapping section"
1319 Call fInsertSection(wrappingSection)
1322 Kontext "BereicheBearbeiten"
1323 Bereich.TypeKeys "<UP>"
1324 if BereichsName.GetText <> wrappingSection then
1325 QAErrorLog "#102552# - The wrapping section names is wrong."
1327 Bereich.TypeKeys "<Down>"
1328 if BereichsName.GetText <> wrappedSection then
1329 QAErrorLog "#102552# - The wrapped section names is wrong."
1331 BereicheBearbeiten.Cancel
1333 Warnlog "Can't generate wrapping section"
1339 '----------------------------------------------------------
1341 testcase tWrappedSections_3
1343 Dim wrappingSection as String
1344 Dim wrappedSection as String
1345 Dim testText as String
1346 Dim contentInWrappedSection as String
1348 wrappingSection = "wrappingSection"
1349 wrappedSection = "wrappedSection"
1350 testText = "This is wrapped section test"
1351 contentInWrappedSection = "wrapped "
1353 PrintLog " - wrapped sections are following properties of the wrapping section - write protection"
1357 PrintLog " Open options and check 'Direct-Cursor' in options"
1360 PrintLog " insert wrapping section"
1361 Call wTypeKeys testText
1363 fInsertSection(wrappingSection)
1365 Call wTypeKeys "<Home>"
1366 Call wTypeKeys "<Mod1 Right>",2
1367 Call wTypeKeys "<Mod1 Shift Right>"
1369 PrintLog " insert wrapped section"
1370 fInsertSection(wrappedSection)
1372 PrintLog " format/section, choose protect in wrappingSection"
1375 Kontext "BereicheBearbeiten"
1376 Bereich.TypeKeys "<Up>"
1378 BereicheBearbeiten.OK
1380 Call wTypeKeys "<Home><Shift End>"
1384 if GetClipBoardtext = contentInWrappedSection then
1385 Call wTypeKeys "<Space>"
1387 if Active.Exists then
1390 Warnlog "- No warning when trying to write in protected area!"
1393 Warnlog "The focus is NOT in the wrapped section!"
1398 '----------------------------------------------------------
1400 testcase tWrappedSections_4
1402 Dim wrappingSection as String
1403 Dim wrappedSection as String
1404 Dim testText as String
1406 wrappingSection = "wrappingSection"
1407 wrappedSection = "wrappedSection"
1408 testText = "This is wrapped section test"
1410 printlog " - wrapped sections are following properties of the wrapping section - visibility"
1414 PrintLog " insert wrapping section"
1415 Call wTypeKeys "<RETURN>"
1416 Call wTypeKeys testText
1417 Call wTypeKeys "<SHIFT HOME>"
1418 Call fInsertSection(wrappingSection)
1419 Call wTypeKeys "<HOME>"
1420 Call wTypeKeys "<MOD1 RIGHT>" , 2
1421 Call wTypeKeys "<MOD1 SHIFT RIGHT>"
1422 PrintLog " insert wrapped section"
1423 Call fInsertSection(wrappedSection)
1424 PrintLog " format/section, choose hide checkbox in wrappingSection"
1427 Kontext "BereicheBearbeiten"
1428 Bereich.TypeKeys "<UP>"
1430 BereicheBearbeiten.OK
1437 warnlog "There should be nothing visible in the document but 'Edit / Copy' is available!"
1438 warnlog "Clipboard: " & GetClipBoardtext
1440 printlog "All sections are invisible."
1446 '----------------------------------------------------------
1448 testcase tWrappedSections_5
1450 Dim wrappingSection as String
1451 Dim wrappedSection as String
1452 Dim testText as String
1454 wrappingSection = "wrappingSection"
1455 wrappedSection = "wrappedSection"
1456 testText = "This is wrapped section test"
1458 PrintLog " - wrapped sections are following properties of the wrapping section - Foot-/endnote position"
1461 PrintLog " insert wrapping section"
1462 Call wTypeKeys testText
1464 Call fInsertSection(wrappingSection)
1466 Call wTypeKeys "<Home>"
1467 Call wTypeKeys "<Mod1 Right>",2
1468 Call wTypeKeys "<Mod1 Shift Right>"
1470 PrintLog " insert wrapped section"
1471 fInsertSection(wrappedSection)
1473 PrintLog " format/section, choose wrappingSection , then press options button,"
1474 PrintLog " + then tabpage footnotes/endnotes ,"
1475 PrintLog " + check collect at end of text in footnotes area and"
1476 PrintLog " + check collect at end of text in endnotes area"
1479 Kontext "BereicheBearbeiten"
1480 Bereich.TypeKeys "<Up>"
1481 'press options button
1484 'tabpage footnotes/endnotes
1486 Active.Setpage TabFussEndnoten
1487 Kontext "TabFussEndnoten"
1489 'check collect at end of text in footnotes area and
1490 'check collect at end of text in endnotes area
1491 FussnotenAmTextendeSammeln.Check
1492 EndnotenAmBereichsendeSammeln.Check
1495 Kontext "BereicheBearbeiten"
1496 BereicheBearbeiten.OK
1498 PrintLog " format/section again, choose wrappedSection , then press options button,"
1499 PrintLog " + then tabpage footnotes/endnotes ,"
1500 PrintLog " + check if collect at end of text in footnotes area and"
1501 PrintLog " + collect at end of text in endnotes area are checked"
1503 Kontext "BereicheBearbeiten"
1504 Bereich.TypeKeys "<Down>"
1505 'press options button
1508 'tabpage footnotes/endnotes
1510 Active.Setpage TabFussEndnoten
1511 Kontext "TabFussEndnoten"
1513 PrintLog " check if collect at end of text in footnotes area is checked"
1514 if FussnotenAmTextendeSammeln.IsChecked <> TRUE then
1515 Warnlog "The footnotes check option is NOT checked in wrappedSection"
1518 PrintLog " check if collect at end of text in endnotes area is checked"
1519 if EndnotenAmBereichsendeSammeln.IsChecked <> TRUE then
1520 Warnlog "The endnotes check option is NOT checked in wrappedSection"
1523 TabFussEndnoten.Cancel
1525 Kontext "BereicheBearbeiten"
1526 BereicheBearbeiten.Cancel
1531 '----------------------------------------------------------
1533 testcase tWrappedSections_6
1535 Dim wrappingSection as String
1536 Dim wrappedSection as String
1537 Dim testText as String
1538 Dim columnInwrappingSection as String
1539 Dim columnInwrappedSection as String
1541 wrappingSection = "wrappingSection"
1542 wrappedSection = "wrappedSection"
1543 testText = "This is wrapped section test"
1544 columnInwrappingSection = "2"
1545 columnInwrappedSection = "3"
1547 PrintLog " - The formatting of columns of sectionWrapping and sectionWrapped can be configured separately"
1551 PrintLog " insert wrapping section"
1552 Call wTypeKeys testText
1554 fInsertSection(wrappingSection)
1556 Call wTypeKeys "<Home>"
1557 Call wTypeKeys "<Mod1 Right>",2
1558 Call wTypeKeys "<Mod1 Shift Right>"
1560 PrintLog " insert wrapped section"
1561 fInsertSection(wrappedSection)
1563 PrintLog " format/section, choose wrappingSection , then press options button,"
1564 PrintLog " + then tabpage columns, set columns to $columnInwrappingSection"
1566 Kontext "BereicheBearbeiten"
1567 Bereich.TypeKeys "<Up>"
1568 'press options button
1572 Active.Setpage TabSpalten
1573 Kontext "TabSpalten"
1575 'Set column to $columnInwrappingSection
1576 Anzahl.Settext columnInwrappingSection
1579 PrintLog " format/section, choose wrappedSection , then press options button,"
1580 PrintLog " + then tabpage columns, set columns to $columnInwrappedSection"
1581 Kontext "BereicheBearbeiten"
1582 Bereich.TypeKeys "<Down>"
1583 'press options button
1587 Active.Setpage TabSpalten
1588 Kontext "TabSpalten"
1590 'Set column to $columnInwrappedSection
1591 Anzahl.Settext columnInwrappedSection
1594 Kontext "BereicheBearbeiten"
1595 BereicheBearbeiten.OK
1597 PrintLog " format/section again, then check if columns is configured separately"
1598 'check columns in wrappingSection
1601 Kontext "BereicheBearbeiten"
1602 Bereich.TypeKeys "<Up>"
1606 Active.Setpage TabSpalten
1607 Kontext "TabSpalten"
1608 if Anzahl.Gettext <> columnInwrappingSection then
1609 Warnlog "The volumn in wrappingSection should be " +columnInwrappingSection +" but get " + Anzahl.Gettext
1613 'check columns in wrappedSection
1614 Kontext "BereicheBearbeiten"
1615 Bereich.TypeKeys "<Down>"
1619 Active.Setpage TabSpalten
1620 Kontext "TabSpalten"
1621 if Anzahl.Gettext <> columnInwrappedSection then
1622 Warnlog "The volumn in wrappedSection should be " +columnInwrappedSection +" but get " + Anzahl.Gettext
1626 Kontext "BereicheBearbeiten"
1627 BereicheBearbeiten.Cancel
1631 '----------------------------------------------------------
1633 testcase tWrappedSections_7
1635 Dim wrappingSection as String
1636 Dim wrappedSection as String
1637 Dim testText as String
1638 Dim testFileWrapping , testFileWrapped as String
1640 wrappingSection = "wrappingSection"
1641 wrappedSection = "wrappedSection"
1642 testText = "This is wrapped section test"
1643 testFileWrapping = ConvertPath ( gTesttoolPath + "writer\optional\input\graphics\jolink.jpg")
1644 testFileWrapped = ConvertPath ( gTesttoolPath + "writer\optional\input\graphics\bild.jpg")
1646 PrintLog " - The background graphic of sectionWrapping and sectionWrapped can be configured separately"
1649 PrintLog " insert wrapping section"
1650 Call wTypeKeys testText
1652 Call fInsertSection(wrappingSection)
1654 Call wTypeKeys "<Home>"
1655 Call wTypeKeys "<Mod1 Right>",2
1656 Call wTypeKeys "<Mod1 Shift Right>"
1658 PrintLog " insert wrapped section"
1659 Call fInsertSection(wrappedSection)
1661 PrintLog " format/section,"
1662 PrintLog " + choose wrappingSection , then press options button ,"
1663 PrintLog " + then tabpage backgroud / graphic, browse a picture ,"
1664 PrintLog " + choose 'Position' in type ."
1666 Kontext "BereicheBearbeiten"
1667 Bereich.TypeKeys "<Up>"
1668 'press options button
1672 Active.SetPage TabHintergrund
1674 Kontext "TabHintergrund"
1680 Kontext "GrafikEinfuegenDlg"
1681 Dateiname.SetText testFileWrapping
1686 Kontext "TabHintergrund"
1690 PrintLog " choose wrappingSection , then press options button ,"
1691 PrintLog " + then tabpage backgroud / graphic, browse a picture ,"
1692 PrintLog " + choose 'area' in type ."
1693 Kontext "BereicheBearbeiten"
1694 Bereich.TypeKeys "<Down>"
1695 'press options button
1699 Active.SetPage TabHintergrund
1701 Kontext "TabHintergrund"
1707 Kontext "GrafikEinfuegenDlg"
1708 Dateiname.SetText testFileWrapped
1713 Kontext "TabHintergrund"
1717 Kontext "BereicheBearbeiten"
1718 BereicheBearbeiten.OK
1720 PrintLog " format/section again,"
1721 PrintLog " + choose wrappingSection , then press options button,"
1722 PrintLog " + then tabpage background / graphic,"
1723 PrintLog " + check if 'Position' is checked in type"
1725 Kontext "BereicheBearbeiten"
1726 Bereich.TypeKeys "<Up>"
1727 'press options button
1731 Active.SetPage TabHintergrund
1733 Kontext "TabHintergrund"
1737 if Position.IsChecked <> TRUE then
1738 Warnlog "'Position' is NOT checked in type"
1741 TabHintergrund.Cancel
1743 PrintLog " choose wrappedSection , then press options button,"
1744 PrintLog " + then tabpage backgroud / graphic,"
1745 PrintLog " + check if 'Area' is checked in type ."
1746 Kontext "BereicheBearbeiten"
1747 Bereich.TypeKeys "<Down>"
1748 'press options button
1752 Active.SetPage TabHintergrund
1754 Kontext "TabHintergrund"
1758 if Flaeche.IsChecked <> TRUE then
1759 Warnlog "'Area' is NOT checked in type"
1761 TabHintergrund.Cancel
1763 Kontext "BereicheBearbeiten"
1764 BereicheBearbeiten.Cancel