forked from Silverfish/proton-bridge
We build too many walls and not enough bridges
This commit is contained in:
88
test/features/imap/auth.feature
Normal file
88
test/features/imap/auth.feature
Normal file
@ -0,0 +1,88 @@
|
||||
Feature: IMAP auth
|
||||
Scenario: Authenticates successfully
|
||||
Given there is connected user "user"
|
||||
When IMAP client authenticates "user"
|
||||
Then IMAP response is "OK"
|
||||
|
||||
Scenario: Authenticates with bad password
|
||||
Given there is connected user "user"
|
||||
When IMAP client authenticates "user" with bad password
|
||||
Then IMAP response is "IMAP error: NO backend/credentials: incorrect password"
|
||||
|
||||
Scenario: Authenticates with disconnected user
|
||||
Given there is disconnected user "user"
|
||||
When IMAP client authenticates "user"
|
||||
Then IMAP response is "IMAP error: NO bridge account is logged out, use bridge to login again"
|
||||
|
||||
Scenario: Authenticates with connected user that was loaded without internet
|
||||
Given there is connected user "user"
|
||||
And there is no internet connection
|
||||
When bridge starts
|
||||
And the internet connection is restored
|
||||
And the event loop of "user" loops once
|
||||
And IMAP client authenticates "user"
|
||||
# Problems during IMAP auth could lead to the user being disconnected.
|
||||
# This could take a few milliseconds because it happens async in separate goroutines.
|
||||
# We wait enough time for that to happen, then check that it didn't happen (user should remain connected).
|
||||
And 2 seconds pass
|
||||
Then "user" is connected
|
||||
|
||||
Scenario: Authenticates with freshly logged-out user
|
||||
Given there is connected user "user"
|
||||
When "user" logs out from bridge
|
||||
And IMAP client authenticates "user"
|
||||
Then IMAP response is "IMAP error: NO bridge account is logged out, use bridge to login again"
|
||||
|
||||
Scenario: Authenticates user which was re-logged in
|
||||
Given there is connected user "user"
|
||||
When "user" logs out from bridge
|
||||
And IMAP client authenticates "user"
|
||||
Then IMAP response is "IMAP error: NO bridge account is logged out, use bridge to login again"
|
||||
When "user" logs in to bridge
|
||||
And IMAP client authenticates "user"
|
||||
Then IMAP response is "OK"
|
||||
When IMAP client selects "INBOX"
|
||||
Then IMAP response is "OK"
|
||||
|
||||
Scenario: Authenticates with no user
|
||||
When IMAP client authenticates with username "user@pm.me" and password "bridgepassword"
|
||||
Then IMAP response is "IMAP error: NO user user@pm.me not found"
|
||||
|
||||
Scenario: Authenticates with capital letter
|
||||
Given there is connected user "userAddressWithCapitalLetter"
|
||||
When IMAP client authenticates "userAddressWithCapitalLetter"
|
||||
Then IMAP response is "OK"
|
||||
|
||||
Scenario: Authenticates with more addresses - primary one
|
||||
Given there is connected user "userMoreAddresses"
|
||||
When IMAP client authenticates "userMoreAddresses" with address "primary"
|
||||
Then IMAP response is "OK"
|
||||
|
||||
Scenario: Authenticates with more addresses - secondary one
|
||||
Given there is connected user "userMoreAddresses"
|
||||
When IMAP client authenticates "userMoreAddresses" with address "secondary"
|
||||
Then IMAP response is "OK"
|
||||
|
||||
Scenario: Authenticates with more addresses - disabled address
|
||||
Given there is connected user "userMoreAddresses"
|
||||
When IMAP client authenticates "userMoreAddresses" with address "disabled"
|
||||
Then IMAP response is "IMAP error: NO user .* not found"
|
||||
|
||||
@ignore-live
|
||||
Scenario: Authenticates with disabled primary address
|
||||
Given there is connected user "userDisabledPrimaryAddress"
|
||||
When IMAP client authenticates "userDisabledPrimaryAddress" with address "primary"
|
||||
Then IMAP response is "OK"
|
||||
|
||||
Scenario: Authenticates two users
|
||||
Given there is connected user "user"
|
||||
And there is connected user "userMoreAddresses"
|
||||
When IMAP client "imap1" authenticates "user"
|
||||
Then IMAP response to "imap1" is "OK"
|
||||
When IMAP client "imap2" authenticates "userMoreAddresses" with address "primary"
|
||||
Then IMAP response to "imap2" is "OK"
|
||||
|
||||
Scenario: Logs out user
|
||||
Given there is connected user "user"
|
||||
When IMAP client logs out
|
||||
Then IMAP response is "OK"
|
||||
62
test/features/imap/idle/basic.feature
Normal file
62
test/features/imap/idle/basic.feature
Normal file
@ -0,0 +1,62 @@
|
||||
Feature: IMAP IDLE
|
||||
Background:
|
||||
Given there is connected user "user"
|
||||
And there are 10 messages in mailbox "INBOX" for "user"
|
||||
|
||||
@ignore
|
||||
Scenario Outline: Mark as read
|
||||
Given there is IMAP client "active" logged in as "user"
|
||||
And there is IMAP client "active" selected in "INBOX"
|
||||
And there is IMAP client "idling" logged in as "user"
|
||||
And there is IMAP client "idling" selected in "INBOX"
|
||||
When IMAP client "idling" starts IDLE-ing
|
||||
And IMAP client "active" marks message "<message>" as read
|
||||
Then IMAP client "idling" receives update marking message "<message>" as read within <seconds> seconds
|
||||
Then message "<message>" in "INBOX" for "user" is marked as read
|
||||
|
||||
Examples:
|
||||
| message | seconds |
|
||||
| 1 | 2 |
|
||||
| 1:5 | 2 |
|
||||
| 1:10 | 5 |
|
||||
|
||||
@ignore
|
||||
Scenario Outline: Mark as unread
|
||||
Given there is IMAP client "active" logged in as "user"
|
||||
And there is IMAP client "active" selected in "INBOX"
|
||||
And there is IMAP client "idling" logged in as "user"
|
||||
And there is IMAP client "idling" selected in "INBOX"
|
||||
When IMAP client "idling" starts IDLE-ing
|
||||
And IMAP client "active" marks message "<message>" as unread
|
||||
Then IMAP client "idling" receives update marking message "<message>" as unread within <seconds> seconds
|
||||
And message "<message>" in "INBOX" for "user" is marked as unread
|
||||
|
||||
Examples:
|
||||
| message | seconds |
|
||||
| 1 | 2 |
|
||||
| 1:5 | 2 |
|
||||
| 1:10 | 5 |
|
||||
|
||||
@ignore
|
||||
Scenario Outline: Three IDLEing
|
||||
Given there is IMAP client "active" logged in as "user"
|
||||
And there is IMAP client "active" selected in "INBOX"
|
||||
And there is IMAP client "idling1" logged in as "user"
|
||||
And there is IMAP client "idling1" selected in "INBOX"
|
||||
And there is IMAP client "idling2" logged in as "user"
|
||||
And there is IMAP client "idling2" selected in "INBOX"
|
||||
And there is IMAP client "idling3" logged in as "user"
|
||||
And there is IMAP client "idling3" selected in "INBOX"
|
||||
When IMAP client "idling1" starts IDLE-ing
|
||||
And IMAP client "idling2" starts IDLE-ing
|
||||
And IMAP client "idling3" starts IDLE-ing
|
||||
And IMAP client "active" marks message "<message>" as read
|
||||
Then IMAP client "idling1" receives update marking message "<message>" as read within <seconds> seconds
|
||||
Then IMAP client "idling2" receives update marking message "<message>" as read within <seconds> seconds
|
||||
Then IMAP client "idling3" receives update marking message "<message>" as read within <seconds> seconds
|
||||
|
||||
Examples:
|
||||
| message | seconds |
|
||||
| 1 | 2 |
|
||||
| 1:5 | 2 |
|
||||
| 1:10 | 5 |
|
||||
28
test/features/imap/idle/two_users.feature
Normal file
28
test/features/imap/idle/two_users.feature
Normal file
@ -0,0 +1,28 @@
|
||||
Feature: IMAP IDLE with two users
|
||||
Scenario: IDLE statements are not leaked to other account
|
||||
Given there is connected user "user"
|
||||
And there are 10 messages in mailbox "INBOX" for "user"
|
||||
And there is connected user "userMoreAddresses"
|
||||
And there is IMAP client "active" logged in as "user"
|
||||
And there is IMAP client "active" selected in "INBOX"
|
||||
And there is IMAP client "idling" logged in as "userMoreAddresses"
|
||||
And there is IMAP client "idling" selected in "INBOX"
|
||||
When IMAP client "idling" starts IDLE-ing
|
||||
And IMAP client "active" marks message "1" as read
|
||||
Then IMAP client "idling" does not receive update for message "1" within 5 seconds
|
||||
|
||||
Scenario: IDLE statements are not leaked to other alias
|
||||
Given there is connected user "userMoreAddresses"
|
||||
And there is "userMoreAddresses" in "combined" address mode
|
||||
And there is "userMoreAddresses" with mailbox "Folders/mbox"
|
||||
And there are messages in mailbox "Folders/mbox" for "userMoreAddresses"
|
||||
| from | to | subject |
|
||||
| john.doe@mail.com | [primary] | foo |
|
||||
| jane.doe@mail.com | [secondary] | bar |
|
||||
And there is IMAP client "active" logged in as "userMoreAddresses" with address "primary"
|
||||
And there is IMAP client "active" selected in "INBOX"
|
||||
And there is IMAP client "idling" logged in as "userMoreAddresses" with address "secondary"
|
||||
And there is IMAP client "idling" selected in "INBOX"
|
||||
When IMAP client "idling" starts IDLE-ing
|
||||
And IMAP client "active" marks message "1" as read
|
||||
Then IMAP client "idling" does not receive update for message "1" within 5 seconds
|
||||
25
test/features/imap/mailbox/create.feature
Normal file
25
test/features/imap/mailbox/create.feature
Normal file
@ -0,0 +1,25 @@
|
||||
Feature: IMAP create mailbox
|
||||
Background:
|
||||
Given there is connected user "user"
|
||||
And there is IMAP client logged in as "user"
|
||||
|
||||
Scenario: Create folder
|
||||
When IMAP client creates mailbox "Folders/mbox"
|
||||
Then IMAP response is "OK"
|
||||
And "user" has mailbox "Folders/mbox"
|
||||
And "user" does not have mailbox "Labels/mbox"
|
||||
|
||||
Scenario: Create label
|
||||
When IMAP client creates mailbox "Labels/mbox"
|
||||
Then IMAP response is "OK"
|
||||
And "user" does not have mailbox "Folders/mbox"
|
||||
And "user" has mailbox "Labels/mbox"
|
||||
|
||||
Scenario: Creating system mailbox is not possible
|
||||
When IMAP client creates mailbox "INBOX"
|
||||
Then IMAP response is "IMAP error: NO mailbox INBOX already exists"
|
||||
|
||||
Scenario: Creating mailbox without prefix is not possible
|
||||
When IMAP client creates mailbox "mbox"
|
||||
Then IMAP response is "OK"
|
||||
And "user" does not have mailbox "mbox"
|
||||
29
test/features/imap/mailbox/delete.feature
Normal file
29
test/features/imap/mailbox/delete.feature
Normal file
@ -0,0 +1,29 @@
|
||||
Feature: IMAP delete mailbox
|
||||
Background:
|
||||
Given there is connected user "user"
|
||||
|
||||
Scenario: Delete folder
|
||||
Given there is "user" with mailbox "Folders/mbox"
|
||||
And there is IMAP client logged in as "user"
|
||||
When IMAP client deletes mailbox "Folders/mbox"
|
||||
Then IMAP response is "OK"
|
||||
And "user" does not have mailbox "Folders/mbox"
|
||||
|
||||
Scenario: Delete label
|
||||
Given there is "user" with mailbox "Labels/mbox"
|
||||
And there is IMAP client logged in as "user"
|
||||
When IMAP client deletes mailbox "Labels/mbox"
|
||||
Then IMAP response is "OK"
|
||||
And "user" does not have mailbox "Labels/mbox"
|
||||
|
||||
Scenario: Empty Trash by deleting it
|
||||
Given there are 10 messages in mailbox "Trash" for "user"
|
||||
And there is IMAP client logged in as "user"
|
||||
When IMAP client deletes mailbox "Trash"
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "Trash" for "user" has 0 messages
|
||||
|
||||
Scenario: Deleting system mailbox is not possible
|
||||
Given there is IMAP client logged in as "user"
|
||||
When IMAP client deletes mailbox "INBOX"
|
||||
Then IMAP response is "IMAP error: NO cannot empty mailbox 0"
|
||||
15
test/features/imap/mailbox/info.feature
Normal file
15
test/features/imap/mailbox/info.feature
Normal file
@ -0,0 +1,15 @@
|
||||
Feature: IMAP get mailbox info
|
||||
Background:
|
||||
Given there is connected user "user"
|
||||
And there are messages in mailbox "INBOX" for "user"
|
||||
| from | to | subject | body | read | starred |
|
||||
| john.doe@mail.com | user@pm.me | foo | hello | false | false |
|
||||
| jane.doe@mail.com | name@pm.me | bar | world | true | true |
|
||||
And there is IMAP client logged in as "user"
|
||||
|
||||
Scenario: Mailbox info contains mailbox name
|
||||
When IMAP client gets info of "INBOX"
|
||||
Then IMAP response contains "2 EXISTS"
|
||||
And IMAP response contains "UNSEEN 1"
|
||||
And IMAP response contains "UIDNEXT 3"
|
||||
And IMAP response contains "UIDVALIDITY"
|
||||
16
test/features/imap/mailbox/list.feature
Normal file
16
test/features/imap/mailbox/list.feature
Normal file
@ -0,0 +1,16 @@
|
||||
Feature: IMAP list mailboxes
|
||||
Background:
|
||||
Given there is connected user "user"
|
||||
And there is "user" with mailbox "Folders/mbox1"
|
||||
And there is "user" with mailbox "Labels/mbox2"
|
||||
And there is IMAP client logged in as "user"
|
||||
|
||||
Scenario: List mailboxes
|
||||
When IMAP client lists mailboxes
|
||||
Then IMAP response contains "INBOX"
|
||||
Then IMAP response contains "Sent"
|
||||
Then IMAP response contains "Archive"
|
||||
Then IMAP response contains "Trash"
|
||||
Then IMAP response contains "All Mail"
|
||||
Then IMAP response contains "Folders/mbox1"
|
||||
Then IMAP response contains "Labels/mbox2"
|
||||
30
test/features/imap/mailbox/rename.feature
Normal file
30
test/features/imap/mailbox/rename.feature
Normal file
@ -0,0 +1,30 @@
|
||||
Feature: IMAP mailbox rename
|
||||
Background:
|
||||
Given there is connected user "user"
|
||||
|
||||
Scenario: Rename folder
|
||||
Given there is "user" with mailbox "Folders/mbox"
|
||||
And there is IMAP client logged in as "user"
|
||||
When IMAP client renames mailbox "Folders/mbox" to "Folders/mbox2"
|
||||
Then IMAP response is "OK"
|
||||
And "user" does not have mailbox "Folders/mbox"
|
||||
And "user" has mailbox "Folders/mbox2"
|
||||
|
||||
Scenario: Rename label
|
||||
Given there is "user" with mailbox "Labels/mbox"
|
||||
And there is IMAP client logged in as "user"
|
||||
When IMAP client renames mailbox "Labels/mbox" to "Labels/mbox2"
|
||||
Then IMAP response is "OK"
|
||||
And "user" does not have mailbox "Labels/mbox"
|
||||
And "user" has mailbox "Labels/mbox2"
|
||||
|
||||
Scenario: Renaming folder to label is not possible
|
||||
Given there is "user" with mailbox "Folders/mbox"
|
||||
And there is IMAP client logged in as "user"
|
||||
When IMAP client renames mailbox "Folders/mbox" to "Labels/mbox"
|
||||
Then IMAP response is "IMAP error: NO cannot rename folder to non-folder"
|
||||
|
||||
Scenario: Renaming system folder is not possible
|
||||
Given there is IMAP client logged in as "user"
|
||||
When IMAP client renames mailbox "INBOX" to "Folders/mbox"
|
||||
Then IMAP response is "IMAP error: NO cannot rename system mailboxes"
|
||||
17
test/features/imap/mailbox/select.feature
Normal file
17
test/features/imap/mailbox/select.feature
Normal file
@ -0,0 +1,17 @@
|
||||
Feature: IMAP select into mailbox
|
||||
Background:
|
||||
Given there is connected user "user"
|
||||
And there is "user" with mailbox "Folders/mbox"
|
||||
And there is IMAP client logged in as "user"
|
||||
|
||||
Scenario: Select into inbox
|
||||
When IMAP client selects "INBOX"
|
||||
Then IMAP response is "OK"
|
||||
|
||||
Scenario: Select into custom mailbox
|
||||
When IMAP client selects "Folders/mbox"
|
||||
Then IMAP response is "OK"
|
||||
|
||||
Scenario: Select into non-existing mailbox
|
||||
When IMAP client selects "qwerty"
|
||||
Then IMAP response is "IMAP error: NO mailbox qwerty does not exist"
|
||||
21
test/features/imap/mailbox/status.feature
Normal file
21
test/features/imap/mailbox/status.feature
Normal file
@ -0,0 +1,21 @@
|
||||
Feature: IMAP get mailbox status
|
||||
Background:
|
||||
Given there is connected user "user"
|
||||
And there are messages in mailbox "INBOX" for "user"
|
||||
| from | to | subject | body | read | starred |
|
||||
| john.doe@mail.com | user@pm.me | foo | hello | false | false |
|
||||
| jane.doe@mail.com | name@pm.me | bar | world | true | true |
|
||||
And there is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "INBOX"
|
||||
|
||||
Scenario: Mailbox status contains mailbox name
|
||||
When IMAP client gets status of "INBOX"
|
||||
Then IMAP response contains "INBOX"
|
||||
|
||||
Scenario: Mailbox status contains
|
||||
When IMAP client gets status of "INBOX"
|
||||
Then IMAP response contains "INBOX"
|
||||
And IMAP response contains "MESSAGES 2"
|
||||
And IMAP response contains "UNSEEN 1"
|
||||
And IMAP response contains "UIDNEXT 3"
|
||||
And IMAP response contains "UIDVALIDITY"
|
||||
45
test/features/imap/message/copy.feature
Normal file
45
test/features/imap/message/copy.feature
Normal file
@ -0,0 +1,45 @@
|
||||
Feature: IMAP copy messages
|
||||
Background:
|
||||
Given there is connected user "user"
|
||||
And there is "user" with mailbox "Folders/mbox"
|
||||
And there is "user" with mailbox "Labels/label"
|
||||
And there are messages in mailbox "INBOX" for "user"
|
||||
| from | to | subject | body |
|
||||
| john.doe@mail.com | user@pm.me | foo | hello |
|
||||
| jane.doe@mail.com | name@pm.me | bar | world |
|
||||
And there is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "INBOX"
|
||||
|
||||
Scenario: Copy message to label
|
||||
When IMAP client copies messages "2" to "Labels/label"
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "INBOX" for "user" has 2 messages
|
||||
And mailbox "Labels/label" for "user" has messages
|
||||
| from | to | subject |
|
||||
| john.doe@mail.com | user@pm.me | foo |
|
||||
|
||||
Scenario: Copy all messages to label
|
||||
When IMAP client copies messages "1:*" to "Labels/label"
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "INBOX" for "user" has 2 messages
|
||||
And mailbox "Labels/label" for "user" has messages
|
||||
| from | to | subject |
|
||||
| john.doe@mail.com | user@pm.me | foo |
|
||||
| jane.doe@mail.com | name@pm.me | bar |
|
||||
|
||||
Scenario: Copy message to folder does move
|
||||
When IMAP client copies messages "2" to "Folders/mbox"
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "INBOX" for "user" has 1 message
|
||||
And mailbox "Folders/mbox" for "user" has messages
|
||||
| from | to | subject |
|
||||
| john.doe@mail.com | user@pm.me | foo |
|
||||
|
||||
Scenario: Copy all messages to folder does move
|
||||
When IMAP client copies messages "1:*" to "Folders/mbox"
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "INBOX" for "user" has 0 messages
|
||||
And mailbox "Folders/mbox" for "user" has messages
|
||||
| from | to | subject |
|
||||
| john.doe@mail.com | user@pm.me | foo |
|
||||
| jane.doe@mail.com | name@pm.me | bar |
|
||||
59
test/features/imap/message/create.feature
Normal file
59
test/features/imap/message/create.feature
Normal file
@ -0,0 +1,59 @@
|
||||
Feature: IMAP create messages
|
||||
Background:
|
||||
Given there is connected user "userMoreAddresses"
|
||||
And there is IMAP client logged in as "userMoreAddresses"
|
||||
|
||||
Scenario: Creates message to user's primary address
|
||||
Given there is IMAP client selected in "INBOX"
|
||||
When IMAP client creates message "foo" from "john.doe@email.com" to address "primary" of "userMoreAddresses" with body "hello world" in "INBOX"
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "INBOX" for "userMoreAddresses" has messages
|
||||
| from | to | subject | read |
|
||||
| john.doe@email.com | [primary] | foo | true |
|
||||
|
||||
Scenario: Creates draft
|
||||
When IMAP client creates message "foo" from address "primary" of "userMoreAddresses" to "john.doe@email.com" with body "hello world" in "Drafts"
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "Drafts" for "userMoreAddresses" has messages
|
||||
| from | to | subject | read |
|
||||
| [primary] | john.doe@email.com | foo | true |
|
||||
|
||||
@ignore
|
||||
Scenario: Creates message sent from user's primary address
|
||||
Given there is IMAP client selected in "Sent"
|
||||
When IMAP client creates message "foo" from address "primary" of "userMoreAddresses" to "john.doe@email.com" with body "hello world" in "Sent"
|
||||
Then IMAP response is "OK"
|
||||
When the event loop of "userMoreAddresses" loops once
|
||||
Then mailbox "Sent" for "userMoreAddresses" has messages
|
||||
| from | to | subject | read |
|
||||
| [primary] | john.doe@email.com | foo | true |
|
||||
And mailbox "INBOX" for "userMoreAddresses" has no messages
|
||||
|
||||
@ignore
|
||||
Scenario: Creates message sent from user's secondary address
|
||||
Given there is IMAP client selected in "Sent"
|
||||
When IMAP client creates message "foo" from address "secondary" of "userMoreAddresses" to "john.doe@email.com" with body "hello world" in "Sent"
|
||||
Then IMAP response is "OK"
|
||||
When the event loop of "userMoreAddresses" loops once
|
||||
Then mailbox "Sent" for "userMoreAddresses" has messages
|
||||
| from | to | subject | read |
|
||||
| [secondary] | john.doe@email.com | foo | true |
|
||||
And mailbox "INBOX" for "userMoreAddresses" has no messages
|
||||
|
||||
Scenario: Imports an unrelated message to inbox
|
||||
Given there is IMAP client selected in "INBOX"
|
||||
When IMAP client creates message "foo" from "john.doe@email.com" to "john.doe2@email.com" with body "hello world" in "INBOX"
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "INBOX" for "userMoreAddresses" has messages
|
||||
| from | to | subject | read |
|
||||
| john.doe@email.com | john.doe2@email.com | foo | true |
|
||||
|
||||
Scenario: Imports an unrelated message to sent
|
||||
Given there is IMAP client selected in "Sent"
|
||||
When IMAP client creates message "foo" from "notuser@gmail.com" to "alsonotuser@gmail.com" with body "hello world" in "Sent"
|
||||
Then IMAP response is "OK"
|
||||
When the event loop of "userMoreAddresses" loops once
|
||||
Then mailbox "Sent" for "userMoreAddresses" has messages
|
||||
| from | to | subject | read |
|
||||
| notuser@gmail.com | alsonotuser@gmail.com | foo | true |
|
||||
And mailbox "INBOX" for "userMoreAddresses" has no messages
|
||||
41
test/features/imap/message/delete.feature
Normal file
41
test/features/imap/message/delete.feature
Normal file
@ -0,0 +1,41 @@
|
||||
Feature: IMAP delete messages
|
||||
Background:
|
||||
Given there is connected user "user"
|
||||
And there is "user" with mailbox "Folders/mbox"
|
||||
And there is "user" with mailbox "Labels/label"
|
||||
|
||||
# https://gitlab.protontech.ch/ProtonMail/Slim-API/issues/1420
|
||||
@ignore-live
|
||||
Scenario Outline: Delete message
|
||||
Given there are 10 messages in mailbox "<mailbox>" for "user"
|
||||
And there is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "<mailbox>"
|
||||
When IMAP client deletes messages "1"
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "<mailbox>" for "user" has 9 messages
|
||||
|
||||
Examples:
|
||||
| mailbox |
|
||||
| INBOX |
|
||||
| Folders/mbox |
|
||||
| Labels/label |
|
||||
| Drafts |
|
||||
| Trash |
|
||||
|
||||
# https://gitlab.protontech.ch/ProtonMail/Slim-API/issues/1420
|
||||
@ignore-live
|
||||
Scenario Outline: Delete all messages
|
||||
Given there are 10 messages in mailbox "<mailbox>" for "user"
|
||||
And there is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "<mailbox>"
|
||||
When IMAP client deletes messages "1:*"
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "<mailbox>" for "user" has 0 messages
|
||||
|
||||
Examples:
|
||||
| mailbox |
|
||||
| INBOX |
|
||||
| Folders/mbox |
|
||||
| Labels/label |
|
||||
| Drafts |
|
||||
| Trash |
|
||||
51
test/features/imap/message/fetch.feature
Normal file
51
test/features/imap/message/fetch.feature
Normal file
@ -0,0 +1,51 @@
|
||||
Feature: IMAP fetch messages
|
||||
Background:
|
||||
Given there is connected user "user"
|
||||
And there is "user" with mailbox "Folders/mbox"
|
||||
|
||||
Scenario: Fetch of inbox
|
||||
Given there are 10 messages in mailbox "INBOX" for "user"
|
||||
And there is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "INBOX"
|
||||
When IMAP client fetches "1:*"
|
||||
Then IMAP response is "OK"
|
||||
And IMAP response has 10 messages
|
||||
|
||||
Scenario: Fetch first few message of inbox
|
||||
Given there are 10 messages in mailbox "INBOX" for "user"
|
||||
And there is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "INBOX"
|
||||
When IMAP client fetches "1:5"
|
||||
Then IMAP response is "OK"
|
||||
And IMAP response has 5 messages
|
||||
|
||||
Scenario: Fetch of custom mailbox
|
||||
Given there are 10 messages in mailbox "Folders/mbox" for "user"
|
||||
And there is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "Folders/mbox"
|
||||
When IMAP client fetches "1:*"
|
||||
Then IMAP response is "OK"
|
||||
And IMAP response has 10 messages
|
||||
|
||||
Scenario: Fetch of emtpy mailbox
|
||||
Given there is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "Folders/mbox"
|
||||
When IMAP client fetches "1:*"
|
||||
Then IMAP response is "OK"
|
||||
And IMAP response has 0 messages
|
||||
|
||||
Scenario: Fetch of big mailbox
|
||||
Given there are 100 messages in mailbox "Folders/mbox" for "user"
|
||||
And there is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "Folders/mbox"
|
||||
When IMAP client fetches "1:*"
|
||||
Then IMAP response is "OK"
|
||||
And IMAP response has 100 messages
|
||||
|
||||
Scenario: Fetch returns alsways latest messages
|
||||
Given there are 10 messages in mailbox "Folders/mbox" for "user"
|
||||
And there is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "Folders/mbox"
|
||||
When IMAP client fetches by UID "11:*"
|
||||
Then IMAP response is "OK"
|
||||
And IMAP response has 1 message
|
||||
54
test/features/imap/message/move.feature
Normal file
54
test/features/imap/message/move.feature
Normal file
@ -0,0 +1,54 @@
|
||||
Feature: IMAP move messages
|
||||
Background:
|
||||
Given there is connected user "user"
|
||||
And there is "user" with mailbox "Folders/mbox"
|
||||
And there are messages in mailbox "INBOX" for "user"
|
||||
| from | to | subject | body |
|
||||
| john.doe@mail.com | user@pm.me | foo | hello |
|
||||
| jane.doe@mail.com | name@pm.me | bar | world |
|
||||
And there is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "INBOX"
|
||||
|
||||
@ignore
|
||||
Scenario: Move message
|
||||
When IMAP client moves messages "1" to "Folders/mbox"
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "INBOX" for "user" has messages
|
||||
| from | to | subject |
|
||||
| jane.doe@mail.com | name@pm.me | bar |
|
||||
And mailbox "Folders/mbox" for "user" has messages
|
||||
| from | to | subject |
|
||||
| john.doe@mail.com | user@pm.me | foo |
|
||||
|
||||
@ignore
|
||||
Scenario: Move all messages
|
||||
When IMAP client moves messages "1:*" to "Folders/mbox"
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "INBOX" for "user" has 0 messages
|
||||
And mailbox "Folders/mbox" for "user" has messages
|
||||
| from | to | subject |
|
||||
| john.doe@mail.com | user@pm.me | foo |
|
||||
| jane.doe@mail.com | name@pm.me | bar |
|
||||
|
||||
@ignore
|
||||
Scenario: Move message to All Mail
|
||||
When IMAP client moves messages "1" to "All Mail"
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "INBOX" for "user" has messages
|
||||
| from | to | subject |
|
||||
| jane.doe@mail.com | name@pm.me | bar |
|
||||
And mailbox "All Mail" for "user" has messages
|
||||
| from | to | subject |
|
||||
| john.doe@mail.com | user@pm.me | foo |
|
||||
|
||||
@ignore
|
||||
Scenario: Move message from All Mail is not possible
|
||||
When IMAP client moves messages "1" to "Folders/mbox"
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "All Mail" for "user" has messages
|
||||
| from | to | subject |
|
||||
| john.doe@mail.com | user@pm.me | foo |
|
||||
| jane.doe@mail.com | name@pm.me | bar |
|
||||
And mailbox "Folders/mbox" for "user" has messages
|
||||
| from | to | subject |
|
||||
| john.doe@mail.com | user@pm.me | foo |
|
||||
29
test/features/imap/message/search.feature
Normal file
29
test/features/imap/message/search.feature
Normal file
@ -0,0 +1,29 @@
|
||||
Feature: IMAP search messages
|
||||
Background:
|
||||
Given there is connected user "user"
|
||||
Given there are messages in mailbox "INBOX" for "user"
|
||||
| from | to | subject | body |
|
||||
| john.doe@mail.com | user@pm.me | foo | hello |
|
||||
| jane.doe@mail.com | name@pm.me | bar | world |
|
||||
And there is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "INBOX"
|
||||
|
||||
Scenario: Search by subject
|
||||
When IMAP client searches for "SUBJECT foo"
|
||||
Then IMAP response is "OK"
|
||||
And IMAP response has 1 message
|
||||
|
||||
Scenario: Search by text
|
||||
When IMAP client searches for "TEXT world"
|
||||
Then IMAP response is "OK"
|
||||
And IMAP response has 1 message
|
||||
|
||||
Scenario: Search by from
|
||||
When IMAP client searches for "FROM jane.doe@email.com"
|
||||
Then IMAP response is "OK"
|
||||
And IMAP response has 1 message
|
||||
|
||||
Scenario: Search by to
|
||||
When IMAP client searches for "TO user@pm.me"
|
||||
Then IMAP response is "OK"
|
||||
And IMAP response has 1 message
|
||||
35
test/features/imap/message/update.feature
Normal file
35
test/features/imap/message/update.feature
Normal file
@ -0,0 +1,35 @@
|
||||
Feature: IMAP update messages
|
||||
Background:
|
||||
Given there is connected user "user"
|
||||
And there are messages in mailbox "INBOX" for "user"
|
||||
| from | to | subject | body | read | starred |
|
||||
| john.doe@mail.com | user@pm.me | foo | hello | false | false |
|
||||
| jane.doe@mail.com | name@pm.me | bar | world | true | true |
|
||||
And there is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "INBOX"
|
||||
|
||||
Scenario: Mark message as read
|
||||
When IMAP client marks message "2" as read
|
||||
Then IMAP response is "OK"
|
||||
And message "1" in "INBOX" for "user" is marked as read
|
||||
And message "1" in "INBOX" for "user" is marked as unstarred
|
||||
|
||||
Scenario: Mark message as unread
|
||||
When IMAP client marks message "1" as unread
|
||||
Then IMAP response is "OK"
|
||||
And message "2" in "INBOX" for "user" is marked as unread
|
||||
And message "2" in "INBOX" for "user" is marked as starred
|
||||
|
||||
Scenario: Mark message as starred
|
||||
Then message "1" in "INBOX" for "user" is marked as unread
|
||||
And message "1" in "INBOX" for "user" is marked as unstarred
|
||||
When IMAP client marks message "2" as starred
|
||||
Then IMAP response is "OK"
|
||||
And message "1" in "INBOX" for "user" is marked as unread
|
||||
And message "1" in "INBOX" for "user" is marked as starred
|
||||
|
||||
Scenario: Mark message as unstarred
|
||||
When IMAP client marks message "1" as unstarred
|
||||
Then IMAP response is "OK"
|
||||
And message "2" in "INBOX" for "user" is marked as read
|
||||
And message "2" in "INBOX" for "user" is marked as unstarred
|
||||
Reference in New Issue
Block a user