'encoding UTF-8 Do not remove or change this line!
'*************************************************************************
'
' Licensed to the Apache Software Foundation (ASF) under one
' or more contributor license agreements. See the NOTICE file
' distributed with this work for additional information
' regarding copyright ownership. The ASF licenses this file
' to you under the Apache License, Version 2.0 (the
' "License"); you may not use this file except in compliance
' with the License. You may obtain a copy of the License at
'
' http://www.apache.org/licenses/LICENSE-2.0
'
' Unless required by applicable law or agreed to in writing,
' software distributed under the License is distributed on an
' "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
' KIND, either express or implied. See the License for the
' specific language governing permissions and limitations
' under the License.
'
'*************************************************************************
'*
'* short description : Test of Hangul/Hanja Conversion - 2
'*
'************************************************************************
'*
' #1 tHHConversion_1 'Hanja/Hangul (Korean -> Chinese)
' #1 tHHConversion_2 'Hanja/Hangul (Chinese -> Korean)
' #1 tHHConversion_3 'Hanja(Hangul) (Korean -> Chinese)
' #1 tHHConversion_4 'Hanja(Hangul) (Chinese -> Korean)
' #1 tHHConversion_5 'Hangul(Hanja) (Korean -> Chinese)
' #1 tHHConversion_6 'Hangul(Hanja) (Chinese -> Korean)
' #1 tHHConversion_7 ''Hanja As Ruby Above Hangul' (Korean -> Chinese)
' #1 tHHConversion_8 ''Hanja As Ruby Above Hangul' (Chinese -> Korean)
' #1 tHHConversion_9 ''Hanja As Ruby Below Hangul' (Korean -> Chinese)
' #1 tHHConversion_10 ''Hanja As Ruby Below Hangul' (Chinese -> Korean)
' #1 tHHConversion_11 ''Hangul As Ruby Above Hanja' (Korean -> Chinese)
' #1 tHHConversion_12 ''Hangul As Ruby Above Hanja' (Chinese -> Korean)
' #1 tHHConversion_13 ''Hangul As Ruby Below Hanja' (Korean -> Chinese)
' #1 tHHConversion_14 ''Hangul As Ruby Below Hanja' (Chinese -> Korean)
' #1 tHHConversion_15 'Hangul Only
' #1 tHHConversion_16 'Hanja Only
' #1 tHHConversion_17 'Ignore
' #1 tHHConversion_18 'Always Ignore -1
' #1 tHHConversion_19 'Always Ignore -2
' #1 tHHConversion_20 'Replace
' #1 tHHConversion_21 'Always Replace -1
' #1 tHHConversion_22 'Always Replace -2
' #1 tHHConversion_23 'Always Replace -3
' #1 tHHConversion_24 'Replace by character -1
' #1 tHHConversion_25 'Replace by character -2(Always Ignore)
' #1 tHHConversion_26 'Replace by character -3(Always Replace)
'*
'\***********************************************************************
testcase tHHConversion_1
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sResult as String
Dim i as Integer
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\KoreanToChinese.sxw")
sResult = "漢字入力은該當하入力하中文信息"
printlog "- Hanja/Hangul (Korean -> Chinese)"
'/// Simple convert from Hangul into Hanja
Call hNewDocument
'/// Open a test file , which includes some
'/// + Korean chacters and chinese character
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion ,
'/// + Press Peplace button
ToolsLanguageHangulHanjaConversion : WaitSlot
Kontext "HangulHanjaConversion"
For i = 1 to 15
if NOT HangulHanjaConversion.Exists then
Exit for
end if
ReplaceBtn.Click
Sleep 1
next i
'/// Check if the result is correct
Call wTypeKeys ""
Call wTypeKeys ""
EditCopy
Sleep 1
if GetClipboardText <> sResult then
Warnlog "Conversion result not: " & sResult & " but: " & GetClipboardText
end if
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_2
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sResult as String
Dim i as Integer
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\ChineseToKorean.sxw")
sResult = "상산하乡황하长강력은해당"
printlog "- Hanja/Hangul (Chinese -> Korean)"
'/// Simple convert from Hanja into Hangul
Call hNewDocument
'/// Open a test file , which includes some
'/// + Chinese character and Korean chacters
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , check hanja only .
'/// + Press Peplace button
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
HanjaOnly.Check
For i = 1 to 15
if NOT HangulHanjaConversion.Exists then
Exit for
end if
ReplaceBtn.Click
Sleep 1
next i
'/// Check if the result is correct
Call wTypeKeys ""
Call wTypeKeys ""
EditCopy
Sleep 1
if GetClipboardText <> sResult then
Warnlog "Conversion doesn't work well !"
end if
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_3
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sResult as String
Dim i as Integer
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\KoreanToChinese.sxw")
sResult = "漢字(한자)入力(입력)은該當(해당)하入力(입력)하中文信息"
printlog "- Hanja(Hangul) (Korean -> Chinese)"
'/// Test Hanja(Hangul) - Simple convert from Hangul into Hanja
Call hNewDocument
'/// Open a test file , which includes some
'/// + Korean chacters and chinese character
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , check Hanja(Hangul)
'/// + Press Peplace button
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
HanjaHangul.Check
Sleep 1
For i = 1 to 15
if NOT HangulHanjaConversion.Exists then
Exit for
end if
ReplaceBtn.Click
Sleep 1
next i
'/// Check if the result is correct
Call wTypeKeys ""
Call wTypeKeys ""
EditCopy
Sleep 1
if GetClipboardText <> sResult then
Warnlog "Conversion result not: " & sResult & " but: " & GetClipboardText
end if
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_4
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sResult as String
Dim i as Integer
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\ChineseToKorean.sxw")
sResult = "上山下(상산하)乡黄河(황하)长江(강)력은該當(해당)"
printlog "- Hanja(Hangul) (Chinese -> Korean)"
'/// Test Hanja(Hangul) - Simple convert from Hanja into Hangul
Call hNewDocument
'/// Open a test file , which includes some
'/// + Chinese character and Korean chacters
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , check Hanja(Hangul).
'/// + Press Peplace button
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
HanjaHangul.Check
Sleep 1
For i = 1 to 15
if NOT HangulHanjaConversion.Exists then
Exit for
end if
ReplaceBtn.Click
Sleep 1
next i
'/// Check if the result is correct
Call wTypeKeys ""
Call wTypeKeys ""
EditCopy
Sleep 1
if GetClipboardText <> sResult then
Warnlog "Conversion result not: " & sResult & " but: " & GetClipboardText
end if
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_5
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sResult as String
Dim i as Integer
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\KoreanToChinese.sxw")
sResult = "한자(漢字)입력(入力)은해당(該當)하입력(入力)하中文信息"
printlog "- Hangul(Hanja) (Korean -> Chinese)"
'/// Test Hangul(Hanja) - Simple convert from Hangul into Hanja
Call hNewDocument
'/// Open a test file , which includes some
'/// + Korean chacters and chinese character
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , check Hangul(Hanja) ,
'/// + Press Peplace button
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
HangulHanja.Check
Sleep 1
For i = 1 to 15
if NOT HangulHanjaConversion.Exists then
Exit for
end if
ReplaceBtn.Click
Sleep 1
next i
'/// Check if the result is correct
Call wTypeKeys ""
Call wTypeKeys ""
EditCopy
Sleep 1
if GetClipboardText <> sResult then
Warnlog "Conversion result not: " & sResult & " but: " & GetClipboardText
end if
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_6
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sResult as String
Dim i as Integer
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\ChineseToKorean.sxw")
sResult = "상산하(上山下)乡황하(黄河)长강(江)력은해당(該當)"
printlog "- Hangul(Hanja) (Chinese -> Korean)"
'/// Test Hangul(Hanja) - Simple convert from Hanja into Hangul
Call hNewDocument
'/// Open a test file , which includes some
'/// + Chinese character and Korean chacters
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , check Hangul(Hanja),
'/// + Press Peplace button
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
HangulHanja.Check
Sleep 1
For i = 1 to 15
if NOT HangulHanjaConversion.Exists then
Exit for
end if
ReplaceBtn.Click
Sleep 1
next i
'/// Check if the result is correct
Call wTypeKeys ""
Call wTypeKeys ""
EditCopy
Sleep 1
if GetClipboardText <> sResult then
Warnlog "Conversion result not: " & sResult & " but: " & GetClipboardText
end if
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_7
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sHangulText , sHanjaText as String
Dim iAlignment , iPosition as Integer
sHangulText = "한자"
sHanjaText = "漢字"
iAlignment = 2 'Center
iPosition = 1 'Top
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\KoreanToChinese.sxw")
printlog "- 'Hanja As Ruby Above Hangul' (Korean -> Chinese)"
'/// Test 'Hanja As Ruby Above Hangul' - Simple convert from Hangul into Hanja
Call hNewDocument
'/// Open a test file , which includes some Korean chacters
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , check 'Hanja As Ruby Above Hangul' ,
'/// + press Peplace button
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
HanjaAsRubyAbove.Check
Sleep 1
ReplaceBtn.Click
Sleep 1
HangulHanjaConversion.Close
Call wTypeKeys ""
'/// Format/Ruby , check if the result is correct
FormatRuby
Kontext "RubyDialog"
Sleep 4
if BasisText1.GetText <> sHangulText then
Warnlog "Base text : hope to get " & sHangulText & " but get " & BasisText1.GetText
end if
if RubyText1.GetText <> sHanjaText then
Warnlog "Ruby text : hope to get " & sHanjaText & " but get " & RubyText1.GetText
end if
if Adjust.GetSelIndex <> iAlignment then
Warnlog "Alignment : hope to get " & Adjust.GeTSelText(iAlignment) & " but get " & Adjust.GeTSelText
end if
if RubyPosition.GetSelIndex <> iPosition then
Warnlog "Position: hope to get " & RubyPosition.GeTSelText(iPosition) & " but get " & RubyPosition.GeTSelText
end if
RubyDialog.Close
Sleep 2
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_8
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sHangulText , sHanjaText as String
Dim iAlignment , iPosition as Integer
sHangulText = "상산하"
sHanjaText = "上山下"
iAlignment = 2 'Center
iPosition = 1 'Top
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\ChineseToKorean.sxw")
printlog "- 'Hanja As Ruby Above Hangul' (Chinese -> Korean)"
'/// Test 'Hanja As Ruby Above Hangul' - Simple convert from Hanja into Hangul
Call hNewDocument
'/// Open a test file , which includes some Chinese chacters
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , check 'Hanja As Ruby Above Hangul' ,
'/// + press Peplace button
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
HanjaAsRubyAbove.Check
Sleep 1
ReplaceBtn.Click
Sleep 1
HangulHanjaConversion.Close
Call wTypeKeys ""
'/// Format/Ruby , check if the result is correct
FormatRuby
Kontext "RubyDialog"
Sleep 4
if BasisText1.GetText <> sHangulText then
Warnlog "#i39186# Base text : hope to get " & sHangulText & " but get " & BasisText1.GetText
end if
if RubyText1.GetText <> sHanjaText then
Warnlog "#i39186# Ruby text : hope to get " & sHanjaText & " but get " & RubyText1.GetText
end if
if Adjust.GetSelIndex <> iAlignment then
Warnlog "Alignment : hope to get " & Adjust.GeTSelText(iAlignment) & " but get " & Adjust.GeTSelText
end if
if RubyPosition.GetSelIndex <> iPosition then
Warnlog "Position: hope to get " & RubyPosition.GeTSelText(iPosition) & " but get " & RubyPosition.GeTSelText
end if
RubyDialog.Close
Sleep 2
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_9
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sHangulText , sHanjaText as String
Dim iAlignment , iPosition as Integer
sHangulText = "한자"
sHanjaText = "漢字"
iAlignment = 2 'Center
iPosition = 2 'Bottom
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\KoreanToChinese.sxw")
printlog "- 'Hanja As Ruby Below Hangul' (Korean -> Chinese)"
'/// Test 'Hanja As Ruby Below Hangul' - Simple convert from Hangul into Hanja
Call hNewDocument
'/// Open a test file , which includes some Korean chacters
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , check 'Hanja As Ruby Below Hangul' ,
'/// + press Peplace button
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
HanjaAsRubyBelow.Check
Sleep 1
ReplaceBtn.Click
Sleep 1
HangulHanjaConversion.Close
Call wTypeKeys ""
'/// Format/Ruby , check if the result is correct
FormatRuby
Kontext "RubyDialog"
Sleep 4
if BasisText1.GetText <> sHangulText then
Warnlog "Base text : hope to get " & sHangulText & " but get " & BasisText1.GetText
end if
if RubyText1.GetText <> sHanjaText then
Warnlog "Ruby text : hope to get " & sHanjaText & " but get " & RubyText1.GetText
end if
if Adjust.GetSelIndex <> iAlignment then
Warnlog "Alignment : hope to get " & Adjust.GeTSelText(iAlignment) & " but get " & Adjust.GeTSelText
end if
if RubyPosition.GetSelIndex <> iPosition then
Warnlog "Position: hope to get " & RubyPosition.GeTSelText(iPosition) & " but get " & RubyPosition.GeTSelText
end if
RubyDialog.Close
Sleep 2
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_10
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sHangulText , sHanjaText as String
Dim iAlignment , iPosition as Integer
sHangulText = "상산하"
sHanjaText = "上山下"
iAlignment = 2 'Center
iPosition = 2 'Bottom
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\ChineseToKorean.sxw")
printlog "- 'Hanja As Ruby Below Hangul' (Chinese -> Korean)"
'/// Test 'Hanja As Ruby Below Hangul' - Simple convert from Hanja into Hangul
Call hNewDocument
'/// Open a test file , which includes some Chinese chacters
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , check 'Hanja As Ruby Below Hangul' ,
'/// + press Peplace button
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
HanjaAsRubyBelow.Check
Sleep 1
ReplaceBtn.Click
Sleep 1
HangulHanjaConversion.Close
Call wTypeKeys ""
'/// Format/Ruby , check if the result is correct
FormatRuby
Kontext "RubyDialog"
Sleep 4
if BasisText1.GetText <> sHangulText then
Warnlog "#i39186# Base text : hope to get " & sHangulText & " but get " & BasisText1.GetText
end if
if RubyText1.GetText <> sHanjaText then
Warnlog "#i39186# Ruby text : hope to get " & sHanjaText & " but get " & RubyText1.GetText
end if
if Adjust.GetSelIndex <> iAlignment then
Warnlog "Alignment : hope to get " & Adjust.GeTSelText(iAlignment) & " but get " & Adjust.GeTSelText
end if
if RubyPosition.GetSelIndex <> iPosition then
Warnlog "Position: hope to get " & RubyPosition.GeTSelText(iPosition) & " but get " & RubyPosition.GeTSelText
end if
RubyDialog.Close
Sleep 2
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_11
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sHangulText , sHanjaText as String
Dim iAlignment , iPosition as Integer
sHangulText = "한자"
sHanjaText = "漢字"
iAlignment = 2 'Center
iPosition = 1 'Top
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\KoreanToChinese.sxw")
printlog "- 'Hangul As Ruby Above Hanja' (Korean -> Chinese)"
'/// Test 'Hangul As Ruby Above Hanja' - Simple convert from Hangul into Hanja
Call hNewDocument
'/// Open a test file , which includes some Korean chacters
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , check 'Hangul As Ruby Above Hanja' ,
'/// + press Peplace button
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
HangulAsRubyAbove.Check
Sleep 1
ReplaceBtn.Click
Sleep 1
HangulHanjaConversion.Close
Call wTypeKeys ""
'/// Format/Ruby , check if the result is correct
FormatRuby
Kontext "RubyDialog"
Sleep 4
if BasisText1.GetText <> sHanjaText then
Warnlog "Base text : hope to get " & sHangulText & " but get " & BasisText1.GetText
end if
if RubyText1.GetText <> sHangulText then
Warnlog "Ruby text : hope to get " & sHanjaText & " but get " & RubyText1.GetText
end if
if Adjust.GetSelIndex <> iAlignment then
Warnlog "Alignment : hope to get " & Adjust.GeTSelText(iAlignment) & " but get " & Adjust.GeTSelText
end if
if RubyPosition.GetSelIndex <> iPosition then
Warnlog "Position: hope to get " & RubyPosition.GeTSelText(iPosition) & " but get " & RubyPosition.GeTSelText
end if
RubyDialog.Close
Sleep 2
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_12
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sHangulText , sHanjaText as String
Dim iAlignment , iPosition as Integer
sHangulText = "상산하"
sHanjaText = "上山下"
iAlignment = 2 'Center
iPosition = 1 'Top
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\ChineseToKorean.sxw")
printlog "- 'Hangul As Ruby Above Hanja' (Chinese -> Korean)"
'/// Test 'Hangul As Ruby Above Hanja' - Simple convert from Hanja into Hangul
Call hNewDocument
'/// Open a test file , which includes some Chinese chacters
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , check 'Hangul As Ruby Above Hanja' ,
'/// + press Peplace button
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
HangulAsRubyAbove.Check
Sleep 1
ReplaceBtn.Click
Sleep 1
HangulHanjaConversion.Close
Call wTypeKeys ""
'/// Format/Ruby , check if the result is correct
FormatRuby
Kontext "RubyDialog"
Sleep 4
if BasisText1.GetText <> sHanjaText then
Warnlog "#i39186# Base text : hope to get " & sHangulText & " but get " & BasisText1.GetText
end if
if RubyText1.GetText <> sHangulText then
Warnlog "#i39186# Ruby text : hope to get " & sHanjaText & " but get " & RubyText1.GetText
end if
if Adjust.GetSelIndex <> iAlignment then
Warnlog "Alignment : hope to get " & Adjust.GeTSelText(iAlignment) & " but get " & Adjust.GeTSelText
end if
if RubyPosition.GetSelIndex <> iPosition then
Warnlog "Position: hope to get " & RubyPosition.GeTSelText(iPosition) & " but get " & RubyPosition.GeTSelText
end if
RubyDialog.Close
Sleep 2
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_13
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sHangulText , sHanjaText as String
Dim iAlignment , iPosition as Integer
sHangulText = "한자"
sHanjaText = "漢字"
iAlignment = 2 'Center
iPosition = 2 'Bottom
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\KoreanToChinese.sxw")
printlog "- 'Hangul As Ruby Below Hanja' (Korean -> Chinese)"
'/// Test 'Hangul As Ruby Below Hanja' - Simple convert from Hangul into Hanja
Call hNewDocument
'/// Open a test file , which includes some Korean chacters
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , check 'Hangul As Ruby Below Hanja' ,
'/// + press Peplace button
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
HangulAsRubyBelow.Check
Sleep 1
ReplaceBtn.Click
Sleep 1
HangulHanjaConversion.Close
Call wTypeKeys ""
'/// Format/Ruby , check if the result is correct
FormatRuby
Kontext "RubyDialog"
Sleep 4
if BasisText1.GetText <> sHanjaText then
Warnlog "Base text : hope to get " & sHangulText & " but get " & BasisText1.GetText
end if
if RubyText1.GetText <> sHangulText then
Warnlog "Ruby text : hope to get " & sHanjaText & " but get " & RubyText1.GetText
end if
if Adjust.GetSelIndex <> iAlignment then
Warnlog "Alignment : hope to get " & Adjust.GeTSelText(iAlignment) & " but get " & Adjust.GeTSelText
end if
if RubyPosition.GetSelIndex <> iPosition then
Warnlog "Position: hope to get " & RubyPosition.GeTSelText(iPosition) & " but get " & RubyPosition.GeTSelText
end if
RubyDialog.Close
Sleep 2
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_14
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sHangulText , sHanjaText as String
Dim iAlignment , iPosition as Integer
sHangulText = "상산하"
sHanjaText = "上山下"
iAlignment = 2 'Center
iPosition = 2 'Bottom
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\ChineseToKorean.sxw")
printlog "- 'Hangul As Ruby Below Hanja' (Chinese -> Korean)"
'/// Test 'Hangul As Ruby Below Hanja' - Simple convert from Hanja into Hangul
Call hNewDocument
'/// Open a test file , which includes some Chinese chacters
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , check 'Hangul As Ruby Below Hanja' ,
'/// + press Peplace button
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
HangulAsRubyBelow.Check
Sleep 1
ReplaceBtn.Click
Sleep 1
HangulHanjaConversion.Close
Call wTypeKeys ""
'/// Format/Ruby , check if the result is correct
FormatRuby
Kontext "RubyDialog"
Sleep 4
if BasisText1.GetText <> sHanjaText then
Warnlog "#i39186# Base text : hope to get " & sHangulText & " but get " & BasisText1.GetText
end if
if RubyText1.GetText <> sHangulText then
Warnlog "#i39186# Ruby text : hope to get " & sHanjaText & " but get " & RubyText1.GetText
end if
if Adjust.GetSelIndex <> iAlignment then
Warnlog "Alignment : hope to get " & Adjust.GeTSelText(iAlignment) & " but get " & Adjust.GeTSelText
end if
if RubyPosition.GetSelIndex <> iPosition then
Warnlog "Position: hope to get " & RubyPosition.GeTSelText(iPosition) & " but get " & RubyPosition.GeTSelText
end if
RubyDialog.Close
Sleep 2
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_15
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\KoreanToChinese.sxw")
printlog "- Hangul Only"
'/// Test 'Hangul Only'
Call hNewDocument
'/// Open a test file , which includes some Korean chacters .
'/// + Set focus before Korean character
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion ,
'/// + 'Hangul Only' should be active and Unchecked,
'/// + 'Hanja Only' should be inactive
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
if HangulOnly.IsChecked = TRUE then
Warnlog "The default of Hangul Only should be Unchecked ! Bug#116320"
end if
try
HangulOnly.UnCheck
HangulOnly.Check
catch
Warnlog "'Hangul Only' Should be active !"
endcatch
try
HanjaOnly.Check
Warnlog "'Hanja Only' should be inactive !"
catch
endcatch
HangulHanjaConversion.Close
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_16
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\ChineseToKorean.sxw")
printlog "- Hanja Only"
'/// Test 'Hanja Only'
Call hNewDocument
'/// Open a test file , which includes some Chinese chacters .
'/// + Set focus before Chinese character
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion ,
'/// + 'Hanja Only' should be active and Unchecked,
'/// + 'Hangul Only' should be inactive
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
if HanjaOnly.IsChecked = TRUE then
Warnlog "The default of Hanja Only should be Unchecked ! Bug#116320"
end if
try
HanjaOnly.UnCheck
HanjaOnly.Check
catch
Warnlog "'Hanja Only' Should be active !"
endcatch
try
HangulOnly.Check
Warnlog "'Hangul Only' should be inactive !"
catch
endcatch
HangulHanjaConversion.Close
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_17
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sResult , sWord as String
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\KoreanToChinese.sxw")
sResult = "한자入力"
sWord = "入力"
GetClipboardText = ""
printlog "- Ignore"
'/// Test 'Ignore'
Call hNewDocument
'/// Open a test file , which includes some Korean chacters .
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , press Ignore ,
'/// + next word should be selected for conversion.
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
Ignore.Click
Sleep 1
if Word.GetText <> sWord then
Warnlog "Hope get " & sWord & " in Word" & " but get " & Word.GetText
end if
ReplaceBtn.Click
Sleep 1
HangulHanjaConversion.Close
Call wTypeKeys ""
Call wTypeKeys "" , 4
EditCopy
if GetClipboardText <> sResult then
Warnlog "Should get " & sResult & " but get " & GetClipboardText
end if
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_18
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sResult as String
Dim sWord as String
Dim i as Integer
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\alwayIgnore.sxw")
GetClipboardText = ""
sWord = "산하"
sResult = "산하 황하 상산하乡 산하"
printlog "- Always Ignore -1"
'/// Test 'Always Ignore' -1
Call hNewDocument
'/// Open a test file , which includes some Chinese chacters =>.
'/// + 山下 上山下乡 山下
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , press Always Ignore ,
'/// + (here, 山下 should be selected) , then press Replace
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
AlwaysIgnore.Click
Sleep 1
For i = 1 to 4
if NOT HangulHanjaConversion.Exists then
Exit for
end if
ReplaceBtn.Click
Sleep 1
next i
'/// The result should be only 黄河 and 上山下 are converted
Call wTypeKeys ""
Call wTypeKeys ""
EditCopy
if GetClipboardText <> sResult then
Warnlog "Should get " & sResult & " but get " & GetClipboardText
end if
'/// Close this active document
Call hCloseDocument
'/// So far , there is still a StarOffice session exists .
'/// Reopen the test file
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion ,
'/// + ,(here, 黄河 should be selected)
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
if Word.GetText <> sWord then
Warnlog "#i39308# Don't get " & sWord & " but get " & Word.GetText
end if
For i = 1 to 4
if NOT HangulHanjaConversion.Exists then
Exit for
end if
ReplaceBtn.Click
Sleep 1
next i
'/// The result should be only 黄河 and 上山下 are converted
Call wTypeKeys ""
Call wTypeKeys ""
EditCopy
if GetClipboardText <> sResult then
QAErrorlog "#i39308# Should get " & sResult & " but get " & GetClipboardText
end if
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_19
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sWord as String
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\alwayIgnore.sxw")
sWord = "산하"
printlog "- Always Ignore -2"
'/// Test 'Always Ignore' -2
Call hNewDocument
'/// Open a test file , which includes some Chinese chacters =>.
'/// + 山下 上山下乡 山下
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , press Always Ignore ,
'/// + (here, 山下 should be selected)
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
AlwaysIgnore.Click
Sleep 1
HangulHanjaConversion.Close
Call hCloseDocument
'/// Close all Office session
try
Call hCloseDocument
Call hCloseDocument
catch
endcatch
Sleep 2
Call hNewDocument
'/// Reopen the test file
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , 山下 should be selcted
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
if Word.GetText <> sWord then
Warnlog "Don't get " & sWord & " but get " & Word.GetText
end if
HangulHanjaConversion.Close
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_20
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sWord as String
Dim sResult as String
Dim i as Integer
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\Replace.sxw")
sWord = "書翰"
sResult = "書翰자 와"
GetClipboardText = ""
printlog "- Replace"
'/// Test Replace
Call hNewDocument
'/// Open a test file , which includes some Korean chacters
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , select a word in selection
'/// + then press Replace button
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
try
Suggestions.Select sWord
catch
Warnlog "No suggestion made in Hangul/Hanja converter"
HangulHanjaConversion.Close
Call hCloseDocument
goto endsub
endcatch
Sleep 1
For i = 1 to 4
if NOT HangulHanjaConversion.Exists then
Exit for
end if
ReplaceBtn.Click
Sleep 1
next i
'/// Check if the result is right
Call wTypeKeys ""
Call wTypeKeys ""
EditCopy
if GetClipboardText <> sResult then
Warnlog "Should get " & sResult & " but get " & GetClipboardText
end if
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_21
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sWord1 as String
Dim sWord2 as String
Dim sResult as String
Dim i as Integer
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\Replace.sxw")
sWord1 = "書翰" : sWord2 = "書翰"
sResult = "書翰자 와"
GetClipboardText = ""
printlog "- Replace All -1"
'/// Test 'Replace All' -1
'/// replace list will be active for the office session
Call hNewDocument
'/// Open a test file , which includes some Korean chacters
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , select a word in selection,
'/// + press 'always replace' , then press Replace button
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
try
Suggestions.Select sWord1
catch
Warnlog "No suggestion made in Hangul/Hanja converter"
HangulHanjaConversion.Close
Call hCloseDocument
goto endsub
endcatch
Sleep 2
AlwaysReplace.Click
Sleep 1
For i = 1 to 2
if NOT HangulHanjaConversion.Exists then
Exit for
end if
ReplaceBtn.Click
Sleep 1
next i
'/// Check if the result is right
Call wTypeKeys ""
Call wTypeKeys ""
EditCopy
Sleep 1
if GetClipboardText <> sResult then
Warnlog "1st:Should get " & sResult & " but get " & GetClipboardText
end if
'/// Close the file , so far , there is still a StarOffice session
Call hCloseDocument
Call hNewDocument
'/// Reopen this test file
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
if Word.GetText <> sWord2 then
Warnlog "#i39308# Should get " & sWord2 & " but get " & Word.GetText
HangulHanjaConversion.Close
Call hCloseDocument
goto endsub
end if
For i = 1 to 2
if NOT HangulHanjaConversion.Exists then
Exit for
end if
ReplaceBtn.Click
Sleep 1
next i
'/// Check if the result is right
Call wTypeKeys ""
Call wTypeKeys ""
GetClipboardText = ""
EditCopy
Sleep 1
if GetClipboardText <> sResult then
Warnlog "2nd:Should get " & sResult & " but get " & GetClipboardText
end if
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_22
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim i as Integer
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\Replace.sxw")
GetClipboardText = ""
printlog "- Replace All -2"
'/// Test 'Replace All' -2
'/// replace list will NOT be active when office session is deleted
Call hNewDocument
'/// Open a test file , which includes some Korean chacters
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , select a word in selection,
'/// + press 'always replace' , then press Replace button
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
try
Suggestions.Select 1
catch
Warnlog "No suggestion made in Hangul/Hanja converter"
HangulHanjaConversion.Close
Call hCloseDocument
goto endsub
endcatch
Sleep 1
AlwaysReplace.Click
if HangulHanjaConversion.Exists then HangulHanjaConversion.Close
'/// Close all documents
For i = 1 to GetDocumentCount - 1
Call hCloseDocument
next i
'/// Restart the office
Call hStartTheOffice
Call hNewDocument
'/// Reopen this test file
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
if HangulHanjaConversion.Exists then
HangulHanjaConversion.Close
else
Warnlog "Replace list is active after office-restart"
end if
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_23
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sWord as String
Dim sResult as String
Dim i as Integer
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\replaceAll.sxw")
sResult = "은력銀河"
GetClipboardText = ""
printlog "- Replace All -3"
'/// Test 'Replace All' -3
'/// Replacing AF must not lead to replace the AF within CAFE
Call hNewDocument
'/// Open a test file , which includes some Korean chacters
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , select a word in selection,
'/// + press 'always replace' , then press Replace button
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
for i = 1 to 2
if ReplaceBtn.IsEnabled then
try
Suggestions.Select 1
catch
Warnlog "No suggestion made in Hangul/Hanja converter"
HangulHanjaConversion.Close
Call hCloseDocument
goto endsub
endcatch
else
Ignore.Click
end if
next i
Sleep 1
AlwaysReplace.Click
Sleep 1
For i = 1 to 2
if NOT HangulHanjaConversion.Exists then
Exit for
end if
ReplaceBtn.Click
Sleep 1
next i
'/// Check if the result is right
Call wTypeKeys ""
Call wTypeKeys ""
EditCopy
if GetClipboardText <> sResult then
Warnlog "Should get " & sResult & " but get " & GetClipboardText
end if
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_24
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sResult as String
Dim i as Integer
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\replaceAll.sxw")
sResult = "垠力垠下"
GetClipboardText = ""
printlog "- Replace by character -1"
'/// Test 'Replace by character' -1
Call hNewDocument
'/// Open a test file , which includes some Korean chacters
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , the default for 'Replace by character'
'/// + is OFF . Check 'Replace by character' , then press Replace button
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
if ReplaceByCharacter.IsChecked = TRUE then
Warnlog "The default for 'Replace By Character' should be OFF !"
end if
ReplaceByCharacter.Check
Sleep 1
For i = 1 to 4
if NOT HangulHanjaConversion.Exists then
Exit for
end if
ReplaceBtn.Click
Sleep 1
next i
'/// Check if the result is right
Call wTypeKeys ""
Call wTypeKeys ""
EditCopy
if GetClipboardText <> sResult then
Warnlog "Should get " & sResult & " but get " & GetClipboardText
end if
Call hCloseDocument
endcase
'-----------------------------------------------------------------
testcase tHHConversion_25
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sResult as String
Dim i as Integer
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\alwayIgnore.sxw")
sResult = "山하 황하 상山하乡 山하"
GetClipboardText = ""
printlog "- Replace by character -2"
'/// Test 'Replace by character' -2
'/// Test Always Ignore when 'Replace by character' is checked
Call hNewDocument
'/// Open a test file , which includes some Chinese chacters =>.
'/// + 山下 上山下乡 山下
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , Check 'Replace by character' ,
'/// + press Always Ignore , then press Replace
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
ReplaceByCharacter.Check
Sleep 1
AlwaysIgnore.Click
Sleep 1
For i = 1 to 10
if NOT HangulHanjaConversion.Exists then
Exit for
end if
ReplaceBtn.Click
Sleep 1
next i
'/// The result should be only 黄河 and 上山下 are converted
Call wTypeKeys ""
Call wTypeKeys ""
EditCopy
if GetClipboardText <> sResult then
Warnlog "Should get " & sResult & " but get " & GetClipboardText
end if
'/// Close this active document
Call hCloseDocument
'The purpose is to delete Office session
try
Call hCloseDocument
Call hCloseDocument
catch
endcatch
Sleep 2
endcase
'-----------------------------------------------------------------
testcase tHHConversion_26
warnlog( "#i111911# - Test is broken beyond repait, please rewrite" )
goto endsub
Dim sTestFile as String
Dim sWord as String
Dim sResult as String
Dim i as Integer
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\replaceAll.sxw")
sWord = "恩"
sResult = "恩力恩下"
GetClipboardText = ""
printlog "- Replace by character -3"
'/// Test 'Replace by character' -3
'/// Test Always Replace when 'Replace by character' is checked
Call hNewDocument
'/// Open a test file , which includes some Korean chacters
hFileOpenLocally( sTestFile )
Call wTypeKeys ""
'/// Tools / HangulHanjaConversion , Check 'Replace by character' ,
'/// + select a word in selection, press 'always replace' ,
'/// + then press Replace button
ToolsLanguageHangulHanjaConversion
Kontext "HangulHanjaConversion"
ReplaceByCharacter.Check
Sleep 1
Grid.Typekeys ""
Sleep 1
AlwaysReplace.Click
Sleep 1
For i = 1 to 4
if NOT HangulHanjaConversion.Exists then
Exit for
end if
ReplaceBtn.Click
Sleep 1
next i
'/// Check if the result is right
Call wTypeKeys ""
Call wTypeKeys ""
EditCopy
if GetClipboardText <> sResult then
Warnlog "Should get " & sResult & " but get " & GetClipboardText
end if
Call hCloseDocument
'Close all Office session
try
Call hCloseDocument
Call hCloseDocument
catch
endcatch
endcase
'-----------------------------------------------------------------