mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-26 03:46:42 +00:00
GODT-1779: Remove go-imap
This commit is contained in:
22
tests/features/imap/auth.feature
Normal file
22
tests/features/imap/auth.feature
Normal file
@ -0,0 +1,22 @@
|
||||
Feature: A user can authenticate an IMAP client
|
||||
Background:
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And bridge starts
|
||||
And the user logs in with username "user@pm.me" and password "password"
|
||||
|
||||
Scenario: IMAP client can authenticate successfully
|
||||
When user "user@pm.me" connects IMAP client "1"
|
||||
Then IMAP client "1" can authenticate
|
||||
|
||||
Scenario: IMAP client cannot authenticate with bad username
|
||||
When user "user@pm.me" connects IMAP client "1"
|
||||
Then IMAP client "1" cannot authenticate with incorrect username
|
||||
|
||||
Scenario: IMAP client cannot authenticate with bad password
|
||||
When user "user@pm.me" connects IMAP client "1"
|
||||
Then IMAP client "1" cannot authenticate with incorrect password
|
||||
|
||||
Scenario: IMAP client cannot authenticate for disconnected user
|
||||
When user "user@pm.me" logs out
|
||||
And user "user@pm.me" connects IMAP client "1"
|
||||
Then IMAP client "1" cannot authenticate
|
||||
15
tests/features/imap/mailbox/create.feature
Normal file
15
tests/features/imap/mailbox/create.feature
Normal file
@ -0,0 +1,15 @@
|
||||
Feature: IMAP create mailbox
|
||||
Background:
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And bridge starts
|
||||
And the user logs in with username "user@pm.me" and password "password"
|
||||
And user "user@pm.me" finishes syncing
|
||||
And user "user@pm.me" connects and authenticates IMAP client "1"
|
||||
|
||||
Scenario: Create folder
|
||||
When IMAP client "1" creates "Folders/mbox"
|
||||
Then IMAP client "1" sees "Folders/mbox"
|
||||
|
||||
Scenario: Create label
|
||||
When IMAP client "1" creates "Labels/mbox"
|
||||
Then IMAP client "1" sees "Labels/mbox"
|
||||
29
tests/features/imap/mailbox/delete.feature
Normal file
29
tests/features/imap/mailbox/delete.feature
Normal file
@ -0,0 +1,29 @@
|
||||
Feature: IMAP delete mailbox
|
||||
Background:
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And the account "user@pm.me" has the following custom mailboxes:
|
||||
| name | type |
|
||||
| one | folder |
|
||||
| two | folder |
|
||||
| three | label |
|
||||
And bridge starts
|
||||
And the user logs in with username "user@pm.me" and password "password"
|
||||
And user "user@pm.me" finishes syncing
|
||||
And user "user@pm.me" connects and authenticates IMAP client "1"
|
||||
|
||||
Scenario: Delete folder
|
||||
When IMAP client "1" deletes "Folders/one"
|
||||
Then IMAP client "1" does not see "Folders/one"
|
||||
But IMAP client "1" sees "Folders/two"
|
||||
But IMAP client "1" sees "Labels/three"
|
||||
|
||||
Scenario: Delete label
|
||||
When IMAP client "1" deletes "Labels/three"
|
||||
Then IMAP client "1" does not see "Labels/three"
|
||||
But IMAP client "1" sees "Folders/one"
|
||||
But IMAP client "1" sees "Folders/two"
|
||||
|
||||
Scenario: Deleting system mailbox is not possible
|
||||
When IMAP client "1" deletes "INBOX"
|
||||
Then it fails
|
||||
And IMAP client "1" sees "INBOX"
|
||||
19
tests/features/imap/mailbox/info.feature
Normal file
19
tests/features/imap/mailbox/info.feature
Normal file
@ -0,0 +1,19 @@
|
||||
Feature: IMAP get mailbox info
|
||||
Background:
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And the account "user@pm.me" has the following custom mailboxes:
|
||||
| name | type |
|
||||
| one | folder |
|
||||
And the account "user@pm.me" has the following messages in "one":
|
||||
| sender | recipient | subject | unread |
|
||||
| a@pm.me | a@pm.me | one | true |
|
||||
| b@pm.me | b@pm.me | two | false |
|
||||
And bridge starts
|
||||
And the user logs in with username "user@pm.me" and password "password"
|
||||
And user "user@pm.me" finishes syncing
|
||||
|
||||
Scenario: Mailbox status reports correct name, total and unread
|
||||
When user "user@pm.me" connects and authenticates IMAP client "1"
|
||||
Then IMAP client "1" sees the following mailbox info for "Folders/one":
|
||||
| name | total | unread |
|
||||
| Folders/one | 2 | 1 |
|
||||
39
tests/features/imap/mailbox/list.feature
Normal file
39
tests/features/imap/mailbox/list.feature
Normal file
@ -0,0 +1,39 @@
|
||||
Feature: IMAP list mailboxes
|
||||
Scenario: List mailboxes
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And the account "user@pm.me" has the following custom mailboxes:
|
||||
| name | type |
|
||||
| mbox1 | folder |
|
||||
| mbox2 | label |
|
||||
When bridge starts
|
||||
And the user logs in with username "user@pm.me" and password "password"
|
||||
And user "user@pm.me" finishes syncing
|
||||
And user "user@pm.me" connects and authenticates IMAP client "1"
|
||||
Then IMAP client "1" sees the following mailbox info:
|
||||
| name | total | unread |
|
||||
| INBOX | 0 | 0 |
|
||||
| Drafts | 0 | 0 |
|
||||
| Sent | 0 | 0 |
|
||||
| Starred | 0 | 0 |
|
||||
| Archive | 0 | 0 |
|
||||
| Spam | 0 | 0 |
|
||||
| Trash | 0 | 0 |
|
||||
| All Mail | 0 | 0 |
|
||||
| Folders | 0 | 0 |
|
||||
| Folders/mbox1 | 0 | 0 |
|
||||
| Labels | 0 | 0 |
|
||||
| Labels/mbox2 | 0 | 0 |
|
||||
|
||||
Scenario: List multiple times in parallel without crash
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And the account "user@pm.me" has 20 custom folders
|
||||
And the account "user@pm.me" has 60 custom labels
|
||||
When bridge starts
|
||||
And the user logs in with username "user@pm.me" and password "password"
|
||||
And user "user@pm.me" finishes syncing
|
||||
When user "user@pm.me" connects and authenticates IMAP client "1"
|
||||
And user "user@pm.me" connects and authenticates IMAP client "2"
|
||||
Then IMAP client "1" counts 20 mailboxes under "Folders"
|
||||
And IMAP client "1" counts 60 mailboxes under "Labels"
|
||||
Then IMAP client "2" counts 20 mailboxes under "Folders"
|
||||
And IMAP client "2" counts 60 mailboxes under "Labels"
|
||||
29
tests/features/imap/mailbox/rename.feature
Normal file
29
tests/features/imap/mailbox/rename.feature
Normal file
@ -0,0 +1,29 @@
|
||||
Feature: IMAP get mailbox info
|
||||
Background:
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And the account "user@pm.me" has the following custom mailboxes:
|
||||
| name | type |
|
||||
| f1 | folder |
|
||||
| l1 | label |
|
||||
And bridge starts
|
||||
And the user logs in with username "user@pm.me" and password "password"
|
||||
And user "user@pm.me" finishes syncing
|
||||
And user "user@pm.me" connects and authenticates IMAP client "1"
|
||||
|
||||
Scenario: Rename folder
|
||||
When IMAP client "1" renames "Folders/f1" to "Folders/f2"
|
||||
Then IMAP client "1" sees "Folders/f2"
|
||||
And IMAP client "1" does not see "Folders/f1"
|
||||
|
||||
Scenario: Rename label
|
||||
When IMAP client "1" renames "Labels/l1" to "Labels/l2"
|
||||
Then IMAP client "1" sees "Labels/l2"
|
||||
And IMAP client "1" does not see "Labels/l1"
|
||||
|
||||
Scenario: Renaming folder to label is not possible
|
||||
When IMAP client "1" renames "Folders/f1" to "Labels/f2"
|
||||
Then it fails
|
||||
|
||||
Scenario: Renaming system folder is not possible
|
||||
When IMAP client "1" renames "Labels/l1" to "Folders/l2"
|
||||
Then it fails
|
||||
27
tests/features/imap/mailbox/select.feature
Normal file
27
tests/features/imap/mailbox/select.feature
Normal file
@ -0,0 +1,27 @@
|
||||
Feature: IMAP select mailbox
|
||||
Background:
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And the account "user@pm.me" has the following custom mailboxes:
|
||||
| name | type |
|
||||
| mbox | folder |
|
||||
| label | label |
|
||||
And bridge starts
|
||||
And the user logs in with username "user@pm.me" and password "password"
|
||||
And user "user@pm.me" finishes syncing
|
||||
And user "user@pm.me" connects and authenticates IMAP client "1"
|
||||
|
||||
Scenario: Select inbox
|
||||
When IMAP client "1" selects "INBOX"
|
||||
Then it succeeds
|
||||
|
||||
Scenario: Select custom mailbox
|
||||
When IMAP client "1" selects "Folders/mbox"
|
||||
Then it succeeds
|
||||
|
||||
Scenario: Select custom label
|
||||
When IMAP client "1" selects "Labels/label"
|
||||
Then it succeeds
|
||||
|
||||
Scenario: Select non-existing mailbox
|
||||
When IMAP client "1" selects "qwerty"
|
||||
Then it fails
|
||||
61
tests/features/imap/message/copy.feature
Normal file
61
tests/features/imap/message/copy.feature
Normal file
@ -0,0 +1,61 @@
|
||||
Feature: IMAP copy messages
|
||||
Background:
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And the account "user@pm.me" has the following custom mailboxes:
|
||||
| name | type |
|
||||
| mbox | folder |
|
||||
| label | label |
|
||||
And the account "user@pm.me" has the following messages in "Inbox":
|
||||
| sender | recipient | subject | unread |
|
||||
| john.doe@mail.com | user@pm.me | foo | false |
|
||||
| jane.doe@mail.com | name@pm.me | bar | true |
|
||||
And bridge starts
|
||||
And the user logs in with username "user@pm.me" and password "password"
|
||||
And user "user@pm.me" finishes syncing
|
||||
And user "user@pm.me" connects and authenticates IMAP client "1"
|
||||
|
||||
Scenario: Copy message to label
|
||||
When IMAP client "1" copies the message with subject "foo" from "INBOX" to "Labels/label"
|
||||
Then IMAP client "1" sees the following messages in "INBOX":
|
||||
| sender | recipient | subject | unread |
|
||||
| john.doe@mail.com | user@pm.me | foo | false |
|
||||
| jane.doe@mail.com | name@pm.me | bar | true |
|
||||
And IMAP client "1" sees the following messages in "Labels/label":
|
||||
| sender | recipient | subject | unread |
|
||||
| john.doe@mail.com | user@pm.me | foo | false |
|
||||
|
||||
Scenario: Copy all messages to label
|
||||
When IMAP client "1" copies all messages from "INBOX" to "Labels/label"
|
||||
Then IMAP client "1" sees the following messages in "INBOX":
|
||||
| sender | recipient | subject | unread |
|
||||
| john.doe@mail.com | user@pm.me | foo | false |
|
||||
| jane.doe@mail.com | name@pm.me | bar | true |
|
||||
And IMAP client "1" sees the following messages in "Labels/label":
|
||||
| sender | recipient | subject | unread |
|
||||
| john.doe@mail.com | user@pm.me | foo | false |
|
||||
| jane.doe@mail.com | name@pm.me | bar | true |
|
||||
|
||||
Scenario: Copy message to folder does move
|
||||
When IMAP client "1" copies the message with subject "foo" from "INBOX" to "Folders/mbox"
|
||||
Then IMAP client "1" eventually sees the following messages in "INBOX":
|
||||
| sender | recipient | subject | unread |
|
||||
| jane.doe@mail.com | name@pm.me | bar | true |
|
||||
And IMAP client "1" sees the following messages in "Folders/mbox":
|
||||
| sender | recipient | subject | unread |
|
||||
| john.doe@mail.com | user@pm.me | foo | false |
|
||||
|
||||
Scenario: Copy all messages to folder does move
|
||||
When IMAP client "1" copies all messages from "INBOX" to "Folders/mbox"
|
||||
Then IMAP client "1" sees the following messages in "Folders/mbox":
|
||||
| sender | recipient | subject | unread |
|
||||
| john.doe@mail.com | user@pm.me | foo | false |
|
||||
| jane.doe@mail.com | name@pm.me | bar | true |
|
||||
And IMAP client "1" eventually sees 0 messages in "INBOX"
|
||||
|
||||
Scenario: Copy message from Inbox to Sent is not possible
|
||||
When IMAP client "1" copies the message with subject "foo" from "INBOX" to "Sent"
|
||||
Then IMAP client "1" eventually sees the following messages in "INBOX":
|
||||
| sender | recipient | subject | unread |
|
||||
| john.doe@mail.com | user@pm.me | foo | false |
|
||||
| jane.doe@mail.com | name@pm.me | bar | true |
|
||||
And IMAP client "1" eventually sees 0 messages in "Sent"
|
||||
39
tests/features/imap/message/delete.feature
Normal file
39
tests/features/imap/message/delete.feature
Normal file
@ -0,0 +1,39 @@
|
||||
Feature: IMAP remove messages from mailbox
|
||||
Background:
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And the account "user@pm.me" has the following custom mailboxes:
|
||||
| name | type |
|
||||
| mbox | folder |
|
||||
| label | label |
|
||||
And the account "user@pm.me" has 10 messages in "mbox"
|
||||
And bridge starts
|
||||
And the user logs in with username "user@pm.me" and password "password"
|
||||
And user "user@pm.me" finishes syncing
|
||||
And user "user@pm.me" connects and authenticates IMAP client "1"
|
||||
|
||||
Scenario: Mark message as deleted and EXPUNGE
|
||||
When IMAP client "1" selects "Folders/mbox"
|
||||
And IMAP client "1" marks message 2 as deleted
|
||||
Then IMAP client "1" sees that message 2 has the flag "\Deleted"
|
||||
When IMAP client "1" expunges
|
||||
Then IMAP client "1" sees 9 messages in "Folders/mbox"
|
||||
|
||||
Scenario: Mark all messages as deleted and EXPUNGE
|
||||
When IMAP client "1" selects "Folders/mbox"
|
||||
And IMAP client "1" marks all messages as deleted
|
||||
And IMAP client "1" expunges
|
||||
Then IMAP client "1" sees 0 messages in "Folders/mbox"
|
||||
|
||||
Scenario: Mark messages as undeleted and EXPUNGE
|
||||
When IMAP client "1" selects "Folders/mbox"
|
||||
And IMAP client "1" marks all messages as deleted
|
||||
But IMAP client "1" marks message 2 as not deleted
|
||||
And IMAP client "1" marks message 3 as not deleted
|
||||
When IMAP client "1" expunges
|
||||
Then IMAP client "1" sees 2 messages in "Folders/mbox"
|
||||
|
||||
Scenario: Not possible to delete from All Mail and expunge does nothing
|
||||
When IMAP client "1" selects "All Mail"
|
||||
And IMAP client "1" marks message 2 as deleted
|
||||
And IMAP client "1" expunges
|
||||
Then IMAP client "1" eventually sees 10 messages in "All Mail"
|
||||
17
tests/features/imap/migration.feature
Normal file
17
tests/features/imap/migration.feature
Normal file
@ -0,0 +1,17 @@
|
||||
Feature: Bridge can fully sync an account
|
||||
Background:
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And the account "user@pm.me" has 20 custom folders
|
||||
And the account "user@pm.me" has 60 custom labels
|
||||
When bridge starts
|
||||
And the user logs in with username "user@pm.me" and password "password"
|
||||
And user "user@pm.me" finishes syncing
|
||||
When user "user@pm.me" connects and authenticates IMAP client "1"
|
||||
Then IMAP client "1" counts 20 mailboxes under "Folders"
|
||||
And IMAP client "1" counts 60 mailboxes under "Labels"
|
||||
|
||||
Scenario: The user changes the gluon path
|
||||
When the user changes the gluon path
|
||||
And user "user@pm.me" connects and authenticates IMAP client "2"
|
||||
Then IMAP client "2" counts 20 mailboxes under "Folders"
|
||||
And IMAP client "2" counts 60 mailboxes under "Labels"
|
||||
10
tests/features/imap/ports.feature
Normal file
10
tests/features/imap/ports.feature
Normal file
@ -0,0 +1,10 @@
|
||||
Feature: A user can connect an IMAP client to custom ports
|
||||
Background:
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And bridge starts
|
||||
And the user logs in with username "user@pm.me" and password "password"
|
||||
And the user changes the IMAP port to 1144
|
||||
|
||||
Scenario: Authenticates successfully on custom port
|
||||
When user "user@pm.me" connects IMAP client "1" on port 1144
|
||||
Then IMAP client "1" can authenticate
|
||||
20
tests/features/imap/user_agent.feature
Normal file
20
tests/features/imap/user_agent.feature
Normal file
@ -0,0 +1,20 @@
|
||||
Feature: The IMAP ID is propagated to bridge
|
||||
Background:
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And bridge starts
|
||||
And the user logs in with username "user@pm.me" and password "password"
|
||||
|
||||
Scenario: Initial user agent before an IMAP client announces its ID
|
||||
When user "user@pm.me" connects IMAP client "1"
|
||||
Then the user agent is "UnknownClient/0.0.1 ([GOOS])"
|
||||
|
||||
Scenario: User agent after an IMAP client announces its ID
|
||||
When user "user@pm.me" connects IMAP client "1"
|
||||
And IMAP client "1" announces its ID with name "name" and version "version"
|
||||
Then the user agent is "name/version ([GOOS])"
|
||||
|
||||
Scenario: User agent is used for API calls
|
||||
When user "user@pm.me" connects IMAP client "1"
|
||||
And IMAP client "1" announces its ID with name "name" and version "version"
|
||||
When the user reports a bug
|
||||
Then the value of the "User-Agent" header in the request to "/core/v4/reports/bug" is "name/version ([GOOS])"
|
||||
22
tests/features/smtp/auth.feature
Normal file
22
tests/features/smtp/auth.feature
Normal file
@ -0,0 +1,22 @@
|
||||
Feature: A user can authenticate an SMTP client
|
||||
Background:
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And bridge starts
|
||||
And the user logs in with username "user@pm.me" and password "password"
|
||||
|
||||
Scenario: SMTP client can authenticate successfully
|
||||
When user "user@pm.me" connects SMTP client "1"
|
||||
Then SMTP client "1" can authenticate
|
||||
|
||||
Scenario: SMTP client cannot authenticate with wrong username
|
||||
When user "user@pm.me" connects SMTP client "1"
|
||||
Then SMTP client "1" cannot authenticate with incorrect username
|
||||
|
||||
Scenario: SMTP client cannot authenticate with wrong password
|
||||
When user "user@pm.me" connects SMTP client "1"
|
||||
Then SMTP client "1" cannot authenticate with incorrect password
|
||||
|
||||
Scenario: SMTP client cannot authenticate for disconnected user
|
||||
When user "user@pm.me" logs out
|
||||
And user "user@pm.me" connects SMTP client "1"
|
||||
Then SMTP client "1" cannot authenticate
|
||||
48
tests/features/smtp/init.feature
Normal file
48
tests/features/smtp/init.feature
Normal file
@ -0,0 +1,48 @@
|
||||
Feature: SMTP initiation
|
||||
Background:
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And bridge starts
|
||||
And the user logs in with username "user@pm.me" and password "password"
|
||||
When user "user@pm.me" connects and authenticates SMTP client "1"
|
||||
|
||||
Scenario: Send without first announcing FROM and TO
|
||||
When SMTP client "1" sends DATA "Subject: test"
|
||||
Then it fails with error "Missing RCPT TO command"
|
||||
|
||||
Scenario: Reset is the same as without FROM and TO
|
||||
When SMTP client "1" sends MAIL FROM "<user@pm.me>"
|
||||
Then it succeeds
|
||||
When SMTP client "1" sends RCPT TO "<user@pm.me>"
|
||||
Then it succeeds
|
||||
When SMTP client "1" sends RSET
|
||||
Then it succeeds
|
||||
When SMTP client "1" sends DATA "Subject: test"
|
||||
Then it fails with error "Missing RCPT TO command"
|
||||
|
||||
Scenario: Send without FROM
|
||||
When SMTP client "1" sends RCPT TO "<user@pm.me>"
|
||||
Then it fails with error "Missing MAIL FROM command"
|
||||
|
||||
Scenario: Send without TO
|
||||
When SMTP client "1" sends MAIL FROM "<user@pm.me>"
|
||||
Then it succeeds
|
||||
When SMTP client "1" sends DATA "Subject: test"
|
||||
Then it fails with error "Missing RCPT TO command"
|
||||
|
||||
Scenario: Send with empty FROM
|
||||
When SMTP client "1" sends MAIL FROM "<>"
|
||||
Then it fails with error "invalid return path"
|
||||
|
||||
Scenario: Send with empty TO
|
||||
When SMTP client "1" sends MAIL FROM "<user@pm.me>"
|
||||
Then it succeeds
|
||||
When SMTP client "1" sends RCPT TO "<>"
|
||||
Then it fails with error "invalid recipient"
|
||||
|
||||
Scenario: Allow BODY parameter of MAIL FROM command
|
||||
When SMTP client "1" sends MAIL FROM "<user@pm.me> BODY=7BIT"
|
||||
Then it succeeds
|
||||
|
||||
Scenario: FROM not owned by user
|
||||
When SMTP client "1" sends MAIL FROM "<user@pm.test>"
|
||||
Then it fails with error "invalid return path"
|
||||
10
tests/features/smtp/ports.feature
Normal file
10
tests/features/smtp/ports.feature
Normal file
@ -0,0 +1,10 @@
|
||||
Feature: A user can connect an SMTP client to custom ports
|
||||
Background:
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And bridge starts
|
||||
And the user logs in with username "user@pm.me" and password "password"
|
||||
And the user changes the SMTP port to 1144
|
||||
|
||||
Scenario: Authenticates successfully on custom port
|
||||
When user "user@pm.me" connects SMTP client "1" on port 1144
|
||||
Then SMTP client "1" can authenticate
|
||||
29
tests/features/updates.feature
Normal file
29
tests/features/updates.feature
Normal file
@ -0,0 +1,29 @@
|
||||
Feature: Bridge checks for updates
|
||||
Scenario: Update not available
|
||||
Given bridge is version "2.3.0" and the latest available version is "2.3.0" reachable from "2.3.0"
|
||||
When bridge starts
|
||||
Then bridge sends an update not available event
|
||||
|
||||
Scenario: Update available without automatic updates enabled
|
||||
Given bridge is version "2.3.0" and the latest available version is "2.4.0" reachable from "2.3.0"
|
||||
And the user has disabled automatic updates
|
||||
When bridge starts
|
||||
Then bridge sends an update available event for version "2.4.0"
|
||||
|
||||
Scenario: Update available with automatic updates enabled
|
||||
Given bridge is version "2.3.0" and the latest available version is "2.4.0" reachable from "2.3.0"
|
||||
When bridge starts
|
||||
Then bridge sends an update installed event for version "2.4.0"
|
||||
|
||||
Scenario: Manual update available with automatic updates enabled
|
||||
Given bridge is version "2.3.0" and the latest available version is "2.4.0" reachable from "2.4.0"
|
||||
When bridge starts
|
||||
Then bridge sends a manual update event for version "2.4.0"
|
||||
|
||||
Scenario: Update is required to continue using bridge
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And bridge is version "2.3.0" and the latest available version is "2.3.0" reachable from "2.3.0"
|
||||
And the API requires bridge version at least "2.4.0"
|
||||
When bridge starts
|
||||
And the user logs in with username "user@pm.me" and password "password"
|
||||
Then bridge sends a forced update event
|
||||
14
tests/features/user/delete.feature
Normal file
14
tests/features/user/delete.feature
Normal file
@ -0,0 +1,14 @@
|
||||
Feature: A user can be deleted
|
||||
Background:
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And bridge starts
|
||||
And the user logs in with username "user@pm.me" and password "password"
|
||||
|
||||
Scenario: Delete a connected user
|
||||
When user "user@pm.me" is deleted
|
||||
Then user "user@pm.me" is not listed
|
||||
|
||||
Scenario: Delete a disconnected user
|
||||
Given user "user@pm.me" logs out
|
||||
When user "user@pm.me" is deleted
|
||||
Then user "user@pm.me" is not listed
|
||||
0
tests/features/user/events.feature
Normal file
0
tests/features/user/events.feature
Normal file
28
tests/features/user/login.feature
Normal file
28
tests/features/user/login.feature
Normal file
@ -0,0 +1,28 @@
|
||||
Feature: A user can login
|
||||
Background:
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And bridge starts
|
||||
|
||||
Scenario: Login to account
|
||||
When the user logs in with username "user@pm.me" and password "password"
|
||||
Then user "user@pm.me" is listed and connected
|
||||
|
||||
Scenario: Login to account with wrong password
|
||||
When the user logs in with username "user@pm.me" and password "wrong"
|
||||
Then user "user@pm.me" is not listed
|
||||
|
||||
Scenario: Login to nonexistent account
|
||||
When the user logs in with username "other@pm.me" and password "unknown"
|
||||
Then user "other@pm.me" is not listed
|
||||
|
||||
Scenario: Login to account without internet
|
||||
Given the internet is turned off
|
||||
When the user logs in with username "user@pm.me" and password "password"
|
||||
Then user "user@pm.me" is not listed
|
||||
|
||||
Scenario: Login to multiple accounts
|
||||
Given there exists an account with username "additional@pm.me" and password "other"
|
||||
When the user logs in with username "user@pm.me" and password "password"
|
||||
And the user logs in with username "additional@pm.me" and password "other"
|
||||
Then user "user@pm.me" is listed and connected
|
||||
And user "additional@pm.me" is listed and connected
|
||||
15
tests/features/user/relogin.feature
Normal file
15
tests/features/user/relogin.feature
Normal file
@ -0,0 +1,15 @@
|
||||
Feature: A logged out user can login again
|
||||
Background:
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And bridge starts
|
||||
And the user logs in with username "user@pm.me" and password "password"
|
||||
|
||||
Scenario: Login to disconnected account
|
||||
When user "user@pm.me" logs out
|
||||
And bridge restarts
|
||||
And the user logs in with username "user@pm.me" and password "password"
|
||||
Then user "user@pm.me" is listed and connected
|
||||
|
||||
Scenario: Cannot login to removed account
|
||||
When user "user@pm.me" is deleted
|
||||
Then user "user@pm.me" is not listed
|
||||
16
tests/features/user/revoke.feature
Normal file
16
tests/features/user/revoke.feature
Normal file
@ -0,0 +1,16 @@
|
||||
Feature: A logged in user is logged out when its auth is revoked.
|
||||
Background:
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And bridge starts
|
||||
And the user logs in with username "user@pm.me" and password "password"
|
||||
|
||||
Scenario: The auth is revoked while bridge is running
|
||||
When the auth of user "user@pm.me" is revoked
|
||||
Then bridge sends a deauth event for user "user@pm.me"
|
||||
And user "user@pm.me" is listed but not connected
|
||||
|
||||
Scenario: The auth is revoked while bridge is not running
|
||||
Given bridge stops
|
||||
And the auth of user "user@pm.me" is revoked
|
||||
When bridge starts
|
||||
Then user "user@pm.me" is listed but not connected
|
||||
38
tests/features/user/sync.feature
Normal file
38
tests/features/user/sync.feature
Normal file
@ -0,0 +1,38 @@
|
||||
Feature: Bridge can fully sync an account
|
||||
Background:
|
||||
Given there exists an account with username "user@pm.me" and password "password"
|
||||
And the account "user@pm.me" has the following custom mailboxes:
|
||||
| name | type |
|
||||
| one | folder |
|
||||
| two | folder |
|
||||
| three | label |
|
||||
And the account "user@pm.me" has the following messages in "one":
|
||||
| sender | recipient | subject | unread |
|
||||
| a@pm.me | a@pm.me | one | true |
|
||||
| b@pm.me | b@pm.me | two | false |
|
||||
And the account "user@pm.me" has the following messages in "two":
|
||||
| sender | recipient | subject | unread |
|
||||
| a@pm.me | a@pm.me | one | true |
|
||||
| b@pm.me | b@pm.me | two | false |
|
||||
And bridge starts
|
||||
|
||||
Scenario: The account is synced when the user logs in and persists across bridge restarts
|
||||
When the user logs in with username "user@pm.me" and password "password"
|
||||
Then bridge sends sync started and finished events for user "user@pm.me"
|
||||
When bridge restarts
|
||||
And user "user@pm.me" connects and authenticates IMAP client "1"
|
||||
Then IMAP client "1" sees the following mailbox info:
|
||||
| name | total | unread |
|
||||
| INBOX | 0 | 0 |
|
||||
| Drafts | 0 | 0 |
|
||||
| Sent | 0 | 0 |
|
||||
| Starred | 0 | 0 |
|
||||
| Archive | 0 | 0 |
|
||||
| Spam | 0 | 0 |
|
||||
| Trash | 0 | 0 |
|
||||
| All Mail | 4 | 2 |
|
||||
| Folders | 0 | 0 |
|
||||
| Folders/one | 2 | 1 |
|
||||
| Folders/two | 2 | 1 |
|
||||
| Labels | 0 | 0 |
|
||||
| Labels/three | 0 | 0 |
|
||||
Reference in New Issue
Block a user