Site control panel
==================

First some initial setup code:

    >>> from Products.CMFCore.utils import getToolByName
    >>> wtool = getToolByName(self.portal, 'portal_workflow')
    >>> self.loginAsManager()

Viewing the workflowed control panel
------------------------------------

    >>> self.browser.open('http://nohost/plone/@@workflowed-controlpanel')
    >>> self.browser.url
    'http://nohost/plone/@@workflowed-controlpanel'

    >>> 'selected_workflow=plone_workflow' in self.browser.contents
    True

Changing the selected workflow
------------------------------

    >>> self.browser.getControl(name='selected_workflow').value = ['one_state_workflow']
    >>> self.browser.getControl(name="form.button.SelectWorkflow").click()
    >>> self.browser.url.endswith('one_state_workflow')
    True

    >>> 'selected_workflow=one_state_workflow' in self.browser.contents
    True

Adding a new workflow
---------------------

    >>> self.browser.getControl(name="form.button.AddWorkflow").click()
    >>> self.browser.url
    'http://nohost/plone/@@workflowed-add-workflow'

    >>> self.browser.getControl(name='form.title').value = 'A new workflow'
    >>> self.browser.getControl(name='form.description').value = 'A new workflow description'
    >>> self.browser.getControl(name='form.based_on').value = ['one_state_workflow']
    >>> self.browser.getControl(name="form.actions.add").click()
    >>> self.browser.url.endswith('a-new-workflow')
    True

    >>> 'selected_workflow=a-new-workflow' in self.browser.contents
    True

Cancel workflow add
-------------------


    >>> self.browser.getControl(name="form.button.AddWorkflow").click()
    >>> self.browser.url
    'http://nohost/plone/@@workflowed-add-workflow'

    >>> self.browser.getControl(name="form.actions.cancel").click()
    >>> self.browser.url
    'http://nohost/plone/@@workflowed-controlpanel'
   
    >>> 'Add new workflow action canceled' in self.browser.contents
    True

