2020-04-08 10:59:16 +00:00
|
|
|
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"
|
2020-05-21 12:37:15 +00:00
|
|
|
Then IMAP response is "IMAP error: NO account is logged out, use the app to login again"
|
2020-04-08 10:59:16 +00:00
|
|
|
|
|
|
|
Scenario: Authenticates with connected user that was loaded without internet
|
2021-05-19 07:57:36 +00:00
|
|
|
Given there is user "user" which just logged in
|
2020-04-08 10:59:16 +00:00
|
|
|
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
|
2021-05-19 07:57:36 +00:00
|
|
|
Given there is user "user" which just logged in
|
2020-06-17 13:29:41 +00:00
|
|
|
When "user" logs out
|
2020-04-08 10:59:16 +00:00
|
|
|
And IMAP client authenticates "user"
|
2020-05-21 12:37:15 +00:00
|
|
|
Then IMAP response is "IMAP error: NO account is logged out, use the app to login again"
|
2020-04-08 10:59:16 +00:00
|
|
|
|
|
|
|
Scenario: Authenticates user which was re-logged in
|
2021-05-19 07:57:36 +00:00
|
|
|
Given there is user "user" which just logged in
|
2020-06-17 13:29:41 +00:00
|
|
|
When "user" logs out
|
2020-04-08 10:59:16 +00:00
|
|
|
And IMAP client authenticates "user"
|
2020-05-21 12:37:15 +00:00
|
|
|
Then IMAP response is "IMAP error: NO account is logged out, use the app to login again"
|
2020-06-17 13:29:41 +00:00
|
|
|
When "user" logs in
|
2020-04-08 10:59:16 +00:00
|
|
|
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
|
2020-06-12 12:39:58 +00:00
|
|
|
Scenario: Authenticates with secondary address of account with disabled primary address
|
2020-04-08 10:59:16 +00:00
|
|
|
Given there is connected user "userDisabledPrimaryAddress"
|
2020-06-11 10:16:26 +00:00
|
|
|
When IMAP client authenticates "userDisabledPrimaryAddress" with address "secondary"
|
2020-04-08 10:59:16 +00:00
|
|
|
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"
|