From 87ce5a6d82ffbd21a0ff0b6ed0db5bc9d21edacf Mon Sep 17 00:00:00 2001 From: James Houlahan Date: Tue, 13 Dec 2022 03:48:54 +0100 Subject: [PATCH] GODT-2181(test): Use [user:NAME] for more test user names --- tests/ctx_test.go | 27 ++++- tests/features/imap/auth.feature | 20 ++-- tests/features/imap/id.feature | 10 +- tests/features/imap/mailbox/create.feature | 26 ++-- tests/features/imap/mailbox/delete.feature | 10 +- .../imap/mailbox/hide_all_mail.feature | 8 +- tests/features/imap/mailbox/info.feature | 18 +-- tests/features/imap/mailbox/list.feature | 24 ++-- tests/features/imap/mailbox/rename.feature | 10 +- tests/features/imap/mailbox/select.feature | 10 +- tests/features/imap/message/copy.feature | 56 ++++----- tests/features/imap/message/create.feature | 58 ++++----- tests/features/imap/message/delete.feature | 12 +- .../imap/message/delete_from_trash.feature | 32 ++--- tests/features/imap/message/drafts.feature | 10 +- tests/features/imap/message/import.feature | 20 ++-- .../imap/message/move_without_support.feature | 14 +-- tests/features/imap/migration.feature | 14 +-- tests/features/imap/ports.feature | 6 +- tests/features/smtp/auth.feature | 14 +-- tests/features/smtp/init.feature | 28 ++--- tests/features/smtp/ports.feature | 6 +- tests/features/smtp/send/bcc.feature | 46 +++---- .../smtp/send/embedded_message.feature | 30 ++--- tests/features/smtp/send/failures.feature | 20 ++-- tests/features/smtp/send/html.feature | 62 +++++----- tests/features/smtp/send/html_att.feature | 42 +++---- tests/features/smtp/send/inline.feature | 50 ++++---- tests/features/smtp/send/mixed_case.feature | 24 ++-- .../smtp/send/one_account_to_another.feature | 52 ++++---- tests/features/smtp/send/plain.feature | 112 +++++++++--------- tests/features/smtp/send/plain_att.feature | 42 +++---- tests/features/smtp/send/same_message.feature | 56 ++++----- tests/features/smtp/send/send_append.feature | 24 ++-- tests/features/smtp/send/two_messages.feature | 60 +++++----- tests/features/user/addressmode.feature | 90 +++++++------- tests/features/user/delete.feature | 14 +-- tests/features/user/events.feature | 0 tests/features/user/relogin.feature | 14 +-- tests/features/user/revoke.feature | 14 +-- tests/features/user/sync.feature | 28 ++--- tests/init_test.go | 4 +- tests/user_test.go | 17 +-- 43 files changed, 631 insertions(+), 603 deletions(-) delete mode 100644 tests/features/user/events.feature diff --git a/tests/ctx_test.go b/tests/ctx_test.go index e7a0ef38..9fe7196d 100644 --- a/tests/ctx_test.go +++ b/tests/ctx_test.go @@ -21,6 +21,7 @@ import ( "context" "fmt" "net/smtp" + "net/url" "regexp" "runtime" "strings" @@ -71,6 +72,7 @@ type testCtx struct { // These maps hold expected userIDByName, their primary addresses and bridge passwords. userUUIDByName map[string]string + addrUUIDByName map[string]string userIDByName map[string]string userAddrByEmail map[string]map[string]string userPassByID map[string]string @@ -114,6 +116,7 @@ func newTestCtx(tb testing.TB) *testCtx { reporter: newReportRecorder(tb), userUUIDByName: make(map[string]string), + addrUUIDByName: make(map[string]string), userIDByName: make(map[string]string), userAddrByEmail: make(map[string]map[string]string), userPassByID: make(map[string]string), @@ -152,6 +155,23 @@ func (t *testCtx) replace(value string) string { return t.userUUIDByName[name] }) + // Replace [addr:EMAIL] with a unique address for the email EMAIL. + value = regexp.MustCompile(`\[addr:(\w+)\]`).ReplaceAllStringFunc(value, func(match string) string { + email := regexp.MustCompile(`\[addr:(\w+)\]`).FindStringSubmatch(match)[1] + + // Create a new address if it doesn't exist yet. + if _, ok := t.addrUUIDByName[email]; !ok { + t.addrUUIDByName[email] = uuid.NewString() + } + + return t.addrUUIDByName[email] + }) + + // Replace {upper:VALUE} with VALUE in uppercase. + value = regexp.MustCompile(`\{toUpper:([^}]+)\}`).ReplaceAllStringFunc(value, func(match string) string { + return strings.ToUpper(regexp.MustCompile(`\{toUpper:([^}].+)\}`).FindStringSubmatch(match)[1]) + }) + return value } @@ -285,8 +305,13 @@ func (t *testCtx) getLastCall(method, pathExp string) (server.Call, error) { t.callsLock.RLock() defer t.callsLock.RUnlock() + root, err := url.Parse(t.api.GetHostURL()) + if err != nil { + return server.Call{}, err + } + if matches := xslices.Filter(xslices.Join(t.calls...), func(call server.Call) bool { - return call.Method == method && regexp.MustCompile("^"+pathExp+"$").MatchString(call.URL.Path) + return call.Method == method && regexp.MustCompile("^"+pathExp+"$").MatchString(strings.TrimPrefix(call.URL.Path, root.Path)) }); len(matches) > 0 { return matches[len(matches)-1], nil } diff --git a/tests/features/imap/auth.feature b/tests/features/imap/auth.feature index 1e741d21..375e047a 100644 --- a/tests/features/imap/auth.feature +++ b/tests/features/imap/auth.feature @@ -1,30 +1,30 @@ Feature: A user can authenticate an IMAP client Background: - Given there exists an account with username "user" and password "password" + Given there exists an account with username "[user:user]" and password "password" And bridge starts - And the user logs in with username "user" and password "password" + And the user logs in with username "[user:user]" and password "password" Scenario: IMAP client can authenticate successfully - When user "user" connects IMAP client "1" + When user "[user:user]" connects IMAP client "1" Then IMAP client "1" can authenticate Scenario: IMAP client can authenticate successfully with different case - When user "user" connects IMAP client "1" - Then IMAP client "1" can authenticate with address "USER@[domain]" + When user "[user:user]" connects IMAP client "1" + Then IMAP client "1" can authenticate with address "{toUpper:[user:user]@[domain]}" Scenario: IMAP client can authenticate successfully - When user "user" connects IMAP client "1" + When user "[user:user]" connects IMAP client "1" Then IMAP client "1" can authenticate Scenario: IMAP client cannot authenticate with bad username - When user "user" connects IMAP client "1" + When user "[user:user]" connects IMAP client "1" Then IMAP client "1" cannot authenticate with incorrect username Scenario: IMAP client cannot authenticate with bad password - When user "user" connects IMAP client "1" + When user "[user:user]" connects IMAP client "1" Then IMAP client "1" cannot authenticate with incorrect password Scenario: IMAP client cannot authenticate for disconnected user - When user "user" logs out - And user "user" connects IMAP client "1" + When user "[user:user]" logs out + And user "[user:user]" connects IMAP client "1" Then IMAP client "1" cannot authenticate diff --git a/tests/features/imap/id.feature b/tests/features/imap/id.feature index 12730e70..a8653b9e 100644 --- a/tests/features/imap/id.feature +++ b/tests/features/imap/id.feature @@ -1,20 +1,20 @@ Feature: The IMAP ID is propagated to bridge Background: - Given there exists an account with username "user" and password "password" + Given there exists an account with username "[user:user]" and password "password" And bridge starts - And the user logs in with username "user" and password "password" + And the user logs in with username "[user:user]" and password "password" Scenario: Initial user agent before an IMAP client announces its ID - When user "user" connects IMAP client "1" + When user "[user:user]" 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" connects IMAP client "1" + When user "[user:user]" 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" connects IMAP client "1" + When user "[user:user]" 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 header in the "POST" request to "/core/v4/reports/bug" has "User-Agent" set to "name/version ([GOOS])" \ No newline at end of file diff --git a/tests/features/imap/mailbox/create.feature b/tests/features/imap/mailbox/create.feature index 43744235..4916c3fb 100644 --- a/tests/features/imap/mailbox/create.feature +++ b/tests/features/imap/mailbox/create.feature @@ -1,16 +1,16 @@ Feature: IMAP create mailbox Background: - Given there exists an account with username "user" and password "password" - And the account "user" has the following custom mailboxes: + Given there exists an account with username "[user:user]" and password "password" + And the account "[user:user]" has the following custom mailboxes: | name | type | | f1 | folder | | f2 | folder | | l1 | label | | l2 | label | And bridge starts - And the user logs in with username "user" and password "password" - And user "user" finishes syncing - And user "user" connects and authenticates IMAP client "1" + 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" Scenario: Create folder When IMAP client "1" creates "Folders/mbox" @@ -85,10 +85,10 @@ Feature: IMAP create mailbox | Labels | | Labels/l1 | | Labels/l2 | - When user "user" is deleted - And the user logs in with username "user" and password "password" - And user "user" finishes syncing - And user "user" connects and authenticates IMAP client "2" + When user "[user:user]" is deleted + 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 "2" Then IMAP client "2" sees the following mailbox info: | name | | INBOX | @@ -163,10 +163,10 @@ Feature: IMAP create mailbox | Labels | | Labels/l1 | | Labels/l2 | - When user "user" is deleted - And the user logs in with username "user" and password "password" - And user "user" finishes syncing - And user "user" connects and authenticates IMAP client "2" + When user "[user:user]" is deleted + 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 "2" Then IMAP client "2" sees the following mailbox info: | name | | INBOX | diff --git a/tests/features/imap/mailbox/delete.feature b/tests/features/imap/mailbox/delete.feature index 7b3efc7b..01c664ae 100644 --- a/tests/features/imap/mailbox/delete.feature +++ b/tests/features/imap/mailbox/delete.feature @@ -1,15 +1,15 @@ Feature: IMAP delete mailbox Background: - Given there exists an account with username "user" and password "password" - And the account "user" has the following custom mailboxes: + Given there exists an account with username "[user:user]" and password "password" + And the account "[user:user]" has the following custom mailboxes: | name | type | | one | folder | | two | folder | | three | label | And bridge starts - And the user logs in with username "user" and password "password" - And user "user" finishes syncing - And user "user" connects and authenticates IMAP client "1" + 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" Scenario: Delete folder When IMAP client "1" deletes "Folders/one" diff --git a/tests/features/imap/mailbox/hide_all_mail.feature b/tests/features/imap/mailbox/hide_all_mail.feature index 611d030b..ba4e7ba1 100644 --- a/tests/features/imap/mailbox/hide_all_mail.feature +++ b/tests/features/imap/mailbox/hide_all_mail.feature @@ -1,10 +1,10 @@ Feature: IMAP Hide All Mail Background: - Given there exists an account with username "user" and password "password" + Given there exists an account with username "[user:user]" and password "password" And bridge starts - And the user logs in with username "user" and password "password" - And user "user" finishes syncing - And user "user" connects and authenticates IMAP client "1" + 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" Scenario: Hide All Mail Mailbox Given IMAP client "1" sees the following mailbox info: diff --git a/tests/features/imap/mailbox/info.feature b/tests/features/imap/mailbox/info.feature index 9cfc000d..6cb65d79 100644 --- a/tests/features/imap/mailbox/info.feature +++ b/tests/features/imap/mailbox/info.feature @@ -1,19 +1,19 @@ Feature: IMAP get mailbox info Background: - Given there exists an account with username "user" and password "password" - And the account "user" has the following custom mailboxes: + Given there exists an account with username "[user:user]" and password "password" + And the account "[user:user]" has the following custom mailboxes: | name | type | | one | folder | - And the address "user@[domain]" of account "user" has the following messages in "one": - | from | to | subject | unread | - | a@[domain] | a@[domain] | one | true | - | b@[domain] | b@[domain] | two | false | + And the address "[user:user]@[domain]" of account "[user:user]" has the following messages in "one": + | from | to | subject | unread | + | a@example.com | a@example.com | one | true | + | b@example.com | b@example.com | two | false | And bridge starts - And the user logs in with username "user" and password "password" - And user "user" finishes syncing + And the user logs in with username "[user:user]" and password "password" + And user "[user:user]" finishes syncing Scenario: Mailbox status reports correct name, total and unread - When user "user" connects and authenticates IMAP client "1" + When user "[user:user]" 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 | \ No newline at end of file diff --git a/tests/features/imap/mailbox/list.feature b/tests/features/imap/mailbox/list.feature index efdbada5..934409fd 100644 --- a/tests/features/imap/mailbox/list.feature +++ b/tests/features/imap/mailbox/list.feature @@ -1,14 +1,14 @@ Feature: IMAP list mailboxes Scenario: List mailboxes - Given there exists an account with username "user" and password "password" - And the account "user" has the following custom mailboxes: + Given there exists an account with username "[user:user]" and password "password" + And the account "[user:user]" has the following custom mailboxes: | name | type | | mbox1 | folder | | mbox2 | label | When bridge starts - And the user logs in with username "user" and password "password" - And user "user" finishes syncing - And user "user" connects and authenticates IMAP client "1" + 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" sees the following mailbox info: | name | | INBOX | @@ -25,14 +25,14 @@ Feature: IMAP list mailboxes | Labels/mbox2 | Scenario: List multiple times in parallel without crash - Given there exists an account with username "user" and password "password" - And the account "user" has 20 custom folders - And the account "user" has 60 custom labels + Given there exists an account with username "[user:user]" and password "password" + And the account "[user:user]" has 20 custom folders + And the account "[user:user]" has 60 custom labels When bridge starts - And the user logs in with username "user" and password "password" - And user "user" finishes syncing - When user "user" connects and authenticates IMAP client "1" - And user "user" connects and authenticates IMAP client "2" + 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 "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" diff --git a/tests/features/imap/mailbox/rename.feature b/tests/features/imap/mailbox/rename.feature index 9130aa70..5e88af5c 100644 --- a/tests/features/imap/mailbox/rename.feature +++ b/tests/features/imap/mailbox/rename.feature @@ -1,14 +1,14 @@ Feature: IMAP get mailbox info Background: - Given there exists an account with username "user" and password "password" - And the account "user" has the following custom mailboxes: + Given there exists an account with username "[user:user]" and password "password" + And the account "[user:user]" has the following custom mailboxes: | name | type | | f1 | folder | | l1 | label | And bridge starts - And the user logs in with username "user" and password "password" - And user "user" finishes syncing - And user "user" connects and authenticates IMAP client "1" + 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" Scenario: Rename folder When IMAP client "1" renames "Folders/f1" to "Folders/f2" diff --git a/tests/features/imap/mailbox/select.feature b/tests/features/imap/mailbox/select.feature index cf8fed70..abfa1d9c 100644 --- a/tests/features/imap/mailbox/select.feature +++ b/tests/features/imap/mailbox/select.feature @@ -1,14 +1,14 @@ Feature: IMAP select mailbox Background: - Given there exists an account with username "user" and password "password" - And the account "user" has the following custom mailboxes: + Given there exists an account with username "[user:user]" and password "password" + And the account "[user:user]" has the following custom mailboxes: | name | type | | mbox | folder | | label | label | And bridge starts - And the user logs in with username "user" and password "password" - And user "user" finishes syncing - And user "user" connects and authenticates IMAP client "1" + 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" Scenario: Select inbox When IMAP client "1" selects "INBOX" diff --git a/tests/features/imap/message/copy.feature b/tests/features/imap/message/copy.feature index 6a61a245..3898296e 100644 --- a/tests/features/imap/message/copy.feature +++ b/tests/features/imap/message/copy.feature @@ -1,39 +1,39 @@ Feature: IMAP copy messages Background: - Given there exists an account with username "user" and password "password" - And the account "user" has the following custom mailboxes: + Given there exists an account with username "[user:user]" and password "password" + And the account "[user:user]" has the following custom mailboxes: | name | type | | mbox | folder | | label | label | - And the address "user@[domain]" of account "user" has the following messages in "Inbox": - | from | to | subject | unread | - | john.doe@mail.com | user@[domain] | foo | false | - | jane.doe@mail.com | name@[domain] | bar | true | + And the address "[user:user]@[domain]" of account "[user:user]" has the following messages in "Inbox": + | from | to | subject | unread | + | john.doe@mail.com | [user:user]@[domain] | foo | false | + | jane.doe@mail.com | name@[domain] | bar | true | And bridge starts - And the user logs in with username "user" and password "password" - And user "user" finishes syncing - And user "user" connects and authenticates IMAP client "1" + 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" 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": - | from | to | subject | unread | - | john.doe@mail.com | user@[domain] | foo | false | - | jane.doe@mail.com | name@[domain] | bar | true | + | from | to | subject | unread | + | john.doe@mail.com | [user:user]@[domain] | foo | false | + | jane.doe@mail.com | name@[domain] | bar | true | And IMAP client "1" sees the following messages in "Labels/label": - | from | to | subject | unread | - | john.doe@mail.com | user@[domain] | foo | false | + | from | to | subject | unread | + | john.doe@mail.com | [user:user]@[domain] | 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": - | from | to | subject | unread | - | john.doe@mail.com | user@[domain] | foo | false | - | jane.doe@mail.com | name@[domain] | bar | true | + | from | to | subject | unread | + | john.doe@mail.com | [user:user]@[domain] | foo | false | + | jane.doe@mail.com | name@[domain] | bar | true | And IMAP client "1" sees the following messages in "Labels/label": - | from | to | subject | unread | - | john.doe@mail.com | user@[domain] | foo | false | - | jane.doe@mail.com | name@[domain] | bar | true | + | from | to | subject | unread | + | john.doe@mail.com | [user:user]@[domain] | foo | false | + | jane.doe@mail.com | name@[domain] | bar | true | Scenario: Copy message to folder does move When IMAP client "1" copies the message with subject "foo" from "INBOX" to "Folders/mbox" @@ -41,21 +41,21 @@ Feature: IMAP copy messages | from | to | subject | unread | | jane.doe@mail.com | name@[domain] | bar | true | And IMAP client "1" sees the following messages in "Folders/mbox": - | from | to | subject | unread | - | john.doe@mail.com | user@[domain] | foo | false | + | from | to | subject | unread | + | john.doe@mail.com | [user:user]@[domain] | 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": - | from | to | subject | unread | - | john.doe@mail.com | user@[domain] | foo | false | - | jane.doe@mail.com | name@[domain] | bar | true | + | from | to | subject | unread | + | john.doe@mail.com | [user:user]@[domain] | foo | false | + | jane.doe@mail.com | name@[domain] | 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": - | from | to | subject | unread | - | john.doe@mail.com | user@[domain] | foo | false | - | jane.doe@mail.com | name@[domain] | bar | true | + | from | to | subject | unread | + | john.doe@mail.com | [user:user]@[domain] | foo | false | + | jane.doe@mail.com | name@[domain] | bar | true | And IMAP client "1" eventually sees 0 messages in "Sent" \ No newline at end of file diff --git a/tests/features/imap/message/create.feature b/tests/features/imap/message/create.feature index 3c415092..37b07565 100644 --- a/tests/features/imap/message/create.feature +++ b/tests/features/imap/message/create.feature @@ -1,60 +1,60 @@ Feature: IMAP create messages Background: - Given there exists an account with username "user" and password "password" - And the account "user" has additional address "alias@[domain]" + 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 - And the user logs in with username "user" and password "password" - And user "user" finishes syncing - And user "user" connects and authenticates IMAP client "1" + 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" Scenario: Creates message to user's primary address When IMAP client "1" appends the following messages to "INBOX": - | from | to | subject | body | - | john.doe@email.com | user@[domain] | foo | bar | + | from | to | subject | body | + | john.doe@email.com | [user:user]@[domain] | foo | bar | Then it succeeds And IMAP client "1" sees the following messages in "INBOX": - | from | to | subject | body | - | john.doe@email.com | user@[domain] | foo | bar | + | from | to | subject | body | + | john.doe@email.com | [user:user]@[domain] | foo | bar | And IMAP client "1" sees the following messages in "All Mail": - | from | to | subject | body | - | john.doe@email.com | user@[domain] | foo | bar | + | from | to | subject | body | + | john.doe@email.com | [user:user]@[domain] | foo | bar | Scenario: Creates draft When IMAP client "1" appends the following messages to "Drafts": - | from | to | subject | body | - | user@[domain] | john.doe@email.com | foo | bar | + | from | to | subject | body | + | [user:user]@[domain] | john.doe@email.com | foo | bar | Then it succeeds And IMAP client "1" eventually sees the following messages in "Drafts": - | from | to | subject | body | - | user@[domain] | john.doe@email.com | foo | bar | + | from | to | subject | body | + | [user:user]@[domain] | john.doe@email.com | foo | bar | # This fails now And IMAP client "1" eventually sees the following messages in "All Mail": - | from | to | subject | body | - | user@[domain] | john.doe@email.com | foo | bar | + | from | to | subject | body | + | [user:user]@[domain] | john.doe@email.com | foo | bar | Scenario: Creates message sent from user's primary address When IMAP client "1" appends the following messages to "Sent": - | from | to | subject | body | - | user@[domain] | john.doe@email.com | foo | bar | + | from | to | subject | body | + | [user:user]@[domain] | john.doe@email.com | foo | bar | Then it succeeds And IMAP client "1" sees the following messages in "Sent": - | from | to | subject | body | - | user@[domain] | john.doe@email.com | foo | bar | + | from | to | subject | body | + | [user:user]@[domain] | john.doe@email.com | foo | bar | And IMAP client "1" sees the following messages in "All Mail": - | from | to | subject | body | - | user@[domain] | john.doe@email.com | foo | bar | + | from | to | subject | body | + | [user:user]@[domain] | john.doe@email.com | foo | bar | Scenario: Creates message sent from user's secondary address When IMAP client "1" appends the following messages to "Sent": - | from | to | subject | body | - | alias@[domain] | john.doe@email.com | foo | bar | + | from | to | subject | body | + | [alias:alias]@[domain] | john.doe@email.com | foo | bar | Then it succeeds And IMAP client "1" sees the following messages in "Sent": - | from | to | subject | body | - | alias@[domain] | john.doe@email.com | foo | bar | + | from | to | subject | body | + | [alias:alias]@[domain] | john.doe@email.com | foo | bar | And IMAP client "1" sees the following messages in "All Mail": - | from | to | subject | body | - | alias@[domain] | john.doe@email.com | foo | bar | + | from | to | subject | body | + | [alias:alias]@[domain] | john.doe@email.com | foo | bar | Scenario: Imports an unrelated message to inbox When IMAP client "1" appends the following messages to "INBOX": diff --git a/tests/features/imap/message/delete.feature b/tests/features/imap/message/delete.feature index f1c6b23b..bb76526f 100644 --- a/tests/features/imap/message/delete.feature +++ b/tests/features/imap/message/delete.feature @@ -1,15 +1,15 @@ Feature: IMAP remove messages from mailbox Background: - Given there exists an account with username "user" and password "password" - And the account "user" has the following custom mailboxes: + Given there exists an account with username "[user:user]" and password "password" + And the account "[user:user]" has the following custom mailboxes: | name | type | | mbox | folder | | label | label | - And the address "user@[domain]" of account "user" has 10 messages in "mbox" + And the address "[user:user]@[domain]" of account "[user:user]" has 10 messages in "mbox" And bridge starts - And the user logs in with username "user" and password "password" - And user "user" finishes syncing - And user "user" connects and authenticates IMAP client "1" + 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" Scenario: Mark message as deleted and EXPUNGE When IMAP client "1" selects "Folders/mbox" diff --git a/tests/features/imap/message/delete_from_trash.feature b/tests/features/imap/message/delete_from_trash.feature index cad6fc48..7797f130 100644 --- a/tests/features/imap/message/delete_from_trash.feature +++ b/tests/features/imap/message/delete_from_trash.feature @@ -1,20 +1,20 @@ Feature: IMAP remove messages from Trash Background: - Given there exists an account with username "user" and password "password" - And the account "user" has the following custom mailboxes: + Given there exists an account with username "[user:user]" and password "password" + And the account "[user:user]" has the following custom mailboxes: | name | type | | mbox | folder | | label | label | Scenario Outline: Message in Trash and some other label is not permanently deleted - Given the address "user@[domain]" of account "user" has the following messages in "Trash": - | from | to | subject | body | - | john.doe@mail.com | user@[domain] | foo | hello | - | jane.doe@mail.com | name@[domain] | bar | world | + Given the address "[user:user]@[domain]" of account "[user:user]" has the following messages in "Trash": + | from | to | subject | body | + | john.doe@mail.com | [user:user]@[domain] | foo | hello | + | jane.doe@mail.com | name@[domain] | bar | world | And bridge starts - And the user logs in with username "user" and password "password" - And user "user" finishes syncing - And user "user" connects and authenticates IMAP client "1" + 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" And IMAP client "1" selects "Trash" When IMAP client "1" copies the message with subject "foo" from "Trash" to "Labels/label" Then it succeeds @@ -30,14 +30,14 @@ Feature: IMAP remove messages from Trash And IMAP client "1" sees 1 messages in "Labels/label" Scenario Outline: Message in Trash only is permanently deleted - Given the address "user@[domain]" of account "user" has the following messages in "Trash": - | from | to | subject | body | - | john.doe@mail.com | user@[domain] | foo | hello | - | jane.doe@mail.com | name@[domain] | bar | world | + Given the address "[user:user]@[domain]" of account "[user:user]" has the following messages in "Trash": + | from | to | subject | body | + | john.doe@mail.com | [user:user]@[domain] | foo | hello | + | jane.doe@mail.com | name@[domain] | bar | world | And bridge starts - And the user logs in with username "user" and password "password" - And user "user" finishes syncing - And user "user" connects and authenticates IMAP client "1" + 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" And IMAP client "1" selects "Trash" When IMAP client "1" marks the message with subject "foo" as deleted Then it succeeds diff --git a/tests/features/imap/message/drafts.feature b/tests/features/imap/message/drafts.feature index be51a9ba..b5dc9532 100644 --- a/tests/features/imap/message/drafts.feature +++ b/tests/features/imap/message/drafts.feature @@ -1,10 +1,10 @@ Feature: IMAP Draft messages Background: - Given there exists an account with username "user" and password "password" + Given there exists an account with username "[user:user]" and password "password" And bridge starts - And the user logs in with username "user" and password "password" - And user "user" finishes syncing - And user "user" connects and authenticates IMAP client "1" + 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" And IMAP client "1" selects "Drafts" When IMAP client "1" appends the following message to "Drafts": """ @@ -35,7 +35,7 @@ Feature: IMAP Draft messages And IMAP client "1" sees 1 messages in "Drafts" Scenario: Draft edited remotely - When the following fields were changed in draft 1 for address "user@[domain]" of account "user": + When the following fields were changed in draft 1 for address "[user:user]@[domain]" of account "[user:user]": | to | subject | body | | someone@proton.me | Basic Draft | This is a draft body, but longer | Then IMAP client "1" eventually sees the following messages in "Drafts": diff --git a/tests/features/imap/message/import.feature b/tests/features/imap/message/import.feature index 65595711..fed7cf27 100644 --- a/tests/features/imap/message/import.feature +++ b/tests/features/imap/message/import.feature @@ -1,16 +1,16 @@ Feature: IMAP import messages Background: - Given there exists an account with username "user" and password "password" + Given there exists an account with username "[user:user]" and password "password" And bridge starts - And the user logs in with username "user" and password "password" - And user "user" finishes syncing - And user "user" connects and authenticates IMAP client "1" + 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" Scenario: Basic message import When IMAP client "1" appends the following message to "INBOX": """ From: Bridge Test - To: Internal Bridge + To: Internal Bridge Received: by 2002:0:0:0:0:0:0:0 with SMTP id 0123456789abcdef; Wed, 30 Dec 2020 01:23:45 0000 Subject: Basic text/plain message Content-Type: text/plain @@ -19,14 +19,14 @@ Feature: IMAP import messages """ Then it succeeds And IMAP client "1" eventually sees the following messages in "INBOX": - | from | to | subject | body | - | bridgetest@pm.test | bridgetest@[domain] | Basic text/plain message | Hello | + | from | to | subject | body | + | bridgetest@pm.test | bridgetest@example.com | Basic text/plain message | Hello | Scenario: Import message with double charset in content type When IMAP client "1" appends the following message to "INBOX": """ From: Bridge Test - To: Internal Bridge + To: Internal Bridge Subject: Message with double charset in content type Content-Type: text/plain; charset=utf-8; charset=utf-8 Content-Disposition: inline @@ -36,8 +36,8 @@ Feature: IMAP import messages """ Then it succeeds And IMAP client "1" eventually sees the following messages in "INBOX": - | from | to | subject | body | - | bridgetest@pm.test | bridgetest@[domain] | Message with double charset in content type | Hello | + | from | to | subject | body | + | bridgetest@pm.test | bridgetest@example.com | Message with double charset in content type | Hello | # The message is imported as UTF-8 and the content type is determined at build time. Scenario: Import message as latin1 without content type diff --git a/tests/features/imap/message/move_without_support.feature b/tests/features/imap/message/move_without_support.feature index 63b56b4a..a19ae566 100644 --- a/tests/features/imap/message/move_without_support.feature +++ b/tests/features/imap/message/move_without_support.feature @@ -1,14 +1,14 @@ Feature: IMAP move messages by append and delete (without MOVE support, e.g., Outlook) Background: - Given there exists an account with username "user" and password "password" - And the account "user" has the following custom mailboxes: + Given there exists an account with username "[user:user]" and password "password" + And the account "[user:user]" has the following custom mailboxes: | name | type | | mbox | folder | And bridge starts - And the user logs in with username "user" and password "password" - And user "user" finishes syncing - And user "user" connects and authenticates IMAP client "source" - And user "user" connects and authenticates IMAP client "target" + 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" Scenario Outline: Move message from to by When IMAP client "source" appends the following message to "": @@ -33,7 +33,7 @@ Feature: IMAP move messages by append and delete (without MOVE support, e.g., Ou Then it succeeds And IMAP client "source" selects "" And IMAP client "target" selects "" - When IMAP clients "source" and "target" move message seq "2" of "user" to "" by + When IMAP clients "source" and "target" move message seq "2" of "[user:user]" to "" by And IMAP client "source" sees 1 messages in "" And IMAP client "source" sees the following messages in "": | from | to | subject | diff --git a/tests/features/imap/migration.feature b/tests/features/imap/migration.feature index d2993891..58e113ed 100644 --- a/tests/features/imap/migration.feature +++ b/tests/features/imap/migration.feature @@ -1,17 +1,17 @@ Feature: Bridge can fully sync an account Background: - Given there exists an account with username "user" and password "password" - And the account "user" has 20 custom folders - And the account "user" has 60 custom labels + Given there exists an account with username "[user:user]" and password "password" + And the account "[user:user]" has 20 custom folders + And the account "[user:user]" has 60 custom labels When bridge starts - And the user logs in with username "user" and password "password" - And user "user" finishes syncing - When user "user" connects and authenticates IMAP client "1" + 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" 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" connects and authenticates IMAP client "2" + And user "[user:user]" connects and authenticates IMAP client "2" Then IMAP client "2" counts 20 mailboxes under "Folders" And IMAP client "2" counts 60 mailboxes under "Labels" \ No newline at end of file diff --git a/tests/features/imap/ports.feature b/tests/features/imap/ports.feature index 52e522e2..11ff9e12 100644 --- a/tests/features/imap/ports.feature +++ b/tests/features/imap/ports.feature @@ -1,10 +1,10 @@ Feature: A user can connect an IMAP client to custom ports Background: - Given there exists an account with username "user" and password "password" + Given there exists an account with username "[user:user]" and password "password" And bridge starts - And the user logs in with username "user" and password "password" + And the user logs in with username "[user:user]" and password "password" And the user changes the IMAP port to 1144 Scenario: Authenticates successfully on custom port - When user "user" connects IMAP client "1" on port 1144 + When user "[user:user]" connects IMAP client "1" on port 1144 Then IMAP client "1" can authenticate \ No newline at end of file diff --git a/tests/features/smtp/auth.feature b/tests/features/smtp/auth.feature index c9ac3fcc..131cf69e 100644 --- a/tests/features/smtp/auth.feature +++ b/tests/features/smtp/auth.feature @@ -1,22 +1,22 @@ Feature: A user can authenticate an SMTP client Background: - Given there exists an account with username "user" and password "password" + Given there exists an account with username "[user:user]" and password "password" And bridge starts - And the user logs in with username "user" and password "password" + And the user logs in with username "[user:user]" and password "password" Scenario: SMTP client can authenticate successfully - When user "user" connects SMTP client "1" + When user "[user:user]" connects SMTP client "1" Then SMTP client "1" can authenticate Scenario: SMTP client cannot authenticate with wrong username - When user "user" connects SMTP client "1" + When user "[user:user]" connects SMTP client "1" Then SMTP client "1" cannot authenticate with incorrect username Scenario: SMTP client cannot authenticate with wrong password - When user "user" connects SMTP client "1" + When user "[user:user]" connects SMTP client "1" Then SMTP client "1" cannot authenticate with incorrect password Scenario: SMTP client cannot authenticate for disconnected user - When user "user" logs out - And user "user" connects SMTP client "1" + When user "[user:user]" logs out + And user "[user:user]" connects SMTP client "1" Then SMTP client "1" cannot authenticate \ No newline at end of file diff --git a/tests/features/smtp/init.feature b/tests/features/smtp/init.feature index 22f911e2..20fb9258 100644 --- a/tests/features/smtp/init.feature +++ b/tests/features/smtp/init.feature @@ -1,9 +1,9 @@ Feature: SMTP initiation Background: - Given there exists an account with username "user" and password "password" + Given there exists an account with username "[user:user]" and password "password" And bridge starts - And the user logs in with username "user" and password "password" - When user "user" connects and authenticates SMTP client "1" + And the user logs in with username "[user:user]" and password "password" + When user "[user:user]" connects and authenticates SMTP client "1" Scenario: Send without first announcing FROM and TO When SMTP client "1" sends DATA: @@ -13,9 +13,9 @@ Feature: SMTP initiation 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 "" + When SMTP client "1" sends MAIL FROM "<[user:user]@[domain]>" Then it succeeds - When SMTP client "1" sends RCPT TO "" + When SMTP client "1" sends RCPT TO "<[user:user]@[domain]>" Then it succeeds When SMTP client "1" sends RSET Then it succeeds @@ -26,11 +26,11 @@ Feature: SMTP initiation Then it fails with error "Missing RCPT TO command" Scenario: Send without FROM - When SMTP client "1" sends RCPT TO "" + When SMTP client "1" sends RCPT TO "<[user:user]@[domain]>" Then it fails with error "Missing MAIL FROM command" Scenario: Send without TO - When SMTP client "1" sends MAIL FROM "" + When SMTP client "1" sends MAIL FROM "<[user:user]@[domain]>" Then it succeeds When SMTP client "1" sends DATA: """ @@ -39,16 +39,16 @@ Feature: SMTP initiation Then it fails with error "Missing RCPT TO command" Scenario: Send with empty FROM - When SMTP client "1" sends the following message from "<>" to "bridgetest@[domain]": + When SMTP client "1" sends the following message from "<>" to "recipient@example.com": """ - To: Internal Bridge + To: Internal Bridge this should fail """ Then it fails Scenario: Send with empty TO - When SMTP client "1" sends MAIL FROM "" + When SMTP client "1" sends MAIL FROM "<[user:user]@[domain]>" Then it succeeds When SMTP client "1" sends RCPT TO "<>" Then it succeeds @@ -59,14 +59,14 @@ Feature: SMTP initiation Then it fails with error "invalid recipient" Scenario: Allow BODY parameter of MAIL FROM command - When SMTP client "1" sends MAIL FROM " BODY=7BIT" + When SMTP client "1" sends MAIL FROM "<[user:user]@[domain]> BODY=7BIT" Then it succeeds Scenario: FROM not owned by user - When SMTP client "1" sends the following message from "other@[domain]" to "bridgetest@[domain]": + When SMTP client "1" sends the following message from "unowned@[domain]" to "recipient@example.com": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:user]@[domain]> + To: Internal Bridge this should fail """ diff --git a/tests/features/smtp/ports.feature b/tests/features/smtp/ports.feature index 736f80ab..82fd17ec 100644 --- a/tests/features/smtp/ports.feature +++ b/tests/features/smtp/ports.feature @@ -1,10 +1,10 @@ Feature: A user can connect an SMTP client to custom ports Background: - Given there exists an account with username "user" and password "password" + Given there exists an account with username "[user:user]" and password "password" And bridge starts - And the user logs in with username "user" and password "password" + And the user logs in with username "[user:user]" and password "password" And the user changes the SMTP port to 1144 Scenario: Authenticates successfully on custom port - When user "user" connects SMTP client "1" on port 1144 + When user "[user:user]" connects SMTP client "1" on port 1144 Then SMTP client "1" can authenticate \ No newline at end of file diff --git a/tests/features/smtp/send/bcc.feature b/tests/features/smtp/send/bcc.feature index 4e383684..ec8d41e6 100644 --- a/tests/features/smtp/send/bcc.feature +++ b/tests/features/smtp/send/bcc.feature @@ -1,28 +1,28 @@ Feature: SMTP with bcc Background: - Given there exists an account with username "user" and password "password" - Given there exists an account with username "bridgetest" and password "password" - Given there exists an account with username "bcc" and password "password" + 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 the user logs in with username "user" and password "password" - And the user logs in with username "bcc" and password "password" - And user "user" connects and authenticates SMTP client "1" + 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" Scenario: Send message to address in to and bcc - When SMTP client "1" sends the following message from "user@[domain]" to "bridgetest@[domain], bcc@[domain]": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain], [user:bcc]@[domain]": """ Subject: hello - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:user]@[domain]> + To: Internal Bridge <[user:to]@[domain]> hello """ Then it succeeds - When user "user" 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 | bcc | subject | unread | - | user@[domain] | bridgetest@[domain] | bcc@[domain] | hello | false | + | from | to | bcc | subject | unread | + | [user:user]@[domain] | [user:to]@[domain] | [user:bcc]@[domain] | hello | false | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -30,14 +30,14 @@ Feature: SMTP with bcc "Subject": "hello", "ToList": [ { - "Address": "bridgetest@[domain]", + "Address": "[user:to]@[domain]", "Name": "Internal Bridge" } ], "CCList": [], "BCCList": [ { - "Address": "bcc@[domain]" + "Address": "[user:bcc]@[domain]" } ] } @@ -46,19 +46,19 @@ Feature: SMTP with bcc Scenario: Send message only to bcc - When SMTP client "1" sends the following message from "user@[domain]" to "bcc@[domain]": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:bcc]@[domain]": """ Subject: hello - From: Bridge Test + From: Bridge Test <[user:user]@[domain]> hello """ Then it succeeds - When user "user" 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 | bcc | subject | - | user@[domain] | | bcc@[domain] | hello | + | from | to | bcc | subject | + | [user:user]@[domain] | | [user:bcc]@[domain] | hello | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -68,13 +68,13 @@ Feature: SMTP with bcc "CCList": [], "BCCList": [ { - "Address": "bcc@[domain]" + "Address": "[user:bcc]@[domain]" } ] } } """ - When user "bcc" connects and authenticates IMAP client "2" + When user "[user:bcc]" connects and authenticates IMAP client "2" Then IMAP client "2" eventually sees the following messages in "Inbox": - | from | to | bcc | subject | unread | - | user@[domain] | | | hello | true | + | from | to | bcc | subject | unread | + | [user:user]@[domain] | | | hello | true | diff --git a/tests/features/smtp/send/embedded_message.feature b/tests/features/smtp/send/embedded_message.feature index b4b6f658..38154a39 100644 --- a/tests/features/smtp/send/embedded_message.feature +++ b/tests/features/smtp/send/embedded_message.feature @@ -1,17 +1,17 @@ Feature: SMTP sending embedded message Background: - Given there exists an account with username "user" and password "password" - And there exists an account with username "bridgetest" and password "password" + 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 - And the user logs in with username "user" and password "password" - And the user logs in with username "bridgetest" and password "password" - And user "user" connects and authenticates SMTP client "1" + 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" Scenario: Send it - When SMTP client "1" sends the following message from "user@[domain]" to "bridgetest@[domain]": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:user]@[domain]> + To: Internal Bridge <[user:to]@[domain]> Subject: Embedded message Content-Type: multipart/mixed; boundary="boundary" @@ -27,7 +27,7 @@ Feature: SMTP sending embedded message Content-Disposition: attachment; filename="embedded.eml" From: Bar - To: Bridge Test + To: Bridge Test <[user:to]@pm.test> Subject: (No Subject) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable @@ -39,11 +39,11 @@ Feature: SMTP sending embedded message """ Then it succeeds - When user "user" 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 | - | user@[domain] | bridgetest@[domain] | Embedded message | - When user "bridgetest" connects and authenticates IMAP client "2" + | from | to | subject | + | [user:user]@[domain] | [user:to]@[domain] | 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@[domain] | bridgetest@[domain] | Embedded message | embedded.eml | true | \ No newline at end of file + | from | to | subject | attachments | unread | + | [user:user]@[domain] | [user:to]@[domain] | Embedded message | embedded.eml | true | \ No newline at end of file diff --git a/tests/features/smtp/send/failures.feature b/tests/features/smtp/send/failures.feature index 8bab481e..cd93f6a6 100644 --- a/tests/features/smtp/send/failures.feature +++ b/tests/features/smtp/send/failures.feature @@ -1,16 +1,16 @@ Feature: SMTP wrong messages Background: - Given there exists an account with username "user" and password "password" - And there exists an account with username "bridgetest" and password "password" + 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 - And the user logs in with username "user" and password "password" - And user "user" connects and authenticates SMTP client "1" + And the user logs in with username "[user:user]" and password "password" + And user "[user:user]" connects and authenticates SMTP client "1" Scenario: Message with attachment and wrong boundaries - When SMTP client "1" sends the following message from "user@[domain]" to "bridgetest@[domain]": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:user]@[domain]> + To: Internal Bridge <[user:to]@[domain]> Subject: With attachment (wrong boundaries) Content-Type: multipart/related; boundary=bc5bd30245232f31b6c976adcd59bb0069c9b13f986f9e40c2571bb80aa16606 @@ -44,10 +44,10 @@ Feature: SMTP wrong messages Then it fails Scenario: Invalid from - When SMTP client "1" sends the following message from "bridgetest@pm.test" to "bridgetest@[domain]": + When SMTP client "1" sends the following message from "unowned@[domain]" to "[user:to]@[domain]": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test + To: Internal Bridge <[user:to]@[domain]> hello diff --git a/tests/features/smtp/send/html.feature b/tests/features/smtp/send/html.feature index ad5441e5..0b120d93 100644 --- a/tests/features/smtp/send/html.feature +++ b/tests/features/smtp/send/html.feature @@ -1,15 +1,15 @@ Feature: SMTP sending of plain messages Background: - Given there exists an account with username "user" and password "password" - And there exists an account with username "bridgetest" and password "password" + 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 - And the user logs in with username "user" and password "password" - And user "user" connects and authenticates SMTP client "1" + And the user logs in with username "[user:user]" and password "password" + And user "[user:user]" connects and authenticates SMTP client "1" Scenario: HTML message to external account - When SMTP client "1" sends the following message from "user@[domain]" to "pm.bridge.qa@gmail.com": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "pm.bridge.qa@gmail.com": """ - From: Bridge Test + From: Bridge Test <[user:user]@[domain]> To: External Bridge Subject: HTML text external Content-Disposition: inline @@ -21,10 +21,10 @@ Feature: SMTP sending of plain messages """ Then it succeeds - When user "user" 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 | - | user@[domain] | pm.bridge.qa@gmail.com | HTML text external | + | from | to | subject | + | [user:user]@[domain] | pm.bridge.qa@gmail.com | HTML text external | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -47,9 +47,9 @@ Feature: SMTP sending of plain messages """ Scenario: HTML message with inline image to external account - When SMTP client "1" sends the following message from "user@[domain]" to "pm.bridge.qa@gmail.com": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "pm.bridge.qa@gmail.com": """ - From: Bridge Test + From: Bridge Test <[user:user]@[domain]> To: External Bridge Subject: Html Inline External Content-Disposition: inline @@ -97,10 +97,10 @@ Feature: SMTP sending of plain messages """ Then it succeeds - When user "user" 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 | - | user@[domain] | pm.bridge.qa@gmail.com | Html Inline External | + | from | to | subject | + | [user:user]@[domain] | pm.bridge.qa@gmail.com | Html Inline External | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -123,10 +123,10 @@ Feature: SMTP sending of plain messages """ Scenario: HTML message with alternative inline to internal account - When SMTP client "1" sends the following message from "user@[domain]" to "bridgetest@[domain]": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:user]@[domain]> + To: Internal Bridge <[user:to]@[domain]> Subject: Html Inline Alternative Internal Content-Disposition: inline User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 @@ -187,10 +187,10 @@ Feature: SMTP sending of plain messages """ Then it succeeds - When user "user" 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 | - | user@[domain] | bridgetest@[domain] | Html Inline Alternative Internal | + | from | to | subject | + | [user:user]@[domain] | [user:to]@[domain] | Html Inline Alternative Internal | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -201,7 +201,7 @@ Feature: SMTP sending of plain messages }, "ToList": [ { - "Address": "bridgetest@[domain]", + "Address": "[user:to]@[domain]", "Name": "Internal Bridge" } ], @@ -213,9 +213,9 @@ Feature: SMTP sending of plain messages """ Scenario: HTML message with alternative inline to external account - When SMTP client "1" sends the following message from "user@[domain]" to "pm.bridge.qa@gmail.com": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "pm.bridge.qa@gmail.com": """ - From: Bridge Test + From: Bridge Test <[user:user]@[domain]> To: External Bridge Subject: Html Inline Alternative External Content-Disposition: inline @@ -277,10 +277,10 @@ Feature: SMTP sending of plain messages """ Then it succeeds - When user "user" 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 | - | user@[domain] | pm.bridge.qa@gmail.com | Html Inline Alternative External | + | from | to | subject | + | [user:user]@[domain] | pm.bridge.qa@gmail.com | Html Inline Alternative External | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -303,9 +303,9 @@ Feature: SMTP sending of plain messages """ 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@[domain]" to "pm.bridge.qa@gmail.com": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "pm.bridge.qa@gmail.com": """ - From: Bridge Test + From: Bridge Test <[user:user]@[domain]> To: External Bridge Subject: HTML text external Content-Disposition: inline @@ -317,10 +317,10 @@ Feature: SMTP sending of plain messages """ Then it succeeds - When user "user" 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 | - | user@[domain] | pm.bridge.qa@gmail.com | HTML text external | + | from | to | subject | + | [user:user]@[domain] | pm.bridge.qa@gmail.com | HTML text external | And the body in the "POST" request to "/mail/v4/messages" is: """ { diff --git a/tests/features/smtp/send/html_att.feature b/tests/features/smtp/send/html_att.feature index b95b65cd..effb7989 100644 --- a/tests/features/smtp/send/html_att.feature +++ b/tests/features/smtp/send/html_att.feature @@ -1,16 +1,16 @@ Feature: SMTP sending of plain messages Background: - Given there exists an account with username "user" and password "password" - And there exists an account with username "bridgetest" and password "password" + 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 - And the user logs in with username "user" and password "password" - And user "user" connects and authenticates SMTP client "1" + And the user logs in with username "[user:user]" and password "password" + And user "[user:user]" connects and authenticates SMTP client "1" Scenario: HTML message with attachment to internal account - When SMTP client "1" sends the following message from "user@[domain]" to "bridgetest@[domain]": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:user]@[domain]> + To: Internal Bridge <[user:to]@[domain]> Subject: HTML with attachment internal Content-Type: multipart/related; boundary=bc5bd30245232f31b6c976adcd59bb0069c9b13f986f9e40c2571bb80aa16606 @@ -41,10 +41,10 @@ Feature: SMTP sending of plain messages """ Then it succeeds - When user "user" 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 | - | user@[domain] | bridgetest@[domain] | HTML with attachment internal | + | from | to | subject | + | [user:user]@[domain] | [user:to]@[domain] | HTML with attachment internal | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -55,7 +55,7 @@ Feature: SMTP sending of plain messages }, "ToList": [ { - "Address": "bridgetest@[domain]", + "Address": "[user:to]@[domain]", "Name": "Internal Bridge" } ], @@ -67,9 +67,9 @@ Feature: SMTP sending of plain messages """ Scenario: HTML message with attachment to external account - When SMTP client "1" sends the following message from "user@[domain]" to "pm.bridge.qa@gmail.com": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "pm.bridge.qa@gmail.com": """ - From: Bridge Test + From: Bridge Test <[user:user]@[domain]> To: External Bridge Subject: HTML with attachment external PGP Content-Type: multipart/mixed; boundary=bc5bd30245232f31b6c976adcd59bb0069c9b13f986f9e40c2571bb80aa16606 @@ -101,10 +101,10 @@ Feature: SMTP sending of plain messages """ Then it succeeds - When user "user" 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 | - | user@[domain] | pm.bridge.qa@gmail.com | HTML with attachment external PGP | + | from | to | subject | + | [user:user]@[domain] | pm.bridge.qa@gmail.com | HTML with attachment external PGP | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -127,9 +127,9 @@ Feature: SMTP sending of plain messages """ Scenario: Alternative plain and HTML message with rfc822 attachment - When SMTP client "1" sends the following message from "user@[domain]" to "pm.bridge.qa@gmail.com": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "pm.bridge.qa@gmail.com": """ - From: Bridge Test + From: Bridge Test <[user:user]@[domain]> To: External Bridge Subject: Alternative plain and HTML with rfc822 attachment Content-Type: multipart/mixed; boundary=main-parts @@ -190,10 +190,10 @@ Feature: SMTP sending of plain messages """ Then it succeeds - When user "user" 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 | - | user@[domain] | pm.bridge.qa@gmail.com | Alternative plain and HTML with rfc822 attachment | + | from | to | subject | + | [user:user]@[domain] | pm.bridge.qa@gmail.com | Alternative plain and HTML with rfc822 attachment | And the body in the "POST" request to "/mail/v4/messages" is: """ { diff --git a/tests/features/smtp/send/inline.feature b/tests/features/smtp/send/inline.feature index e8a84b6a..29d0fd17 100644 --- a/tests/features/smtp/send/inline.feature +++ b/tests/features/smtp/send/inline.feature @@ -1,16 +1,16 @@ Feature: SMTP messages containing inlines Background: - Given there exists an account with username "user" and password "password" - And there exists an account with username "bridgetest" and password "password" + 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 - And the user logs in with username "user" and password "password" - And user "user" connects and authenticates SMTP client "1" + And the user logs in with username "[user:user]" and password "password" + And user "[user:user]" connects and authenticates SMTP client "1" Scenario: A message with inline attachment to internal account - When SMTP client "1" sends the following message from "user@[domain]" to "bridgetest@[domain]": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:user]@[domain]> + To: Internal Bridge <[user:to]@[domain]> Subject: Plain with inline Content-Type: multipart/related; boundary=bc5bd30245232f31b6c976adcd59bb0069c9b13f986f9e40c2571bb80aa16606 @@ -40,10 +40,10 @@ Feature: SMTP messages containing inlines """ Then it succeeds - When user "user" 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 | - | user@[domain] | bridgetest@[domain] | Plain with inline | + | from | to | subject | + | [user:user]@[domain] | [user:to]@[domain] | Plain with inline | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -54,7 +54,7 @@ Feature: SMTP messages containing inlines }, "ToList": [ { - "Address": "bridgetest@[domain]", + "Address": "[user:to]@[domain]", "Name": "Internal Bridge" } ], @@ -66,10 +66,10 @@ Feature: SMTP messages containing inlines """ Scenario: A message with inline attachment without content ID to internal account - When SMTP client "1" sends the following message from "user@[domain]" to "bridgetest@[domain]": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:user]@[domain]> + To: Internal Bridge <[user:to]@[domain]> Subject: Plain with inline Content-Type: multipart/related; boundary=bc5bd30245232f31b6c976adcd59bb0069c9b13f986f9e40c2571bb80aa16606 @@ -98,10 +98,10 @@ Feature: SMTP messages containing inlines """ Then it succeeds - When user "user" 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 | - | user@[domain] | bridgetest@[domain] | Plain with inline | + | from | to | subject | + | [user:user]@[domain] | [user:to]@[domain] | Plain with inline | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -112,7 +112,7 @@ Feature: SMTP messages containing inlines }, "ToList": [ { - "Address": "bridgetest@[domain]", + "Address": "[user:to]@[domain]", "Name": "Internal Bridge" } ], @@ -124,10 +124,10 @@ Feature: SMTP messages containing inlines """ Scenario: A message with bad disposition to internal account - When SMTP client "1" sends the following message from "user@[domain]" to "bridgetest@[domain]": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:user]@[domain]> + To: Internal Bridge <[user:to]@[domain]> Subject: Plain with inline Content-Type: multipart/related; boundary=bc5bd30245232f31b6c976adcd59bb0069c9b13f986f9e40c2571bb80aa16606 @@ -156,10 +156,10 @@ Feature: SMTP messages containing inlines """ Then it succeeds - When user "user" 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 | - | user@[domain] | bridgetest@[domain] | Plain with inline | + | from | to | subject | + | [user:user]@[domain] | [user:to]@[domain] | Plain with inline | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -170,7 +170,7 @@ Feature: SMTP messages containing inlines }, "ToList": [ { - "Address": "bridgetest@[domain]", + "Address": "[user:to]@[domain]", "Name": "Internal Bridge" } ], diff --git a/tests/features/smtp/send/mixed_case.feature b/tests/features/smtp/send/mixed_case.feature index ab9fe8cf..dd6b918b 100644 --- a/tests/features/smtp/send/mixed_case.feature +++ b/tests/features/smtp/send/mixed_case.feature @@ -1,25 +1,25 @@ Feature: SMTP sending with mixed case address Background: - Given there exists an account with username "user" and password "password" - And there exists an account with username "bridgetest" and password "password" + 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 - And the user logs in with username "user" and password "password" - And user "user" connects and authenticates SMTP client "1" + And the user logs in with username "[user:user]" and password "password" + And user "[user:user]" connects and authenticates SMTP client "1" Scenario: Mixed sender case in sender address - When SMTP client "1" sends the following message from "user@[domain]" to "bridgetest@[domain]": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <{toUpper:[user:user]@[domain]}> + To: Internal Bridge <[user:to]@[domain]> hello """ Then it succeeds - When user "user" 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 | - | user@[domain] | bridgetest@[domain] | | + | from | to | subject | + | [user:user]@[domain] | [user:to]@[domain] | | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -27,11 +27,11 @@ Feature: SMTP sending with mixed case address "Subject": "", "Sender": { "Name": "Bridge Test", - "Address": "user@[domain]" + "Address": "[user:user]@[domain]" }, "ToList": [ { - "Address": "bridgetest@[domain]", + "Address": "[user:to]@[domain]", "Name": "Internal Bridge" } ], diff --git a/tests/features/smtp/send/one_account_to_another.feature b/tests/features/smtp/send/one_account_to_another.feature index c0afd975..08d1a53a 100644 --- a/tests/features/smtp/send/one_account_to_another.feature +++ b/tests/features/smtp/send/one_account_to_another.feature @@ -1,17 +1,17 @@ Feature: SMTP sending two messages Background: - Given there exists an account with username "user" and password "password" - And there exists an account with username "other" and password "other" + 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 - And the user logs in with username "user" and password "password" - And the user logs in with username "other" and password "other" + And the user logs in with username "[user:user]" and password "password" + And the user logs in with username "[user:recp]" and password "password" Scenario: Send from one account to the other - When user "user" connects and authenticates SMTP client "1" - And SMTP client "1" sends the following message from "user@[domain]" to "other@[domain]": + 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]": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:user]@[domain]> + To: Internal Bridge <[user:recp]@[domain]> Subject: One account to the other hello @@ -25,12 +25,12 @@ Feature: SMTP sending two messages "Subject": "One account to the other", "Sender": { "Name": "Bridge Test", - "Address": "user@[domain]" + "Address": "[user:user]@[domain]" }, "ToList": [ { "Name": "Internal Bridge", - "Address": "other@[domain]" + "Address": "[user:recp]@[domain]" } ], "CCList": [], @@ -45,7 +45,7 @@ Feature: SMTP sending two messages "Packages": [ { "Addresses": { - "other@[domain]": { + "[user:recp]@[domain]": { "Type": 1 } }, @@ -55,17 +55,17 @@ Feature: SMTP sending two messages ] } """ - When user "other" connects and authenticates IMAP client "1" + When user "[user:recp]" connects and authenticates IMAP client "1" Then IMAP client "1" eventually sees the following messages in "Inbox": - | from | to | subject | body | - | user@[domain] | other@[domain] | One account to the other | hello | + | from | to | subject | body | + | [user:user]@[domain] | [user:recp]@[domain] | One account to the other | hello | Scenario: Send from one account to the other with attachments - When user "user" connects and authenticates SMTP client "1" - And SMTP client "1" sends the following message from "user@[domain]" to "other@[domain]": + 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]": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:user]@[domain]> + To: Internal Bridge <[user:recp]@[domain]> Subject: Plain with attachment internal Content-Type: multipart/related; boundary=bc5bd30245232f31b6c976adcd59bb0069c9b13f986f9e40c2571bb80aa16606 @@ -106,7 +106,7 @@ Feature: SMTP sending two messages }, "ToList": [ { - "Address": "other@[domain]", + "Address": "[user:recp]@[domain]", "Name": "Internal Bridge" } ], @@ -122,7 +122,7 @@ Feature: SMTP sending two messages "Packages": [ { "Addresses": { - "other@[domain]": { + "[user:recp]@[domain]": { "Type": 1 } }, @@ -132,11 +132,11 @@ Feature: SMTP sending two messages ] } """ - When user "user" 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 | body | attachments | unread | - | user@[domain] | other@[domain] | Plain with attachment internal | This is the body | outline-light-instagram-48.png | false | - When user "other" connects and authenticates IMAP client "2" + | 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 | false | + 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@[domain] | other@[domain] | Plain with attachment internal | This is the body | outline-light-instagram-48.png | true | \ No newline at end of file + | 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 | \ No newline at end of file diff --git a/tests/features/smtp/send/plain.feature b/tests/features/smtp/send/plain.feature index a761bf3e..1dffe325 100644 --- a/tests/features/smtp/send/plain.feature +++ b/tests/features/smtp/send/plain.feature @@ -1,26 +1,26 @@ Feature: SMTP sending of plain messages Background: - Given there exists an account with username "user" and password "password" - And there exists an account with username "bridgetest" and password "password" - And there exists an account with username "bridgetest2" and password "password" + 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 - And the user logs in with username "user" and password "password" - And user "user" connects and authenticates SMTP client "1" + And the user logs in with username "[user:user]" and password "password" + And user "[user:user]" connects and authenticates SMTP client "1" Scenario: Only from and to headers to internal account - When SMTP client "1" sends the following message from "user@[domain]" to "bridgetest@[domain]": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:user]@[domain]> + To: Internal Bridge <[user:to]@[domain]> hello """ Then it succeeds - When user "user" 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 | - | user@[domain] | bridgetest@[domain] | | + | from | to | subject | + | [user:user]@[domain] | [user:to]@[domain] | | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -31,7 +31,7 @@ Feature: SMTP sending of plain messages }, "ToList": [ { - "Address": "bridgetest@[domain]", + "Address": "[user:to]@[domain]", "Name": "Internal Bridge" } ], @@ -43,19 +43,19 @@ Feature: SMTP sending of plain messages """ Scenario: Only from and to headers to external account - When SMTP client "1" sends the following message from "user@[domain]" to "pm.bridge.qa@gmail.com": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "pm.bridge.qa@gmail.com": """ - From: Bridge Test + From: Bridge Test <[user:user]@[domain]> To: External Bridge hello """ Then it succeeds - When user "user" 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 | - | user@[domain] | pm.bridge.qa@gmail.com | | + | from | to | subject | + | [user:user]@[domain] | pm.bridge.qa@gmail.com | | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -78,10 +78,10 @@ Feature: SMTP sending of plain messages """ Scenario: Basic message to internal account - When SMTP client "1" sends the following message from "user@[domain]" to "bridgetest@[domain]": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:user]@[domain]> + To: Internal Bridge <[user:to]@[domain]> Subject: Plain text internal Content-Disposition: inline Content-Type: text/plain; charset=utf-8 @@ -90,10 +90,10 @@ Feature: SMTP sending of plain messages """ Then it succeeds - When user "user" 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 | - | user@[domain] | bridgetest@[domain] | Plain text internal | + | from | to | subject | + | [user:user]@[domain] | [user:to]@[domain] | Plain text internal | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -104,7 +104,7 @@ Feature: SMTP sending of plain messages }, "ToList": [ { - "Address": "bridgetest@[domain]", + "Address": "[user:to]@[domain]", "Name": "Internal Bridge" } ], @@ -116,9 +116,9 @@ Feature: SMTP sending of plain messages """ Scenario: Basic message to external account - When SMTP client "1" sends the following message from "user@[domain]" to "pm.bridge.qa@gmail.com": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "pm.bridge.qa@gmail.com": """ - From: Bridge Test + From: Bridge Test <[user:user]@[domain]> To: External Bridge Subject: Plain text external Content-Disposition: inline @@ -128,10 +128,10 @@ Feature: SMTP sending of plain messages """ Then it succeeds - When user "user" 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 | - | user@[domain] | pm.bridge.qa@gmail.com | Plain text external | + | from | to | subject | + | [user:user]@[domain] | pm.bridge.qa@gmail.com | Plain text external | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -154,9 +154,9 @@ Feature: SMTP sending of plain messages """ Scenario: Message without charset is utf8 - When SMTP client "1" sends the following message from "user@[domain]" to "pm.bridge.qa@gmail.com": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "pm.bridge.qa@gmail.com": """ - From: Bridge Test + From: Bridge Test <[user:user]@[domain]> To: External Bridge Subject: Plain text no charset external Content-Disposition: inline @@ -166,10 +166,10 @@ Feature: SMTP sending of plain messages """ Then it succeeds - When user "user" 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 | - | user@[domain] | pm.bridge.qa@gmail.com | Plain text no charset external | + | from | to | subject | + | [user:user]@[domain] | pm.bridge.qa@gmail.com | Plain text no charset external | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -192,9 +192,9 @@ Feature: SMTP sending of plain messages """ Scenario: Message without charset is base64-encoded latin1 - When SMTP client "1" sends the following message from "user@[domain]" to "pm.bridge.qa@gmail.com": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "pm.bridge.qa@gmail.com": """ - From: Bridge Test + From: Bridge Test <[user:user]@[domain]> To: External Bridge Subject: Plain text no charset external Content-Disposition: inline @@ -207,10 +207,10 @@ Feature: SMTP sending of plain messages """ Then it succeeds - When user "user" 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 | - | user@[domain] | pm.bridge.qa@gmail.com | Plain text no charset external | + | from | to | subject | + | [user:user]@[domain] | pm.bridge.qa@gmail.com | Plain text no charset external | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -233,9 +233,9 @@ Feature: SMTP sending of plain messages """ Scenario: Message without charset and content is detected as HTML - When SMTP client "1" sends the following message from "user@[domain]" to "pm.bridge.qa@gmail.com": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "pm.bridge.qa@gmail.com": """ - From: Bridge Test + From: Bridge Test <[user:user]@[domain]> To: External Bridge Subject: Plain, no charset, no content, external Content-Disposition: inline @@ -243,10 +243,10 @@ Feature: SMTP sending of plain messages """ Then it succeeds - When user "user" 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 | - | user@[domain] | pm.bridge.qa@gmail.com | Plain, no charset, no content, external | + | from | to | subject | + | [user:user]@[domain] | pm.bridge.qa@gmail.com | Plain, no charset, no content, external | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -269,13 +269,13 @@ Feature: SMTP sending of plain messages """ Scenario: RCPT does not contain all CC - When SMTP client "1" sends MAIL FROM "" - And SMTP client "1" sends RCPT TO "" + When SMTP client "1" sends MAIL FROM "<[user:user]@[domain]>" + And SMTP client "1" sends RCPT TO "<[user:to]@[domain]>" And SMTP client "1" sends DATA: """ - From: Bridge Test - To: Internal Bridge - CC: Internal Bridge 2 + From: Bridge Test <[user:user]@[domain]> + To: Internal Bridge <[user:to]@[domain]> + CC: Internal Bridge 2 <[user:cc]@[domain]> Content-Type: text/plain Subject: RCPT-CC test @@ -283,10 +283,10 @@ Feature: SMTP sending of plain messages . """ Then it succeeds - When user "user" 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 | cc | subject | - | user@[domain] | bridgetest@[domain] | bridgetest2@[domain] | RCPT-CC test | + | from | to | cc | subject | + | [user:user]@[domain] | [user:to]@[domain] | [user:cc]@[domain] | RCPT-CC test | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -297,13 +297,13 @@ Feature: SMTP sending of plain messages }, "ToList": [ { - "Address": "bridgetest@[domain]", + "Address": "[user:to]@[domain]", "Name": "Internal Bridge" } ], "CCList": [ { - "Address": "bridgetest2@[domain]", + "Address": "[user:cc]@[domain]", "Name": "Internal Bridge 2" } ], @@ -317,10 +317,10 @@ Feature: SMTP sending of plain messages "Packages": [ { "Addresses": { - "bridgetest@[domain]": { + "[user:to]@[domain]": { "Type": 1 }, - "bridgetest2@[domain]": { + "[user:cc]@[domain]": { "Type": 1 } }, diff --git a/tests/features/smtp/send/plain_att.feature b/tests/features/smtp/send/plain_att.feature index ae0b99d3..41a9112f 100644 --- a/tests/features/smtp/send/plain_att.feature +++ b/tests/features/smtp/send/plain_att.feature @@ -1,16 +1,16 @@ Feature: SMTP sending of plain messages Background: - Given there exists an account with username "user" and password "password" - And there exists an account with username "bridgetest" and password "password" + 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 - And the user logs in with username "user" and password "password" - And user "user" connects and authenticates SMTP client "1" + And the user logs in with username "[user:user]" and password "password" + And user "[user:user]" connects and authenticates SMTP client "1" Scenario: Basic message with attachment to internal account - When SMTP client "1" sends the following message from "user@[domain]" to "bridgetest@[domain]": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:user]@[domain]> + To: Internal Bridge <[user:to]@[domain]> Subject: Plain with attachment Content-Type: multipart/related; boundary=bc5bd30245232f31b6c976adcd59bb0069c9b13f986f9e40c2571bb80aa16606 @@ -41,10 +41,10 @@ Feature: SMTP sending of plain messages """ Then it succeeds - When user "user" 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 | - | user@[domain] | bridgetest@[domain] | Plain with attachment | + | from | to | subject | + | [user:user]@[domain] | [user:to]@[domain] | Plain with attachment | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -55,7 +55,7 @@ Feature: SMTP sending of plain messages }, "ToList": [ { - "Address": "bridgetest@[domain]", + "Address": "[user:to]@[domain]", "Name": "Internal Bridge" } ], @@ -67,9 +67,9 @@ Feature: SMTP sending of plain messages """ Scenario: Plain message with attachment to external account - When SMTP client "1" sends the following message from "user@[domain]" to "pm.bridge.qa@gmail.com": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "pm.bridge.qa@gmail.com": """ - From: Bridge Test + From: Bridge Test <[user:user]@[domain]> To: External Bridge Subject: Plain with attachment external Content-Type: multipart/related; boundary=bc5bd30245232f31b6c976adcd59bb0069c9b13f986f9e40c2571bb80aa16606 @@ -101,10 +101,10 @@ Feature: SMTP sending of plain messages """ Then it succeeds - When user "user" 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 | - | user@[domain] | pm.bridge.qa@gmail.com | Plain with attachment external | + | from | to | subject | + | [user:user]@[domain] | pm.bridge.qa@gmail.com | Plain with attachment external | And the body in the "POST" request to "/mail/v4/messages" is: """ { @@ -127,9 +127,9 @@ Feature: SMTP sending of plain messages """ Scenario: Plain message with attachment to two external accounts - When SMTP client "1" sends the following message from "user@[domain]" to "pm.bridge.qa@gmail.com": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "pm.bridge.qa@gmail.com": """ - From: Bridge Test + From: Bridge Test <[user:user]@[domain]> To: External Bridge 1 CC: External Bridge 2 Subject: Plain with attachment external PGP and external CC @@ -162,10 +162,10 @@ Feature: SMTP sending of plain messages """ Then it succeeds - When user "user" 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 | cc | subject | - | user@[domain] | pm.bridge.qa@gmail.com | bridgeqa@seznam.cz | Plain with attachment external PGP and external CC | + | from | to | cc | subject | + | [user:user]@[domain] | pm.bridge.qa@gmail.com | bridgeqa@seznam.cz | Plain with attachment external PGP and external CC | And the body in the "POST" request to "/mail/v4/messages" is: """ { diff --git a/tests/features/smtp/send/same_message.feature b/tests/features/smtp/send/same_message.feature index 8c79609c..dddb810b 100644 --- a/tests/features/smtp/send/same_message.feature +++ b/tests/features/smtp/send/same_message.feature @@ -1,15 +1,15 @@ Feature: SMTP sending the same message twice Background: - Given there exists an account with username "user" and password "password" - And there exists an account with username "bridgetest" and password "password" + 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 - And the user logs in with username "user" and password "password" - And the user logs in with username "bridgetest" and password "password" - And user "user" connects and authenticates SMTP client "1" - And SMTP client "1" sends the following message from "user@[domain]" to "bridgetest@[domain]": + 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" + And SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:user]@[domain]> + To: Internal Bridge <[user:to]@[domain]> Subject: Hello World @@ -17,42 +17,42 @@ Feature: SMTP sending the same message twice And it succeeds Scenario: The exact same message is not sent twice - When SMTP client "1" sends the following message from "user@[domain]" to "bridgetest@[domain]": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:user]@[domain]> + To: Internal Bridge <[user:to]@[domain]> Subject: Hello World """ Then it succeeds - When user "user" 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 | body | - | user@[domain] | bridgetest@[domain] | Hello | World | - When user "bridgetest" connects and authenticates IMAP client "2" + | from | to | subject | body | + | [user:user]@[domain] | [user:to]@[domain] | Hello | World | + When user "[user:to]" connects and authenticates IMAP client "2" Then IMAP client "2" eventually sees the following messages in "Inbox": - | from | to | subject | body | - | user@[domain] | bridgetest@[domain] | Hello | World | + | from | to | subject | body | + | [user:user]@[domain] | [user:to]@[domain] | Hello | World | Scenario: Slight change means different message and is sent twice - When SMTP client "1" sends the following message from "user@[domain]" to "bridgetest@[domain]": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:user]@[domain]> + To: Internal Bridge <[user:to]@[domain]> Subject: Hello. World """ Then it succeeds - When user "user" 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 | body | - | user@[domain] | bridgetest@[domain] | Hello | World | - | user@[domain] | bridgetest@[domain] | Hello. | World | - When user "bridgetest" connects and authenticates IMAP client "2" + | from | to | subject | body | + | [user:user]@[domain] | [user:to]@[domain] | Hello | World | + | [user:user]@[domain] | [user:to]@[domain] | Hello. | World | + When user "[user:to]" connects and authenticates IMAP client "2" Then IMAP client "2" eventually sees the following messages in "Inbox": - | from | to | subject | body | - | user@[domain] | bridgetest@[domain] | Hello | World | - | user@[domain] | bridgetest@[domain] | Hello. | World | \ No newline at end of file + | from | to | subject | body | + | [user:user]@[domain] | [user:to]@[domain] | Hello | World | + | [user:user]@[domain] | [user:to]@[domain] | Hello. | World | \ No newline at end of file diff --git a/tests/features/smtp/send/send_append.feature b/tests/features/smtp/send/send_append.feature index 84c1ac0d..1d475360 100644 --- a/tests/features/smtp/send/send_append.feature +++ b/tests/features/smtp/send/send_append.feature @@ -1,17 +1,17 @@ Feature: SMTP sending with APPENDing to Sent Background: - Given there exists an account with username "user" and password "password" - And there exists an account with username "bridgetest" and password "password" + 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 - And the user logs in with username "user" and password "password" - And user "user" connects and authenticates SMTP client "1" - And user "user" connects and authenticates IMAP client "1" + 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" Scenario: Send message and append to Sent # First do sending. - When SMTP client "1" sends the following message from "user@[domain]" to "bridgetest@[domain]": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]": """ - To: Internal Bridge + To: Internal Bridge <[user:to]@[domain]> Subject: Manual send and append Message-ID: bridgemessage42 @@ -29,13 +29,13 @@ Feature: SMTP sending with APPENDing to Sent } """ And IMAP client "1" eventually sees the following messages in "Sent": - | to | subject | body | message-id | - | bridgetest@[domain] | Manual send and append | hello | | + | to | subject | body | message-id | + | [user:to]@[domain] | Manual send and append | hello | | # Then simulate manual append to Sent mailbox - message should be detected as a duplicate. When IMAP client "1" appends the following message to "Sent": """ - To: Internal Bridge + To: Internal Bridge <[user:to]@[domain]> Subject: Manual send and append Message-ID: bridgemessage42 @@ -44,5 +44,5 @@ Feature: SMTP sending with APPENDing to Sent """ Then it succeeds And IMAP client "1" eventually sees the following messages in "Sent": - | to | subject | body | message-id | - | bridgetest@[domain] | Manual send and append | hello | | \ No newline at end of file + | to | subject | body | message-id | + | [user:to]@[domain] | Manual send and append | hello | | \ No newline at end of file diff --git a/tests/features/smtp/send/two_messages.feature b/tests/features/smtp/send/two_messages.feature index bed10101..509c848c 100644 --- a/tests/features/smtp/send/two_messages.feature +++ b/tests/features/smtp/send/two_messages.feature @@ -1,29 +1,29 @@ Feature: SMTP sending two messages Background: - Given there exists an account with username "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 there exists an account with username "bridgetest" and password "password" + 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 there exists an account with username "[user:to]" and password "password" And bridge starts - And the user logs in with username "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" + 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" Scenario: Send two messages in one connection - When user "user" connects and authenticates SMTP client "1" - And SMTP client "1" sends the following message from "user@[domain]" to "bridgetest@[domain]": + When user "[user:user]" connects and authenticates SMTP client "1" + And SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:user]@[domain]> + To: Internal Bridge <[user:to]@[domain]> hello """ Then it succeeds - When SMTP client "1" sends the following message from "user@[domain]" to "bridgetest@[domain]": + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:user]@[domain]> + To: Internal Bridge <[user:to]@[domain]> world @@ -31,21 +31,21 @@ Feature: SMTP sending two messages Then it succeeds 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 SMTP client "1" sends the following message from "user-multi@[domain]" to "bridgetest@[domain]>": + 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 SMTP client "1" sends the following message from "[user:multi]@[domain]" to "[user:to]@[domain]>": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:multi]@[domain]> + To: Internal Bridge <[user:to]@[domain]> hello """ Then it succeeds - When SMTP client "2" sends the following message from "user-multi@[domain]" to "bridgetest@[domain]>": + When SMTP client "2" sends the following message from "[user:multi]@[domain]" to "[user:to]@[domain]>": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:multi]@[domain]> + To: Internal Bridge <[user:to]@[domain]> world @@ -53,21 +53,21 @@ Feature: SMTP sending two messages Then it succeeds Scenario: Send with two separate users - When user "user" connects and authenticates SMTP client "1" - And user "user-multi" connects and authenticates SMTP client "2" - When SMTP client "1" sends the following message from "user@[domain]" to "bridgetest@[domain]>": + When user "[user:user]" connects and authenticates SMTP client "1" + And user "[user:multi]" connects and authenticates SMTP client "2" + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]>": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:user]@[domain]> + To: Internal Bridge <[user:to]@[domain]> hello """ Then it succeeds - When SMTP client "2" sends the following message from "user-multi@[domain]" to "bridgetest@[domain]>": + When SMTP client "2" sends the following message from "[user:multi]@[domain]" to "[user:to]@[domain]>": """ - From: Bridge Test - To: Internal Bridge + From: Bridge Test <[user:multi]@[domain]> + To: Internal Bridge <[user:to]@[domain]> world diff --git a/tests/features/user/addressmode.feature b/tests/features/user/addressmode.feature index 472a0835..eac6636c 100644 --- a/tests/features/user/addressmode.feature +++ b/tests/features/user/addressmode.feature @@ -1,25 +1,25 @@ Feature: Address mode Background: - Given there exists an account with username "user" and password "password" - And the account "user" has additional address "alias@[domain]" - And the account "user" has the following custom mailboxes: + Given there exists an account with username "[user:user]" and password "password" + And the account "[user:user]" has additional address "[alias:alias]@[domain]" + And the account "[user:user]" has the following custom mailboxes: | name | type | | one | folder | | two | folder | - And the address "user@[domain]" of account "user" has the following messages in "one": + And the address "[user:user]@[domain]" of account "[user:user]" has the following messages in "one": | from | to | subject | unread | | a@[domain] | a@[domain] | one | true | | b@[domain] | b@[domain] | two | false | - And the address "alias@[domain]" of account "user" has the following messages in "two": + And the address "[alias:alias]@[domain]" of account "[user:user]" has the following messages in "two": | from | to | subject | unread | | c@[domain] | c@[domain] | three | true | | d@[domain] | d@[domain] | four | false | And bridge starts - And the user logs in with username "user" and password "password" - And user "user" finishes syncing + And the user logs in with username "[user:user]" and password "password" + And user "[user:user]" finishes syncing Scenario: The user is in combined mode - When user "user" connects and authenticates IMAP client "1" with address "user@[domain]" + When user "[user:user]" connects and authenticates IMAP client "1" with address "[user:user]@[domain]" Then IMAP client "1" sees the following messages in "Folders/one": | from | to | subject | unread | | a@[domain] | a@[domain] | one | true | @@ -34,7 +34,7 @@ Feature: Address mode | b@[domain] | b@[domain] | two | false | | c@[domain] | c@[domain] | three | true | | d@[domain] | d@[domain] | four | false | - When user "user" connects and authenticates IMAP client "2" with address "alias@[domain]" + When user "[user:user]" connects and authenticates IMAP client "2" with address "[alias:alias]@[domain]" Then IMAP client "2" sees the following messages in "Folders/one": | from | to | subject | unread | | a@[domain] | a@[domain] | one | true | @@ -51,9 +51,9 @@ Feature: Address mode | d@[domain] | d@[domain] | four | false | Scenario: The user is in split mode - Given the user sets the address mode of user "user" to "split" - And user "user" finishes syncing - When user "user" connects and authenticates IMAP client "1" with address "user@[domain]" + Given the user sets the address mode of user "[user:user]" to "split" + And user "[user:user]" finishes syncing + When user "[user:user]" connects and authenticates IMAP client "1" with address "[user:user]@[domain]" Then IMAP client "1" sees the following messages in "Folders/one": | from | to | subject | unread | | a@[domain] | a@[domain] | one | true | @@ -63,7 +63,7 @@ Feature: Address mode | from | to | subject | unread | | a@[domain] | a@[domain] | one | true | | b@[domain] | b@[domain] | two | false | - When user "user" connects and authenticates IMAP client "2" with address "alias@[domain]" + When user "[user:user]" connects and authenticates IMAP client "2" with address "[alias:alias]@[domain]" Then IMAP client "2" sees 0 messages in "Folders/one" And IMAP client "2" sees the following messages in "Folders/two": | from | to | subject | unread | @@ -75,18 +75,18 @@ Feature: Address mode | d@[domain] | d@[domain] | four | false | Scenario: The user switches from combined to split mode and back - Given the user sets the address mode of user "user" to "split" - And user "user" finishes syncing - And the user sets the address mode of user "user" to "combined" - And user "user" finishes syncing - When user "user" connects and authenticates IMAP client "1" with address "user@[domain]" + Given the user sets the address mode of user "[user:user]" to "split" + And user "[user:user]" finishes syncing + And the user sets the address mode of user "[user:user]" to "combined" + And user "[user:user]" finishes syncing + When user "[user:user]" connects and authenticates IMAP client "1" with address "[user:user]@[domain]" Then IMAP client "1" sees the following messages in "All Mail": | from | to | subject | unread | | a@[domain] | a@[domain] | one | true | | b@[domain] | b@[domain] | two | false | | c@[domain] | c@[domain] | three | true | | d@[domain] | d@[domain] | four | false | - When user "user" connects and authenticates IMAP client "2" with address "alias@[domain]" + When user "[user:user]" connects and authenticates IMAP client "2" with address "[alias:alias]@[domain]" Then IMAP client "2" sees the following messages in "All Mail": | from | to | subject | unread | | a@[domain] | a@[domain] | one | true | @@ -95,23 +95,23 @@ Feature: Address mode | d@[domain] | d@[domain] | four | false | Scenario: The user adds an address while in combined mode - When user "user" connects and authenticates IMAP client "1" with address "user@[domain]" + When user "[user:user]" connects and authenticates IMAP client "1" with address "[user:user]@[domain]" Then IMAP client "1" sees the following messages in "All Mail": | from | to | subject | unread | | a@[domain] | a@[domain] | one | true | | b@[domain] | b@[domain] | two | false | | c@[domain] | c@[domain] | three | true | | d@[domain] | d@[domain] | four | false | - When user "user" connects and authenticates IMAP client "2" with address "alias@[domain]" + When user "[user:user]" connects and authenticates IMAP client "2" with address "[alias:alias]@[domain]" Then IMAP client "2" sees the following messages in "All Mail": | from | to | subject | unread | | a@[domain] | a@[domain] | one | true | | b@[domain] | b@[domain] | two | false | | c@[domain] | c@[domain] | three | true | | d@[domain] | d@[domain] | four | false | - Given the account "user" has additional address "other@[domain]" - And bridge sends an address created event for user "user" - When user "user" connects and authenticates IMAP client "3" with address "other@[domain]" + Given the account "[user:user]" has additional address "other@[domain]" + And bridge sends an address created event for user "[user:user]" + When user "[user:user]" connects and authenticates IMAP client "3" with address "other@[domain]" Then IMAP client "3" sees the following messages in "All Mail": | from | to | subject | unread | | a@[domain] | a@[domain] | one | true | @@ -120,60 +120,60 @@ Feature: Address mode | d@[domain] | d@[domain] | four | false | Scenario: The user adds an address while in split mode - Given the user sets the address mode of user "user" to "split" - And user "user" finishes syncing - When user "user" connects and authenticates IMAP client "1" with address "user@[domain]" + Given the user sets the address mode of user "[user:user]" to "split" + And user "[user:user]" finishes syncing + When user "[user:user]" connects and authenticates IMAP client "1" with address "[user:user]@[domain]" And IMAP client "1" sees the following messages in "All Mail": | from | to | subject | unread | | a@[domain] | a@[domain] | one | true | | b@[domain] | b@[domain] | two | false | - When user "user" connects and authenticates IMAP client "2" with address "alias@[domain]" + When user "[user:user]" connects and authenticates IMAP client "2" with address "[alias:alias]@[domain]" And IMAP client "2" sees the following messages in "All Mail": | from | to | subject | unread | | c@[domain] | c@[domain] | three | true | | d@[domain] | d@[domain] | four | false | - Given the account "user" has additional address "other@[domain]" - And bridge sends an address created event for user "user" - When user "user" connects and authenticates IMAP client "3" with address "other@[domain]" + Given the account "[user:user]" has additional address "other@[domain]" + And bridge sends an address created event for user "[user:user]" + When user "[user:user]" connects and authenticates IMAP client "3" with address "other@[domain]" Then IMAP client "3" eventually sees 0 messages in "All Mail" Scenario: The user deletes an address while in combined mode - When user "user" connects and authenticates IMAP client "1" with address "user@[domain]" + When user "[user:user]" connects and authenticates IMAP client "1" with address "[user:user]@[domain]" Then IMAP client "1" sees the following messages in "All Mail": | from | to | subject | unread | | a@[domain] | a@[domain] | one | true | | b@[domain] | b@[domain] | two | false | | c@[domain] | c@[domain] | three | true | | d@[domain] | d@[domain] | four | false | - When user "user" connects and authenticates IMAP client "2" with address "alias@[domain]" + When user "[user:user]" connects and authenticates IMAP client "2" with address "[alias:alias]@[domain]" Then IMAP client "2" sees the following messages in "All Mail": | from | to | subject | unread | | a@[domain] | a@[domain] | one | true | | b@[domain] | b@[domain] | two | false | | c@[domain] | c@[domain] | three | true | | d@[domain] | d@[domain] | four | false | - Given the account "user" no longer has additional address "alias@[domain]" - And bridge sends an address deleted event for user "user" - When user "user" connects IMAP client "3" - Then IMAP client "3" cannot authenticate with address "alias@[domain]" + Given the account "[user:user]" no longer has additional address "[alias:alias]@[domain]" + And bridge sends an address deleted event for user "[user:user]" + When user "[user:user]" connects IMAP client "3" + Then IMAP client "3" cannot authenticate with address "[alias:alias]@[domain]" Scenario: The user deletes an address while in split mode - Given the user sets the address mode of user "user" to "split" - And user "user" finishes syncing - When user "user" connects and authenticates IMAP client "1" with address "user@[domain]" + Given the user sets the address mode of user "[user:user]" to "split" + And user "[user:user]" finishes syncing + When user "[user:user]" connects and authenticates IMAP client "1" with address "[user:user]@[domain]" And IMAP client "1" sees the following messages in "All Mail": | from | to | subject | unread | | a@[domain] | a@[domain] | one | true | | b@[domain] | b@[domain] | two | false | - When user "user" connects and authenticates IMAP client "2" with address "alias@[domain]" + When user "[user:user]" connects and authenticates IMAP client "2" with address "[alias:alias]@[domain]" And IMAP client "2" sees the following messages in "All Mail": | from | to | subject | unread | | c@[domain] | c@[domain] | three | true | | d@[domain] | d@[domain] | four | false | - Given the account "user" no longer has additional address "alias@[domain]" - And bridge sends an address deleted event for user "user" - When user "user" connects IMAP client "3" - Then IMAP client "3" cannot authenticate with address "alias@[domain]" + Given the account "[user:user]" no longer has additional address "[alias:alias]@[domain]" + And bridge sends an address deleted event for user "[user:user]" + When user "[user:user]" connects IMAP client "3" + Then IMAP client "3" cannot authenticate with address "[alias:alias]@[domain]" Scenario: The user makes an alias the primary address while in combined mode diff --git a/tests/features/user/delete.feature b/tests/features/user/delete.feature index 4dbaa5b1..e4027df4 100644 --- a/tests/features/user/delete.feature +++ b/tests/features/user/delete.feature @@ -1,14 +1,14 @@ Feature: A user can be deleted Background: - Given there exists an account with username "user" and password "password" + Given there exists an account with username "[user:user]" and password "password" And bridge starts - And the user logs in with username "user" and password "password" + And the user logs in with username "[user:user]" and password "password" Scenario: Delete a connected user - When user "user" is deleted - Then user "user" is not listed + When user "[user:user]" is deleted + Then user "[user:user]" is not listed Scenario: Delete a disconnected user - Given user "user" logs out - When user "user" is deleted - Then user "user" is not listed \ No newline at end of file + Given user "[user:user]" logs out + When user "[user:user]" is deleted + Then user "[user:user]" is not listed \ No newline at end of file diff --git a/tests/features/user/events.feature b/tests/features/user/events.feature deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/features/user/relogin.feature b/tests/features/user/relogin.feature index 9c105d9e..2da7b437 100644 --- a/tests/features/user/relogin.feature +++ b/tests/features/user/relogin.feature @@ -1,15 +1,15 @@ Feature: A logged out user can login again Background: - Given there exists an account with username "user" and password "password" + Given there exists an account with username "[user:user]" and password "password" And bridge starts - And the user logs in with username "user" and password "password" + And the user logs in with username "[user:user]" and password "password" Scenario: Login to disconnected account - When user "user" logs out + When user "[user:user]" logs out And bridge restarts - And the user logs in with username "user" and password "password" - Then user "user" is listed and connected + And the user logs in with username "[user:user]" and password "password" + Then user "[user:user]" is listed and connected Scenario: Cannot login to removed account - When user "user" is deleted - Then user "user" is not listed \ No newline at end of file + When user "[user:user]" is deleted + Then user "[user:user]" is not listed \ No newline at end of file diff --git a/tests/features/user/revoke.feature b/tests/features/user/revoke.feature index 17261008..f0d59055 100644 --- a/tests/features/user/revoke.feature +++ b/tests/features/user/revoke.feature @@ -1,16 +1,16 @@ Feature: A logged in user is logged out when its auth is revoked. Background: - Given there exists an account with username "user" and password "password" + Given there exists an account with username "[user:user]" and password "password" And bridge starts - And the user logs in with username "user" and password "password" + And the user logs in with username "[user:user]" and password "password" Scenario: The auth is revoked while bridge is running - When the auth of user "user" is revoked - Then bridge sends a deauth event for user "user" - And user "user" is listed but not connected + When the auth of user "[user:user]" is revoked + Then bridge sends a deauth event for user "[user:user]" + And user "[user:user]" is listed but not connected Scenario: The auth is revoked while bridge is not running Given bridge stops - And the auth of user "user" is revoked + And the auth of user "[user:user]" is revoked When bridge starts - Then user "user" is listed but not connected \ No newline at end of file + Then user "[user:user]" is listed but not connected \ No newline at end of file diff --git a/tests/features/user/sync.feature b/tests/features/user/sync.feature index bdbab918..d1f8038a 100644 --- a/tests/features/user/sync.feature +++ b/tests/features/user/sync.feature @@ -1,26 +1,26 @@ Feature: Bridge can fully sync an account Background: - Given there exists an account with username "user" and password "password" - And the account "user" has the following custom mailboxes: + Given there exists an account with username "[user:user]" and password "password" + And the account "[user:user]" has the following custom mailboxes: | name | type | | one | folder | | two | folder | | three | label | - And the address "user@[domain]" of account "user" has the following messages in "one": + And the address "[user:user]@[domain]" of account "[user:user]" has the following messages in "one": | from | to | subject | unread | | a@[domain] | a@[domain] | one | true | | b@[domain] | b@[domain] | two | false | - And the address "user@[domain]" of account "user" has the following messages in "two": + And the address "[user:user]@[domain]" of account "[user:user]" has the following messages in "two": | from | to | subject | unread | | a@[domain] | a@[domain] | one | true | | b@[domain] | b@[domain] | 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" and password "password" - Then bridge sends sync started and finished events for user "user" + When the user logs in with username "[user:user]" and password "password" + Then bridge sends sync started and finished events for user "[user:user]" When bridge restarts - And user "user" connects and authenticates IMAP client "1" + And user "[user:user]" connects and authenticates IMAP client "1" Then IMAP client "1" sees the following mailbox info: | name | total | unread | | INBOX | 0 | 0 | @@ -38,12 +38,12 @@ Feature: Bridge can fully sync an account | Labels/three | 0 | 0 | Scenario: If the gluon files are deleted, the account is synced again - Given the user logs in with username "user" and password "password" - And user "user" finishes syncing + Given the user logs in with username "[user:user]" and password "password" + And user "[user:user]" finishes syncing And bridge stops And the user deletes the gluon files And bridge starts - When user "user" connects and authenticates IMAP client "1" + When user "[user:user]" connects and authenticates IMAP client "1" Then IMAP client "1" eventually sees the following mailbox info: | name | total | unread | | INBOX | 0 | 0 | @@ -61,10 +61,10 @@ Feature: Bridge can fully sync an account | Labels/three | 0 | 0 | Scenario: If an address has no keys, it does not break other addresses - Given the account "user" has additional address "alias@[domain]" without keys - When the user logs in with username "user" and password "password" - And user "user" finishes syncing - When user "user" connects and authenticates IMAP client "1" + Given the account "[user:user]" has additional address "[alias:alias]@[domain]" without keys + When 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" Then IMAP client "1" eventually sees the following messages in "Folders/one": | from | to | subject | unread | | a@[domain] | a@[domain] | one | true | diff --git a/tests/init_test.go b/tests/init_test.go index 498438cf..6a2507b0 100644 --- a/tests/init_test.go +++ b/tests/init_test.go @@ -32,8 +32,8 @@ func init() { // Use the fast cert generation for tests. certs.GenerateCert = FastGenerateCert - // Set the event period to 100 milliseconds for more responsive tests. - user.EventPeriod = 100 * time.Millisecond + // Set the event period to 1 second for more responsive tests. + user.EventPeriod = time.Second // Don't use jitter during tests. user.EventJitter = 0 diff --git a/tests/user_test.go b/tests/user_test.go index 6f5ccacb..d5cd08fa 100644 --- a/tests/user_test.go +++ b/tests/user_test.go @@ -123,7 +123,7 @@ func (s *scenario) theAccountHasAdditionalAddressWithoutKeys(username, address s userID := s.t.getUserID(username) // Decrypt the user's encrypted ID for use with quark. - userDecID, err := s.t.runQuarkCmd(context.Background(), "--decrypt", "encryption:id", userID) + userDecID, err := s.t.runQuarkCmd(context.Background(), "encryption:id", "--decrypt", userID) if err != nil { return err } @@ -178,8 +178,9 @@ func (s *scenario) theAccountHasCustomFolders(username string, count int) error return s.t.withClient(ctx, username, func(ctx context.Context, client *proton.Client) error { for idx := 0; idx < count; idx++ { if _, err := client.CreateLabel(ctx, proton.CreateLabelReq{ - Name: uuid.NewString(), - Type: proton.LabelTypeFolder, + Name: uuid.NewString(), + Type: proton.LabelTypeFolder, + Color: "#f66", }); err != nil { return err } @@ -196,8 +197,9 @@ func (s *scenario) theAccountHasCustomLabels(username string, count int) error { return s.t.withClient(ctx, username, func(ctx context.Context, client *proton.Client) error { for idx := 0; idx < count; idx++ { if _, err := client.CreateLabel(ctx, proton.CreateLabelReq{ - Name: uuid.NewString(), - Type: proton.LabelTypeLabel, + Name: uuid.NewString(), + Type: proton.LabelTypeLabel, + Color: "#f66", }); err != nil { return err } @@ -234,8 +236,9 @@ func (s *scenario) theAccountHasTheFollowingCustomMailboxes(username string, tab } if _, err := client.CreateLabel(ctx, proton.CreateLabelReq{ - Name: wantMailbox.Name, - Type: labelType, + Name: wantMailbox.Name, + Type: labelType, + Color: "#f66", }); err != nil { return err }