diff -r 47d93faea82a mail/test/mozmill/account-setup-wizard/test-account-setup.js
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/test/mozmill/account-setup-wizard/test-account-setup.js	Fri Mar 19 15:43:10 2010 +0800
@@ -0,0 +1,92 @@
+/* ***** BEGIN LICENSE BLOCK ***** 
+ *   Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Thunderbird Mail Client.
+ *
+ * The Initial Developer of the Original Code is
+ * Mozilla Foundation.
+ * Portions created by the Initial Developer are Copyright (C) 2010
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Brian Lu <brian.lu@sun.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+var MODULE_NAME = 'test-account-setup-wizard';
+
+var RELATIVE_ROOT= '../shared-modules';
+var MODULE_REQUIRES=['window-helpers'];
+
+var mc = null;
+
+function setupModule(module) {
+  let wh = collector.getModule('window-helpers');
+  wh.installInto(module);
+  
+  mc = wh.wait_for_existing_window("mail:3pane");
+}
+
+function test_account_wizard_setup()
+{
+  // Step1: open account setup wizard
+  plan_for_modal_dialog("mail:autoconfig",autoconfig_callback);
+  mc.click(new elementslib.Elem(mc.menus.menu_File.menu_New.newMailAccountMenuItem));
+  wait_for_modal_dialog("mail:autoconfig");
+  
+  mc.window.close();
+}
+
+var autoconfig_callback = function ac_callback(c)
+{
+   // Step2: setup "real name" and "e-mail field" in the first page
+   var realname = c.window.document.getElementById("realname");
+   realname.value = "foo";
+
+   var email = c.window.document.getElementById("email");
+   // c.type(email,"bar@abc.com") doesn't work here
+   email.value = "bar@abc.com";
+
+   // click "next" button to go to next page
+   var next_button_node = c.eid("next_button");
+   var next_button = next_button_node.getNode();
+   next_button.disabled = false;
+   c.click(next_button_node);
+
+   // click "stop" button on the second page
+   var stop_button = c.eid("stop_button");
+   c.waitForElement(stop_button);
+   c.click(stop_button);
+
+   // set "username" field to "abcdefg"
+   var username  = c.eid("username");
+   var username_node = username.getNode();
+   username_node.value = "abcdefg";
+
+   // sleep 20s for timeout
+   c.sleep(20000);
+   c.assertValue(username,"abcdefg");
+   c.window.close();
+}
diff -r 47d93faea82a mail/test/mozmill/mozmilltests.list
--- a/mail/test/mozmill/mozmilltests.list	Fri Mar 19 00:52:21 2010 +0100
+++ b/mail/test/mozmill/mozmilltests.list	Fri Mar 19 15:43:10 2010 +0800
@@ -2,8 +2,9 @@ folder-display
 junk-commands
 search-window
 cookies
 content-policy
 content-tabs
 message-header
 folder-pane
 pref-window
+account-setup-wizard
