How to automated test
a Web application with
sending e-mail feature?
* Not unit test, focus on "system test" by tester who is not developer.
Target Application
"Attendee Registration" Sample App.
 Enter

the name and e-mail address, and
click "Regist".

 Then,

the application send the
confirmation e-mail to entried address.
Automated Testing Environment
Selenium2
 To

remoting Web browser.

SpecFlow
 To

describe test scenario more readable
with "Gherkin" syntax, like the "Cucamber"
library on Ruby.
But, thease libraries are not main
theme of this slides...
Question:
How to assert the contents of
received e-mail from test code!?
There is many applications to mocking
SMTP server, but...


They have NO WAY to interact with Test App...!
 then,

the test code can't validate the sent mails.
Answer:

"Black Jumbo Dog"
Black Jumbo Dog is...
 Desktop

application for Windows

 written
 Open

 It

by C#

source, public at CodePlex.

can be SMTP server.

 Web

API

 It

can speak HTTP to control SMTP server,

 It

can clean all received mails via Web API.

 It

can retrieve all received mails via Web API.
Remote Control

Selenium

Test App
(MSTest)
Web Browser

- Clean up mails
- Retrieve mails
HTTP

Request
Response
HTTP

Target
Web Application

Send e-mail
SMTP

Black Jumbo Dog
(for Mocking SMTP Server)
NOTICE


The Web API of "Black Jumbo Dog" is not stable today.



But, the complete version is coming soon!
Resources


Black Jumbo Dog




http://blackjumbodog.codeplex.com/

Sample Code


https://github.com/sample-by-jsakamoto/How-to-test-webapp-with-BJD

How to automated test a web application with sending e mail feature