Closed (fixed)
Project:
Drupal.org BDD
Version:
7.x-1.x-dev
Component:
Feature/Scenarios
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 Aug 2012 at 21:45 UTC
Updated:
18 Jul 2013 at 17:08 UTC
I don't think there's an issue yet, but we do need to learn how to test that a user receives e-mail when requesting a new password, creating an account, etc.
We can test with a feature like:
Feature: Retrieve password
In order to participate efficiently and not to be a bother to administrators
As a site user
I need to be able to automatically retrieve my password if I've forgotten it
Scenario: User knows user name
Given I am at "/user"
And I follow "Request new password"
When I enter "site user"
And I press "E-mail new password"
Then I should see "Further instructions have been sent to your e-mail address."
And I should receive an e-mail
I misunderstood some symfony documentation here,
Docs are here: http://docs.behat.org/cookbook/intercepting_the_redirections.html. That dead end means we still need a strategy for testing e-mail functionality.
Comments
Comment #1
halstead commentedAfter reading the documents at the link above it seems we cannot use the Symfony2 profiler until Symfony2 is part of Drupal.
In the future, when the tests are pointed at a server that can send mail, we could test that password resets are working by taking advantage of a public mail receiving service such as Mailinator. The steps would be:
Comment #3
eliza411 commentedUpdating title
Comment #3.0
eliza411 commentedRetaining spaces with code tag
Comment #4
eliza411 commentedThis is more about the test environment, methinks.
Comment #6
eliza411 commentedA few things that we've realized working on mail tests:
It's totally fine to test mail just to the point where Drupal prints the message that an e-mail has been sent on account creation.
There is only value in testing that mail is sent and received against the production site, as far as I can see, because at that point we're not testing the code base, we're testing the server configuration.
In the process of thinking about this only one test really needs to be added:
Comment #7
kssundar commentedI think we can add one or two scenarios related to #6 in user_registration.feature
Comment #8
sachin2dhoni commentedAdded the scenario in user_profile_contact.feature as per comment #7
Please check the commit log
http://drupalcode.org/project/doobie.git/commit/f92be18
Comment #9
eliza411 commentedI'm not sure that the new test belongs in this feature, but I can see reasons for including it here, too. It just doesn't seem to fit the business value.
tvn, your thoughts?
Comment #10
eliza411 commentedWith short deadlines to finish up actual work on tests, I'm going to set this as RTBC. The scenario is fine and functional, and we're just discussing its location.
Comment #11
tvn commentedI think this new test belongs to user_registration.feature
http://drupalcode.org/project/doobie.git/blob/HEAD:/features/drupalorg/u...
which is exactly about site behavior when registering new account with different types of emails/names.
Comment #12
pradeeprkara commentedUpdated.
http://drupalcode.org/project/doobie.git/commit/f4a6882
Comment #13
eliza411 commentedComment #13.0
eliza411 commentedRewrote feature and noted that we can't use the docs originally proposed.