test(GODT-1602): run integration tests against black 🖤

This commit is contained in:
Jakub Cuth
2024-02-19 10:43:35 +00:00
parent 2a1aeb208d
commit 37352d44d2
51 changed files with 525 additions and 271 deletions

View File

@ -2,15 +2,11 @@ Feature: A user can authenticate an SMTP client
Background:
Given there exists an account with username "[user:user]" and password "password"
And there exists an account with username "[user:user2]" and password "password2"
And there exists a disabled account with username "[user:user3]" and password "password3"
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]"
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
@ -40,8 +36,12 @@ Feature: A user can authenticate an SMTP client
When user "[user:user]" connects and authenticates SMTP client "1" with address "[alias:alias]@[domain]"
Then it succeeds
# Need to find way to setup disabled address on black
@skip-black
Scenario: SMTP client can not authenticate with disabled address
When user "[user:user2]" connects and authenticates SMTP client "1" with address "[alias:alias2]@[domain]"
Given the account "[user:user2]" has additional disabled address "[alias:disabled]@[domain]"
And it succeeds
When user "[user:user2]" connects and authenticates SMTP client "1" with address "[alias:disabled]@[domain]"
Then it fails
Scenario: SMTP Logs out user
@ -55,7 +55,13 @@ Feature: A user can authenticate an SMTP client
When user "[user:user2]" connects SMTP client "2"
Then SMTP client "2" can authenticate
@ignore-live
# Need to find way to setup disabled address on black
@skip-black
Scenario: SMTP Authenticates with secondary address of account with disabled primary address
Given there exists a disabled account with username "[user:user3]" and password "password3"
And the account "[user:user3]" has additional address "[alias:alias3]@[domain]"
And it succeeds
And the user logs in with username "[user:user3]" and password "password3"
And it succeeds
When user "[user:user3]" connects and authenticates SMTP client "1" with address "[alias:alias3]@[domain]"
Then it succeeds

View File

@ -11,7 +11,8 @@ Feature: SMTP sending with attachment
And user "[user:user1]" connects and authenticates IMAP client "1"
Then it succeeds
@long-black
# black has issues with cyrilic char
@skip-black
Scenario: Sending with cyrillic PDF attachment
When SMTP client "1" sends the following message from "[user:user1]@[domain]" to "[user:user2]@[domain]":
"""
@ -77,7 +78,8 @@ Feature: SMTP sending with attachment
"""
@long-black
# black has issues with cyrilic char
@skip-black
Scenario: Sending with cyrillic docx attachment
When SMTP client "1" sends the following message from "[user:user1]@[domain]" to "[user:user2]@[domain]":
"""

View File

@ -48,8 +48,6 @@ Feature: SMTP with bcc
}
"""
@long-black
Scenario: Send message only to bcc
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:bcc]@[domain]":
"""

View File

@ -9,7 +9,6 @@ Feature: SMTP sending embedded message
And user "[user:user]" connects and authenticates SMTP client "1"
Then it succeeds
@long-black
Scenario: Send it
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]":
"""
@ -49,4 +48,4 @@ Feature: SMTP sending embedded message
When user "[user:to]" connects and authenticates IMAP client "2"
Then IMAP client "2" eventually sees the following messages in "Inbox":
| from | to | subject | attachments | unread |
| [user:user]@[domain] | [user:to]@[domain] | Embedded message | embedded.eml | true |
| [user:user]@[domain] | [user:to]@[domain] | Embedded message | embedded.eml | true |

View File

