diff options
author | Kurt Zenker <kz@openoffice.org> | 2009-12-03 18:43:21 +0100 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2009-12-03 18:43:21 +0100 |
commit | 65bb25337807de1241fdc14f727daab3a8a6fc82 (patch) | |
tree | 28b5f3f1d7eb0c2450439e600714c7768069bb7a /testautomation/writer/optional | |
parent | CWS-TOOLING: integrate CWS validityref (diff) | |
parent | CWS-TOOLING: integrate CWS fwk125 (diff) | |
download | core-65bb25337807de1241fdc14f727daab3a8a6fc82.tar.gz core-65bb25337807de1241fdc14f727daab3a8a6fc82.zip |
CWS-TOOLING: integrate CWS fwk125_DEV300
Diffstat (limited to 'testautomation/writer/optional')
-rwxr-xr-x | testautomation/writer/optional/includes/hyphenation/w_hyphenation.inc | 659 | ||||
-rwxr-xr-x | testautomation/writer/optional/input/hyphenation/tHyphenation.odt | bin | 6608 -> 9034 bytes | |||
-rw-r--r-- | testautomation/writer/optional/w_hyphenation.bas | 8 |
3 files changed, 331 insertions, 336 deletions
diff --git a/testautomation/writer/optional/includes/hyphenation/w_hyphenation.inc b/testautomation/writer/optional/includes/hyphenation/w_hyphenation.inc index c663faf68001..8b7296d1d5a4 100755 --- a/testautomation/writer/optional/includes/hyphenation/w_hyphenation.inc +++ b/testautomation/writer/optional/includes/hyphenation/w_hyphenation.inc @@ -40,354 +40,347 @@ ' #1 tHyphenation_1 ' #1 tHyphenation_2 ' #1 tHyphenation_3 +' #1 tHyphenation_4 '* '\*********************************************************************** testcase tHyphenation_1 - Dim testFile as String - Dim testWord as String - Dim firstPartOfTestWord as String - Dim secondPartOfTestWord as String - - testFile = "tHyphenation.odt" - testWord = "following" - firstPartOfTestWord = "fol" - secondPartOfTestWord = "follow" - - PrintLog "- Test Hyphenation using ctrl and -" - - printlog "Test Hyphenation using ctrl and -" - - printlog "open a test file" - Call hFileOpen ( gTesttoolPath + "writer\optional\input\hyphenation\" + testFile ) - Call sMakeReadOnlyDocumentEditable - - Call wTypeKeys "<End><Shift Mod1 Left>" - - EditCopy - - printlog "add '-' between 'fol' and 'lowing' , then press 3 times 'space bar' (pc). (7 times on linux)" - printlog "+ check if fol in the end of the line" - if GetClipboardText = testWord then - Call wTypeKeys "<Right>" , 3 - Call wTypeKeys "<Mod1 SUBTRACT>" - Call wTypeKeys "<Home>" - if gPlatGroup <> "unx" then - Call wTypeKeys "<SPACE>" ,3 - else - Call wTypeKeys "<SPACE>" ,7 - end if - - Call wTypeKeys "<End><Left><Shift Mod1 Left>" - EditCopy - - if GetClipboardText <> firstPartOfTestWord then - Warnlog "The hyphenation does NOT work well in first part!" - end if - - printlog "add '-' between 'follow' and 'ing' , then press 6 times 'space bar'" - printlog "+ check if follow in the end of the line ." - Call wTypeKeys "<Mod1 z>",2 - Call wTypeKeys "<End>" - Call wTypeKeys "<Left>",3 - Call wTypeKeys "<Mod1 SUBTRACT>" - Call wTypeKeys "<Home>" - if gPlatGroup <> "unx" then - Call wTypeKeys "<SPACE>" ,3 - else - Call wTypeKeys "<SPACE>" ,6 - end if - Call wTypeKeys "<End><Left><Shift Mod1 Left>" - EditCopy - - if GetClipboardText = secondPartOfTestWord then - Call wTypeKeys "<Home>" - - printlog "press 5 times 'space bar'" - printlog "check if fol in the end of the line ." - if gPlatGroup <> "unx" then - Call wTypeKeys "<SPACE>" ,3 - else - Call wTypeKeys "<SPACE>" ,5 - end if - Call wTypeKeys "<End><Shift Mod1 Left>" - EditCopy - - if GetClipboardText <> firstPartOfTestWord then - Warnlog "The hyphenation does NOT work well in first part, but it works fine in second part!" - end if - else - Warnlog "The hyphenation does NOT work well in second part!" - end if - - else - Warnlog "The test word is wrong !!" - end if - - Call hCloseDocument - -endcase + Dim testFile as String + Dim testWord as String + Dim PartOfTestWord as String + + testFile = "tHyphenation.odt" + testWord = "following" + PartOfTestWord = "fol" + + printlog "Test Hyphenation using ctrl and -" + + printlog "open a test file" + Call hFileOpen ( gTesttoolPath + "writer\optional\input\hyphenation\" + testFile ) + Call sMakeReadOnlyDocumentEditable + + ' we must assure the word 'following' is the first word in second line + ' otherwise the test will not work correctly + if fPrepareHyphenationDocument(testWord) = false then + Warnlog "Unable to prepare document for hyphenation. Check testcase" + Call hCloseDocument + end if + + printlog "add '-' between 'fol' and 'lowing'" + printlog "+ check if fol in the end of the line" + + Call wTypeKeys "<Home>" + Call wTypeKeys "<Right>" , 3 + Call wTypeKeys "<Mod1 SUBTRACT>" + Call wTypeKeys "<Mod1 Home>" + Call wTypeKeys "<End>" + Call wTypeKeys "<Delete>" + + Call wTypeKeys "<End><Left>" + Call wTypeKeys "<Mod1 Shift Left>" + EditCopy + + if GetClipboardText <> PartOfTestWord then + Warnlog "The hyphenation does NOT work ! Found '" & GetClipboardText & "' and not '" & PartOfTestWord & "'" + end if + + Call hCloseDocument + +endcase '------------------------------------------------------------------------- testcase tHyphenation_2 -warnlog "#i102304# - outcommenting tHyphenation_2 due to bug." -goto endsub - - Dim testFile as String - Dim testWord as String - Dim firstPartOfTestWord as String - Dim secondPartOfTestWord as String - Dim testWordInHyphenationDlg as String - - testFile = "tHyphenation.odt" - testWord = "following" - testWordInHyphenationDlg = "fol=low-ing" - firstPartOfTestWord = "fol" - secondPartOfTestWord = "follow" - - PrintLog "- Test Hyphenation using Tools/Hyphenation ,test like fol-lowing" - - printlog "Test Hyphenation using Tools/Hyphenation ,test like fol-lowing" - - printlog "open a test file" - Call hFileOpen ( gTesttoolPath + "writer\optional\input\hyphenation\" + testFile ) - Call sMakeReadOnlyDocumentEditable - - Call wTypeKeys "<End><Shift Mod1 Left>" - - EditCopy - - if GetClipboardText <> testWord then - Warnlog "The test word is wrong !!" - goto endsub - end if - - printlog "Press 3 times 'space bar'" - Call wTypeKeys "<Home>" - if gPlatGroup <> "unx" then - Call wTypeKeys "<SPACE>" ,3 - else - Call wTypeKeys "<SPACE>" ,6 - end if - - printlog "Tools/Hyphenation" - ToolsLanguageHyphenate - Kontext "Silbentrennung" - - if Not Silbentrennung.Exists then - Kontext "Active" - if Active.Exists then - if Active.GetRT = 304 then - Active.Yes - - Kontext "Active" - if Active.Exists then - if Active.GetRT = 304 then Active.Ok - end if - end if - end if - Warnlog "Unable to bring up Dialog 'Hyphenation'!" - goto endsub - end if - - printlog "check if get 'fol=low-ing'" - if Wort.Gettext <> testWordInHyphenationDlg then - Warnlog "#i40561# The test can NOT be seperated two times , or something wrong!" - Silbentrennung.Cancel - goto NOTest - end if - - if NOT Vor.IsEnabled then - Warnlog "the Vor button is Not enabled, or something wrong!" - Silbentrennung.Cancel - goto NOTest - end if - - printlog "add '-' between 'fol' and 'lowing' using left arrow key" - Vor.Click - Silbentrennung.OK - - printlog "Close all dialogue, and recover the file to default" - Kontext "Active" - if NOT Active.Exists then - Kontext "Silbentrennung" - Silbentrennung.Cancel - Warnlog "The first message box is NOT pop up" - goto NOTest - end if - - Active.Yes - - Kontext "Active" - if NOT Active.Exists then - Warnlog "The second message box is NOT pop up" - goto endsub - end if - - Active.OK - - printlog "Press 3 times 'space bar' in front of the line" - Call wTypeKeys "<BACKSPACE>",3 - Call wTypeKeys "<SPACE>",3 - - Call wTypeKeys "<End><Left><Shift Mod1 Left>" - EditCopy - - printlog "Check if get 'fol'" - if GetClipboardText <> firstPartOfTestWord then - Warnlog "The hyphenation does NOT work well in first part!" - end if - -NOTest: - Call hCloseDocument - -endcase + Dim testFile as String + Dim testWord as String + Dim PartOfTestWord as String + + testFile = "tHyphenation.odt" + testWord = "following" + PartOfTestWord = "follow" + + printlog "Test Hyphenation using ctrl and -" + + printlog "open a test file" + Call hFileOpen ( gTesttoolPath + "writer\optional\input\hyphenation\" + testFile ) + Call sMakeReadOnlyDocumentEditable + + ' we must assure the word 'following' is the first word in second line + ' otherwise the test will not work correctly + if fPrepareHyphenationDocument(testWord) = false then + Warnlog "Unable to prepare document for hyphenation. Check testcase" + Call hCloseDocument + end if + + printlog "add '-' between 'follow' and 'ing'" + printlog "+ check if 'follow' in the end of the line" + + Call wTypeKeys "<Home>" + Call wTypeKeys "<Right>" , 6 + Call wTypeKeys "<Mod1 SUBTRACT>" + Call wTypeKeys "<Mod1 Home>" + Call wTypeKeys "<End>" + if gPlatgroup = "unx" then + Call wTypeKeys "<Delete>", 6 + else + Call wTypeKeys "<Delete>", 7 + end if + + Call wTypeKeys "<End><Left>" + Call wTypeKeys "<Mod1 Shift Left>" + EditCopy + + if GetClipboardText <> PartOfTestWord then + Warnlog "The hyphenation does NOT work ! Found '" & GetClipboardText & "' and not '" & PartOfTestWord & "'" + end if + + Call hCloseDocument + +endcase '------------------------------------------------------------------------- testcase tHyphenation_3 -warnlog "#i102304# - outcommenting tHyphenation_3 due to bug." -goto endsub - - Dim testFile as String - Dim testWord as String - Dim firstPartOfTestWord - Dim secondPartOfTestWord as String - Dim testWordInHyphenationDlg1 as String - Dim testWordInHyphenationDlg2 as String - - testFile = "tHyphenation.odt" - testWord = "following" - firstPartOfTestWord = "fol" - secondPartOfTestWord = "follow" - testWordInHyphenationDlg1 = "fol=low-ing" - testWordInHyphenationDlg2 = "fol-low=ing" - - printLog "- Test Hyphenation using Tools/Hyphenation ,test like follow-ing" - printlog "Test Hyphenation using Tools/Hyphenation ,test like follow-ing" - - printlog "open a test file" - Call hFileOpen ( gTesttoolPath + "writer\optional\input\hyphenation\" + testFile ) - Call sMakeReadOnlyDocumentEditable - - Call wTypeKeys "<End><Shift Mod1 Left>" - - EditCopy - - if GetClipboardText <> testWord then - Warnlog "The test word is wrong !!" - goto endsub - end if - - printlog "Press 3 times 'space bar'" - Call wTypeKeys "<Home>" - if gPlatGroup <> "unx" then - Call wTypeKeys "<SPACE>" ,3 - else - Call wTypeKeys "<SPACE>" ,6 - end if - - printlog "Tools/Hyphenation" - ToolsLanguageHyphenate - Kontext "Silbentrennung" - - if Not Silbentrennung.Exists then - Kontext "Active" - if Active.Exists then - if Active.GetRT = 304 then - Active.Yes - - Kontext "Active" - if Active.Exists then - if Active.GetRT = 304 then Active.Ok - end if - end if - end if - Warnlog "Unable to bring up Dialog 'Hyphenation'!" - goto endsub - end if - - printlog "check if get 'fol=low-ing'" - if Wort.Gettext <> testWordInHyphenationDlg1 then - Warnlog "#i40561# The test can NOT be seperated two times , or something wrong!" - Silbentrennung.Cancel - goto NOTest - end if - - printlog "click left arrow key" - if NOT Vor.IsEnabled then - Warnlog "the Vor button is Not enabled, or something wrong!" - Silbentrennung.Cancel - goto NOTest - end if - Vor.Click - - printlog "check if get ''fol-low=ing'" - if Wort.Gettext <> testWordInHyphenationDlg2 then - Warnlog "The test word should be changed after clicking Vor!" - goto endsub - end if - - printlog "add '-' between 'follow' and 'ing' pressing right arrow key" - if NOT Zurueck.IsEnabled then - Warnlog "the Zuruech button is Not enabled, or something wrong!" - goto endsub - end if - Zurueck.Click - - printlog "check if get 'fol-low=ing'" - if Wort.Gettext <> testWordInHyphenationDlg1 then - Warnlog "The test word should be changed after clicking Zurueck!" - goto endsub - end if - - Sleep 1 - - printlog "close all dialogue" - Silbentrennung.OK - - Kontext "Active" - if NOT Active.Exists then - Warnlog "The first message box is NOT pop up" - goto endsub - end if - - Active.Yes - - Kontext "Active" - if NOT Active.Exists then - Warnlog "The second message box is NOT pop up" - goto endsub - end if - - Active.OK - - printlog "recover to the default file and press 3 sparc bar in front of the line" - Call wTypeKeys "<BACKSPACE>",3 - Call wTypeKeys "<SPACE>",3 - - Call wTypeKeys "<End><Left><Shift Mod1 Left>" - EditCopy - - printlog "check if get 'follow' in the end of the line" - if GetClipboardText = secondPartOfTestWord then - Call wTypeKeys "<Home>" - Call wTypeKeys "<SPACE>" , 5 - - Call wTypeKeys "<End><Shift Mod1 Left>" - EditCopy + Dim testFile as String + Dim testWord as String + Dim firstPartOfTestWord as String + Dim secondPartOfTestWord as String + Dim testWordInHyphenationDlg as String + + testFile = "tHyphenation.odt" + testWord = "following" + testWordInHyphenationDlg = "fol=low-ing" + firstPartOfTestWord = "fol" + secondPartOfTestWord = "follow" + + printlog "Test Hyphenation using Tools/Hyphenation ,test like fol-lowing" + + printlog "open a test file" + Call hFileOpen ( gTesttoolPath + "writer\optional\input\hyphenation\" + testFile ) + Call sMakeReadOnlyDocumentEditable + + ' we must assure the word 'following' is the first word in second line + ' otherwise the test will not work correctly + if fPrepareHyphenationDocument(testWord) = false then + Warnlog "Unable to prepare document for hyphenation. Check testcase" + Call hCloseDocument + end if + + Call wTypeKeys "<Mod1 Home>" + Call wTypeKeys "<End>" + if gPlatgroup = "unx" then + Call wTypeKeys "<Delete>", 6 + else + Call wTypeKeys "<Delete>", 7 + end if + + printlog "Tools/Hyphenation" + ToolsLanguageHyphenate + Kontext "Silbentrennung" + + if Not Silbentrennung.Exists then + Warnlog "Unable to bring up Dialog 'Hyphenation'!" + Call hCloseDocument + goto endsub + end if + + printlog "check if get 'fol=low-ing'" + if Wort.Gettext <> testWordInHyphenationDlg then + Warnlog "Expected " & testWordInHyphenationDlg & " but found " & Wort.Gettext + Silbentrennung.Cancel + Call hCloseDocument + goto endsub + end if + + if NOT Vor.IsEnabled then + Warnlog "the 'Vor' button is Not enabled, or something wrong!" + Silbentrennung.Cancel + Call hCloseDocument + goto endsub + end if + + printlog "add '-' between 'fol' and 'lowing' using left arrow key" + Vor.Click + Silbentrennung.OK + + ' Messagebox 'Start hypheantion from the beginning ? + Kontext "Active" + if Active.Exists then + if Active.GetRT = 304 then + try + Active.Yes + catch + Active.ok + endcatch + else + Warnlog "No messagebox asking for hyphenate at beginning of document" + end if + end if + + ' End of hyphenation message + if Active.Exists then + if Active.GetRT = 304 then + try + Active.Ok + catch + Active.yes + endcatch + else + Warning "No 'end of hyphenation' messagebox" + end if + end if + + printlog "Press 3 times 'space bar' in front of the line" + Call wTypeKeys "<Mod1 Home>" + Call wTypeKeys "<End>" + Call wTypeKeys "<Left>" + Call wTypeKeys "<Shift Mod1 Left>" + EditCopy + + printlog "Check if get 'fol'" + if GetClipboardText <> firstPartOfTestWord then + Warnlog "The hyphenation does NOT work ! Found '" & GetClipboardText & "' and not '" & PartOfTestWord & "'" + end if + + Call hCloseDocument + +endcase - if GetClipboardText <> firstPartOfTestWord then - Warnlog "The hyphenation does NOT work well in first part, but it works fine in second part!" - end if - else - Warnlog "The hyphenation does NOT work well in second part!" - end if -NOTest: - Call hCloseDocument +'------------------------------------------------------------------------- +testcase tHyphenation_4 + + Dim testFile as String + Dim testWord as String + Dim firstPartOfTestWord as string + Dim secondPartOfTestWord as String + Dim testWordInHyphenationDlg1 as String + Dim testWordInHyphenationDlg2 as String + + testFile = "tHyphenation.odt" + testWord = "following" + firstPartOfTestWord = "fol" + secondPartOfTestWord = "follow" + testWordInHyphenationDlg1 = "fol=low-ing" + testWordInHyphenationDlg2 = "fol-low=ing" + + printLog "- Test Hyphenation using Tools/Hyphenation ,test like follow-ing" + printlog "Test Hyphenation using Tools/Hyphenation ,test like follow-ing" + + printlog "open a test file" + Call hFileOpen ( gTesttoolPath + "writer\optional\input\hyphenation\" + testFile ) + Call sMakeReadOnlyDocumentEditable + + ' we must assure the word 'following' is the first word in second line + ' otherwise the test will not work correctly + if fPrepareHyphenationDocument(testWord) = false then + Warnlog "Unable to prepare document for hyphenation. Check testcase" + Call hCloseDocument + end if + + Call wTypeKeys "<Mod1 Home>" + Call wTypeKeys "<End>" + if gPlatgroup = "unx" then + Call wTypeKeys "<Delete>", 6 + else + Call wTypeKeys "<Delete>", 7 + end if + + printlog "Tools/Hyphenation" + ToolsLanguageHyphenate + Kontext "Silbentrennung" + + if Not Silbentrennung.Exists then + Call hCloseDocument + goto endsub + end if + + printlog "check if get 'fol=low-ing'" + if Wort.Gettext <> testWordInHyphenationDlg1 then + Warnlog "Expected " & testWordInHyphenationDlg1 & " but found " & Wort.Gettext + Silbentrennung.Cancel + Call hCloseDocument + goto endsub + end if + + printlog "click left arrow key" + if NOT Vor.IsEnabled then + Warnlog "the Vor button is Not enabled, or something wrong!" + Silbentrennung.Cancel + Call hCloseDocument + goto endsub + end if + Vor.Click + + printlog "check if get ''fol-low=ing'" + if Wort.Gettext <> testWordInHyphenationDlg2 then + Warnlog "Expected " & testWordInHyphenationDlg2 & " but found " & Wort.Gettext + Call hCloseDocument + goto endsub + end if + + printlog "add '-' between 'follow' and 'ing' pressing right arrow key" + if NOT Zurueck.IsEnabled then + Warnlog "the 'Back' button is Not enabled, or something wrong!" + Call hCloseDocument + goto endsub + end if + Zurueck.Click + + printlog "check if get 'fol-low=ing'" + if Wort.Gettext <> testWordInHyphenationDlg1 then + Warnlog "The test word should be changed after clicking Zurueck!" + Call hCloseDocument + goto endsub + end if + + Sleep 1 + + printlog "close all dialogs" + Silbentrennung.OK + + ' Messagebox 'Start hypheantion from the beginning ? + Kontext "Active" + if Active.Exists then + if Active.GetRT = 304 then + try + Active.Yes + catch + Active.ok + endcatch + else + Warnlog "No messagebox asking for hyphenate at beginning of document" + end if + end if + + ' End of hyphenation message + if Active.Exists then + if Active.GetRT = 304 then + try + Active.Ok + catch + Active.yes + endcatch + else + Warning "No 'end of hyphenation' messagebox" + end if + end if + + printlog "Press 3 times 'space bar' in front of the line" + Call wTypeKeys "<Mod1 Home>" + Call wTypeKeys "<End>" + Call wTypeKeys "<Left>" + Call wTypeKeys "<Shift Mod1 Left>" + EditCopy + + printlog "Check if get 'follow'" + if GetClipboardText <> secondPartOfTestWord then + Warnlog "The hyphenation does NOT work ! Found '" & GetClipboardText & "' and not '" & secondPartOfTestWord & "'" + end if + + Call hCloseDocument + endcase diff --git a/testautomation/writer/optional/input/hyphenation/tHyphenation.odt b/testautomation/writer/optional/input/hyphenation/tHyphenation.odt Binary files differindex 8854a645a9d7..b2b0494cd4e7 100755 --- a/testautomation/writer/optional/input/hyphenation/tHyphenation.odt +++ b/testautomation/writer/optional/input/hyphenation/tHyphenation.odt diff --git a/testautomation/writer/optional/w_hyphenation.bas b/testautomation/writer/optional/w_hyphenation.bas index e71c1ad8a978..0a4fe264f5ab 100644 --- a/testautomation/writer/optional/w_hyphenation.bas +++ b/testautomation/writer/optional/w_hyphenation.bas @@ -41,15 +41,17 @@ sub main use "writer\tools\includes\w_tools.inc" use "writer\tools\includes\w_tool4.inc" + use "writer\tools\includes\w_tools_hyphenation.inc" use "writer\optional\includes\hyphenation\w_hyphenation.inc" printlog Chr(13) + "******* Writer - Hyphenation - Test *******" Call hStatusIn ( "writer" , "w_hyphenation.bas" ) Call wEnableHyphenation(true) - Call tHyphenation_1 'Test Hyphenation using ctrl and "-" - Call tHyphenation_2 'Test Hyphenation using Tools/Hyphenation ,test like fol-lowing - Call tHyphenation_3 'Test Hyphenation using Tools/Hyphenation ,test like follow-ing + Call tHyphenation_1 + Call tHyphenation_2 + Call tHyphenation_3 + Call tHyphenation_4 Call wEnableHyphenation(false) Call hStatusOut |