EmailContext
class EmailContext implements Context (View source)
Context used to define steps related to email sending.
Traits
Represents a behat context which is aware of a main {SilverStripeContext} context.
Properties
protected | SilverStripeContext | $mainContext | from MainContextAwareTrait | |
protected | TestMailer | $mailer | ||
protected | $lastMatchedEmail | Stored to simplify later assertions |
Methods
No description
Example: Given the email should contain "Thank you for registering!".
Example: Given the email contains "Thank you for registering!".
No description
Assumes an email has been identified by a previous step, e.g. through 'Given there should be an email to "[email protected]"'.
Example: Then the email should contain the following data: | row1 | | row2 | Assumes an email has been identified by a previous step.
The link text is the link address itself which contains special characters e.g. http://localhost/Security/changepassword?m=199&title=reset Example: When I click on the http link "changepassword" in the email
Details
SilverStripeContext
getMainContext()
Get the main context
$this
setMainContext(SilverStripeContext $mainContext)
No description
detectMainContext(BeforeScenarioScope $scope)
Helper method to detect the main context
Session
getSession(string $name = null)
Get Mink session from MinkContext
before(BeforeScenarioScope $event)
No description
thereIsAnEmailFromTo(string $negate, string $direction, string $email)
No description
thereIsAnEmailFromToTitled(string $negate, string $direction, string $email, string $subject)
No description
thereTheEmailContains(string $negate, string $content)
Example: Given the email should contain "Thank you for registering!".
Assumes an email has been identified by a previous step, e.g. through 'Given there should be an email to "[email protected]"'.
thereTheEmailContainsPlainText(string $content)
Example: Given the email contains "Thank you for registering!".
Then the email should contain plain text "Thank you for registering!" Assumes an email has been identified by a previous step, e.g. through 'Given there should be an email to "[email protected]"'.
iGoToInTheEmailTo(string $linkSelector, string $direction, string $email)
No description
iGoToInTheEmailToTitled(string $linkSelector, string $direction, string $email, string $title)
No description
iGoToInTheEmail(string $linkSelector)
Assumes an email has been identified by a previous step, e.g. through 'Given there should be an email to "[email protected]"'.
iClearAllEmails()
No description
theEmailContainFollowingData(string $negate, TableNode $table)
Example: Then the email should contain the following data: | row1 | | row2 | Assumes an email has been identified by a previous step.
thereIsAnEmailTitled(string $negate, string $subject)
No description
theEmailSentFrom(string $negate, string $from)
No description
theEmailSentTo(string $negate, string $to)
No description
iClickOnHttpLinkInEmail(string $httpText)
The link text is the link address itself which contains special characters e.g. http://localhost/Security/changepassword?m=199&title=reset Example: When I click on the http link "changepassword" in the email