[Checkins] SVN: bluebream/website/docs/v1.0/manual/functionaltesting.rst begin functional testing

Baiju M baiju.m.mail at gmail.com
Sun Jan 24 02:20:36 EST 2010


Log message for revision 108421:
  begin functional testing
  

Changed:
  U   bluebream/website/docs/v1.0/manual/functionaltesting.rst

-=-
Modified: bluebream/website/docs/v1.0/manual/functionaltesting.rst
===================================================================
--- bluebream/website/docs/v1.0/manual/functionaltesting.rst	2010-01-24 07:12:17 UTC (rev 108420)
+++ bluebream/website/docs/v1.0/manual/functionaltesting.rst	2010-01-24 07:20:36 UTC (rev 108421)
@@ -1,2 +1,53 @@
 Functional Testing
 ==================
+
+Introduction
+------------
+
+In this chapter, you will learn more about functional testing.  A doctest based
+package (``zope.testbrowser``) is used in Zope 3 for functional testing.
+Unlike unit tests, functional tests are user interface (view) oriented.
+
+
+zope.testbrowser
+----------------
+
+The central part of this package is a browser object.  This create this object,
+import ``Browser`` class from ``zope.testbrowser.testing``::
+
+  >>> from zope.testbrowser.testing import Browser
+  >>> browser = Browser()
+
+To learn the usage of package, first create a simple HTML page with following
+content::
+
+  <html>
+    <head>
+      <title>Test Page</title>
+    </head>
+    <body>
+      <h1>Test Page</h1>
+    </body>
+  </html>
+
+To open a page::
+
+  >>> browser.open('http://localhost/zopetest/simple.html')
+  >>> browser.url
+  'http://localhost/zopetest/simple.html'
+
+
+Running tests
+-------------
+
+By conventions your functional test modules are put in `ftests` packages under
+each main packages.  But the doctest files can be placed in the package itself.
+Create a sub-package `zopetic.ftests`, under this package create test modules
+like `test_main.py`, `test_extra.py` etc.
+
+To run the functional tests, change to instance home::
+
+  $ cd $HOME/myzope/etc
+  $ ../bin/test
+
+Note that, for unit test 'vpu' is used and here it is 'vpf'.



More information about the checkins mailing list