I was creating a whole structure of robot tests where each test was expecting a change in a plone.app.registry from the last test case (there's a specific client requirement for this). Since using transaction.commit()
in the code wasn't working, after lots of reading, googling (thanks @datakurre for https://stackoverflow.com/questions/24368487/how-to-create-test-site-structure-before-each-plone-app-robotframework-based-tes), prints and a better understanding of how robot tests works in plone (using the template in https://github.com/plone/bobtemplates.plone/blob/350bffe80d046e2252c962e8b7a42236c655b043/bobtemplates/plone/addon/src/%2Bpackage.namespace%2B/%2Bpackage.name%2B/tests/test_robot.py.bob#L19), it's simply not possible since setUp
and tearDown
are called for each test case in the Acceptance layer.
I don't think I will be the only one having this kind of confusion, so I would like to document it somewhere and I'm asking for some guidance here.
Should this be documented in plone.app.framework (we can't there unfortunately since we can't yet sign Contributor's Agreement)? Plone docs? In Plone training, in https://training.plone.org/5/mastering-plone/testing.html#integration-tests, we have But this also means you cannot commit a transaction.
. Something similar to https://training.plone.org/5/mastering-plone/testing.html#acceptance-tests should be added as well? What do you think @pbauer?