|
@@ -24,6 +24,9 @@ Task Template Download Statement
|
|
|
|
|
|
*** Variables ***
|
|
|
${HOME_PAGE} https://sbsbank.co.nz
|
|
|
+${EXPORT_PREFIX} SB
|
|
|
+${SAVE_PREFIX} Robot
|
|
|
+${SAVE_TYPE} csv
|
|
|
${LANDING_PAGE} ${EMPTY}
|
|
|
${FROM_DATE} ${EMPTY}
|
|
|
${TO_DATE} ${EMPTY}
|
|
@@ -42,7 +45,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
|
|
@@ -85,23 +88,24 @@ Download Statement
|
|
|
${old_timeout}= Set Browser Timeout 30 seconds
|
|
|
Click xpath=//div/h2[contains(.,'Account Manager')]/..//div[@data-focusable="true"]/div[contains(.,'${account.upper()}')]
|
|
|
${account_code}= Get Text xpath=//iframe >>> div.chosen-container >> span.account-bsb-number #css=div.chosen-container >> span.account-bsb-number
|
|
|
+ ${account_code}= Convert To Uppercase ${account_code}
|
|
|
Click xpath=//iframe >>> xpath=//label[contains(.,'date range')]/.. >> .ui-selectmenu-icon
|
|
|
Click xpath=//iframe >>> .ui-selectmenu-menu >> .ui-menu-item >> xpath=//*[contains(.,'The last 3 months')]
|
|
|
Click xpath=//iframe >>> .btn--export-all
|
|
|
Click xpath=//iframe >>> xpath=//label[contains(.,'Export Format')]/.. >> .ui-selectmenu-icon
|
|
|
- Click xpath=//iframe >>> .ui-selectmenu-menu >> .ui-menu-item >> xpath=//*[contains(.,'Comma Separated Values')]
|
|
|
+ Click xpath=//iframe >>> .ui-selectmenu-menu >> .ui-menu-item >> xpath=//*[contains(.,'${SAVE_TYPE.upper()}')]
|
|
|
${now}= Get Current Date result_format=%Y%m%d
|
|
|
- Promise To Wait For Download ${OUTPUTDIR}/SB${account_code}_${now}.csv
|
|
|
+ Promise To Wait For Download ${OUTPUTDIR}/${EXPORT_PREFIX}${account_code}_${now}.${SAVE_TYPE}
|
|
|
Click xpath=//iframe >>> .btn--download
|
|
|
Wait For All Promises
|
|
|
${status}= Run Keyword And Return Status
|
|
|
- ... Wait Until Created ${OUTPUTDIR}/SB*.csv 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('SB')
|
|
|
- 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}
|