Browse Source

Fix timeout on upgraded Browser library and add support for 2-factor authentication on login

Daniel Sheffield 2 years ago
parent
commit
0f9be31755
2 changed files with 8 additions and 2 deletions
  1. 8 1
      Download Statements.robot
  2. 0 1
      requirements.txt

+ 8 - 1
Download Statements.robot

@@ -35,6 +35,12 @@ ${TO_DATE}    ${EMPTY}
 ${SKIP}    no
 
 *** Keywords ***
+New Page
+    [Arguments]    ${url}    @{args}    &{kwargs}
+    ${old_timeout} =    Set Browser Timeout    30 seconds
+	Browser.New Page    ${url}    @{args}    &{kwargs}
+	[Teardown]    Set Browser Timeout    ${old_timeout}
+
 Page Should Contain
     [Arguments]    ${expected}
     ${page}=    Get Page Source
@@ -90,6 +96,7 @@ Enter Username And Password
 Login
     [Documentation]    Login and Return Home URL. Assumes user/password already entered.
     Click    xpath=//button[@id="loginBtn"]
+    Execute Manual Step    Complete 2-factor authentication
     Wait Until Keyword Succeeds    5x    1 second
     ...    Page Should Contain    ${ACCOUNT_HOLDER_NAME}
     ${url}=    Get Url
@@ -123,7 +130,7 @@ Download Statement
     Wait For All Promises
     ${status}=    Run Keyword And Return Status
     ...    Wait Until Created    ${OUTPUTDIR}/Export*.ofx    timeout=5 seconds
-    Run Keyword Unless     ${status}    Take Screenshot
+    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}

+ 0 - 1
requirements.txt

@@ -1,3 +1,2 @@
 robotframework
 robotframework-browser
-