Writing Robot Framework tests for Plone¶
plone.app.robotframework provides Robot Framework-compatible tools and resources for writing functional Selenium-tests (including acceptance tests) for Plone CMS and its add-ons.
This documentation gives you everything to get started in writing and executing functional Selenium tests (including acceptance tests) for Plone or your own Plone add-on. We depend on two testing frameworks, Robot Framework and Selenium (with Selenium2Library), and our tools and resources provided in plone.app.robotframework.
Robot Framework is a generic test automation framework for acceptance testing and acceptance test-driven development (ATDD), even for behavior driven development (BDD). It has easy-to-use plain text test syntax and utilizes the keyword-driven testing approach. Selenium is a web browser automation framework that exercises the browser as if the user was interacting with the browser.
Start here¶
Start here to learn the default way of writing Robot Framework tests to be run just next to your other Plone-tests with zope.testrunner:
Print these¶
Print these keyword libraries to be easily available when writing Robot Framework tests, because they provide the basic building blocks for your tests:
Advanced topics¶
User keywords¶
plone.app.robotframework ships with the following user keyword libraries as resource files:
-
libdoc/user_keywords.html
-
libdoc/user_saucelabs.html
-
libdoc/user_selenium.html
-
libdoc/user_server.html
Each user keyword library can be included as a resource
with
Resource
plone/app/robotframework/libraryname.rst
in test suite
***
Settings
***
.
Remote keywords¶
Remote keywords are a special plone.app.robotframework-way to implement Plone-specific keyword in Python for e.g. creating Plone content in test setup keywords. plone.app.robotframework comes with the following remote keyword libraries:
-
libdoc/remote_autologin.html
-
libdoc/remote_content.html
-
libdoc/remote_genericsetup.html
-
libdoc/remote_i18n.html
-
libdoc/remote_mockmailhost.html
-
libdoc/remote_quickinstaller.html
-
libdoc/remote_users.html
-
libdoc/remote_zope2server.html
All remote keywords above are included by including a
special test fixture
plone.app.robotframework.testing.REMOTE_LIBRARY_BUNDLE_FIXTURE
in bases of the used functional testing fixture,
and finally with
Library
Remote
${PLONE_URL}/RobotRemote
-command in test suite
***
Settings
***
.
See
testing.py
in plone.app.robotframework for how to create a
custom remote library bundle fixture with only selected
(or custom) remote keyword libraries.
Python keywords¶
In addition to user keywords and remote libraries, plone.app.robotframeworks provides the following generic Python keyword libraries (their code is not dependent on Plone code base).
-
libdoc/python_debugging.html
-
libdoc/python_layoutmath.html
-
libdoc/python_saucelabs.html
-
libdoc/python_zope2server.html
Each Python keyword library can be included as with
Library
plone.app.robotframework.LibraryClassName
in test suite
`***
Settings
***
.
Other resources¶
Old tutorials¶
Note
While these tutorials are still useful for gettings started with Robot Framework testing for Plone, these may contain outdated instructions!