Back to index

plone3  3.1.7
zopeconfig.py
Go to the documentation of this file.
00001 
00002 from kss.demo.interfaces import (
00003     IKSSDemoResource,
00004     IKSSSeleniumTestResource,
00005     )
00006 from kss.demo import (
00007     KSSSeleniumTestSuite,
00008     KSSSeleniumTestDirectory,
00009     KSSSeleniumTestLayerBase,
00010     KSSSeleniumSandboxCreationTestCase,
00011     KSSSeleniumTestCase,
00012     KSSDemo,
00013     )
00014 from zope.interface import implements
00015 
00016 
00017 
00018 #
00019 # XXX Important message to developers
00020 #
00021 # Dear Developer! Do _not_ use the setup you see below as an example
00022 # for your own programs, or otherwise you will need to change
00023 # it later. The test suite creation interface will change in
00024 # the next kss.demo versions. The plugin class (PloneDemos) 
00025 # will change in the next major KSS (and possibly Plone) version. 
00026 # This configuration file will be kept up-to-date to these changes.
00027 #
00028 # It is safe, however, to fix existing tests or drop new
00029 # tests in the directories set up below.
00030 #
00031 
00032 
00033 # Create a mesh of provided interfaces
00034 # This is needed, because an utility must have a single interface.
00035 class IResource(IKSSDemoResource, IKSSSeleniumTestResource):
00036     pass
00037 
00038 
00039 class PloneSiteLayer(KSSSeleniumTestLayerBase):
00040     setup = KSSSeleniumSandboxCreationTestCase('@@kss_test_create_site')
00041 
00042 class LoggedInManagerLayer(PloneSiteLayer):
00043     setup = KSSSeleniumTestCase('log-in-manager.html')
00044     teardown = KSSSeleniumTestCase('log-out.html')
00045 
00046 class LoggedInUserLayer(PloneSiteLayer):
00047     setup = KSSSeleniumTestCase('log-in-user.html')
00048     teardown = KSSSeleniumTestCase('log-out.html')
00049 
00050 class PloneDemos(object):
00051     implements(IResource)
00052 
00053     demos = (
00054         KSSDemo('plone.app.kss', '', "follow-link.html", "Follow link action"),
00055         )
00056 
00057     selenium_tests = (
00058         KSSSeleniumTestSuite(
00059             tests = KSSSeleniumTestDirectory('selenium_tests/run_as_anonymous'),
00060             layer = PloneSiteLayer,
00061             component = 'plone.app.kss',
00062             application = 'Plone',
00063             ),
00064         KSSSeleniumTestSuite(
00065             tests = KSSSeleniumTestDirectory('selenium_tests/run_as_testuser'),
00066             layer = LoggedInUserLayer,
00067             component = 'plone.app.kss',
00068             application = 'Plone',
00069             ),
00070         KSSSeleniumTestSuite(
00071             tests = KSSSeleniumTestDirectory('selenium_tests/run_as_testmanager'),
00072             layer = LoggedInManagerLayer,
00073             component = 'plone.app.kss',
00074             application = 'Plone',
00075             ),
00076 
00077         # these are the plugin tests
00078         # but for now we put them into the application suite
00079         KSSSeleniumTestSuite(
00080             tests = KSSSeleniumTestDirectory('selenium_tests/plugin'),
00081             component = 'plone.app.kss',
00082             application = 'Plone',
00083             ),
00084         )