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