test: fix flaky tests.

This commit is contained in:
Romain Le Jeune
2023-05-22 11:16:56 +00:00
parent bb99695e68
commit 9c25f56fe6
57 changed files with 265 additions and 109 deletions

View File

@ -1,7 +1,9 @@
Feature: Send Telemetry Heartbeat
Background:
Given there exists an account with username "[user:user1]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
Then it succeeds
Scenario: Send at first start - one user default settings

View File

@ -4,9 +4,11 @@ Feature: A user can authenticate an IMAP client
And there exists an account with username "[user:user2]" and password "password2"
And the account "[user:user]" has additional address "[alias:alias]@[domain]"
And the account "[user:user2]" has additional disabled address "[alias:alias2]@[domain]"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And the user logs in with username "[user:user2]" and password "password2"
Then it succeeds
Scenario: IMAP client can authenticate successfully
When user "[user:user]" connects IMAP client "1"

View File

@ -1,8 +1,10 @@
Feature: The IMAP ID is propagated to bridge
Background:
Given there exists an account with username "[user:user]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
Then it succeeds
Scenario: Initial user agent before an IMAP client announces its ID
When user "[user:user]" connects IMAP client "1"

View File

@ -7,10 +7,12 @@ Feature: IMAP create mailbox
| f2 | folder |
| l1 | label |
| l2 | label |
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" finishes syncing
And user "[user:user]" connects and authenticates IMAP client "1"
Then it succeeds
Scenario: Create folder
When IMAP client "1" creates "Folders/mbox"

View File

@ -6,10 +6,12 @@ Feature: IMAP delete mailbox
| one | folder |
| two | folder |
| three | label |
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" finishes syncing
And user "[user:user]" connects and authenticates IMAP client "1"
Then it succeeds
Scenario: Delete folder
When IMAP client "1" deletes "Folders/one"

View File

@ -1,10 +1,12 @@
Feature: IMAP Hide All Mail
Background:
Given there exists an account with username "[user:user]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" finishes syncing
And user "[user:user]" connects and authenticates IMAP client "1"
Then it succeeds
Scenario: Hide All Mail Mailbox
Given IMAP client "1" eventually sees the following mailbox info:

View File

@ -8,9 +8,11 @@ Feature: IMAP get mailbox info
| from | to | subject | unread |
| a@example.com | a@example.com | one | true |
| b@example.com | b@example.com | two | false |
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" finishes syncing
Then it succeeds
Scenario: Mailbox status reports correct name, total and unread
When user "[user:user]" connects and authenticates IMAP client "1"

View File

@ -5,11 +5,13 @@ Feature: IMAP list mailboxes
| name | type |
| mbox1 | folder |
| mbox2 | label |
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" finishes syncing
And user "[user:user]" connects and authenticates IMAP client "1"
Then IMAP client "1" eventually sees the following mailbox info:
Then it succeeds
And IMAP client "1" eventually sees the following mailbox info:
| name |
| INBOX |
| Drafts |

View File

@ -5,10 +5,12 @@ Feature: IMAP get mailbox info
| name | type |
| f1 | folder |
| l1 | label |
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" finishes syncing
And user "[user:user]" connects and authenticates IMAP client "1"
Then it succeeds
Scenario: Rename folder
When IMAP client "1" renames "Folders/f1" to "Folders/f2"

View File

@ -5,10 +5,12 @@ Feature: IMAP get mailbox info
| name | type |
| f1 | folder |
| f1/f2| folder |
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" finishes syncing
And user "[user:user]" connects and authenticates IMAP client "1"
Then it succeeds
Scenario: Rename folder with subfolders
When IMAP client "1" renames "Folders/f1" to "Folders/f3"

View File

@ -5,10 +5,12 @@ Feature: IMAP select mailbox
| name | type |
| mbox | folder |
| label | label |
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" finishes syncing
And user "[user:user]" connects and authenticates IMAP client "1"
Then it succeeds
Scenario: Select inbox
When IMAP client "1" selects "INBOX"

View File

@ -9,10 +9,12 @@ Feature: IMAP copy messages
| from | to | subject | unread |
| john.doe@mail.com | [user:user]@[domain] | foo | false |
| jane.doe@mail.com | name@[domain] | bar | true |
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" finishes syncing
And user "[user:user]" connects and authenticates IMAP client "1"
Then it succeeds
Scenario: Copy message to label
When IMAP client "1" copies the message with subject "foo" from "INBOX" to "Labels/label"

View File

