Skip to main content

A IMAP email testing library for Robot Framework

Project description

IMAP email testing library for Robot Framework

Docs Version Status Python Download License

Introduction

Note: This is a fork of https://github.com/rickypc/robotframework-imaplibrary

ImapLibrary is a IMAP email testing library for Robot Framework.

More information about this library can be found in the Keyword Documentation.

Maintainership Transfer

Please note the new authoritative git repository for robotframework-imaplibrary package is: https://github.com/rickypc/robotframework-imaplibrary

robotframework-imaplibrary package ownership is transitioned to me as the new project maintainer.

I will go through the pull requests from previous repository, as well as issue list. I will try to accomodate as much as I could as time permit. There is no need to re-post.

If you are interested to contribute back to this project, please see Contributing section.

Examples

*** Settings ***
Library    ImapLibrary

*** Test Cases ***
Email Verification
    Open Mailbox    host=imap.domain.com    user=email@domain.com    password=secret
    ${LATEST} =    Wait For Email    sender=noreply@domain.com    timeout=300
    ${HTML} =    Open Link From Email    ${LATEST}
    Should Contain    ${HTML}    Your email address has been updated
    Close Mailbox

Multipart Email Verification
    Open Mailbox    host=imap.domain.com    user=email@domain.com    password=secret
    ${LATEST} =    Wait For Email    sender=noreply@domain.com    timeout=300
    ${parts} =    Walk Multipart Email    ${LATEST}
    :FOR    ${i}    IN RANGE    ${parts}
    \\    Walk Multipart Email    ${LATEST}
    \\    ${content-type} =    Get Multipart Content Type
    \\    Continue For Loop If    '${content-type}' != 'text/html'
    \\    ${payload} =    Get Multipart Payload    decode=True
    \\    Should Contain    ${payload}    your email
    \\    ${HTML} =    Open Link From Email    ${LATEST}
    \\    Should Contain    ${HTML}    Your email
    Close Mailbox

Installation

Using pip

The recommended installation method is using pip:

pip install robotframework-imaplibrary

The main benefit of using pip is that it automatically installs all dependencies needed by the library. Other nice features are easy upgrading and support for un-installation:

pip install --upgrade robotframework-imaplibrary
pip uninstall robotframework-imaplibrary

Notice that using --upgrade above updates both the library and all its dependencies to the latest version. If you want, you can also install a specific version:

pip install robotframework-imaplibrary==x.x.x

Proxy configuration

If you are behind a proxy, you can use --proxy command line option or set http_proxy and/or https_proxy environment variables to configure pip to use it. If you are behind an authenticating NTLM proxy, you may want to consider installing CNTML to handle communicating with it.

For more information about --proxy option and using pip with proxies in general see:

Manual installation

If you do not have network connection or cannot make proxy to work, you need to resort to manual installation. This requires installing both the library and its dependencies yourself.

gpg --keyserver pgp.mit.edu --search-keys D1406DE7
  • Select the number from the list to import the public key
  • Verify the package against its PGP signature:
gpg --verify robotframework-imaplibrary-x.x.x.tar.gz.asc robotframework-imaplibrary-x.x.x.tar.gz
  • Extract each source distribution to a temporary location.
  • Go to each created directory from the command line and install each project using:
python setup.py install

If you are on Windows, and there are Windows installers available for certain projects, you can use them instead of source distributions. Just download 32bit or 64bit installer depending on your system, double-click it, and follow the instructions.

Directory Layout

doc/ : Keyword documentation

src/ : Python source code

test/ : Test files

utest/
:   Python unit test

Usage

To write tests with Robot Framework and ImapLibrary, ImapLibrary must be imported into your Robot test suite.

*** Settings ***
Library    ImapLibrary

See Robot Framework User Guide for more information.

More information about Robot Framework standard libraries and built-in tools can be found in the Robot Framework Documentation.

Building Keyword Documentation

The Keyword Documentation can be found online, if you need to generate the keyword documentation, run:

make doc

Run Unit Tests, and Test Coverage Report

Test the testing library, talking about dogfooding, let's run:

make test

Contributing

If you would like to contribute code to Imap Library project you can do so through GitHub by forking the repository and sending a pull request.

When submitting code, please make every effort to follow existing conventions and style in order to keep the code as readable as possible. Please also include appropriate test cases.

Before your code can be accepted into the project you must also sign the Imap Library CLA (Individual Contributor License Agreement).

That's it! Thank you for your contribution!

License

Copyright (c) 2015-2016 Richard Huang.

This library is free software, licensed under: Apache License, Version 2.0.

Documentation and other similar content are provided under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

robotframework-imaplibrary2-0.3.4.tar.gz (62.5 kB view details)

Uploaded Source

Built Distribution

robotframework_imaplibrary2-0.3.4-py2.py3-none-any.whl (13.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file robotframework-imaplibrary2-0.3.4.tar.gz.

File metadata

  • Download URL: robotframework-imaplibrary2-0.3.4.tar.gz
  • Upload date:
  • Size: 62.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.4

File hashes

Hashes for robotframework-imaplibrary2-0.3.4.tar.gz
Algorithm Hash digest
SHA256 1c4ac981f8181b6cf2b0add7604d729903ce9850aa86dcd4adf9294a1f17d1d0
MD5 3a37aa04058f988e6f256de995ce81a3
BLAKE2b-256 ab318720b66fd72ec78aa15861937800a92e70c16fba45705ddf0311260f55c2

See more details on using hashes here.

File details

Details for the file robotframework_imaplibrary2-0.3.4-py2.py3-none-any.whl.

File metadata

  • Download URL: robotframework_imaplibrary2-0.3.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.4

File hashes

Hashes for robotframework_imaplibrary2-0.3.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 abb5cd75524192fd87cb5fb6e52ca5424e62db0c92223fd0f06b76019748128a
MD5 c4469235f1d4904385fe266b71830cfa
BLAKE2b-256 61adaf5a8cb53d0aeaf68fc2a429224912ffd839fd5af7b8c1c66eef19ada393

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page