@ -1,7 +1,6 @@
Feature: SMTP wrong messages
Background:
Given there exists an account with username "[user:user]" and password "password"
And the account "[user:user]" has additional disabled address "[user:disabled]@[domain]"
And there exists an account with username "[user:to]" and password "password"
Then it succeeds
When bridge starts
@ -48,13 +47,3 @@ Feature: SMTP wrong messages
"""
Then it fails with error "invalid return path"
Scenario: Send from a valid address that cannot send
When SMTP client "1" sends the following message from "[user:disabled]@[domain]" to "[user:to]@[domain]":
"""
From: Bridge Test Disabled <[user:disabled]@[domain]>
To: Internal Bridge <[user:to]@[domain]>
Hello
"""
And it fails with error "Error: can't send on address: [user:disabled]@[domain]"

View File

@ -0,0 +1,24 @@
Feature: SMTP wrong messages
Background:
Given there exists an account with username "[user:user]" and password "password"
And the account "[user:user]" has additional disabled address "[user:disabled]@[domain]"
And there exists an account with username "[user:to]" and password "password"
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
# Need to find way to setup disabled address on black
@skip-black
Scenario: Send from a valid address that cannot send
Given the account "[user:user]" has additional disabled address "[user:disabled]@[domain]"
When SMTP client "1" sends the following message from "[user:disabled]@[domain]" to "[user:to]@[domain]":
"""
From: Bridge Test Disabled <[user:disabled]@[domain]>
To: Internal Bridge <[user:to]@[domain]>
Hello
"""
And it fails with error "Error: can't send on address: [user:disabled]@[domain]"

View File

@ -9,6 +9,8 @@ Feature: SMTP sending of plain messages
And user "[user:user]" connects and authenticates SMTP client "1"
Then it succeeds
# black fails to get parent ID
@skip-black
Scenario: HTML message to external account
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "pm.bridge.qa@gmail.com":
"""
@ -49,6 +51,8 @@ Feature: SMTP sending of plain messages
}
"""
# black is changing order of attachments
@skip-black
Scenario: HTML message with inline image to external account
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "pm.bridge.qa@gmail.com":
"""
@ -311,6 +315,8 @@ Feature: SMTP sending of plain messages
}
"""
# black fails to get parent ID
@skip-black
Scenario: HTML message with extremely long line (greater than default 2000 line limit) to external account
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "pm.bridge.qa@gmail.com":
"""
@ -352,15 +358,13 @@ Feature: SMTP sending of plain messages
"""
Scenario: HTML message with Foreign/Nonascii chars in Subject and Body to external
When there exists an account with username "bridgetest" and password "password"
And the user logs in with username "bridgetest" and password "password"
And user "bridgetest" connects and authenticates SMTP client "1"
And SMTP client "1" sends the following EML "html/foreign_ascii_subject_body.eml" from "bridgetest@proton.local" to "pm.bridge.qa@gmail.com"
When user "[user:user]" connects and authenticates SMTP client "1"
And SMTP client "1" sends the following EML "html/foreign_ascii_subject_body.template.eml" from "[user:user]@[domain]" to "pm.bridge.qa@gmail.com"
Then it succeeds
When user "bridgetest" connects and authenticates IMAP client "1"
When user "[user:user]" connects and authenticates IMAP client "1"
Then IMAP client "1" eventually sees the following messages in "Sent":
| from | to | subject |
| bridgetest@proton.local | pm.bridge.qa@gmail.com | Subjεέςτ Ä È |
| from | to | subject |
| [user:user]@[domain] | pm.bridge.qa@gmail.com | Subjεέςτ Ä È |
And the body in the "POST" request to "/mail/v4/messages" is:
"""
{
@ -384,11 +388,13 @@ Feature: SMTP sending of plain messages
# It is expected for the structure check to look a bit different. More info on GODT-3011
@regression
# Black changes order of attachments
@skip-black
Scenario: HTML message with remote content in Body
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]":
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:user2]@[domain]":
"""
Date: 01 Jan 1980 00:00:00 +0000
To: Internal Bridge Test <[user:to]@[domain]>
To: Internal Bridge Test <[user:user2]@[domain]>
From: Bridge Test <[user:user]@[domain]>
Subject: MESSAGE WITH REMOTE CONTENT SENT
Content-Type: multipart/alternative;
@ -442,7 +448,7 @@ Feature: SMTP sending of plain messages
"""
{
"date": "01 Jan 01 00:00 +0000",
"to": "Internal Bridge Test <[user:to]@[domain]>",
"to": "Internal Bridge Test <[user:user2]@[domain]>",
"from": "Bridge Test <[user:user]@[domain]>",
"subject": "MESSAGE WITH REMOTE CONTENT SENT",
"content": {

View File

@ -1,5 +1,5 @@
@regression
Feature: SMTP sending of HTMl messages to Internal recipient
Feature: SMTP sending of HTML messages to Internal recipient
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"
@ -248,6 +248,8 @@ Feature: SMTP sending of HTMl messages to Internal recipient
}
"""
# black is changing the order of attachments
@skip-black
Scenario: HTML message with multiple attachments to Internal
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]":
"""
@ -754,6 +756,8 @@ Feature: SMTP sending of HTMl messages to Internal recipient
}
"""
# black is changing order of attachments
@skip-black
Scenario: HTML message with multiple inline images to Internal
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]":
"""
@ -1999,6 +2003,8 @@ Feature: SMTP sending of HTMl messages to Internal recipient
}
"""
# black is changing order of attachments
@skip-black
Scenario: HTML message with inline HTML and HTML attachment encoded in UTF-8
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]":
"""
@ -2071,6 +2077,8 @@ Feature: SMTP sending of HTMl messages to Internal recipient
}
"""
# black is changing order of attachments
@skip-black
Scenario: HTML msg with inline HTML and HTML attachment not encoded in UTF-8
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]":
"""
@ -2135,6 +2143,8 @@ Feature: SMTP sending of HTMl messages to Internal recipient
}
"""
# black is changing order of attachments
@skip-black
Scenario: HTML message and attachment not encoded in UTF-8 and without meta charset
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]":
"""
@ -2773,4 +2783,4 @@ Feature: SMTP sending of HTMl messages to Internal recipient
]
}
}
"""
"""

