|
@@ -27,6 +27,10 @@ Task Template Download Statement
|
|
|
|
|
|
*** Variables ***
|
|
|
${HOME_PAGE} https://www.asb.co.nz
|
|
|
+${EXPORT_PREFIX} Export
|
|
|
+${SAVE_PREFIX} Robot
|
|
|
+${SAVE_TYPE} ofx
|
|
|
+${SAVE_SUBTYPE} MS Money
|
|
|
${LANDING_PAGE} ${EMPTY}
|
|
|
${FROM_DATE} ${EMPTY}
|
|
|
${TO_DATE} ${EMPTY}
|
|
@@ -45,7 +49,7 @@ Page Should Contain
|
|
|
Should Contain ${page} ${expected}
|
|
|
|
|
|
Output Directory Is Dirty
|
|
|
- File Should Exist ${OUTPUTDIR}/Export*.ofx
|
|
|
+ File Should Exist ${OUTPUTDIR}/${EXPORT_PREFIX}*.${SAVE_TYPE}
|
|
|
|
|
|
Set Executable Status
|
|
|
${status}= Run Keyword And Return Status Output Directory Is Dirty
|
|
@@ -125,17 +129,19 @@ Download Statement
|
|
|
Fill Text xpath=//*[@id="Request_ToDate_inputYear"] ${TO_DATE_year}
|
|
|
Fill Text xpath=//*[@id="Request_ToDate_inputMonth"] ${TO_DATE_month}
|
|
|
Fill Text xpath=//*[@id="Request_ToDate_inputDate"] ${TO_DATE_day}
|
|
|
- Promise To Wait For Download ${OUTPUTDIR}/Export-${account}.ofx
|
|
|
+ Click xpath=//*[@id="Request_ExportFormat_input"]
|
|
|
+ Click xpath=//li[contains(.,'${SAVE_TYPE.upper()}') and contains(.,'${SAVE_SUBTYPE}')]
|
|
|
+ Promise To Wait For Download ${OUTPUTDIR}/${EXPORT_PREFIX}-${account}.${SAVE_TYPE}
|
|
|
Click xpath=//input[@value="Export"]
|
|
|
Wait For All Promises
|
|
|
${status}= Run Keyword And Return Status
|
|
|
- ... Wait Until Created ${OUTPUTDIR}/Export*.ofx timeout=5 seconds
|
|
|
+ ... Wait Until Created ${OUTPUTDIR}/${EXPORT_PREFIX}*.${SAVE_TYPE} timeout=5 seconds
|
|
|
Run Keyword If not ${status} Take Screenshot
|
|
|
Run Keyword If not ${status} Fail msg=No file downloaded for account: ${account}
|
|
|
${files}= List Files In Directory ${OUTPUTDIR}
|
|
|
FOR ${f} IN @{files}
|
|
|
- Continue For Loop If not '${f}'.startswith('Export')
|
|
|
- Move File ${OUTPUTDIR}${/}${f} ${OUTPUTDIR}${/}${account}-${f}
|
|
|
+ Continue For Loop If not '${f}'.startswith('${EXPORT_PREFIX}')
|
|
|
+ Move File ${OUTPUTDIR}${/}${f} ${OUTPUTDIR}${/}${SAVE_PREFIX}-${account}.${SAVE_TYPE}
|
|
|
Return From Keyword
|
|
|
END
|
|
|
Fail msg=Failed to save downloaded account statement to ${OUTPUTDIR}: ${account}
|