plone / plone.app.robotframework

Provides Robot Framework compatible resources and tools for writing functional Selenium tests (including acceptance tests) for Plone CMS and its add-ons.
https://docs.plone.org/external/plone.app.robotframework/docs/source/index.html
11 stars 17 forks source link

Keyword support for Plone 5 #45

Closed datakurre closed 6 years ago

datakurre commented 9 years ago

The basic robot test integration in plone.app.robotframework has alwasy supported Plone 5, but the support in shipped default keyowrds and its own CI is shamingly late. So, this ticket to follow the process.

@cewing was the latest to ping this on #plone and is probably interested

The base for making the same keywords work on both Plone 4 and Plone 5 was done already at Cologne Cathedral sprint 2014, but we never finished the work.

To summarize: When selenium.robot is included, we include different set of selectors for Plone 4 and Plone 5. An alternative would be to include some base set of selectors for all and then include overrides selectors that need overrides. Since we never wrote any selectors, this strategy can still be changed:

https://github.com/plone/plone.app.robotframework/blob/datakurre-plone-5/src/plone/app/robotframework/variables.py#L18

https://github.com/plone/plone.app.robotframework/tree/datakurre-plone-5/src/plone/app/robotframework/selectors

Meanwhile, for add-ons, one could do also do what I did on Mosaic and use CMFPLONE_VARIABLE to vary selectors / test steps between Plone 4 and Plone 5:

https://github.com/plone/plone.app.mosaic/commit/b2d0c23198f1b4cf7b3d0942948264b640109344#diff-35b2a63a2ffd46342118487f32b64b53R29

https://github.com/plone/plone.app.mosaic/commit/b2d0c23198f1b4cf7b3d0942948264b640109344#diff-22ab0e1b24df9ee7410dc1959a86d339R71

I figured out that the easiest way to run p.a.robotframeworks internal tests for both Plone 4 and Plone 5, for both Archetypes and Dexterity, is to simply run Plone 4 tests with Archetypes and Plone 5 tests with Dexterity. I started a branch on this, but have not had time to finish:

https://github.com/plone/plone.app.robotframework/tree/datakurre-plone-5

jensens commented 7 years ago

I just found this issue, is it still a problem? The branch never made it in a PR and needs at least a rebase.

datakurre commented 7 years ago

Wow, I've completely forgotten this, although, I've used the same approach in in-house packages.

Two years more and there's no need for Plone 4 support :)

ksuess commented 6 years ago

While fixing a robot test in an add-on with users of different roles https://community.plone.org/t/a-robot-test-fails-on-wrong-roles-updated/6255/2?u=ksuess, I found this issue. Now its not possible to create a user with more than one role or a role like 'Site Administrator' with a space in name. So I run the test for the keywords itself test_users_library.robot. This failed on Plone 5 buildout coredev.

I'm interested in using plone.app.robotframeworks for Plone 5. Would it make sense to make a new branch and work on it? Or do I miss the point where Plone 5 selectors are already covered? If yes, do we have to consider Plone 4 and Archetypes, or can we go on without and let Plone 4 stick to the last version of plone.app. robotframework?

jensens commented 6 years ago

this should be solved with https://github.com/plone/plone.app.robotframework/pull/83