robotframework-imaplibrary icon indicating copy to clipboard operation
robotframework-imaplibrary copied to clipboard

Looks that `Delete All Emails` keyword does not work straight away

Open gsikorski opened this issue 9 years ago • 2 comments

If there is something in the mailbox, calling Delete All Emails soon after Open Mailbox keyword does not seem to do anything (calling Wait For Email after returns me emails straight away). It works though if I Delete All Emails and Close mailbox in the test teardown. I was trying to solve this issue with:

Open Mailbox
Delete All Emails
Close mailbox
Open Mailbox

but it looks the emails are still there :( Is there any lag/cached test data that may cause invalid state?

gsikorski avatar Oct 13 '16 16:10 gsikorski

Pull Request #13 should fix this issue.

mayribeirofernandes avatar Apr 04 '18 13:04 mayribeirofernandes

@rickypc Interested to know when the fix for this issue (and others) available upstream. The last pypi version is 0.3.0 which is released on 10 Nov, 2016. Also I am facing similar issue where deleting email at specific index doesn't work and stays in the inbox (tried with gmail). Using this keyword for deleting specific email. Snapshot below if I am missing something:

Get Payload From Multipart Email
    [Arguments]    ${subject}   ${timeout}
    ${LATEST} =    Wait For Email    timeout=${timeout}
    ...    subject=${subject}    status=UNSEEN
    ${parts} =    Walk Multipart Email    ${LATEST}

    :FOR    ${i}    IN RANGE    ${parts}
    \    Walk Multipart Email    ${LATEST}
    \    ${ctype} =    Get Multipart Content Type
    \    Continue For Loop If    '${ctype}' != 'text/html'
    \    ${payload} =    Get Multipart Payload    decode=True
    \    Exit For Loop
    Delete Email    ${LATEST}
    [Return]    ${payload}

Thanks in advance.

vishal-yadav avatar Jan 17 '19 09:01 vishal-yadav