@ -2,10 +2,12 @@ Feature: IMAP create messages
Background:
Given there exists an account with username "[user:user]" and password "password"
And the account "[user:user]" has additional address "[alias:alias]@[domain]"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" finishes syncing
And user "[user:user]" connects and authenticates IMAP client "1"
Then it succeeds
Scenario: Creates message to user's primary address
When IMAP client "1" appends the following messages to "INBOX":

View File

@ -7,10 +7,12 @@ Feature: IMAP remove messages from mailbox
| label | label |
And the address "[user:user]@[domain]" of account "[user:user]" has 10 messages in "Folders/mbox"
And the address "[user:user]@[domain]" of account "[user:user]" has 1 messages in "Scheduled"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" finishes syncing
And user "[user:user]" connects and authenticates IMAP client "1"
Then it succeeds
Scenario: Mark message as deleted and EXPUNGE
When IMAP client "1" selects "Folders/mbox"

View File

@ -5,6 +5,7 @@ Feature: IMAP remove messages from Trash
| name | type |
| mbox | folder |
| label | label |
Then it succeeds
Scenario Outline: Message in Trash and some other label is not permanently deleted
Given the address "[user:user]@[domain]" of account "[user:user]" has the following messages in "Trash":

View File

@ -1,7 +1,8 @@
Feature: IMAP Draft messages
Background:
Given there exists an account with username "[user:user]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" finishes syncing
And user "[user:user]" connects and authenticates IMAP client "1"
@ -11,12 +12,13 @@ Feature: IMAP Draft messages
This is a dra
"""
And it succeeds
Then IMAP client "1" eventually sees the following messages in "Drafts":
Then it succeeds
And IMAP client "1" eventually sees the following messages in "Drafts":
| body |
| This is a dra |
And IMAP client "1" eventually sees 1 messages in "Drafts"
Scenario: Draft edited locally
When IMAP client "1" marks message 1 as deleted
And IMAP client "1" expunges

View File

@ -7,10 +7,12 @@ Feature: IMAP Fetch
And the address "[user:user]@[domain]" of account "[user:user]" has the following messages in "Inbox":
| from | to | subject | date |
| john.doe@mail.com | [user:user]@[domain] | foo | 13 Jul 69 00:00 +0000 |
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" finishes syncing
And user "[user:user]" connects and authenticates IMAP client "1"
Then it succeeds
Scenario: Fetch very old message
Given IMAP client "1" eventually sees the following messages in "INBOX":

View File

@ -1,10 +1,12 @@
Feature: IMAP import messages
Background:
Given there exists an account with username "[user:user]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" finishes syncing
And user "[user:user]" connects and authenticates IMAP client "1"
Then it succeeds
Scenario: Basic message import
When IMAP client "1" appends the following message to "INBOX":

View File

@ -19,10 +19,12 @@ Feature: IMAP move messages
And the address "[user:user]@[domain]" of account "[user:user]" has the following messages in "Scheduled":
| from | to | subject | unread |
| john.doe@mail.com | [user:user]@[domain] | sch | false |
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" finishes syncing
And user "[user:user]" connects and authenticates IMAP client "1"
Then it succeeds
Scenario: Move message from folder to label (keeps in folder)
When IMAP client "1" moves the message with subject "foo" from "INBOX" to "Labels/label"

View File

@ -4,11 +4,13 @@ Feature: IMAP move messages by append and delete (without MOVE support, e.g., Ou
And the account "[user:user]" has the following custom mailboxes:
| name | type |
| mbox | folder |
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" finishes syncing
And user "[user:user]" connects and authenticates IMAP client "source"
And user "[user:user]" connects and authenticates IMAP client "target"
Then it succeeds
Scenario Outline: Move message from <srcMailbox> to <dstMailbox> by <order>
When IMAP client "source" appends the following message to "<srcMailbox>":

View File

@ -7,10 +7,11 @@ Feature: Bridge can fully sync an account
| jane.doe@mail.com | name@[domain] | bar | true |
And the account "[user:user]" has 20 custom folders
And the account "[user:user]" has 60 custom labels
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" finishes syncing
When user "[user:user]" connects and authenticates IMAP client "1"
And user "[user:user]" connects and authenticates IMAP client "1"
Then IMAP client "1" counts 20 mailboxes under "Folders"
And IMAP client "1" counts 60 mailboxes under "Labels"

View File

@ -1,9 +1,11 @@
Feature: A user can connect an IMAP client to custom ports
Background:
Given there exists an account with username "[user:user]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And the user changes the IMAP port to 1144
Then it succeeds
Scenario: Authenticates successfully on custom port
When user "[user:user]" connects IMAP client "1" on port 1144

View File

@ -6,10 +6,12 @@ Feature: A user can authenticate an SMTP client
And the account "[user:user]" has additional address "[alias:alias]@[domain]"
And the account "[user:user2]" has additional disabled address "[alias:alias2]@[domain]"
And the account "[user:user3]" has additional address "[alias:alias3]@[domain]"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And the user logs in with username "[user:user2]" and password "password2"
And the user logs in with username "[user:user3]" and password "password3"
Then it succeeds
Scenario: SMTP client can authenticate successfully
When user "[user:user]" connects SMTP client "1"

View File

@ -1,9 +1,11 @@
Feature: SMTP initiation
Background:
Given there exists an account with username "[user:user]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
When user "[user:user]" connects and authenticates SMTP client "1"
And user "[user:user]" connects and authenticates SMTP client "1"
Then it succeeds
Scenario: Send without first announcing FROM and TO
When SMTP client "1" sends DATA:

View File

@ -1,10 +1,12 @@
Feature: A user can connect an SMTP client to custom ports
Background:
Given there exists an account with username "[user:user]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And the user changes the SMTP port to 1144
Then it succeeds
Scenario: Authenticates successfully on custom port
When the user changes the SMTP port to 1144
When user "[user:user]" connects SMTP client "1" on port 1144
Then SMTP client "1" can authenticate

View File

@ -1,12 +1,14 @@
Feature: SMTP with bcc
Background:
Given there exists an account with username "[user:user]" and password "password"
Given there exists an account with username "[user:to]" and password "password"
Given there exists an account with username "[user:bcc]" and password "password"
And bridge starts
And there exists an account with username "[user:to]" and password "password"
And there exists an account with username "[user:bcc]" and password "password"
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And the user logs in with username "[user:bcc]" and password "password"
And user "[user:user]" connects and authenticates SMTP client "1"
Then it succeeds
Scenario: Send message to address in to and bcc
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain], [user:bcc]@[domain]":

View File

@ -2,10 +2,12 @@ Feature: SMTP sending embedded message
Background:
Given there exists an account with username "[user:user]" and password "password"
And there exists an account with username "[user:to]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And the user logs in with username "[user:to]" and password "password"
And user "[user:user]" connects and authenticates SMTP client "1"
Then it succeeds
@long-black
Scenario: Send it

View File

@ -2,9 +2,11 @@ Feature: SMTP wrong messages
Background:
Given there exists an account with username "[user:user]" and password "password"
And there exists an account with username "[user:to]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" connects and authenticates SMTP client "1"
Then it succeeds
Scenario: Message with attachment and wrong boundaries
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]":

View File

@ -2,9 +2,11 @@ Feature: SMTP sending of plain messages
Background:
Given there exists an account with username "[user:user]" and password "password"
And there exists an account with username "[user:to]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" connects and authenticates SMTP client "1"
Then it succeeds
Scenario: HTML message to external account
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "pm.bridge.qa@gmail.com":

View File

@ -2,9 +2,11 @@ Feature: SMTP sending of plain messages
Background:
Given there exists an account with username "[user:user]" and password "password"
And there exists an account with username "[user:to]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" connects and authenticates SMTP client "1"
Then it succeeds
Scenario: HTML message with attachment to internal account
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]":

View File

@ -2,9 +2,11 @@ Feature: SMTP messages containing inlines
Background:
Given there exists an account with username "[user:user]" and password "password"
And there exists an account with username "[user:to]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" connects and authenticates SMTP client "1"
Then it succeeds
Scenario: A message with inline attachment to internal account
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]":

View File

@ -2,9 +2,11 @@ Feature: SMTP sending with mixed case address
Background:
Given there exists an account with username "[user:user]" and password "password"
And there exists an account with username "[user:to]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" connects and authenticates SMTP client "1"
Then it succeeds
Scenario: Mixed sender case in sender address
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]":

View File

@ -2,9 +2,11 @@ Feature: SMTP sending two messages
Background:
Given there exists an account with username "[user:user]" and password "password"
And there exists an account with username "[user:recp]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And the user logs in with username "[user:recp]" and password "password"
Then it succeeds
@long-black

View File

@ -3,9 +3,11 @@ Feature: SMTP sending of plain messages
Given there exists an account with username "[user:user]" and password "password"
And there exists an account with username "[user:to]" and password "password"
And there exists an account with username "[user:cc]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" connects and authenticates SMTP client "1"
Then it succeeds
Scenario: Only from and to headers to internal account
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]":

View File

@ -2,9 +2,11 @@ Feature: SMTP sending of plain messages
Background:
Given there exists an account with username "[user:user]" and password "password"
And there exists an account with username "[user:to]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" connects and authenticates SMTP client "1"
Then it succeeds
Scenario: Basic message with attachment to internal account
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]":

View File

@ -2,7 +2,8 @@ Feature: SMTP sending the same message twice
Background:
Given there exists an account with username "[user:user]" and password "password"
And there exists an account with username "[user:to]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And the user logs in with username "[user:to]" and password "password"
And user "[user:user]" connects and authenticates SMTP client "1"

View File

@ -2,10 +2,12 @@ Feature: SMTP sending with APPENDing to Sent
Background:
Given there exists an account with username "[user:user]" and password "password"
And there exists an account with username "[user:to]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" connects and authenticates SMTP client "1"
And user "[user:user]" connects and authenticates IMAP client "1"
Then it succeeds
Scenario: Send message and append to Sent
# First do sending.

View File

@ -3,11 +3,13 @@ Feature: SMTP send reply
Background:
Given there exists an account with username "[user:user1]" and password "password"
And there exists an account with username "[user:user2]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user1]" and password "password"
And user "[user:user1]" finishes syncing
And user "[user:user1]" connects and authenticates SMTP client "1"
And user "[user:user1]" connects and authenticates IMAP client "1"
Then it succeeds
@long-black
Scenario: Reply with In-Reply-To but no References

View File

@ -4,10 +4,12 @@ Feature: SMTP sending two messages
And there exists an account with username "[user:multi]" and password "password"
And the account "[user:multi]" has additional address "[user:multi-alias]@[domain]"
And there exists an account with username "[user:to]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And the user logs in with username "[user:multi]" and password "password"
And the user sets the address mode of user "[user:multi]" to "split"
Then it succeeds
Scenario: Send two messages in one connection
When user "[user:user]" connects and authenticates SMTP client "1"

View File

@ -14,9 +14,11 @@ Feature: Address mode
| from | to | subject | unread |
| c@[domain] | c@[domain] | three | true |
| d@[domain] | d@[domain] | four | false |
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
And user "[user:user]" finishes syncing
Then it succeeds
Scenario: The user is in combined mode
When user "[user:user]" connects and authenticates IMAP client "1" with address "[user:user]@[domain]"

View File

@ -1,8 +1,10 @@
Feature: A user can be deleted
Background:
Given there exists an account with username "[user:user]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
Then it succeeds
Scenario: Delete a connected user
When user "[user:user]" is deleted

View File

@ -1,9 +1,11 @@
Feature: A user can login
Background:
Given there exists an account with username "[user:user]" and password "password"
Given there exists an account with username "[user:MixedCaps]" and password "password"
Given there exists a disabled account with username "[user:disabled]" and password "password"
And there exists an account with username "[user:MixedCaps]" and password "password"
And there exists a disabled account with username "[user:disabled]" and password "password"
Then it succeeds
And bridge starts
Then it succeeds
Scenario: Login to account
When the user logs in with username "[user:user]" and password "password"

View File

@ -1,8 +1,10 @@
Feature: A logged out user can login again
Background:
Given there exists an account with username "[user:user]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
Then it succeeds
Scenario: Login to disconnected account
When user "[user:user]" logs out

View File

@ -1,8 +1,10 @@
Feature: A logged in user is logged out when its auth is revoked.
Background:
Given there exists an account with username "[user:user]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
And the user logs in with username "[user:user]" and password "password"
Then it succeeds
Scenario: The auth is revoked while bridge is running
When the auth of user "[user:user]" is revoked

View File

@ -14,7 +14,9 @@ Feature: Bridge can fully sync an account
| from | to | subject | unread |
| a@[domain] | a@[domain] | one | true |
| b@[domain] | b@[domain] | two | false |
And bridge starts
Then it succeeds
When bridge starts
Then it succeeds
Scenario: The account is synced when the user logs in and persists across bridge restarts
When the user logs in with username "[user:user]" and password "password"

View File

@ -2,7 +2,9 @@ Feature: Bridge send usage metrics
Background:
Given there exists an account with username "[user:user1]" and password "password"
And there exists an account with username "[user:user2]" and password "password"
And bridge starts
Then it succeeds
When bridge starts
Then it succeeds
Scenario: Telemetry availability - No user