View File

@ -8,8 +8,6 @@ Feature: SMTP sending two messages
And the user logs in with username "[user:recp]" and password "password"
Then it succeeds
@long-black
Scenario: Send from one account to the other
When user "[user:user]" connects and authenticates SMTP client "1"
And SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:recp]@[domain]":
@ -64,8 +62,6 @@ Feature: SMTP sending two messages
| from | to | subject | body |
| [user:user]@[domain] | [user:recp]@[domain] | One account to the other | hello |
@long-black
Scenario: Send from one account to the other with attachments
When user "[user:user]" connects and authenticates SMTP client "1"
And SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:recp]@[domain]":
@ -137,4 +133,4 @@ Feature: SMTP sending two messages
When user "[user:recp]" connects and authenticates IMAP client "2"
Then IMAP client "2" eventually sees the following messages in "Inbox":
| from | to | subject | body | attachments | unread |
| [user:user]@[domain] | [user:recp]@[domain] | Plain with attachment internal | This is the body | outline-light-instagram-48.png | true |
| [user:user]@[domain] | [user:recp]@[domain] | Plain with attachment internal | This is the body | outline-light-instagram-48.png | true |

View File

@ -171,15 +171,13 @@ Feature: SMTP sending of plain messages
"""
Scenario: Basic message with multiple different attachments to internal account
When there exists an account with username "bridgetest" and password "password"
And the user logs in with username "bridgetest" and password "password"
And user "bridgetest" connects and authenticates SMTP client "1"
And SMTP client "1" sends the following EML "plain/text_plain_multiple_attachments.eml" from "bridgetest@proton.local" to "internalbridgetest@proton.local"
When user "[user:user]" connects and authenticates SMTP client "1"
And SMTP client "1" sends the following EML "plain/text_plain_multiple_attachments.template.eml" from "[user:user]@[domain]" to "[user:to]@[domain]"
Then it succeeds
When user "bridgetest" connects and authenticates IMAP client "1"
When user "[user:user]" connects and authenticates IMAP client "1"
Then IMAP client "1" eventually sees the following messages in "Sent":
| from | to | subject |
| bridgetest@proton.local | internalbridgetest@proton.local | Plain with multiple different attachments |
| from | to | subject |
| [user:user]@[domain] | [user:to]@[domain] | Plain with multiple different attachments |
And the body in the "POST" request to "/mail/v4/messages" is:
"""
{
@ -190,7 +188,7 @@ Feature: SMTP sending of plain messages
},
"ToList": [
{
"Address": "internalbridgetest@proton.local",
"Address": "[user:to]@[domain]",
"Name": "Internal Bridge"
}
],

View File

@ -164,6 +164,8 @@ Feature: SMTP sending of PLAIN messages to Internal recipient
}
"""
# black changes order of attachments
@skip-black
Scenario: Plain message with multiple attachments to Internal
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]":
"""
@ -660,6 +662,8 @@ Feature: SMTP sending of PLAIN messages to Internal recipient
}
"""
# black is changing order of attachments
@skip-black
Scenario: Forward a Plain message containing various attachments
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]":
"""

View File

