automationdev300m87: #i112208# - Modified tDocumentFilename and tDocumentTemplate to make them compatible with hFileOpenLocally(). Need to verify on Windows though, Linux is good.

This commit is contained in:
Joerg Skottke [jsk] 2010-09-15 13:04:51 +02:00
parent 6347f601e9
commit 139b369673

View file

@ -320,7 +320,7 @@ testcase tDocumentChapter
'/// Open test file chapterTest.sxw '/// Open test file chapterTest.sxw
hFileOpenLocally( sTestFile ) hFileOpenLocally( sTestFile )
Call wTypeKeys "<MOD1 End><Return>" Call wTypeKeys "<MOD1 End><Return>"
@ -357,12 +357,12 @@ endcase
testcase tDocumentDate testcase tDocumentDate
Dim sDate as String Dim sDate as String
printlog "Insert/Fields/Other/Document / Date" printlog "Insert/Fields/Other/Document / Date"
'/// <b> Insert/Fields/Other/Document / Date </b> '/// <b> Insert/Fields/Other/Document / Date </b>
Call hNewDocument Call hNewDocument
'/// Insert/Fields/Other/Document / Date '/// Insert/Fields/Other/Document / Date
'/// Check if the insertion is correct '/// Check if the insertion is correct
Call fInsertFieldsOther("TabDokumentFeldbefehle") Call fInsertFieldsOther("TabDokumentFeldbefehle")
@ -371,14 +371,14 @@ testcase tDocumentDate
Einfuegen.Click Einfuegen.Click
Kontext "TabDokumentFeldbefehle" Kontext "TabDokumentFeldbefehle"
TabDokumentFeldbefehle.Close TabDokumentFeldbefehle.Close
Call wTypeKeys "<Shift Left>" Call wTypeKeys "<Shift Left>"
EditCopy EditCopy
Sleep 1 Sleep 1
if GetClipboard = "" then if GetClipboard = "" then
Warnlog "Field returns an empty string" Warnlog "Field returns an empty string"
end if end if
Call hCloseDocument Call hCloseDocument
endcase endcase
@ -386,56 +386,57 @@ endcase
'----------------------------------------------------------------- '-----------------------------------------------------------------
testcase tDocumentFilename testcase tDocumentFilename
if bAsianLan = true then
QaErrorLog "No testing with Asian language. Aborting." if ( bAsianLan ) then
goto endsub QaErrorLog "No testing with Asian language. Aborting."
end if goto endsub
end if
Dim sTestFile as String
Dim sFilename(4) as String Dim sTestFile as String
Dim i as Integer Dim sFilename(4) as String
Dim i as Integer
sTestFile = gTesttoolpath & "writer\optional\input\fields\pageTest.sxw"
sTestFile = convertpath( gTesttoolPath & "writer\optional\input\fields\pageTest.sxw" )
sFilename(0) = "pageTest.sxw"
sFilename(1) = "pageTest" sFilename(0) = "pageTest.sxw"
sFilename(2) = Convertpath( gOfficepath + "user\work\" ) sFilename(1) = "pageTest"
sFilename(3) = sTestFile sFilename(2) = hGetWorkPath()
sFilename(3) = hFileGetLocalPath( sTestFile )
printlog "Insert/Fields/Other/Document / File name"
printlog "Insert/Fields/Other/Document / File name"
Call hNewDocument
Call hNewDocument
'/// Open test file pageTest.sxw
hFileOpenLocally( sTestFile ) '/// Open test file pageTest.sxw
hFileOpenLocally( sTestFile )
Call wTypeKeys "<MOD1 Home>"
Call wTypeKeys "<End><Return>" Call wTypeKeys "<MOD1 Home>"
Call wTypeKeys "<End><Return>"
printlog "Insert/Fields/Other/Document / File name"
printlog "Insert File name, File name without extension , Path , Path/File name" printlog "Insert/Fields/Other/Document / File name"
printlog "Check if the insertion is correct" printlog "Insert File name, File name without extension , Path , Path/File name"
Call fInsertFieldsOther("TabDokumentFeldbefehle") printlog "Check if the insertion is correct"
Feldtyp.Select fGetType("File name") Call fInsertFieldsOther("TabDokumentFeldbefehle")
for i = 0 to 3 Feldtyp.Select fGetType("File name")
Kontext "TabDokumentFeldbefehle" for i = 0 to 3
Formatliste.Select i+1 Kontext "TabDokumentFeldbefehle"
Sleep 1 Formatliste.Select i+1
Einfuegen.Click Sleep 1
sleep 1 Einfuegen.Click
Call wTypeKeys "<F9>" sleep 1
Sleep 2 Call wTypeKeys "<F9>"
Call wTypeKeys "<Shift LEFT>" 'HOME Sleep 2
Sleep 1 Call wTypeKeys "<Shift LEFT>" 'HOME
if fGetFieldContent() <> sFilename(i) then Sleep 1
Warnlog i &" - Should get " & sFilename(i) & " but get " & fGetFieldContent() if fGetFieldContent() <> sFilename(i) then
end if Warnlog i &" - Should get " & sFilename(i) & " but get " & fGetFieldContent()
Call wTypeKeys "<Delete>" end if
next i Call wTypeKeys "<Delete>"
Kontext "TabDokumentFeldbefehle" next i
TabDokumentFeldbefehle.Close Kontext "TabDokumentFeldbefehle"
TabDokumentFeldbefehle.Close
Call hCloseDocument
Call hCloseDocument
endcase endcase
@ -462,7 +463,7 @@ testcase tDocumentPage
'/// Open test file pageTest.sxw which includes 3 pages '/// Open test file pageTest.sxw which includes 3 pages
hFileOpenLocally( sTestFile ) hFileOpenLocally( sTestFile )
'/// Go to the 2nd page '/// Go to the 2nd page
Call wTypeKeys "<MOD1 Home>" Call wTypeKeys "<MOD1 Home>"
@ -915,25 +916,25 @@ testcase tDocumentTemplate
Dim sFormat() as String Dim sFormat() as String
Dim sResult(6) as String Dim sResult(6) as String
Dim i as Integer Dim i as Integer
sLanguage = fGetDirLanguage() sLanguage = fGetDirLanguage()
sTestFile = gTesttoolpath + "writer\optional\input\fields\diploma.ott" sTestFile = convertpath( gTesttoolpath + "writer\optional\input\fields\diploma.ott" )
sResult(0) = fGetCateGory() sResult(0) = fGetCategory()
sResult(1) = "diploma.ott" sResult(1) = "diploma.ott"
sResult(2) = "diploma" sResult(2) = "diploma"
sResult(3) = Convertpath (gOfficepath + "user\work") sResult(3) = convertpath( gOfficePath & "user/work" )
sResult(4) = sTestFile sResult(4) = hGetWorkFile( sResult( 1 ) )
sResult(5) = fGetStyle() sResult(5) = fGetStyle()
printlog "Insert/Fields/Other/Document / Template" printlog "Insert/Fields/Other/Document / Template"
'/// <b> Insert/Fields/Other/Document / Template </b> '/// <b> Insert/Fields/Other/Document / Template </b>
'/// Open test file diploma.ott '/// Open test file diploma.ott
hFileOpenLocally( sTestFile ) hFileOpenLocally( sTestFile )
Call wTypeKeys "<MOD1 Home>" Call wTypeKeys "<MOD1 Home>"
'/// Insert/Fields/Other/Document / Template '/// Insert/Fields/Other/Document / Template
'/// Insert Category , File name , File name without extension , '/// Insert Category , File name , File name without extension ,
'/// + Path , Path/File name , Style '/// + Path , Path/File name , Style
@ -963,10 +964,8 @@ testcase tDocumentTemplate
next i next i
Kontext "TabDokumentFeldbefehle" Kontext "TabDokumentFeldbefehle"
TabDokumentFeldbefehle.Close TabDokumentFeldbefehle.Close
Do Until GetDocumentCount = 0 hFileCloseAll()
Call hCloseDocument
Loop
endcase endcase
'----------------------------------------------------------------- '-----------------------------------------------------------------