diff options
Diffstat (limited to 'testautomation/framework/optional/includes/w_grid_layout1.inc')
-rwxr-xr-x[-rw-r--r--] | testautomation/framework/optional/includes/w_grid_layout1.inc | 282 |
1 files changed, 149 insertions, 133 deletions
diff --git a/testautomation/framework/optional/includes/w_grid_layout1.inc b/testautomation/framework/optional/includes/w_grid_layout1.inc index 737cf850ad65..16ca31b09fa4 100644..100755 --- a/testautomation/framework/optional/includes/w_grid_layout1.inc +++ b/testautomation/framework/optional/includes/w_grid_layout1.inc @@ -25,7 +25,7 @@ ' '/************************************************************************ '* -'* owner : thorsten.bosbach@sun.com +'* owner : thorsten.bosbach@oracle.com '* '* short description : Grid Layout for CJK test in Writer '* @@ -35,11 +35,17 @@ private const SOURCE_PATH = "framework\optional\input\CJK\" testcase tTextGridDialog_1 + dim lsSave( 3 ) as string + dim lbSave( 3 ) as boolean + + kontext "Navigator" + hCloseDialog( Navigator, "close,optional" ) + '/// Check if tabpage 'Text Grid' disappears when "Asian Language support" is NOT checked if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then Call CheckAsianLanguageSupport("Off") hNewDocument() - FormatPageWriter + hUseAsyncSlot( "FormatPageWriter" ) try Kontext Active.SetPage TabGrid @@ -57,26 +63,33 @@ testcase tTextGridDialog_1 '/// Check if tabpage 'Text Grid' appears when "Asian Language support" is checked Call CheckAsianLanguageSupport("On") - sleep 5 - FormatPageWriter - Kontext - if Active.exists (10) then - try - Kontext - Active.SetPage TabGrid - Kontext "TabGrid" - TabGrid.Cancel - catch - Kontext - Active.SetPage TabSeite - Kontext "TabSeite" - TabSeite.Cancel - warnlog "Couldn't get Tabpage: Grid Text" - endcatch - else - warnlog "FormatPageWriter didn't bring up ndialog" - endif - hCloseDocument() + hNewDocument + ToolsOptions + hToolsOptions ( "StarOffice", "General" ) + + printlog " - save old data" + lsSave ( 1 ) = Zweistellig.GetText + lbSave ( 1 ) = Aktivieren.IsChecked + Aktivieren.Check + if gPlatgroup = "w95" then + lbSave (2) = StarOfficeDialogeBenutzen.IsChecked + end if + lbSave ( 3 ) = DruckenStatus.IsChecked + lsSave ( 3 ) = StyleSheet.GetSelText + + printlog " - invert/change data" + Zweistellig.SetText "1950" + Zuruecksetzen.Click + if gPlatgroup = "w95" then + if lbSave (2) = TRUE then StarOfficeDialogeBenutzen.Uncheck else StarOfficeDialogeBenutzen.Check + end if + If lbSave ( 3 ) = TRUE then DruckenStatus.Uncheck else DruckenStatus.Check + StyleSheet.Select 3 + + Kontext "ExtrasOptionenDlg" + hCloseDialog( ExtrasOptionenDlg, "ok" ) + hFileCloseAll() + endcase '------------------------------------------------------------------------- @@ -94,30 +107,28 @@ testcase tTextGridDialog_2 Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile ) sMakeReadOnlyDocumentEditable - FormatPageWriter + hUseAsyncSlot( "FormatPageWriter" ) Kontext if active.exists(5) then Active.SetPage TabGrid endif Kontext "TabGrid" NoGrid.Check - Sleep 1 - TabGrid.OK - Sleep 1 + hCloseDialog( TabGrid, "ok" ) + '/// Active navigator dialogue , set page to '2' and wait for a while Kontext ViewNavigator Kontext "NavigatorWriter" - - Seitennummer.SetText "2" - Sleep 5 - hCloseNavigator + Seitennummer.SetText "2" : Wait( 2000 ) + kontext "Navigator" + hCloseDialog( Navigator, "close" ) '/// In No Grid mode, there should be only 1 page, the focus is before the first line Kontext "DocumentWriter" Call DocumentWriter.TypeKeys "<End>" - Sleep 1 + wait( 200 ) ' sleep 1 Call DocumentWriter.TypeKeys "<Shift Left>" hUseAsyncSlot( "EditCopy" ) @@ -142,7 +153,7 @@ testcase tTextGridDialog_3 '/// + set 10 line/page Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile ) sMakeReadOnlyDocumentEditable - FormatPageWriter + hUseAsyncSlot( "FormatPageWriter" ) Kontext if active.exists(5) then Active.SetPage TabGrid @@ -150,22 +161,19 @@ testcase tTextGridDialog_3 Kontext "TabGrid" LinesGrid.Check LinesPerPage.SetText sLinesPerPage - Sleep 1 - TabGrid.OK - Sleep 1 + hCloseDialog( TabGrid, "ok" ) '/// Active navigator dialogue , set page to '2' and wait for a while Kontext ViewNavigator Kontext "NavigatorWriter" - - Seitennummer.SetText "2" - Sleep 5 - hCloseNavigator + Seitennummer.SetText "2" : Wait( 2000 ) + kontext "Navigator" + hCloseDialog( Navigator, "close" ) Kontext "DocumentWriter" Call DocumentWriter.TypeKeys "<End>" - Sleep 1 + wait( 200 ) ' sleep 1 Call DocumentWriter.TypeKeys "<Shift Left>" hUseAsyncSlot( "EditCopy" ) @@ -192,7 +200,7 @@ testcase tTextGridDialog_4 '/// + set 10 line/page and 9 characters/line Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile ) sMakeReadOnlyDocumentEditable - FormatPageWriter + hUseAsyncSlot( "FormatPageWriter" ) Kontext if active.exists(5) then Active.SetPage TabGrid @@ -201,22 +209,19 @@ testcase tTextGridDialog_4 CharsGrid.Check LinesPerPage.SetText sLinesPerPage CharsPerLine.SetText sCharsPerLine - Sleep 1 - TabGrid.OK - Sleep 1 + hCloseDialog( TabGrid, "ok" ) '/// Active navigator dialogue , set page to '2' and wait for a while Kontext ViewNavigator Kontext "NavigatorWriter" - - Seitennummer.SetText "2" - Sleep 5 - hCloseNavigator + Seitennummer.SetText "2" : Wait( 2000 ) + kontext "Navigator" + hCloseDialog( Navigator, "close" ) Kontext "DocumentWriter" Call DocumentWriter.TypeKeys "<End>" - Sleep 1 + wait( 200 ) ' sleep 1 Call DocumentWriter.TypeKeys "<Shift Left>" hUseAsyncSlot( "EditCopy" ) @@ -233,7 +238,7 @@ testcase tGridDisplay_1 '/// format / page / tabpage Text grid '/// + check "display grid" and check "print grid" - FormatPageWriter + hUseAsyncSlot( "FormatPageWriter" ) Kontext if active.exists(5) then Active.SetPage TabGrid @@ -241,14 +246,12 @@ testcase tGridDisplay_1 Kontext "TabGrid" CharsGrid.Check Display.Check - Sleep 1 PrintGrid.Check - Sleep 1 - TabGrid.OK - Sleep 1 + hCloseDialog( TabGrid, "ok" ) + '/// Print to printer - FilePrint + hUseAsyncSlot( "FilePrint" ) Kontext "Active" if ( Active.Exists( 5 ) ) then if Active.GetRT() = 304 then @@ -262,7 +265,7 @@ testcase tGridDisplay_1 else Kontext "Printing" if ( Printing.exists( 2 )) then - printing.cancel() + Printing.OK() Printing.notExists( 5 ) endif @@ -283,11 +286,8 @@ testcase tGridDisplay_1 Kontext "TabGrid" CharsGrid.Check Display.Check - Sleep 1 PrintGrid.UnCheck - Sleep 1 - TabGrid.OK - Sleep 1 + hCloseDialog( TabGrid, "ok" ) '/// Print to printer FilePrint @@ -303,10 +303,8 @@ testcase tGridDisplay_1 endif else Kontext "Printing" - if( Printing.exists( 1 )) then - printing.cancel() - Printing.notExists( 5 ) - endif + hCloseDialog( Printing, "ok" ) + kontext if ( active.exists( 2 ) ) then qaErrorLog active.getText @@ -333,7 +331,7 @@ testcase tUserDefineLayout_1 '/// Format/page , set lines per page to 20, and set charsets per line to 2 '/// + wait for a moment , then check the the number of lines per page. - FormatPageWriter + hUseAsyncSlot( "FormatPageWriter" ) Kontext if active.exists(5) then Active.SetPage TabGrid @@ -342,16 +340,13 @@ testcase tUserDefineLayout_1 CharsGrid.Check LinesPerPage.SetText sLinesPerPage - Sleep 2 CharsPerLine.SetText sCharsPerLine - Sleep 2 'This step is no use, just let the LinesPerPage change the number CharsGrid.Check if LinesPerPage.GetText <> sExpectLinesPerPage AND LinesPerPage.GetText <> sExpectLinesPerPage1 then - Warnlog( "#i106381# - LInes per page changed" ) - printlog( "The lines per page should be" + sExpectLinesPerPage & " OR " & sExpectLinesPerPage1 & " but get " &LinesPerPage.GetText ) + Warnlog "The lines per page should be" + sExpectLinesPerPage + " OR " + sExpectLinesPerPage1 +" but get " +LinesPerPage.GetText endif TabGrid.Cancel @@ -362,7 +357,6 @@ endcase '------------------------------------------------------------------------- testcase tFontSizeChanges_1 - '/// Change the font size to bigger enough will change the layout Dim testFile , sCorrectResult as String Dim sLinesPerPage , sCharsPerLine as String @@ -381,10 +375,9 @@ testcase tFontSizeChanges_1 Kontext "FormatObjectbar" Schriftgroesse.Select "60" Schriftgroesse.TypeKeys "<Return>" - Sleep 1 Kontext "DocumentWriter" - FormatPageWriter + hUseAsyncSlot( "FormatPageWriter" ) Kontext if active.exists(5) then Active.SetPage TabGrid @@ -393,11 +386,11 @@ testcase tFontSizeChanges_1 if TabGrid.exists(5) then sTemp = LinesPerPage.GetText if sTemp <> sLinesPerPage then - Warnlog "The lines per page should be: '" & sLinesPerPage & "'; but get: '" & sTemp & "'" + Warnlog "The lines per page should be: '" + sLinesPerPage + "'; but get: '" + sTemp + "'" endif sTemp = CharsPerLine.GetText if sTemp <> sCharsPerLine then - Warnlog "The chars per line should be: '" & sCharsPerLine & "'; but get: '" &sTemp & "'" + Warnlog "The chars per line should be: '" + sCharsPerLine + "'; but get: '" +sTemp + "'" endif TabGrid.Cancel else @@ -408,21 +401,21 @@ testcase tFontSizeChanges_1 ViewNavigator Kontext "NavigatorWriter" if NavigatorWriter.exists(5) then - Seitennummer.SetText "2" - Sleep 5 + Seitennummer.SetText "2" : Wait( 2000 ) + kontext "Navigator" + hCloseDialog( Navigator, "close" ) else - warnlog "Navigator not available" + warnlog( "Navigator not open" ) endif - hCloseNavigator Kontext "DocumentWriter" - sleep 3 + wait( 200 ) ' sleep 3 Call DocumentWriter.TypeKeys "<Shift Right>" hUseAsyncSlot( "EditCopy" ) sTemp = GetClipboardText if sTemp <> sCorrectResult then - Warnlog "Don't get the expected result , hope to be: '" & sCorrectResult & "'; but get: '" & sTemp & "'" + Warnlog "Don't get the expected result , hope to be: '" + sCorrectResult + "'; but get: '" + sTemp + "'" endif Call hCloseDocument @@ -431,41 +424,51 @@ endcase '------------------------------------------------------------------------- testcase tRubyText_1 - '/// If Ruby Text is applied and longer than its Base Text it will stretch over more grid cells than the base text itself. - Dim testFile , sRubyText as String - testFile = "rubytest.sxw" - sRubyText = "Ruby Test Text ....................." + '/// If Ruby Text is applied and longer than its Base Text it will stretch over more grid cells than the base text itself. + const TEST_FILE = "rubytest.sxw" + const RUBY_TEXT = "Ruby Test Text ....................." + printlog( "Create a new document" ) Call hNewDocument - '/// open a test file , and insert long ruby test text - Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile ) - sMakeReadOnlyDocumentEditable + printlog( "Open test file" ) + Call hFileOpen ( gTesttoolPath + SOURCE_PATH + TEST_FILE ) + + printlog( "Remove write protection of document (if set)" ) + Call sMakeReadOnlyDocumentEditable() + Kontext "DocumentWriter" + printlog( "Mark character to the right of current cursor position" ) Call DocumentWriter.TypeKeys "<Shift Right>" - Sleep 1 - FormatRuby + printlog( "Open <Format Ruby> dialog" ) + hUseAsyncSlot( "FormatRuby" ) + Kontext "RubyDialog" - Sleep 3 - RubyText1.setText sRubyText - Sleep 2 - RubyDialog.OK - Sleep 2 - DialogClose.Click - Sleep 1 + if ( RubyDialog.exists( 3 ) ) then + RubyText1.setText( RUBY_TEXT ) + RubyDialog.OK + DialogClose.Click + else + warnlog( "Ruby dialog not open" ) + endif Kontext "DocumentWriter" - FormatAutoformatApply - Sleep 2 + printlog( "Apply Autoformat" ) + hUseAsyncSlot( "FormatAutoformatApply" ) + + printlog( "Select last character in current line" ) Call DocumentWriter.TypeKeys "<End>" - Sleep 2 + Wait( 200 ) Call DocumentWriter.TypeKeys "<Shift Left>" + Wait( 200 ) + + printlog( "<EditCopy>" ) hUseAsyncSlot( "EditCopy" ) if NOT(GetClipboardText = "5" OR GetClipboardText = "6") then - Warnlog "Don't get the correct result after inserting ruby text! Get " & GetClipboardText + Warnlog "Don't get the correct result after inserting ruby text! Get " + GetClipboardText endif Call hCloseDocument @@ -475,47 +478,54 @@ endcase testcase tIndentsTest_1 '/// Indents should work and always indenting as close as possible to their measurements by snapping to the appropriate grid cell. Tabs therefore will be ignored. - Dim testFile , sCorrectPage1 , sCorrectPage2 as String - testFile = "IndentsTest.sxw" - sCorrectPage1 = "1" - sCorrectPage2 = "2" + const TEST_FILE = "IndentsTest.sxw" + const CORRECT_PAGE_1 = "1" + const CORRECT_PAGE_2 = "2" Call hNewDocument '/// open a test file , and press TAB in second line - Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile ) + Call hFileOpen ( gTesttoolPath + SOURCE_PATH + TEST_FILE ) + sMakeReadOnlyDocumentEditable + Kontext "DocumentWriter" Call DocumentWriter.TypeKeys "<Down>" - Sleep 1 + wait( 200 ) ' sleep 1 Call DocumentWriter.TypeKeys "<Tab>" - Sleep 1 + wait( 200 ) ' sleep 1 Call DocumentWriter.TypeKeys "<End>" - Sleep 1 + wait( 200 ) ' sleep 1 '/// Active navigator dialogue , check if the page number is 1 Kontext ViewNavigator Kontext "NavigatorWriter" - if Seitennummer.GetText <> sCorrectPage1 then Warnlog "First test :Something wrong in indents test!" - hCloseNavigator + if ( Seitennummer.GetText <> CORRECT_PAGE_1 ) then + Warnlog "First test :Something wrong in indents test!" + endif + kontext "Navigator" + hCloseDialog( Navigator, "close" ) '/// press TAB in second line again Kontext "DocumentWriter" Call DocumentWriter.TypeKeys "<Home>" - Sleep 1 + wait( 200 ) ' sleep 1 Call DocumentWriter.TypeKeys "<Tab>" - Sleep 1 + wait( 200 ) ' sleep 1 Call DocumentWriter.TypeKeys "<End>" - Sleep 1 + wait( 200 ) ' sleep 1 '/// Active navigator dialogue , check if the page number is 2 Kontext ViewNavigator Kontext "NavigatorWriter" - if Seitennummer.GetText <> sCorrectPage2 then Warnlog "Second test :Something wrong in indents test!" - hCloseNavigator + if ( Seitennummer.GetText <> CORRECT_PAGE_2 ) then + Warnlog "Second test :Something wrong in indents test!" + endif + kontext "Navigator" + hCloseDialog( Navigator, "close" ) Call hCloseDocument endcase @@ -525,23 +535,23 @@ endcase testcase tObjectsTest_1 '/// If objects are anchored to text they will "wander" with its surrounding text. '/// If they are anchored as character they will snap to the appropriate grid cell (since they are a character). - Dim testFile , sCorrectPage1 , sCorrectPage2 as String - testFile = "objectsTest.sxw" - sCorrectPage1 = "1" - sCorrectPage2 = "2" + const TEST_FILE = "objectsTest.sxw" + const CORRECT_PAGE_1 = "1" + const CORRECT_PAGE_2 = "2" Call hNewDocument '/// open a test file , and press TAB in second line - Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile ) + Call hFileOpen ( gTesttoolPath + SOURCE_PATH + TEST_FILE ) '/// If object is anchored as Character , check if it will snap to the appropriate grid cell fStartupNavigator( "OLEObject" , 1 ) - Sleep 1 + wait( 200 ) ' sleep 1 Auswahlliste.TypeKeys "<Return>" - Sleep 1 - hCloseNavigator + wait( 200 ) ' sleep 1 + kontext "Navigator" + hCloseDialog( Navigator, "close" ) Kontext FormatAnchorAsCharacter @@ -550,26 +560,32 @@ testcase tObjectsTest_1 ViewNavigator Kontext "NavigatorWriter" - Seitennummer.SetText sCorrectPage2 - Sleep 5 - if Seitennummer.GetText <> sCorrectPage2 then Warnlog "Something wrong when object is anchored as Character!" - hCloseNavigator + Seitennummer.SetText( CORRECT_PAGE_1 ) + WaitSlot( 5000 ) ' wait( 200 ) ' sleep 5 + if ( Seitennummer.GetText <> CORRECT_PAGE_1 ) then + Warnlog "Something wrong when object is anchored as Character!" + endif + kontext "Navigator" + hCloseDialog( Navigator, "close" ) '/// If object is anchored to Character , check if it will NOT snap to the appropriate grid cell fStartupNavigator( "OLEObject" , 1 ) Auswahlliste.TypeKeys "<Return>" - hCloseNavigator + kontext "Navigator" + hCloseDialog( Navigator, "close" ) Kontext FormatAnchorToCharacter ViewNavigator Kontext "NavigatorWriter" - Seitennummer.SetText sCorrectPage2 - Sleep 5 - if Seitennummer.GetText <> sCorrectPage1 then Warnlog "Something wrong when object is anchored to Character!" - hCloseNavigator - Kontext + Seitennummer.SetText( CORRECT_PAGE_2 ) + WaitSlot( 5000 ) ' wait( 200 ) ' sleep 5 + if ( Seitennummer.GetText <> CORRECT_PAGE_1 ) then + Warnlog "Something wrong when object is anchored to Character!" + endif + kontext "Navigator" + hCloseDialog( Navigator, "close" ) Call hCloseDocument endcase |