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.
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: - form (
ftw.testbrowser.form.Form) – The form node to check for errors. - browser (
ftw.testbrowser.core.Browser) – A browser instance. (Default: global browser)
Returns: A dict of erroneous fields with error messages.
Return type: dict
- form (