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.
Editbar page object¶
-
ftw.testbrowser.pages.editbar.
container
(browser=<ftw.browser.core.Browser instance>)¶ Returns the editbar container node or raises a
NoElementFound
exception.Parameters: browser ( ftw.testbrowser.core.Browser
) – The browser instance to operate with. Uses the global singleton default browser by default.Returns: The #edit-bar
container node.Return type: ftw.testbrowser.nodes.NodeWrapper
Raises: ftw.testbrowser.exceptions.NoElementFound
-
ftw.testbrowser.pages.editbar.
contentview
(*args, **kwargs)¶ Finds and returns a content view link node by its label.
Parameters: - label (string) – The label of the contentview to find.
- browser (
ftw.testbrowser.core.Browser
) – The browser instance to operate with. Uses the global singleton default browser by default.
Returns: The link node (
<a>
) of the content view.Return type: Raises:
-
ftw.testbrowser.pages.editbar.
contentviews
(browser=<ftw.browser.core.Browser instance>)¶ Returns the text labels of all visible content views.
Parameters: browser ( ftw.testbrowser.core.Browser
) – The browser instance to operate with. Uses the global singleton default browser by default.Returns: A list of the labels of the visible content views. Return type: list of str
Finds a menu by label and returns its
<dl class="actionMenu">
node.Parameters: - label (string) – The label of the menu to find.
- browser (
ftw.testbrowser.core.Browser
) – The browser instance to operate with. Uses the global singleton default browser by default.
Returns: The menu container node.
Return type: Raises:
Returns the link node (
<a>
) of an option in a menu.Parameters: - menu_label (string) – The label of the menu.
- menu_label – The label of the option to find in the menu.
- browser (
ftw.testbrowser.core.Browser
) – The browser instance to operate with. Uses the global singleton default browser by default.
Returns: The option link node.
Return type: Raises:
Returns the labels of the options of a menu.
Parameters: - menu_label (string) – The label of the menu to find.
- browser (
ftw.testbrowser.core.Browser
) – The browser instance to operate with. Uses the global singleton default browser by default.
Returns: A list of the labels of the visible menus.
Return type: list of str
Returns the text labels of all visible menus in the edit bar.
Parameters: browser ( ftw.testbrowser.core.Browser
) – The browser instance to operate with. Uses the global singleton default browser by default.Returns: A list of the labels of the visible menus. Return type: list of str
-
ftw.testbrowser.pages.editbar.
visible
(browser=<ftw.browser.core.Browser instance>)¶ Returns
True
when the editbar is visible on the current page.Parameters: browser ( ftw.testbrowser.core.Browser
) – The browser instance to operate with. Uses the global singleton default browser by default.Returns: True
when the editbar is visible,False
when it is not.Return type: boolean
Status messages page object¶
-
ftw.testbrowser.pages.statusmessages.
as_string
(filter_=None)¶ 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)¶ 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.Returns: A dict of erroneous fields with error messages. Return type: dict