@ -17,7 +17,6 @@ Feature: SMTP sending the same message twice
"""
And it succeeds
@long-black
Scenario: The exact same message is not sent twice
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]":
"""
@ -37,8 +36,6 @@ Feature: SMTP sending the same message twice
| from | to | subject | body |
| [user:user]@[domain] | [user:to]@[domain] | Hello | World |
@long-black
Scenario: Slight change means different message and is sent twice
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]":
"""
@ -58,4 +55,4 @@ Feature: SMTP sending the same message twice
Then IMAP client "2" eventually sees the following messages in "Inbox":
| from | to | subject | body |
| [user:user]@[domain] | [user:to]@[domain] | Hello | World |
| [user:user]@[domain] | [user:to]@[domain] | Hello. | World |
| [user:user]@[domain] | [user:to]@[domain] | Hello. | World |

View File

@ -11,7 +11,6 @@ Feature: SMTP send reply
And user "[user:user1]" connects and authenticates IMAP client "1"
Then it succeeds
@long-black
Scenario: Reply with In-Reply-To but no References
# User1 send the initial message.
When SMTP client "1" sends the following message from "[user:user1]@[domain]" to "[user:user2]@[domain]":
@ -58,7 +57,6 @@ Feature: SMTP send reply
| from | subject | body | in-reply-to | references | reply-to |
| [user:user2]@[domain] | FW - Please Reply | Heya | <something@protonmail.ch> | <something@protonmail.ch> | [user:user2]@[domain] |
@long-black
Scenario: Reply with References but no In-Reply-To
# User1 send the initial message.
When SMTP client "1" sends the following message from "[user:user1]@[domain]" to "[user:user2]@[domain]":
@ -106,7 +104,6 @@ Feature: SMTP send reply
| [user:user2]@[domain] | FW - Please Reply | Heya | <something@protonmail.ch> | <something@protonmail.ch> | [user:user2]@[domain] |
@long-black
Scenario: Reply with both References and In-Reply-To
# User1 send the initial message.
When SMTP client "1" sends the following message from "[user:user1]@[domain]" to "[user:user2]@[domain]":
@ -155,7 +152,6 @@ Feature: SMTP send reply
| [user:user2]@[domain] | FW - Please Reply | Heya | <something@protonmail.ch> | <something@protonmail.ch> | [user:user2]@[domain] |
@long-black
Scenario: Reply with In-Reply-To matching several received ExternalID
# User1 send the initial message.
When SMTP client "1" sends the following message from "[user:user1]@[domain]" to "[user:user2]@[domain]":
@ -216,7 +212,6 @@ Feature: SMTP send reply
| [user:user2]@[domain] | FW - Please Reply | Heya | | |
@long-black
Scenario: Reply with In-Reply-To matching several ExternalID but one sent by us
# User1 send the initial message.
When SMTP client "1" sends the following message from "[user:user1]@[domain]" to "[user:user2]@[domain]":
@ -279,7 +274,6 @@ Feature: SMTP send reply
| [user:user2]@[domain] | FW - Please Reply | <something@external.com> | <something@external.com> |
| [user:user2]@[domain] | FW - Please Reply Again | <something@external.com> | <something@external.com> |
@long-black
Scenario: Reply with In-Reply-To and X-Forwarded-Message-Id sets forwarded flag
# User1 send the initial message.
When SMTP client "1" sends the following message from "[user:user1]@[domain]" to "[user:user2]@[domain]":
@ -334,7 +328,8 @@ Feature: SMTP send reply
| from | subject | in-reply-to | references |
| [user:user2]@[domain] | FW - Please Reply | <something@external.com> | <something@external.com> |
@long-black
# black: missing answered flag
@skip-black
Scenario: Reply with In-Reply-To sets answered flag
# User1 send the initial message.
When SMTP client "1" sends the following message from "[user:user1]@[domain]" to "[user:user2]@[domain]":
@ -386,4 +381,4 @@ Feature: SMTP send reply
# User1 receive the reply.|
And IMAP client "1" eventually sees the following messages in "INBOX":
| from | subject | in-reply-to | references |
| [user:user2]@[domain] | FW - Please Reply | <something@external.com> | <something@external.com> |
| [user:user2]@[domain] | FW - Please Reply | <something@external.com> | <something@external.com> |

View File

@ -2,7 +2,7 @@ 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:multi]" and password "password"
And the account "[user:multi]" has additional address "[user:multi-alias]@[domain]"
And the account "[user:multi]" has additional address "[alias:multi]@[domain]"
And there exists an account with username "[user:to]" and password "password"
Then it succeeds
When bridge starts
@ -34,7 +34,7 @@ Feature: SMTP sending two messages
Scenario: Send with two addresses of the same user in split mode
When user "[user:multi]" connects and authenticates SMTP client "1" with address "[user:multi]@[domain]"
And user "[user:multi]" connects and authenticates SMTP client "2" with address "[user:multi-alias]@[domain]"
And user "[user:multi]" connects and authenticates SMTP client "2" with address "[alias:multi]@[domain]"
And SMTP client "1" sends the following message from "[user:multi]@[domain]" to "[user:to]@[domain]>":
"""
From: Bridge Test <[user:multi]@[domain]>