@@ -23,49 +23,35 @@ I will try to accomodate as much as I could as time permit. **There is no need t
2323
2424If you are interested to contribute back to this project, please see **Contributing ** section.
2525
26- Example
27- '''''''
28-
29- +----------------+----------------------+---------------------------+-----------------+
30- | Open Mailbox
| host=imap.domain.com
| [email protected] | password=secret
| 31- +----------------+----------------------+---------------------------+-----------------+
32- | ${LATEST} =
| Wait For Email
| [email protected] | timeout=300
| 33- +----------------+----------------------+---------------------------+-----------------+
34- | ${HTML} = | Open Link From Email | ${LATEST} |
35- +----------------+----------------------+---------------------------------------------+
36- | Should Contain | ${HTML} | Your email address has been updated |
37- +----------------+----------------------+---------------------------------------------+
38- | Close Mailbox |
39- +-------------------------------------------------------------------------------------+
40-
41- Multipart Email Example
42- '''''''''''''''''''''''
43-
44- +----------------+----------------------+---------------------------+-----------------+
45- | Open Mailbox
| host=imap.domain.com
| [email protected] | password=secret
| 46- +----------------+----------------------+---------------------------+-----------------+
47- | ${LATEST} =
| Wait For Email
| [email protected] | timeout=300
| 48- +----------------+----------------------+---------------------------+-----------------+
49- | ${parts} = | Walk Multipart Email | ${LATEST} |
50- +----------------+----------------------+---------------------------+-----------------+
51- | :FOR | ${i} | IN RANGE | ${parts} |
52- +----------------+----------------------+---------------------------+-----------------+
53- | \\ | Walk Multipart Email | ${LATEST} |
54- +----------------+----------------------+---------------------------------------------+
55- | \\ | ${content-type} = | Get Multipart Content Type |
56- +----------------+----------------------+---------------------------------------------+
57- | \\ | Continue For Loop If | '${content-type}' != 'text/html' |
58- +----------------+----------------------+---------------------------+-----------------+
59- | \\ | ${payload} = | Get Multipart Payload | decode=True |
60- +----------------+----------------------+---------------------------+-----------------+
61- | \\ | Should Contain | ${payload} | your email |
62- +----------------+----------------------+---------------------------+-----------------+
63- | \\ | ${HTML} = | Open Link From Email | ${LATEST} |
64- +----------------+----------------------+---------------------------+-----------------+
65- | \\ | Should Contain | ${HTML} | Your email |
66- +----------------+----------------------+---------------------------+-----------------+
67- | Close Mailbox |
68- +-------------------------------------------------------------------------------------+
26+ Examples
27+ ''''''''
28+
29+ .. code :: robotframework
30+
31+ *** Settings ***
32+ Library ImapLibrary
33+
34+ *** Test Cases ***
35+ Email Verification
36+ Open Mailbox host=imap.domain.com [email protected] password=secret 37+ ${LATEST} = Wait For Email [email protected] timeout=300 38+ ${HTML} = Open Link From Email ${LATEST}
39+ Should Contain ${HTML} Your email address has been updated
40+ Close Mailbox
41+
42+ Multipart Email Verification
43+ Open Mailbox host=imap.domain.com [email protected] password=secret 44+ ${LATEST} = Wait For Email [email protected] timeout=300 45+ ${parts} = Walk Multipart Email ${LATEST}
46+ :FOR ${i} IN RANGE ${parts}
47+ \\ Walk Multipart Email ${LATEST}
48+ \\ ${content-type} = Get Multipart Content Type
49+ \\ Continue For Loop If '${content-type}' != 'text/html'
50+ \\ ${payload} = Get Multipart Payload decode=True
51+ \\ Should Contain ${payload} your email
52+ \\ ${HTML} = Open Link From Email ${LATEST}
53+ \\ Should Contain ${HTML} Your email
54+ Close Mailbox
6955
7056 Installation
7157------------
@@ -75,15 +61,15 @@ Using ``pip``
7561
7662The recommended installation method is using pip _:
7763
78- .. code :: bash
64+ .. code :: console
7965
8066 pip install robotframework-imaplibrary
8167
8268 The main benefit of using ``pip `` is that it automatically installs all
8369dependencies needed by the library. Other nice features are easy upgrading
8470and support for un-installation:
8571
86- .. code :: bash
72+ .. code :: console
8773
8874 pip install --upgrade robotframework-imaplibrary
8975 pip uninstall robotframework-imaplibrary
@@ -92,7 +78,7 @@ Notice that using ``--upgrade`` above updates both the library and all
9278its dependencies to the latest version. If you want, you can also install
9379a specific version:
9480
95- .. code :: bash
81+ .. code :: console
9682
9783 pip install robotframework-imaplibrary==x.x.x
9884
@@ -128,23 +114,23 @@ and its dependencies yourself.
128114
129115- Find each public key used to sign the package:
130116
131- .. code :: bash
117+ .. code :: console
132118
133119 gpg --keyserver pgp.mit.edu --search-keys D1406DE7
134120
135121 - Select the number from the list to import the public key
136122
137123- Verify the package against its PGP signature:
138124
139- .. code :: bash
125+ .. code :: console
140126
141127 gpg --verify robotframework-imaplibrary-x.x.x.tar.gz.asc robotframework-imaplibrary-x.x.x.tar.gz
142128
143129 - Extract each source distribution to a temporary location.
144130
145131- Go to each created directory from the command line and install each project using:
146132
147- .. code :: bash
133+ .. code :: console
148134
149135 python setup.py install
150136
@@ -174,11 +160,10 @@ Usage
174160To write tests with Robot Framework and ImapLibrary,
175161ImapLibrary must be imported into your Robot test suite.
176162
177- +-----------------------+
178- | *** Settings * ** |
179- +---------+-------------+
180- | Library | ImapLibrary |
181- +---------+-------------+
163+ .. code :: robotframework
164+
165+ *** Settings ***
166+ Library ImapLibrary
182167
183168 See `Robot Framework User Guide `_ for more information.
184169
@@ -190,7 +175,7 @@ Building Keyword Documentation
190175
191176The `Keyword Documentation `_ can be found online, if you need to generate the keyword documentation, run:
192177
193- .. code :: bash
178+ .. code :: console
194179
195180 make doc
196181
@@ -199,7 +184,7 @@ Run Unit Tests, and Test Coverage Report
199184
200185Test the testing library, talking about dogfooding, let's run:
201186
202- .. code :: bash
187+ .. code :: console
203188
204189 make test
205190
0 commit comments