summaryrefslogtreecommitdiff
path: root/testautomation/graphics/optional/includes/global/g_find_replace.inc
diff options
context:
space:
mode:
Diffstat (limited to 'testautomation/graphics/optional/includes/global/g_find_replace.inc')
-rwxr-xr-xtestautomation/graphics/optional/includes/global/g_find_replace.inc314
1 files changed, 174 insertions, 140 deletions
diff --git a/testautomation/graphics/optional/includes/global/g_find_replace.inc b/testautomation/graphics/optional/includes/global/g_find_replace.inc
index 49b38dd85713..f6eea7f29ee2 100755
--- a/testautomation/graphics/optional/includes/global/g_find_replace.inc
+++ b/testautomation/graphics/optional/includes/global/g_find_replace.inc
@@ -41,54 +41,54 @@
' #1 tiEditSearchAndReplaceBUGS
'*
'\**********************************************************************************
-
testcase tiEditSearchAndReplace
- Dim sFile 'as string
- Dim sExpression(2) as string ' Expression to look for: ... Replace with
- dim sExt as string
+ '/// This test tests the 'Search and Replace' -dialogue. ///'
+ Dim sFile 'as string
+ Dim sExpression(2) as string ' Expression to look for: ... Replace with
+ dim sExt as string
- Select Case Ucase(gApplication)
- case "DRAW" : sExt = ".odg"
- case "IMPRESS" : sExt = ".odp"
- end select
+ Select Case Ucase(gApplication)
+ case "DRAW" : sExt = ".odg"
+ case "IMPRESS" : sExt = ".odp"
+ end select
- 'First we need some errornes words to replace. (sExpression)
- 'sExpression(1) has to be 3 times in the document
- select case iSprache
- case 01 : sExpression(1) = "Alle" : sExpression(2) = "Allz"
- case 03 : sExpression(1) = "empreza" : sExpression(2) = "Emperor" ' Portuguese
- case 07 : qaerrorlog "No files for Russian yet, will use english instead."
- sExpression(1) = "Alle" : sExpression(2) = "Allz"
- case 30 : ' Greek
- case 31 : sExpression(1) = "bedoeling" : sExpression(2) = "Bedoling" ' Netherlands
- case 33 : sExpression(1) = "projjet" : sExpression(2) = "projete" ' French
- case 34 : sExpression(1) = "lazsos" : sExpression(2) = "Lazsi" ' Spanish
- case 35 : ' Finnish
- case 36 : sExpression(1) = "Bozniai" : sExpression(2) = "Boszniai" ' Hungaria
- case 37 : ' Catalan
- case 39 : sExpression(1) = "Presentazione" : sExpression(2) = "Raggazi" ' Italian
- case 42 : ' Czech
- case 43 : ' Slowak
- case 44 : ' English (GB)
- case 45 : sExpression(1) = "installlere" : sExpression(2) = "installer" ' Danish
- case 46 : sExpression(1) = "desa" : sExpression(2) = "ased" ' Swedish
- case 47 : ' Norwegian
- case 48 : sExpression(1) = "programmu" : sExpression(2) = "programu" ' Polish
- case 49 : sExpression(1) = "Texxt" : sExpression(2) = "Schrieb" ' German
- case 55 : sExpression(1) = "esktava" : sExpression(2) = "norte" ' Portuguese (Brazil)
- case 66 : ' Thai
- ' case 81 : sExpression(1) = "���" : sExpression(2) = "���" ' Japanese
- ' case 82 : ' Korean
- ' case 86 : ' Chinese (simplified)
- ' case 88 : ' Chinese (traditional)
- case 90 : ' Turkish
- case 91 : ' Hindi
- case 96 : ' Arab
- case 97 : ' Hebrew
- case else :
- ' Warnlog "For the language " + iSprache +" nothing is prepared yet: insert text here and create the file"
- printlog " :-) Will use English instead"
- sExpression(1) = "Alle" : sExpression(2) = "Allz"
+ 'First we need some errornes words to replace. (sExpression)
+ 'sExpression(1) has to be 3 times in the document
+ select case iSprache
+ case 01 : sExpression(1) = "Alle" : sExpression(2) = "Allz"
+ case 03 : sExpression(1) = "empreza" : sExpression(2) = "Emperor" ' Portuguese
+ case 07 : qaerrorlog "No files for Russian yet, will use english instead."
+ sExpression(1) = "Alle" : sExpression(2) = "Allz"
+ case 30 : ' Greek
+ case 31 : sExpression(1) = "bedoeling" : sExpression(2) = "Bedoling" ' Netherlands
+ case 33 : sExpression(1) = "projjet" : sExpression(2) = "projete" ' French
+ case 34 : sExpression(1) = "lazsos" : sExpression(2) = "Lazsi" ' Spanish
+ case 35 : ' Finnish
+ case 36 : sExpression(1) = "Bozniai" : sExpression(2) = "Boszniai" ' Hungaria
+ case 37 : ' Catalan
+ case 39 : sExpression(1) = "Presentazione" : sExpression(2) = "Raggazi" ' Italian
+ case 42 : ' Czech
+ case 43 : ' Slowak
+ case 44 : ' English (GB)
+ case 45 : sExpression(1) = "installlere" : sExpression(2) = "installer" ' Danish
+ case 46 : sExpression(1) = "desa" : sExpression(2) = "ased" ' Swedish
+ case 47 : ' Norwegian
+ case 48 : sExpression(1) = "programmu" : sExpression(2) = "programu" ' Polish
+ case 49 : sExpression(1) = "Texxt" : sExpression(2) = "Schrieb" ' German
+ case 55 : sExpression(1) = "esktava" : sExpression(2) = "norte" ' Portuguese (Brazil)
+ case 66 : ' Thai
+' case 81 : sExpression(1) = "���" : sExpression(2) = "���" ' Japanese
+ ' case 82 : ' Korean
+ ' case 86 : ' Chinese (simplified)
+ ' case 88 : ' Chinese (traditional)
+ case 90 : ' Turkish
+ case 91 : ' Hindi
+ case 96 : ' Arab
+ case 97 : ' Hebrew
+ case else :
+' Warnlog "For the language " + iSprache +" nothing is prepared yet: insert text here and create the file"
+ printlog " :-) Will use English instead"
+ sExpression(1) = "Alle" : sExpression(2) = "Allz"
end select
if ((bAsianLan) OR (iSprache = 07)) then
@@ -113,61 +113,74 @@ testcase tiEditSearchAndReplace
Messagebox.OK
end if
sleep 2
+ hTypeKeys "<MOD1 HOME>" '/// Select the text ///'
+ '/// Edit-Find & Replace I///'
EditSearchAndReplace
sleep 1
Kontext "FindAndReplace"
+ '/// Clap the 'more options'-part open ///'
More.Click
+ '/// verify, that search is done without 'similarity search' !!! ///'
if SimilaritySearch.IsChecked = TRUE then
SimilaritySearch.UnCheck
warnlog "'Similar search' checkbox was enabled! It shouldn't be the default!"
end if
+ SearchFor.SetText sExpression(1) '/// set Search text ///'
+ ReplaceWith.SetText sExpression(2) '/// set Replace text///'
+ '/// Word has to be there ONLY three times ///'
+ SearchNow.Click '/// 1st search for text ///'
Kontext "Messagebox"
- if Messagebox.Exists(2) then
- Printlog Messagebox.GetText
- Messagebox.OK
- end if
+ if Messagebox.Exists(2) then
+ Printlog Messagebox.GetText
+ Messagebox.OK
+ end if
sleep 1
Kontext "FindAndReplace"
+ SearchNow.Click '/// 2nd search for text ///'
Kontext "Messagebox"
- if Messagebox.Exists(2) then
- Printlog Messagebox.GetText
- Messagebox.OK
- end if
+ if Messagebox.Exists(2) then
+ Printlog Messagebox.GetText
+ Messagebox.OK
+ end if
sleep 1
Kontext "FindAndReplace"
+ SearchNow.Click '/// 3th search for text///'
Kontext "Messagebox"
- if Messagebox.Exists(2) then
- Printlog Messagebox.GetText
- Messagebox.OK
- end if
+ if Messagebox.Exists(2) then
+ Printlog Messagebox.GetText
+ Messagebox.OK
+ end if
sleep 1
Kontext "FindAndReplace"
+ SearchNow.Click '/// 4th search for text; but it is no more available!///'
sleep 2
kontext "Messagebox"
if Messagebox.Exists Then
Printlog "- The word was found 3 times: '" + messagebox.gettext + "'"
Messagebox.OK
else
+ SearchNow.Click '/// 5th search for word 1///'
kontext
if Messagebox.Exists (5) Then
Printlog "?: "+Messagebox.gettext
- Warnlog "- No MsgBox appeared: 'changed'"
+ Warnlog "- No MsgBox appeared: 'changed'"
Messagebox.OK
endif
Warnlog "- No MsgBox appeared: 'changed'"
end if
+ '/// Replace all ///'
Kontext "FindAndReplace"
sleep 1
ReplaceAll.Click
Kontext "Messagebox"
if Not Messagebox.Exists (2) then
- ' Warnlog " Not all words are replaced" ' there never was a mesagebox ! (compared to 5.2)
+ ' Warnlog " Not all words are replaced" ' there never was a mesagebox ! (compared to 5.2)
else
printlog messagebox.gettext
qaerrorlog "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
@@ -175,6 +188,7 @@ testcase tiEditSearchAndReplace
end if
Kontext "FindAndReplace"
sleep 2
+ SearchNow.Click '/// Search for word 1 to check if all words are replaced ///'
Kontext "Messagebox"
if Not Messagebox.Exists then
Warnlog " Not all words are replaced (Replace All)"
@@ -186,13 +200,17 @@ testcase tiEditSearchAndReplace
FindAndReplace.Close
sleep 3
+ '/// Edit-Find & Replace II ///'
gMouseClick 50,50
sleep 1
hTypeKeys "<MOD1 HOME>"
EditSearchAndReplace
sleep 1
Kontext "FindAndReplace"
+ SearchFor.SetText sExpression(2) '/// Search for word 2 ///'
+ ReplaceWith.SetText sExpression(1) '/// Replace with word 1 ///'
+ Replace.Click '/// Replace 1 ///'
Kontext "Messagebox"
if Messagebox.Exists(4) Then
Kontext "Messagebox"
@@ -204,6 +222,7 @@ testcase tiEditSearchAndReplace
Kontext "FindAndReplace"
sleep 1
+ SearchNow.Click '/// 2nd search for word 2 ///'
Kontext "Messagebox"
if Messagebox.Exists(2) Then
Warnlog " All words got replaced, but only the 1st should have been"
@@ -214,6 +233,7 @@ testcase tiEditSearchAndReplace
Printlog " Word replaced"
end if
+ '/// Replace all ///'
Kontext "FindAndReplace"
ReplaceAll.Click
kontext "Messagebox"
@@ -223,6 +243,7 @@ testcase tiEditSearchAndReplace
Printlog "- No messagebox after replace all"
end if
+ '/// Search for word 2 to check if all are replaced ///'
Kontext "FindAndReplace"
SearchNow.Click
kontext "Messagebox"
@@ -237,98 +258,111 @@ testcase tiEditSearchAndReplace
More.Click
FindAndReplace.Close
sleep 2
+ '/// Close document ///'
Call hCloseDocument
-endcase
-
+
+endcase 'tiEditSearchAndReplace
+'--------------------------------------------------------
testcase tiEditSearchAndReplaceBUGS
- dim i as integer
- dim bTemp as boolean
- Call hNewDocument
- sleep 3
- EditSearchAndReplace
- Kontext "FindAndReplace"
- if FindAndReplace.Exists (5) then
- Printlog "Dialog for Search&Replace could be opened :-)"
- else
- Warnlog "Dialog for Search&Replace could NOT be opened :-("
- endif
+'/// inspired by bugs: 101974, 101975, 101976 ///'
+ dim i as integer
+ dim bTemp as boolean
- for i = 1 to 6
- Printlog "- " + i + " View->Workspace->... ------------------------------------------------------"
- try
- select case i
+ '/// open application ///'
+ Call hNewDocument
+ sleep 3
+ '/// Edit->Search and Replace ///'
+ EditSearchAndReplace
+ Kontext "FindAndReplace"
+ if FindAndReplace.Exists (5) then
+ Printlog "Dialog for Search&Replace could be opened :-)"
+ else
+ Warnlog "Dialog for Search&Replace could NOT be opened :-("
+ endif
+
+ '/// for al 5 views in 'View->Workspace->...' do: ///'
+ for i = 1 to 6
+ Printlog "- " + i + " View->Workspace->... ------------------------------------------------------"
+ try
+ select case i
case 1:Printlog " Drawing"
- ViewWorkspaceDrawingView
+ ViewWorkspaceDrawingView
case 2:Printlog " Outline"
- ViewWorkspaceOutlineView
+ ViewWorkspaceOutlineView
case 3:Printlog " Slides"
- ViewWorkspaceSlidesView
+ ViewWorkspaceSlidesView
case 4:Printlog " Notes"
- ViewWorkspaceNotesView
+ ViewWorkspaceNotesView
case 5:Printlog " Handout"
- ' this is done this way, to regcognize BUGID:101975
- ViewWorkspaceHandoutView
+ ' this is done this way, to regcognize BUGID:101975
+ ViewWorkspaceHandoutView
case 6:Printlog " Drawing"
- ViewWorkspaceDrawingView
+ ViewWorkspaceDrawingView
+ end select
+ catch
+ Warnlog "Couldn't excecute the last view ^^^^^^^^^ :-("
+ Printlog "Will close the search&replace dialog as a workaround and then try to switch to the view again"
+ Kontext "FindAndReplace"
+ FindAndReplace.close
+ sleep 5
+ try
+ select case i
+ case 1:ViewWorkspaceDrawingView
+ case 2:ViewWorkspaceOutlineView
+ case 3:ViewWorkspaceSlidesView
+ case 4:ViewWorkspaceNotesView
+ case 5:ViewWorkspaceHandoutView
end select
- catch
- Warnlog "Couldn't excecute the last view ^^^^^^^^^ :-("
- Printlog "Will close the search&replace dialog as a workaround and then try to switch to the view again"
- Kontext "FindAndReplace"
- FindAndReplace.close
- sleep 5
- try
- select case i
- case 1:ViewWorkspaceDrawingView
- case 2:ViewWorkspaceOutlineView
- case 3:ViewWorkspaceSlidesView
- case 4:ViewWorkspaceNotesView
- case 5:ViewWorkspaceHandoutView
- end select
- catch
- Warnlog "Couldn't really switch the view :-("
- endcatch
- endcatch
- sleep 5
- Kontext "FindAndReplace"
- if (FindAndReplace.exists <> TRUE) then
+ catch
+ Warnlog "Couldn't really switch the view :-("
+ endcatch
+ endcatch
+ sleep 5
+ Kontext "FindAndReplace"
+ '///+ if not already open, open. edit->search and replace ///'
+ if (FindAndReplace.exists <> TRUE) then
+ try
+ EditSearchAndReplace
+ catch
+ endcatch
+ endif
+ if (FindAndReplace.exists <> TRUE) then
+ if (i=3) then
+ ' SlideView
+ else
+ Warnlog "Search and replace was not open, and could not be opened :-("
+ endif
+ else
+ Kontext "FindAndReplace"
+ '///+ set text to look for to "a" ///'
+ SearchFor.SetText "a"
+ Printlog "'///+ click button 'find' ///'"
+ SearchNow.Click
+ sleep 5
+ kontext
+ '///+ if active exists 'wrap/not found...' say OK ///'
+ if active.exists(5) then
+ Printlog "Active: '" + active.GetText + "'"
try
- EditSearchAndReplace
+ active.ok
catch
+ active.yes
+ sleep 2
+ if active.exists(5) then
+ Printlog "Active: '" + active.GetText + "'"
+ active.ok
+ endif
endcatch
- endif
- if (FindAndReplace.exists <> TRUE) then
- if (i=3) then
- ' SlideView
- else
- Warnlog "Search and replace was not open, and could not be opened :-("
- endif
- else
- Kontext "FindAndReplace"
- SearchFor.SetText "a"
- SearchNow.Click
- sleep 5
- kontext
- if active.exists(5) then
- Printlog "Active: '" + active.GetText + "'"
- try
- active.ok
- catch
- active.yes
- sleep 2
- if active.exists(5) then
- Printlog "Active: '" + active.GetText + "'"
- active.ok
- endif
- endcatch
- else
- ' this is done this way, to regcognize BUGID:101974
- Warnlog "No message about 'search key not found' :-("
- endif
- endif
- next i
- Kontext "FindAndReplace"
- FindAndReplace.cancel
- Call hCloseDocument
-endcase
+ else
+ ' this is done this way, to regcognize BUGID:101974
+ Warnlog "No message about 'search key not found' :-("
+ endif
+ endif
+ next i
+ Kontext "FindAndReplace"
+ FindAndReplace.cancel
+ '/// close application ///'
+ Call hCloseDocument
+
+endcase 'tiEditSearchAndReplaceBUGS