Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultMailslurperImageName specifies the Mailslurper docker image name to use in tests. DefaultMailslurperImageName = "oryd/mailslurper" // DefaultMailslurperEnvVarImageName is the environment variable name for default Mailslurper docker image name. DefaultMailslurperEnvVarImageName = "TEST_ORY_MAILSLURPER_IMAGE_NAME" // DefaultMailslurperImageVersion specifies the Mailslurper docker image version to use in tests. DefaultMailslurperImageVersion = "smtps-latest" // DefaultMailslurperEnvVarImageVersion is the environment variable name for default Mailslurper docker image version. DefaultMailslurperEnvVarImageVersion = "TEST_ORY_MAILSLURPER_IMAGE_VERSION" // DefaultSubjectRecoverAccount is used when retrieving account recovery email DefaultSubjectRecoverAccount = "Recover access to your account" // DefaultSubjectVerifyAccount is used when retrieving account verification email DefaultSubjectVerifyAccount = "Please verify your email address" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mail ¶
type Mail struct { MailItems []*MailItem `json:"mailItems"` TotalPages int `json:"totalPages"` TotalRecords int `json:"totalRecords"` }
Mail represents mailslurper messages.
type MailItem ¶
type MailItem struct { ID string `json:"id"` DateSent string `json:"dateSent"` FromAddress string `json:"fromAddress"` ToAddresses []string `json:"toAddresses"` Subject string `json:"subject"` XMailer string `json:"xmailer"` MIMEVersion string `json:"mimeVersion"` Body string `json:"body"` ContentType string `json:"contentType"` Boundary string `json:"boundary"` Attachments []interface{} `json:"attachments"` TransferEncoding string `json:"transferEncoding"` Message interface{} `json:"Message,omitempty"` InlineAttachments interface{} `json:"InlineAttachments,omitempty"` TextBody string `json:"TextBody"` HTMLBody string `json:"HTMLBody"` }
MailItem represents a single mailslurper message.
type TestEnvContext ¶
type TestEnvContext interface { Cleanup() ContainerIP() string ContainerWWWPort() string ContainerServicePort() string ContainerSMTPPort() string ExtractRecoveryLink(*MailItem) (string, error) ExtractVerificationLink(*MailItem) (string, error) ListEmail() (*Mail, error) WaitForRecoveryEmail(context.Context, *testing.T, string) <-chan interface{} WaitForVerificationEmail(context.Context, *testing.T, string) <-chan interface{} WaitForEmailWithSubject(context.Context, *testing.T, string, string) <-chan interface{} }
TestEnvContext represents a test Mailslurper environment context.
func SetupTestMailslurper ¶
func SetupTestMailslurper(t *testing.T) TestEnvContext
SetupTestMailslurper sets up Mailslurper environment for tests. This environment can be passed to other Ory components in tests.
Click to show internal directories.
Click to hide internal directories.