Page objects

Plone page object

ftw.testbrowser.pages.plone.document_description(browser=<ftw.browser.core.Browser instance>)

Returns the whitespace-normalized document description of the current page or None.

ftw.testbrowser.pages.plone.first_heading(browser=<ftw.browser.core.Browser instance>)

Returns the whitespace-normalized first heading of the current page.

ftw.testbrowser.pages.plone.logged_in(browser=<ftw.browser.core.Browser instance>)

If a user is logged in in the current browser session (last request), it resturns the user-ID, otherwise False.

ftw.testbrowser.pages.plone.portal_type(browser=<ftw.browser.core.Browser instance>)

Returns the current content type, extracted from the body css classes.

ftw.testbrowser.pages.plone.view(browser=<ftw.browser.core.Browser instance>)

Returns the view, taken from the template class, of the current page.

ftw.testbrowser.pages.plone.view_and_portal_type(browser=<ftw.browser.core.Browser instance>)

Returns a tuple of the view and the content type, both taken from the body css classes.

Factories menu page object

ftw.testbrowser.pages.factoriesmenu.add(type_name, browser=<ftw.browser.core.Browser instance>)

Clicks on the add-link in the factories menu for the passed type name. The type name is the literal link label. This opens the add form for this type.

Parameters:type_name (string) – The name (label) of the type to add.
ftw.testbrowser.pages.factoriesmenu.addable_types(browser=<ftw.browser.core.Browser instance>)

Returns a list of addable types. Each addable types is the link label in the factories menu.

ftw.testbrowser.pages.factoriesmenu.menu(browser=<ftw.browser.core.Browser instance>)

Returns the factories menu container node or None if it is not visible.

ftw.testbrowser.pages.factoriesmenu.visible(browser=<ftw.browser.core.Browser instance>)

Returns True when the factories menu is visible on the current page.

Status messages page object

ftw.testbrowser.pages.statusmessages.as_string(filter_=None, browser=<ftw.browser.core.Browser instance>)

All status messages as string instead of dict, so that it can be used for formatting assertion errors. Pass a type (“info”, “warning” or “error”) for filter_ing the messages.

ftw.testbrowser.pages.statusmessages.assert_message(text, browser=<ftw.browser.core.Browser instance>)

Assert that a status message is visible.

ftw.testbrowser.pages.statusmessages.assert_no_error_messages(browser=<ftw.browser.core.Browser instance>)

Assert that there are no error messages.

ftw.testbrowser.pages.statusmessages.assert_no_messages(browser=<ftw.browser.core.Browser instance>)

Assert that there are no status messages at all.

ftw.testbrowser.pages.statusmessages.error_messages(browser=<ftw.browser.core.Browser instance>)

Returns all “error” statusmessages.

ftw.testbrowser.pages.statusmessages.info_messages(browser=<ftw.browser.core.Browser instance>)

Returns all “info” statusmessages.

ftw.testbrowser.pages.statusmessages.messages(browser=<ftw.browser.core.Browser instance>)

Returns a dict with lists of status messages (normalized text) for “info”, “warning” and “error”.

ftw.testbrowser.pages.statusmessages.warning_messages(browser=<ftw.browser.core.Browser instance>)

Returns all “warning” statusmessages.

dexterity page object

ftw.testbrowser.pages.dexterity.erroneous_fields(browser=<ftw.browser.core.Browser instance>)

Returns a mapping of erroneous fields (key is label or name of the field) to a list of error messages for the fields on a dexterity add and edit forms (form#form).

Returns:A dict of erroneous fields with error messages.
Return type:dict

z3cform page object

ftw.testbrowser.pages.z3cform.erroneous_fields(form, browser=<ftw.browser.core.Browser instance>)

Returns a mapping of erroneous fields (key is label or name of the field) to a list of error messages for the fields on the form passed as argument.

Parameters:
Returns:

A dict of erroneous fields with error messages.

Return type:

dict