diff --git a/Products/CMFPlone/testing.py b/Products/CMFPlone/testing.py index 63f65ce3b9..e65abac85a 100644 --- a/Products/CMFPlone/testing.py +++ b/Products/CMFPlone/testing.py @@ -17,6 +17,13 @@ from Products.MailHost.interfaces import IMailHost from zope.component import getSiteManager from zope.configuration import xmlconfig +from plone.autoform.form import AutoExtensibleForm +from plone.app.z3cform.widget import SelectWidget +from plone.autoform import directives +from z3c.form import form +from zope.schema import Choice +from zope.schema import List +from zope.interface import Interface import doctest @@ -115,3 +122,24 @@ def setUpPloneSite(self, portal): ) optionflags = doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE + + +class ITestSelectWidgetSchema(Interface): + + directives.widget('select_field', SelectWidget) + select_field = Choice( + title=u'Select Widget', + values=['one', 'two', 'three', ] + ) + + directives.widget('list_field', SelectWidget) + list_field = List( + title=u'Select Multiple Widget', + value_type=Choice(values=['four', 'five', 'six', ]), + ) + + +class TestSelectWidgetForm(AutoExtensibleForm, form.EditForm): + + schema = ITestSelectWidgetSchema + ignoreContext = True \ No newline at end of file diff --git a/Products/CMFPlone/tests/configure.zcml b/Products/CMFPlone/tests/configure.zcml index 29f6057348..1c0e6d0f69 100644 --- a/Products/CMFPlone/tests/configure.zcml +++ b/Products/CMFPlone/tests/configure.zcml @@ -13,4 +13,11 @@ permission="zope2.View" /> + + diff --git a/Products/CMFPlone/tests/robot/common.robot b/Products/CMFPlone/tests/robot/common.robot deleted file mode 100644 index 33791aa6dc..0000000000 --- a/Products/CMFPlone/tests/robot/common.robot +++ /dev/null @@ -1,69 +0,0 @@ -*** Settings *** - -Resource plone/app/robotframework/variables.robot - -Library Remote ${PLONE_URL}/RobotRemote - -*** Variables *** - -${TEST_FOLDER} test-folder - -*** Keywords *** - -a document - [Arguments] ${title} - Go to ${PLONE_URL}/${TEST_FOLDER}/++add++Document - Given patterns are loaded - Execute Javascript $('#form-widgets-IDublinCore-title').val('${title}'); return 0; - Click Button Save - -a folder - [Arguments] ${title} - Go to ${PLONE_URL}/${TEST_FOLDER}/++add++Folder - Given patterns are loaded - Execute Javascript $('#form-widgets-IDublinCore-title').val('${title}'); return 0; - Click Button Save - -a folder '${foldername}' with a document '${documentname}' - Go to ${PLONE_URL}/${TEST_FOLDER}/++add++Folder - Given patterns are loaded - Execute Javascript $('#form-widgets-IDublinCore-title').val('${foldername}'); return 0; - Click Button Save - Go to ${PLONE_URL}/${TEST_FOLDER}/folder/edit - Given patterns are loaded - Execute Javascript $('#form-widgets-IDublinCore-title').val('${documentname}'); return 0; - Click Button Save - -a collection - [Arguments] ${title} - Go to ${PLONE_URL}/${TEST_FOLDER}/++add++Collection - Given patterns are loaded - Execute Javascript $('#form-widgets-IDublinCore-title').val('${title}'); return 0; - Click Button Save - -a site owner - Log in as site owner - -the site root - Go to ${PLONE_URL} - -a test folder - Go to ${PLONE_URL}/++add++Folder - Given patterns are loaded - Execute Javascript $('#form-widgets-IDublinCore-title').val('Test Folder'); return 0; - Click Button Save - -the test folder - Go to ${PLONE_URL}/${TEST_FOLDER} - -there should be '${count}' livesearch results - Wait until keyword succeeds 5s 1s Element Should Be Visible css=div#LSResult - Wait until keyword succeeds 5s 1s Xpath Should Match X Times //div[@id = 'LSResult']/descendant::li ${count} - -patterns are loaded - Wait For Condition return !!document.querySelector('body.patterns-loaded') - -Refresh JS/CSS resources - # Not needed anymore, and it is breaking the Plone Zope 4 tests. - # Keep the keyword for backwards compatibility purposes. - Sleep 0.0000001 diff --git a/Products/CMFPlone/tests/robot/keywords.robot b/Products/CMFPlone/tests/robot/keywords.robot index ca0c598c4b..2cb187d473 100644 --- a/Products/CMFPlone/tests/robot/keywords.robot +++ b/Products/CMFPlone/tests/robot/keywords.robot @@ -1,39 +1,93 @@ -*** Keywords ***************************************************************** +*** Keywords *** -# --- SETUP ------------------------------------------------------------------ +# SETUP Refresh JS/CSS resources # Not needed anymore, and it is breaking the Plone Zope 4 tests. # Keep the keyword for backwards compatibility purposes. Sleep 0.0000001 -# --- GIVEN ------------------------------------------------------------------ +# GIVEN + +a logged-in manager + Enable autologin as + ... Manager + +a logged-in member + Enable autologin as + ... Member a logged-in site administrator - Enable autologin as Site Administrator Contributor Reviewer + Enable autologin as + ... Site Administrator + ... Contributor + ... Reviewer + a document '${title}' - Create content type=Document id=doc title=${title} + Create content + ... type=Document + ... id=doc + ... title=${title} a file '${title}' - Create content type=File id=file title=${title} + Create content + ... type=File + ... id=file + ... title=${title} a news item '${title}' - Create content type=News Item id=doc title=${title} + Create content + ... type=News Item + ... id=doc + ... title=${title} an image '${title}' - Create content type=Image id=doc title=${title} + Create content + ... type=Image + ... id=doc + ... title=${title} a folder '${title}' - Create content type=Folder title=${title} - -patterns are loaded - Wait For Condition return !!document.querySelector('body.patterns-loaded') + Create content + ... type=Folder + ... title=${title} a folder with a document '${title}' - ${folder_uid}= Create content type=Folder title=folder - Create content type=Document container=${folder_uid} title=${title} + ${folder_uid}= Create content type=Folder title=folder + Create content + ... type=Document + ... container=${folder_uid} + ... title=${title} + +Remove line from textarea + [Arguments] ${fieldName} ${value} + + Import library String + ${lines}= Get Text //textarea[@name="${fieldName}"] + ${lines}= Remove String ${lines} ${value}\n + Type Text //textarea[@name="${fieldName}"] ${lines} + + +Fill text to tinymce editor + [Arguments] ${attr_name} ${input} + + Wait For Condition Attribute //body class contains patterns-loaded + + Sleep 1 + + ${check}= Evaluate JavaScript //textarea[@name="${attr_name}"] + ... (elem, text) => { + ... const tiny = window.tinymce.get(elem.getAttribute("id")); + ... let input_text = ""; + ... tiny.setContent('${input}'); + ... return tiny.getContent(); + ... } + ... all_elements=False + + Should not be empty ${check} + -folder contents pattern loaded - Page should contain element css=.pat-structure - Wait For Condition return !!document.querySelector('.pat-structure div.navbar') +Pause + Import library Dialogs + Pause execution diff --git a/Products/CMFPlone/tests/robot/robodoc/README.rst b/Products/CMFPlone/tests/robot/robodoc/README.rst deleted file mode 100644 index d25585bf30..0000000000 --- a/Products/CMFPlone/tests/robot/robodoc/README.rst +++ /dev/null @@ -1,85 +0,0 @@ -============== -ROBODOC README -============== - -The ``robodoc`` folder contains Robot Framework tests moved from the Plone documentation project. -Because they are designed to be run as test suite level stories (sandbox is cleared only when changing a robot file), -they are not integrated with zope.testrunner (``./bin/test``), but are designed to be run with Robot Framework test runner (``pybot``). - - -Installing Robot Framework -========================== - -Most tools needed to run the tests and generate the screenshots are available from within a standard Plone buildout.coredev environment. -The only extra piece of software needed is `webdriver` for your operating system and browser of choice, and that browser. - -Minimal buildout to generate a good enough Robot Framework test runner would look like the following: - -.. code:: ini - - [buildout] - extends = https://dist.plone.org/release/5-latest/versions.cfg - parts = robot - - [robot] - recipe = zc.recipe.egg - eggs = - Plone - Pillow - robotframework-selenium2screenshots - plone.app.robotframework [debug] - - -Running the tests -================= - -There are two possible ways to run the tests. - -The first option is to run them with a single command: - -.. code:: bash - - $ bin/pybot -v BROWSER:phantomjs src/Products.CMFPlone/Products/CMFPlone/tests/robot/robodoc/collaboration-advanced_control.robot - -This command will 1) start up a Plone site, 2) run the defined test suite and 3) shut down the Plone site. It will take some time. -``-v BROWSER:phantomjs`` is optional, and will define a Robot Framework variable named ``BROWSER`` with value ``phantomjs``, effectively running the test suite using headless PhantomJS browser. - -You can run multiple test suites in the same directory, - -.. code:: bash - - $ bin/pybot -v BROWSER:phantomjs src/Products.CMFPlone/Products/CMFPlone/tests/robot/robodoc - -will run all tests and generate all screenshots. - -The second option is to first start a robot server and only then, in parallel, to execute the desired test suite: - -.. code:: bash - - $ APPLY_PROFILES=plone.app.contenttypes:plone-content bin/robot-server plone.app.robotframework.PLONE_ROBOT_TESTING - -or - -.. code:: bash - - $ CONFIGURE_PACKAGES=plone.app.iterate APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.app.iterate:default bin/robot-server plone.app.robotframework.PLONE_ROBOT_TESTING - -and - - $ bin/pybot -v ROBOT_SERVER:True -v BROWSER:phantomjs src/Products.CMFPlone/Products/CMFPlone/tests/robot/robodoc/screenshot-tall/collaboration-advanced_control.robot - -This option will be faster for subsequent runs. - -Environment variable ``APPLY_PROFILES`` can be set to a comma separated list of Generic Setup profiles and is used by the very special test fixture ``PLONE_ROBOT_TESTING`` to prepare a Plone site with those profiles installed. There's also an another special variable ``CONFIGURE_PACKAGES`` that can be set to a comma separated list of package names (e.g. to ``plone.app.iterate``) to configure more profiles to be available for ``APPLY_PROFILES``. - -A special variable ``ROBOT_SERVER:True`` must be set for Robot Framework test runner to fix the test suite to be aware of being executed against long-running robot server. - -Screenshots for documentation -============================= - -The screenshots are meant for the Plone documentation. - -As there are still browser bugs, it is good to visually inspect them before they are uploaded in the repository -https://github.com/plone/documentation-roboshots - -In there, the tagged releases should contain known-good-sets of screenshots for a particular Plone version. diff --git a/Products/CMFPlone/tests/robot/robodoc/TODO.rst b/Products/CMFPlone/tests/robot/robodoc/TODO.rst deleted file mode 100644 index f6136f2724..0000000000 --- a/Products/CMFPlone/tests/robot/robodoc/TODO.rst +++ /dev/null @@ -1,10 +0,0 @@ -Browser and webdriver support ------------------------------ - -2017-07-20: - -Ubuntu 16.04: - -- Phantomjs works well, but has issues with iframes. The `working_with_tinymce.robot` tests have visual errors in the screenshots. -- Chrome 59 with chromedriver has issues, reportedly Chrome 60 should be better, and be able to do headless screenshots. -- Firefox 54 does not work with the current geckodriver software for Linux. diff --git a/Products/CMFPlone/tests/robot/robodoc/anonymous.robot b/Products/CMFPlone/tests/robot/robodoc/anonymous.robot deleted file mode 100644 index 89cb4c1c16..0000000000 --- a/Products/CMFPlone/tests/robot/robodoc/anonymous.robot +++ /dev/null @@ -1,96 +0,0 @@ -*** Settings *** - -Resource plone/app/robotframework/keywords.robot -Resource Selenium2Screenshots/keywords.robot - -Library plone.app.robotframework.Zope2Server -Library OperatingSystem - -Suite Setup Common Suite Setup -Suite Teardown Common Suite Teardown - -*** Variables *** - -${FIXTURE} plone.app.robotframework.PLONE_ROBOT_TESTING -@{CONFIGURE_PACKAGES} -@{APPLY_PROFILES} plone.app.contenttypes:plone-content -@{DIMENSIONS} 1024 768 -${ROBOT_SERVER} False - -*** Keywords *** - -Common Suite Setup - Run keyword if ${ROBOT_SERVER} Setup Plone keywords - Run keyword if ${ROBOT_SERVER} Remote ZODB setup ${FIXTURE} - Run keyword if not ${ROBOT_SERVER} Setup Plone site ${FIXTURE} - Run keyword if not ${ROBOT_SERVER} ZODB setup ${FIXTURE} - - ${language} = Get environment variable LANGUAGE 'en' - Set default language ${language} - - Open test browser - Run keyword and ignore error Set window size @{DIMENSIONS} - -Common Suite Teardown - Close all browsers - Run keyword if ${ROBOT_SERVER} Remote ZODB TearDown ${FIXTURE} - Run keyword if not ${ROBOT_SERVER} ZODB TearDown ${FIXTURE} - Run keyword if not ${ROBOT_SERVER} Teardown Plone site - -Setup Plone site - [Arguments] ${zope_layer_dotted_name} - Start Zope server ${zope_layer_dotted_name} - Wait until keyword succeeds 2min 0s Setup Plone keywords - -Setup Plone keywords - Import library Remote ${PLONE_URL}/RobotRemote - -Teardown Plone site - Close all browsers - Stop Zope server - -Highlight link - [Arguments] ${locator} - Update element style ${locator} padding 0.5em - Highlight ${locator} - - -*** Test Cases *** - -Take login link screenshot - Go to ${PLONE_URL} - Highlight link css=#personaltools-login - Capture and crop page screenshot - ... ${CURDIR}/_robot/login-link.png - ... css=#content-header - ... css=#above-content-wrapper - - -Take login screenshot - Go to ${PLONE_URL}/login - Capture and crop page screenshot - ... ${CURDIR}/_robot/login-popup.png - ... css=#content-core - -Take annotated screenshot - Go to ${PLONE_URL} - Highlight link css=#personaltools-login - Capture and crop page screenshot - ... ${CURDIR}/_robot/anonymous-surfing.png - ... css=#content-header - ... css=#above-content-wrapper - - Enable autologin as Manager - ${user_id} = Translate user_id - ... default=jane-doe - ${user_fullname} = Translate user_fullname - ... default=Jane Doe - Create user ${user_id} Member fullname=${user_fullname} - Set autologin username ${user_id} - -Take logged in screenshot - Go to ${PLONE_URL} - Capture and crop page screenshot - ... ${CURDIR}/_robot/loggedin-surfing.png - ... css=#above-content-wrapper - ... css=div.plone-toolbar-container \ No newline at end of file diff --git a/Products/CMFPlone/tests/robot/robodoc/collaboration-advanced_control.robot b/Products/CMFPlone/tests/robot/robodoc/collaboration-advanced_control.robot deleted file mode 100644 index a81141374d..0000000000 --- a/Products/CMFPlone/tests/robot/robodoc/collaboration-advanced_control.robot +++ /dev/null @@ -1,44 +0,0 @@ -*** Settings *** - -Resource common.robot - -Suite Setup Common Suite Setup -Suite Teardown Common Suite Teardown - -*** Variables *** - -@{DIMENSIONS} 1024 1200 - -*** Test Cases *** - -Create sample content - Go to ${PLONE_URL} - Capture page screenshot - - ${item} = Create content type=Folder - ... id=documentation title=Documentation - ... description=Here you can find the documentation on our new product - -Show state menu - Go to ${PLONE_URL}/documentation - - Click link css=#plone-contentmenu-workflow a - - Wait until element is visible - ... css=#plone-contentmenu-workflow li.plone-toolbar-submenu-header - - Mouse over workflow-transition-advanced - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/workflow-advanced-menu.png - ... css=#content-header - ... css=div.plone-toolbar-container - - Click link workflow-transition-advanced - Wait until element is visible - ... css=div.modal-content - - Capture and crop page screenshot - ... ${CURDIR}/_robot/workflow-advanced.png - ... css=div.modal-wrapper diff --git a/Products/CMFPlone/tests/robot/robodoc/collaboration.robot b/Products/CMFPlone/tests/robot/robodoc/collaboration.robot deleted file mode 100644 index 32508a142a..0000000000 --- a/Products/CMFPlone/tests/robot/robodoc/collaboration.robot +++ /dev/null @@ -1,92 +0,0 @@ -*** Settings *** - -Resource common.robot - -Suite Setup Common Suite Setup -Suite Teardown Common Suite Teardown - -*** Variables *** - -@{DIMENSIONS} 1280 1600 - -*** Test Cases *** - -Create sample content - Go to ${PLONE_URL} - - ${item} = Create content type=Document - ... id=samplepage title=Sample Page - ... description=The long wait is now over - ... text=

Our new site is built with Plone.

- - -Show state menu - Go to ${PLONE_URL}/samplepage - - Wait until element is visible - ... css=span.icon-plone-contentmenu-workflow - Click element css=span.icon-plone-contentmenu-workflow - - Wait until element is visible - ... css=#plone-contentmenu-workflow li.plone-toolbar-submenu-header - - Mouse over workflow-transition-publish - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/workflow-basic.png - ... css=#content-header - ... css=div.plone-toolbar-container - -Show sendback - Go to ${PLONE_URL}/samplepage - - Wait until element is visible - ... css=span.icon-plone-contentmenu-workflow - Click element css=span.icon-plone-contentmenu-workflow - - Wait until element is visible - ... css=#plone-contentmenu-workflow li.plone-toolbar-submenu-header - - click link workflow-transition-submit - - Go to ${PLONE_URL}/samplepage - - Wait until element is visible - ... css=span.icon-plone-contentmenu-workflow - Click element css=span.icon-plone-contentmenu-workflow - - Wait until element is visible - ... css=#plone-contentmenu-workflow li.plone-toolbar-submenu-header - - Mouse over workflow-transition-reject - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/workflow-reject.png - ... css=#content-header - ... css=div.plone-toolbar-container - -Create sample folder - Go to ${PLONE_URL} - - ${item} = Create content type=Folder - ... id=documentation title=Documentation - ... description=Here you can find the documentation on our new product - -Show sharing menu - - Go to ${PLONE_URL}/documentation - - Click link css=#contentview-local_roles a - - Wait until element is visible - ... css=#user-group-sharing-container - - Update element style portal-footer display none - - - Capture and crop page screenshot - ... ${CURDIR}/_robot/sharing-menu.png - ... css=#content-header - ... css=div.plone-toolbar-container \ No newline at end of file diff --git a/Products/CMFPlone/tests/robot/robodoc/common.robot b/Products/CMFPlone/tests/robot/robodoc/common.robot deleted file mode 100644 index 7c2a33733b..0000000000 --- a/Products/CMFPlone/tests/robot/robodoc/common.robot +++ /dev/null @@ -1,55 +0,0 @@ -*** Settings *** - -Resource plone/app/robotframework/keywords.robot -Resource Selenium2Screenshots/keywords.robot - -Library plone.app.robotframework.Zope2Server -Library OperatingSystem - -*** Variables *** - -${FIXTURE} plone.app.robotframework.PLONE_ROBOT_TESTING -@{CONFIGURE_PACKAGES} -@{APPLY_PROFILES} plone.app.contenttypes:plone-content -@{DIMENSIONS} 1024 768 -${ROBOT_SERVER} False - -*** Keywords *** - -Common Suite Setup - Run keyword if ${ROBOT_SERVER} Setup Plone keywords - Run keyword if ${ROBOT_SERVER} Remote ZODB setup ${FIXTURE} - Run keyword if not ${ROBOT_SERVER} Setup Plone site ${FIXTURE} - Run keyword if not ${ROBOT_SERVER} ZODB setup ${FIXTURE} - - ${language} = Get environment variable LANGUAGE 'en' - Set default language ${language} - - Enable autologin as Manager - ${user_id} = Translate user_id - ... default=jane-doe - ${user_fullname} = Translate user_fullname - ... default=Jane Doe - Create user ${user_id} Member fullname=${user_fullname} - Set autologin username ${user_id} - - Open test browser - Run keyword and ignore error Set window size @{DIMENSIONS} - -Common Suite Teardown - Close all browsers - Run keyword if ${ROBOT_SERVER} Remote ZODB TearDown ${FIXTURE} - Run keyword if not ${ROBOT_SERVER} ZODB TearDown ${FIXTURE} - Run keyword if not ${ROBOT_SERVER} Teardown Plone site - -Setup Plone site - [Arguments] ${zope_layer_dotted_name} - Start Zope server ${zope_layer_dotted_name} - Wait until keyword succeeds 2min 0s Setup Plone keywords - -Setup Plone keywords - Import library Remote ${PLONE_URL}/RobotRemote - -Teardown Plone site - Close all browsers - Stop Zope server diff --git a/Products/CMFPlone/tests/robot/robodoc/config-screens.robot b/Products/CMFPlone/tests/robot/robodoc/config-screens.robot deleted file mode 100644 index 8422f57999..0000000000 --- a/Products/CMFPlone/tests/robot/robodoc/config-screens.robot +++ /dev/null @@ -1,212 +0,0 @@ -*** Settings *** - -Resource common.robot - -Suite Setup Common Suite Setup -Suite Teardown Common Suite Teardown - -*** Variables *** - -@{DIMENSIONS} 1280 1600 -@{CONFIGURE_PACKAGES} plone.app.caching -@{APPLY_PROFILES} plone.app.contenttypes:plone-content plone.app.caching:default - - -*** Keywords *** - -Highlight field - [Arguments] ${locator} - Update element style ${locator} padding 0.5em - Highlight ${locator} - -*** Test Cases *** - -Show Add-ons setup screen - Go to ${PLONE_URL}/prefs_install_products_form - Capture and crop page screenshot - ... ${CURDIR}/_robot/addon-setup.png - ... css=#content - -Show caching setup screen - Go to ${PLONE_URL}/@@caching-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/caching-setup.png - ... css=#content - -Show Configuration Registry screen - Go to ${PLONE_URL}/portal_registry - Capture and crop page screenshot - ... ${CURDIR}/_robot/configuration-registry.png - ... css=#content - -Show Content setup screen - Go to ${PLONE_URL}/@@content-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/content-setup.png - ... css=#content - - Click element type_id - - Select From List By Label name=type_id Document - - Capture and crop page screenshot - ... ${CURDIR}/_robot/content-document.png - ... css=#content - -Show Date setup screen - Go to ${PLONE_URL}/@@dateandtime-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/date-setup.png - ... css=#content - -Show Dexterity setup screen - Go to ${PLONE_URL}/@@dexterity-types - Capture and crop page screenshot - ... ${CURDIR}/_robot/dexterity-setup.png - ... css=#content - -Show Discussion setup screen - Go to ${PLONE_URL}/@@discussion-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/discussion-setup.png - ... css=#content - -Show Editing setup screen - Go to ${PLONE_URL}/@@editing-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/editing-setup.png - ... css=#content - -Show Error log setup screen - Go to ${PLONE_URL}/@@error-log-form - Capture and crop page screenshot - ... ${CURDIR}/_robot/errorlog-setup.png - ... css=#content - -Show HTML filter setup screen - Go to ${PLONE_URL}/@@filter-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/filter-setup.png - ... css=#content - -Show Image handling setup screen - Go to ${PLONE_URL}/@@imaging-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/imaging-setup.png - ... css=#content - -Show Site setup overview screen - Go to ${PLONE_URL}/@@overview-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/site-overview.png - ... css=#content - -Show Language setup screen - Go to ${PLONE_URL}/@@language-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/language-setup.png - ... css=#content - - Click link autotoc-item-autotoc-1 - Capture and crop page screenshot - ... ${CURDIR}/_robot/language-negotiation.png - ... css=#content - -Show Mail setup screen - Go to ${PLONE_URL}/@@mail-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/mail-setup.png - ... css=#content - -Show ZODB maintenance setup screen - Go to ${PLONE_URL}/@@maintenance-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/zodb-setup.png - ... css=#content - -Show Markup setup screen - Go to ${PLONE_URL}/@@markup-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/markup-setup.png - ... css=#content - -Show Navigation setup screen - Go to ${PLONE_URL}/@@navigation-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/navigation-setup.png - ... css=#content - -Show Resource Registry screen - Go to ${PLONE_URL}/@@resourceregistry-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/resource-registry.png - ... css=#content - -Show Search setup screen - Go to ${PLONE_URL}/@@search-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/search-setup.png - ... css=#content - -Show Security setup screen - Go to ${PLONE_URL}/@@security-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/security-setup.png - ... css=#content - -Show Site setup screen - Go to ${PLONE_URL}/@@site-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/site-setup.png - ... css=#content - -Show socialmedia setup screen - Go to ${PLONE_URL}/@@social-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/social-setup.png - ... css=#content - -Show Syndication setup screen - Go to ${PLONE_URL}/@@syndication-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/syndication-setup.png - ... css=#content - -Show Theming setup screen - Go to ${PLONE_URL}/@@theming-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/theme-setup.png - ... css=#content - -Show Tinymce setup screen - Go to ${PLONE_URL}/@@tinymce-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/tinymce-setup.png - ... css=#content - -Show Users setup screen - Go to ${PLONE_URL}/@@usergroup-userprefs - Capture and crop page screenshot - ... ${CURDIR}/_robot/users-setup.png - ... css=#content - - Go to ${PLONE_URL}/@@usergroup-groupprefs - Capture and crop page screenshot - ... ${CURDIR}/_robot/groups-setup.png - ... css=#content - Go to ${PLONE_URL}/@@usergroup-controlpanel - Capture and crop page screenshot - ... ${CURDIR}/_robot/users-settings.png - ... css=#content - Go to ${PLONE_URL}/@@member-fields - Capture and crop page screenshot - ... ${CURDIR}/_robot/users-fields.png - ... css=#content - -Changing the logo - Go to ${PLONE_URL}/@@site-controlpanel - Highlight field css=#formfield-form-widgets-site_logo - Capture and crop page screenshot - ... ${CURDIR}/_robot/change-logo-in-site-control-panel.png - ... css=#content - ... css=#formfield-form-widgets-site_logo diff --git a/Products/CMFPlone/tests/robot/robodoc/content.robot b/Products/CMFPlone/tests/robot/robodoc/content.robot deleted file mode 100644 index 891622ab6a..0000000000 --- a/Products/CMFPlone/tests/robot/robodoc/content.robot +++ /dev/null @@ -1,334 +0,0 @@ -*** Settings *** - -Resource common.robot - -Suite Setup Common Suite Setup -Suite Teardown Common Suite Teardown - - - -*** Test Cases *** - -Show add collection menu - Go to ${PLONE_URL} - Wait until element is visible - ... css=span.icon-plone-contentmenu-factories - Click element css=span.icon-plone-contentmenu-factories - Wait until element is visible - ... css=#plone-contentmenu-factories li.plone-toolbar-submenu-header - - Mouse over collection - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/adding-collections_add-menu.png - ... css=div.plone-toolbar-container - ... css=#plone-contentmenu-factories ul - - -Select collection criteria - Go to ${PLONE_URL}/++add++Collection - Click element css=div.querystring-criteria-index a - Capture and crop page screenshot - ... ${CURDIR}/_robot/collection-criteria.png - ... css=div.select2-drop-active - -Show add new event menu - Go to ${PLONE_URL} - - Wait until element is visible - ... css=span.icon-plone-contentmenu-factories - Click element css=span.icon-plone-contentmenu-factories - - Wait until element is visible - ... css=#plone-contentmenu-factories li.plone-toolbar-submenu-header - - Mouse over event - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/adding-events_add-menu.png - ... css=div.plone-toolbar-container - ... css=#plone-contentmenu-factories ul - -Show new event add form - Page should contain element event - Click link event - - Wait until element is visible - ... css=#mceu_16-body - Wait until element is visible - ... id=portal-footer - Capture and crop page screenshot - ... ${CURDIR}/_robot/adding-events_add-form.png - ... id=content - -Show add files menu - Go to ${PLONE_URL} - - Wait until element is visible - ... css=span.icon-plone-contentmenu-factories - Click element css=span.icon-plone-contentmenu-factories - Wait until element is visible - ... css=#plone-contentmenu-factories li.plone-toolbar-submenu-header - - Mouse over file - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/adding-files_add-menu.png - ... css=div.plone-toolbar-container - ... css=#plone-contentmenu-factories ul - -Show new file add form - Page should contain element file - Click link file - - Wait until element is visible - ... css=#form-widgets-title - - Capture and crop page screenshot - ... ${CURDIR}/_robot/adding-files_add-form.png - ... css=#content - -Show add new folder menu - Go to ${PLONE_URL} - - Wait until element is visible - ... css=span.icon-plone-contentmenu-factories - Click element css=span.icon-plone-contentmenu-factories - - Wait until element is visible - ... css=#plone-contentmenu-factories li.plone-toolbar-submenu-header - - Mouse over folder - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/adding-folders_add-menu.png - ... css=div.plone-toolbar-container - ... css=#plone-contentmenu-factories ul - -Show new folder add form - Page should contain element folder - Click link folder - - Wait until element is visible - ... css=#form-widgets-IDublinCore-title - - Capture and crop page screenshot - ... ${CURDIR}/_robot/adding-folders_add-form.png - ... css=#content - -Show add new image menu - Go to ${PLONE_URL} - - Wait until element is visible - ... css=span.icon-plone-contentmenu-factories - Click element css=span.icon-plone-contentmenu-factories - - Wait until element is visible - ... css=#plone-contentmenu-factories li.plone-toolbar-submenu-header - - Mouse over image - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/adding-images_add-menu.png - ... css=div.plone-toolbar-container - ... css=#plone-contentmenu-factories ul - -Show new image edit form - Page should contain element image - Click link image - - Wait until element is visible - ... css=#form-widgets-title - - Capture and crop page screenshot - ... ${CURDIR}/_robot/adding-images_add-form.png - ... css=#content - -*** Test Cases *** - -Show add new link menu - Go to ${PLONE_URL} - - Wait until element is visible - ... css=span.icon-plone-contentmenu-factories - Click element css=span.icon-plone-contentmenu-factories - - Wait until element is visible - ... css=#plone-contentmenu-factories li.plone-toolbar-submenu-header - - Mouse over link - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/adding-links_add-menu.png - ... css=div.plone-toolbar-container - ... css=#plone-contentmenu-factories ul - -*** Test Cases *** - -Show new link add form - Page should contain element link - Click link link - - Wait until element is visible - ... css=#form-widgets-IDublinCore-title - - Capture and crop page screenshot - ... ${CURDIR}/_robot/adding-links_add-form.png - ... css=#content - -Show add new content menu - Go to ${PLONE_URL} - - Wait until element is visible - ... css=span.icon-plone-contentmenu-factories - Click element css=span.icon-plone-contentmenu-factories - - Wait until element is visible - ... css=#plone-contentmenu-factories li.plone-toolbar-submenu-header - - Mouse over document - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/adding-content_add-menu.png - ... css=div.plone-toolbar-container - ... css=#plone-contentmenu-factories ul - -Show add new news-item menu - Go to ${PLONE_URL} - - Wait until element is visible - ... css=span.icon-plone-contentmenu-factories - Click element css=span.icon-plone-contentmenu-factories - - Wait until element is visible - ... css=#plone-contentmenu-factories li.plone-toolbar-submenu-header - - Mouse over news-item - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/adding-news-items_add-menu.png - ... css=div.plone-toolbar-container - ... css=#plone-contentmenu-factories ul - -Show new news-item edit form - Page should contain element news-item - Click link news-item - - Wait until element is visible - ... css=#mceu_16-body - - Capture and crop page screenshot - ... ${CURDIR}/_robot/adding-news-items_add-form.png - ... css=#content - -Show add new page menu - Go to ${PLONE_URL} - - Wait until element is visible - ... css=span.icon-plone-contentmenu-factories - Click element css=span.icon-plone-contentmenu-factories - - Wait until element is visible - ... css=#plone-contentmenu-factories li.plone-toolbar-submenu-header - - Mouse over document - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/adding-pages_add-menu.png - ... css=div.plone-toolbar-container - ... css=#plone-contentmenu-factories ul - -Show new page edit form - Page should contain element document - Click link document - - Wait until element is visible - ... css=#mceu_16-body - - Capture and crop page screenshot - ... ${CURDIR}/_robot/adding-pages_add-form.png - ... css=#content - -Show Content restrictions - Go to ${PLONE_URL}/news - - Click link css=#plone-contentmenu-factories a - - Wait until element is visible - ... css=#plone-contentmenu-factories li.plone-toolbar-submenu-header - - Mouse over plone-contentmenu-settings - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/show-restrictions.png - ... css=div.plone-toolbar-container - ... css=#plone-contentmenu-factories ul - -Menu restrictions - Go to ${PLONE_URL}/news/folder_constraintypes_form - - Click element form-widgets-constrain_types_mode - - - Capture and crop page screenshot - ... ${CURDIR}/_robot/menu-restrictions.png - ... css=#main-container - -Show basic content properties tab - Go to ${PLONE_URL} - - Wait until element is visible - ... css=span.icon-plone-contentmenu-factories - Click element css=span.icon-plone-contentmenu-factories - - Wait until element is visible - ... css=#plone-contentmenu-factories li.plone-toolbar-submenu-header - - Page should contain element document - Click link document - Update element style portal-footer display none - - Wait until element is visible - ... css=#form-widgets-IDublinCore-title - - Capture and crop page screenshot - ... ${CURDIR}/_robot/basicpropertiestabs.png - ... css=nav.autotoc-nav - -Show edit page categorization - Click link Categorization - - Capture and crop page screenshot - ... ${CURDIR}/_robot/editpagecategorization.png - ... css=#content-core - -Show content dates settings - Click link Dates - - Capture and crop page screenshot - ... ${CURDIR}/_robot/datessettings.png - ... css=#content-core - -Show content ownershippanel - Click link Ownership - - Capture and crop page screenshot - ... ${CURDIR}/_robot/ownershippanel.png - ... css=#content-core - -Show content settingspanel - Click link Settings - - Capture and crop page screenshot - ... ${CURDIR}/_robot/settingspanel.png - ... css=#content-core \ No newline at end of file diff --git a/Products/CMFPlone/tests/robot/robodoc/managing-working_copy.robot b/Products/CMFPlone/tests/robot/robodoc/managing-working_copy.robot deleted file mode 100644 index 6677e9cb83..0000000000 --- a/Products/CMFPlone/tests/robot/robodoc/managing-working_copy.robot +++ /dev/null @@ -1,114 +0,0 @@ -*** Settings *** - -Resource common.robot - -Suite Setup Common Suite Setup -Suite Teardown Common Suite Teardown - -*** Variables *** - -@{CONFIGURE_PACKAGES} plone.app.iterate -@{APPLY_PROFILES} plone.app.contenttypes:plone-content plone.app.iterate:default -# ${REGISTER_TRANSLATIONS} ${CURDIR}/../../_locales - -*** Test Cases *** - -Show how to checkout - Go to ${PLONE_URL}/front-page - - Wait until element is visible - ... css=span.icon-plone-contentmenu-actions - Click element css=span.icon-plone-contentmenu-actions - Wait until element is visible - ... css=#plone-contentmenu-actions li.plone-toolbar-submenu-header - - Mouse over css=#plone-contentmenu-actions-iterate_checkout - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/working-copy_checkout.png - ... css=#content-header - ... css=div.plone-toolbar-container - -Show checkout notification - Go to ${PLONE_URL}/front-page - - Wait until element is visible - ... css=span.icon-plone-contentmenu-actions - Click element css=span.icon-plone-contentmenu-actions - Wait until element is visible - ... css=#plone-contentmenu-actions li.plone-toolbar-submenu-header - Click link css=#plone-contentmenu-actions-iterate_checkout - Wait until element is visible - ... name=form.button.Checkout - Click button name=form.button.Checkout - Element should be visible css=.portalMessage - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/working-copy_checkout-notification.png - ... css=#content-header - ... css=div.plone-toolbar-container - -Show locked original - Go to ${PLONE_URL}/front-page - - Element should be visible css=#plone-lock-status - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/working-copy_locked.png - ... css=#content-header - ... css=div.plone-toolbar-container - -Show check-in option - Go to ${PLONE_URL}/copy_of_front-page - - Wait until element is visible - ... css=span.icon-plone-contentmenu-actions - Click element css=span.icon-plone-contentmenu-actions - Wait until element is visible - ... css=#plone-contentmenu-actions li.plone-toolbar-submenu-header - - Mouse over css=#plone-contentmenu-actions-iterate_checkin - Update element style portal-footer display none - Capture and crop page screenshot - ... ${CURDIR}/_robot/working-copy_checkin.png - ... css=#content-header - ... css=div.plone-toolbar-container - - Click link css=#plone-contentmenu-actions-iterate_checkin - - Element should be visible css=#checkin_message - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/working-copy_checkin-form.png - ... css=#content-header - ... css=div.plone-toolbar-container - -Show cancel checkout - Go to ${PLONE_URL}/copy_of_front-page - - Wait until element is visible - ... css=span.icon-plone-contentmenu-actions - Click element css=span.icon-plone-contentmenu-actions - Wait until element is visible - ... css=#plone-contentmenu-actions li.plone-toolbar-submenu-header - - Mouse over css=#plone-contentmenu-actions-iterate_checkout_cancel - Update element style portal-footer display none - Capture and crop page screenshot - ... ${CURDIR}/_robot/working-copy_cancel-checkout.png - ... css=#content-header - ... css=div.plone-toolbar-container - - Click link css=#plone-contentmenu-actions-iterate_checkout_cancel - - Element should be visible css=.destructive - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/working-copy_cancel-checkout-form.png - ... css=#content-header - ... css=div.plone-toolbar-container diff --git a/Products/CMFPlone/tests/robot/robodoc/managing_content.robot b/Products/CMFPlone/tests/robot/robodoc/managing_content.robot deleted file mode 100644 index 1d5de8ccb7..0000000000 --- a/Products/CMFPlone/tests/robot/robodoc/managing_content.robot +++ /dev/null @@ -1,198 +0,0 @@ -*** Settings *** - -Resource common.robot - -Suite Setup Common Suite Setup -Suite Teardown Common Suite Teardown - - - -*** Test Cases *** - -Show contentrules - Go to ${PLONE_URL}/@@rules-controlpanel - - Capture and crop page screenshot - ... ${CURDIR}/_robot/contentrules-start.png - ... css=#content - ... css=div.plone-toolbar-container - -add rule - Go to ${PLONE_URL}/+rule/plone.ContentRule - Wait until element is visible - ... css=#formfield-form-widgets-title - Click element css=#form-widgets-title - Input text css=#form-widgets-title Send Email when any Page is Modified - - Click element css=#form-widgets-description - Input text css=#form-widgets-description this rule is meant for folders where new staff is having a go - Click element css=#formfield-form-widgets-event - Select From List By Label id=form-widgets-event Object modified - - - Capture and crop page screenshot - ... ${CURDIR}/_robot/contentrules-add.png - ... css=#content - Click button css=#form-buttons-save - Capture and crop page screenshot - ... ${CURDIR}/_robot/contentrules-conditions.png - ... css=#content - Wait until element is visible - ... name=form.button.Save - Click button name=form.button.Save - - -assign rule - Go to ${PLONE_URL}/news - Click link css=#contentview-contentrules a - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/contentrules-assign.png - ... css=#content - ... css=div.plone-toolbar-container - -Edit folder - Go to ${PLONE_URL} - Click element css=#contentview-folderContents a - Capture and crop page screenshot - ... ${CURDIR}/_robot/foldercontents-cutpaste.png - ... css=#content - -Deleting content - Go to ${PLONE_URL} - Click element css=#contentview-folderContents a - Capture and crop page screenshot - ... ${CURDIR}/_robot/foldercontents-delete.png - ... css=#content - -Edit Page - Go to ${PLONE_URL} - Click element css=#contentview-edit a - Wait until element is visible - ... css=#mceu_16-body - Capture and crop page screenshot - ... ${CURDIR}/_robot/edit-page.png - ... css=#content - -Foldercontents - Go to ${PLONE_URL} - Click element css=#contentview-folderContents a - Capture and crop page screenshot - ... ${CURDIR}/_robot/foldercontents.png - ... css=#content - Capture and crop page screenshot - ... ${CURDIR}/_robot/foldercontents-columns.png - ... css=#btn-attribute-columns - Capture and crop page screenshot - ... ${CURDIR}/_robot/foldercontents-selected.png - ... css=#btn-selected-items - Capture and crop page screenshot - ... ${CURDIR}/_robot/foldercontents-rearrange.png - ... css=#btn-rearrange - Capture and crop page screenshot - ... ${CURDIR}/_robot/foldercontents-rearrange.png - ... css=#btn-rearrange - Capture and crop page screenshot - ... ${CURDIR}/_robot/foldercontents-upload.png - ... css=#btn-upload - Capture and crop page screenshot - ... ${CURDIR}/_robot/foldercontents-cut.png - ... css=#btn-cut - Capture and crop page screenshot - ... ${CURDIR}/_robot/foldercontents-copy.png - ... css=#btn-copy - Capture and crop page screenshot - ... ${CURDIR}/_robot/foldercontents-paste.png - ... css=#btn-paste - Capture and crop page screenshot - ... ${CURDIR}/_robot/foldercontents-delete.png - ... css=#btn-delete - Capture and crop page screenshot - ... ${CURDIR}/_robot/foldercontents-rename.png - ... css=#btn-rename - Capture and crop page screenshot - ... ${CURDIR}/_robot/foldercontents-tags.png - ... css=#btn-tags - Capture and crop page screenshot - ... ${CURDIR}/_robot/foldercontents-state.png - ... css=#btn-workflow - Capture and crop page screenshot - ... ${CURDIR}/_robot/foldercontents-properties.png - ... css=#btn-properties - Capture and crop page screenshot - ... ${CURDIR}/_robot/foldercontents-searchbox.png - ... css=#filter - -Show display menu - Go to ${PLONE_URL} - - Click link css=#plone-contentmenu-display a - - Wait until element is visible - ... css=#plone-contentmenu-display li.plone-toolbar-submenu-header - - - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/display-menu.png - ... css=#content-header - ... css=div.plone-toolbar-container - -Reordering - Go to ${PLONE_URL} - Click element css=#contentview-folderContents a - Capture and crop page screenshot - ... ${CURDIR}/_robot/foldercontents-reorder.png - ... css=#content - -Create sample content for history - Go to ${PLONE_URL} - - ${item} = Create content type=Document - ... id=samplepage title=Sample Page - ... description=The long wait is now over - ... text=

Our new site is built with Plone.

- Fire transition ${item} publish - - Go to ${PLONE_URL}/samplepage - Click element css=#contentview-edit a - Click element css=#form-widgets-IDublinCore-title - Input text css=#form-widgets-IDublinCore-title Hurray - Click element css=#form-widgets-IVersionable-changeNote - Input text css=#form-widgets-IVersionable-changeNote Title should be Hurray, not Sample Page. - Click button css=#form-buttons-save - -Show history - Go to ${PLONE_URL}/samplepage - Click link css=#contentview-history a - Wait until element is visible - ... css=#history-list - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/content-history.png - ... css=#content-header - ... css=div.plone-toolbar-container - -Show portlet management - Go to ${PLONE_URL} - Click link css=#plone-contentmenu-portletmanager a - - Wait until element is visible - ... css=#plone-contentmenu-portletmanager li.plone-toolbar-submenu-header - - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/portlet-menu.png - ... css=div.plone-toolbar-container - ... css=#content-header - -Show right portlets - Go to ${PLONE_URL}/@@topbar-manage-portlets/plone.footerportlets - - Capture and crop page screenshot - ... ${CURDIR}/_robot/portlet-footer.png - ... css=#content diff --git a/Products/CMFPlone/tests/robot/robodoc/personalsettings.robot b/Products/CMFPlone/tests/robot/robodoc/personalsettings.robot deleted file mode 100644 index 7c1edf71a8..0000000000 --- a/Products/CMFPlone/tests/robot/robodoc/personalsettings.robot +++ /dev/null @@ -1,45 +0,0 @@ -*** Settings *** - -Resource common.robot - -Suite Setup Common Suite Setup -Suite Teardown Common Suite Teardown - -*** Test Cases *** - -Show menubar - Go to ${PLONE_URL} - - Click link css=#portal-personaltools a - - Wait until element is visible - ... css=#portal-personaltools li.plone-toolbar-submenu-header - - Mouse over personaltools-preferences - Update element style portal-footer display none - - Capture and crop page screenshot - ... ${CURDIR}/_robot/show-preferences.png - ... css=div.plone-toolbar-container - ... css=li.plone-toolbar-submenu-header - -Show personal preferences - Go to ${PLONE_URL}/@@personal-preferences - - Capture and crop page screenshot - ... ${CURDIR}/_robot/personal-preferences.png - ... css=#main-container - -Show personal information - Go to ${PLONE_URL}/@@personal-information - - Capture and crop page screenshot - ... ${CURDIR}/_robot/personal-information.png - ... css=#main-container - -Show changing password - Go to ${PLONE_URL}/@@change-password - - Capture and crop page screenshot - ... ${CURDIR}/_robot/change-password.png - ... css=#main-container \ No newline at end of file diff --git a/Products/CMFPlone/tests/robot/robodoc/working_with_tinymce.robot b/Products/CMFPlone/tests/robot/robodoc/working_with_tinymce.robot deleted file mode 100644 index 296ba742c0..0000000000 --- a/Products/CMFPlone/tests/robot/robodoc/working_with_tinymce.robot +++ /dev/null @@ -1,79 +0,0 @@ -*** Settings *** - -Resource common.robot - -Suite Setup Common Suite Setup -Suite Teardown Common Suite Teardown - - -*** Test Cases *** - -Create sample content - Go to ${PLONE_URL} - - ${item} = Create content type=Document - ... id=samplepage title=Sample Page - ... description=The long wait is now over - ... text=

Our new site is built with Plone.

- - -Show TinyMCE - Go to ${PLONE_URL}/samplepage - Click element css=#contentview-edit a - Wait until element is visible - ... css=#mceu_16-body - Click element css=#mceu_2-open - Click element css=#mceu_2-open - Capture and crop page screenshot - ... ${CURDIR}/_robot/tinymce.png - ... css=#mceu_16 - -Show TinyMCE image - Go to ${PLONE_URL}/samplepage - Click element css=#contentview-edit a - Wait until element is visible - ... css=#mceu_16-body - Capture and crop page screenshot - ... ${CURDIR}/_robot/tinymce-imgbutton.png - ... css=#mceu_15 - - Click element css=#mceu_15 button - Wait until element is visible - ... css=h2.modal-title - Wait until element is visible - ... css=div.common-controls - - Capture and crop page screenshot - ... ${CURDIR}/_robot/tinymce-imgdialog.png - ... css=div.outer-wrapper - ... css=div.modal-content - -Show TinyMCE insert links - Go to ${PLONE_URL}/samplepage - Click element css=#contentview-edit a - Wait until element is visible - ... css=#mceu_16-body - Capture and crop page screenshot - ... ${CURDIR}/_robot/tinymce-linkbutton.png - ... css=#mceu_14 - - Click element css=#mceu_14 button - Capture and crop page screenshot - ... ${CURDIR}/_robot/tinymce-linkdialog.png - ... css=div.outer-wrapper - ... css=div.modal-content - -Show TinyMCE insert tables - Go to ${PLONE_URL}/samplepage - Click element css=#contentview-edit a - Wait until element is visible - ... css=#mceu_16-body - - Click element css=#mceu_22-open - Click element css=#mceu_42-text - Wait until element is visible - ... css=#mceu_42-text - Mouse over css=#mceu_42-text - Capture and crop page screenshot - ... ${CURDIR}/_robot/tinymce-table.png - ... css=div.outer-wrappper \ No newline at end of file diff --git a/Products/CMFPlone/tests/robot/test_actionmenu.robot b/Products/CMFPlone/tests/robot/test_actionmenu.robot index 58539cb3ec..27a4bd10c2 100644 --- a/Products/CMFPlone/tests/robot/test_actionmenu.robot +++ b/Products/CMFPlone/tests/robot/test_actionmenu.robot @@ -1,24 +1,21 @@ -*** Settings ***************************************************************** +*** Settings *** -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Library Remote ${PLONE_URL}/RobotRemote -Resource keywords.robot +Library Remote ${PLONE_URL}/RobotRemote -Test Setup Run keywords Plone Test Setup -Test Teardown Run keywords Plone Test Teardown +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown +*** Variables *** -*** Variables **************************************************************** +${TITLE} An actionsmenu page +${PAGE_ID} an-actionsmenu-page -${TITLE} An actionsmenu page -${PAGE_ID} an-actionsmenu-page - -*** Test cases *************************************************************** +*** Test Cases *** # --- # Basic Contentactions menu @@ -41,13 +38,13 @@ Scenario: Clicking again collapses action menu and an actionsmenu page When menu link is clicked and menu link is clicked + Then actions menu should not be visible # --- # Switching Contentactions menu by MouseOver # --- -Scenario: Hovering mouse from expanded menu on other menu shows that menu - Pass Execution This functionality needs to be fixed for Plone 5, but let's not make it break the build for now. +Scenario: Click from expanded menu on other menu shows that menu Given a logged-in site administrator and an actionsmenu page When first menu link is clicked @@ -88,95 +85,78 @@ Scenario: Then I should see 'Item(s) pasted.' in the page -*** Keywords ***************************************************************** +*** Keywords *** -# --- GIVEN ------------------------------------------------------------------ +# GIVEN an actionsmenu page - Create content type=Document title=${TITLE} - Go to ${PLONE_URL}/${PAGE_ID} - Wait until page contains An actionsmenu page + Create content type=Document title=${TITLE} + Go To ${PLONE_URL}/${PAGE_ID} + Get Text //body contains An actionsmenu page -# --- WHEN ------------------------------------------------------------------- +# WHEN + +first menu link is clicked + Click xpath=//li[@id='plone-contentmenu-workflow']/a mouse moves to second menu - Click Link xpath=(//div[@class="contentActions"]//a[contains(@class, 'actionMenuHeader')])[2] + Click xpath=//li[@id='plone-contentmenu-actions']/a I click outside of menu - Click Element xpath=//h1 + Click xpath=//h1 workflow link is clicked # store current state - ${OLD_STATE} = Get Text xpath=(//span[contains(@class,'state-')]) - Set Suite Variable ${OLD_STATE} ${OLD_STATE} - Given patterns are loaded - Click Link xpath=//li[@id='plone-contentmenu-workflow']/a - Click Link xpath=(//li[@id='plone-contentmenu-workflow']/ul/li/a)[1] - Page Should Contain Item state changed. - -Open Menu - [Arguments] ${elementId} - Element Should Not Be Visible css=#${elementId} ul.actionMenuContent - Click link css=#${elementId} a.actionMenuHeader - Wait until keyword succeeds 5 1 Element Should Be Visible css=#${elementId} .actionMenuContent - -Open Action Menu - Given patterns are loaded - Click link xpath=//li[@id='plone-contentmenu-actions']/a - Wait until keyword succeeds 5 1 Element Should Be Visible css=#plone-contentmenu-actions .dropdown-menu + ${OLD_STATE}= Get Text xpath=(//span[contains(@class,'state-')]) + Set Suite Variable ${OLD_STATE} ${OLD_STATE} + Click xpath=//li[@id='plone-contentmenu-workflow']/a + Click xpath=(//li[@id='plone-contentmenu-workflow']/ul/li/a)[1] + Get Text //body contains Item state changed. I copy the page Open Action Menu - Click Link css=#plone-contentmenu-actions .actionicon-object_buttons-copy - Page should contain copied + Click xpath=//li[@id='plone-contentmenu-actions']//a[contains(@class,'actionicon-object_buttons-copy')] + Get Text //body contains copied I paste Go to ${PLONE_URL} Open Action Menu - Click Link css=#plone-contentmenu-actions .actionicon-object_buttons-paste + Click xpath=//li[@id='plone-contentmenu-actions']//a[contains(@class,'actionicon-object_buttons-paste')] -# --- THEN ------------------------------------------------------------------- +# THEN delete link exists - Page Should Contain Element xpath=//a[@id='plone-contentmenu-actions-delete'] + Get Element Count xpath=//a[@id='plone-contentmenu-actions-delete'] should be 1 delete link should not be visible - Element Should Not Be Visible xpath=//div[@class='contentActions']//a[@id='plone-contentmenu-actions-delete'] + Wait For Elements State xpath=//li[@id='plone-contentmenu-actions']/a[@id='plone-contentmenu-actions-delete'] hidden menu link is clicked - Given patterns are loaded - Click link xpath=//li[@id='plone-contentmenu-actions']/a + Click xpath=//li[@id='plone-contentmenu-actions']/a -delete link should be visible - Given patterns are loaded - Element Should Be Visible xpath=//div[@class='contentActions']//a[@id='plone-contentmenu-actions-delete'] +second menu should be visible + Get Element States xpath=//li[@id='plone-contentmenu-actions']/ul[contains(@class,'dropdown-menu')] contains visible -actions menu should be visible - Given patterns are loaded - Element Should Be Visible xpath=//li[@id='plone-contentmenu-actions'] +first menu should not be visible + Get Element States xpath=//li[@id='plone-contentmenu-workflow']/ul[contains(@class,'dropdown-menu')] contains hidden -first menu link is clicked - Given patterns are loaded - Click Link xpath=(//div[@class="contentActions"]//a[contains(@class, 'actionMenuHeader')])[1] +actions menu should not be visible + Get Element States xpath=//li[@id='plone-contentmenu-actions']/ul[contains(@class,'dropdown-menu')] contains hidden -I should see '${message}' in the page - Wait until page contains ${message} - Page should contain ${message} +actions menu should be visible + Get Element States xpath=//li[@id='plone-contentmenu-actions']/ul[contains(@class,'dropdown-menu')] contains visible state should have changed - Wait until page contains Item state changed - ${NEW_STATE} = Get Text xpath=(//span[contains(@class,'state-')]) - # Should Not Be Equal ${NEW_STATE} ${OLD_STATE} + ${NEW_STATE}= Get Text xpath=(//span[contains(@class,'state-')]) + Should Not Be Equal As Strings ${NEW_STATE} ${OLD_STATE} -second menu should be visible - Element Should Be Visible xpath=(//li[contains(@class, 'actionMenu')])[2] +I should see '${message}' in the page + Get Text //body contains ${message} -first menu should not be visible - Given patterns are loaded - Wait until keyword succeeds 10s 1s Element Should Not Be Visible xpath=(//li[contains(@class, 'actionMenu')])[1]//li -actions menu should not be visible - Given patterns are loaded - Wait until keyword succeeds 10s 1s Element Should Not Be Visible xpath=//li[@id='plone-contentmenu-actions-delete'] +# DRY +Open Action Menu + Click xpath=//li[@id='plone-contentmenu-actions']/a + actions menu should be visible diff --git a/Products/CMFPlone/tests/robot/test_contentbrowser.robot b/Products/CMFPlone/tests/robot/test_contentbrowser.robot index 577fbf2b32..2025e9af4f 100644 --- a/Products/CMFPlone/tests/robot/test_contentbrowser.robot +++ b/Products/CMFPlone/tests/robot/test_contentbrowser.robot @@ -1,8 +1,6 @@ *** Settings ***************************************************************** -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Resource plone/app/robotframework/browser.robot Resource keywords.robot Library Remote ${PLONE_URL}/RobotRemote @@ -114,121 +112,112 @@ a document I select a related item image via contentbrowser Go to ${PLONE_URL}/${DOCUMENT_ID}/edit # Click the Categorization Tab - Wait For Then Click Element //a[@id="autotoc-item-autotoc-2"] + Click //a[@id="autotoc-item-autotoc-2"] # Click the select button - Wait For Then Click Element //div[@id="formfield-form-widgets-IRelatedItems-relatedItems"]//button + Click //div[@id="formfield-form-widgets-IRelatedItems-relatedItems"]//button # Click third element in first column, that is the "Assets" folder - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[1]/div[contains(@class, "levelItems")]/div[4] + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[1]/div[contains(@class, "levelItems")]/div[4] # Click first element in second column, that is the "Mixed" folder - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[2]/div[contains(@class, "levelItems")]/div[1] + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[2]/div[contains(@class, "levelItems")]/div[1] # Click fifth element in third column, that is the "Files" folder - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[3]/div[contains(@class, "levelItems")]/div[5] + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[3]/div[contains(@class, "levelItems")]/div[5] # Click third element in fourth column, that is the "Images" folder - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[4]/div[contains(@class, "levelItems")]/div[3] + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[4]/div[contains(@class, "levelItems")]/div[3] # Click second element in fifth column, that is the "Image2" Object - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[5]/div[contains(@class, "levelItems")]/div[2] + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[5]/div[contains(@class, "levelItems")]/div[2] # Click the select Button in the Toolbar of column 6 - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[6]/div[contains(@class, "levelToolbar")]/button + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[6]/div[contains(@class, "levelToolbar")]/button I select two related item images via contentbrowser Go to ${PLONE_URL}/${DOCUMENT_ID}/edit # Click the Categorization Tab - Wait For Then Click Element //a[@id="autotoc-item-autotoc-2"] + Click //a[@id="autotoc-item-autotoc-2"] # Click the select button - Wait For Then Click Element //div[@id="formfield-form-widgets-IRelatedItems-relatedItems"]//button + Click //div[@id="formfield-form-widgets-IRelatedItems-relatedItems"]//button # Click third element in first column, that is the "Assets" folder - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[1]/div[contains(@class, "levelItems")]/div[4] + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[1]/div[contains(@class, "levelItems")]/div[4] # Click first element in second column, that is the "Mixed" folder - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[2]/div[contains(@class, "levelItems")]/div[1] + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[2]/div[contains(@class, "levelItems")]/div[1] # Click fifth element in third column, that is the "Files" folder - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[3]/div[contains(@class, "levelItems")]/div[5] + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[3]/div[contains(@class, "levelItems")]/div[5] # Click third element in fourth column, that is the "Images" folder - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[4]/div[contains(@class, "levelItems")]/div[3] + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[4]/div[contains(@class, "levelItems")]/div[3] # now we select two items in a colum via Shift+Click # Click first element in fifth column, that is the "Image1" Object - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[5]/div[contains(@class, "levelItems")]/div[1] + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[5]/div[contains(@class, "levelItems")]/div[1] # Click second element in fifth column with SHIFT, that is the "Image2" Object - Wait For Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[5]/div[contains(@class, "levelItems")]/div[2] - Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[5]/div[contains(@class, "levelItems")]/div[2] SHIFT + Click With Options //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[5]/div[contains(@class, "levelItems")]/div[2] left Shift # Click the select Button in the Toolbar of column 6 - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[6]/div[contains(@class, "levelToolbar")]/button + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[6]/div[contains(@class, "levelToolbar")]/button I set an internal link via contentbrowser Go to ${PLONE_URL}/${DOCUMENT_ID}/edit - Fill text to tinymce editor Susi Sorglos and John Doe - Execute Javascript function selectText() { - ... var iframe_document = document.querySelector(".tox-edit-area iframe").contentDocument; - ... var body = iframe_document.body; - ... var p = body.firstChild; - ... var range = new Range(); - ... range.setStart(p.firstChild, 5); - ... range.setEnd(p.firstChild, 12); - ... iframe_document.getSelection().removeAllRanges(); - ... iframe_document.getSelection().addRange(range); - ... }; selectText(); - Click Button //button[@aria-label='Insert/edit link'] - Wait For Then Click Element css=.linkModal .content-browser-selected-items-wrapper button.btn-primary + Fill text to tinymce editor form.widgets.IRichTextBehavior.text

Susi Sorglos and John Doe

+ Evaluate JavaScript //div[contains(@class, 'tox-edit-area')]//iframe + ... (elem, args) => { + ... const iframe_document = elem.contentDocument; + ... const body = iframe_document.body; + ... const p = body.firstChild; + ... const range = new Range(); + ... range.setStart(p.firstChild, 5); + ... range.setEnd(p.firstChild, 12); + ... iframe_document.getSelection().removeAllRanges(); + ... iframe_document.getSelection().addRange(range); + ... } + ... all_elements=False + Click //button[@aria-label='Insert/edit link'] + Click css=.linkModal .content-browser-selected-items-wrapper button.btn-primary Click item in column 1 3 - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[contains(@class, "preview")]/div[contains(@class, "levelToolbar")]/button - Wait Until Element Is Not Visible //div[contains(@class,"content-browser-position-wrapper")] - Wait For Then Click Element //div[contains(@class, 'modal-footer')]//input[contains(@name, 'insert')] - Wait Until Element Is Not Visible css=.modal-footer input[name="insert"] + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[contains(@class, "preview")]/div[contains(@class, "levelToolbar")]/button + Click //div[contains(@class, 'modal-footer')]//input[contains(@name, 'insert')] I set an image via contentbrowser Go to ${PLONE_URL}/${DOCUMENT_ID}/edit - Fill text to tinymce editor Susi Sorglos and John Doe - Click Button //button[@aria-label='Insert/edit image'] - Wait For Then Click Element css=.linkModal .content-browser-selected-items-wrapper button.btn-primary + Fill text to tinymce editor form.widgets.IRichTextBehavior.text

Susi Sorglos and John Doe

+ Click //button[@aria-label='Insert/edit image'] + Click css=.linkModal .content-browser-selected-items-wrapper button.btn-primary Click item in column 1 3 Click item in column 2 1 Click item in column 3 1 - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[contains(@class, "preview")]/div[contains(@class, "levelToolbar")]/button - Wait Until Element Is Not Visible //div[contains(@class,"content-browser-position-wrapper")] - Wait For Then Click Element //div[contains(@class, 'modal-footer')]//input[contains(@name, 'insert')] - Wait Until Element Is Not Visible css=.modal-footer input[name="insert"] + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[contains(@class, "preview")]/div[contains(@class, "levelToolbar")]/button + Click //div[contains(@class, 'modal-footer')]//input[contains(@name, 'insert')] I upload an image via contentbrowser Go to ${PLONE_URL}/${DOCUMENT_ID}/edit - Fill text to tinymce editor Susi Sorglos and John Doe - Click Button //button[@aria-label="Insert/edit image"] - Wait For Then Click Element css=.linkModal .content-browser-selected-items-wrapper button.btn-primary + Fill text to tinymce editor form.widgets.IRichTextBehavior.text

Susi Sorglos and John Doe

+ Click //button[@aria-label="Insert/edit image"] + Click css=.linkModal .content-browser-selected-items-wrapper button.btn-primary Click item in column 1 3 Click item in column 2 1 - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "toolBar")]/button[contains(@class,"upload")] - Choose File //div[contains(@class,"pat-upload")]//input[@class="dz-hidden-input"] ${PATH_TO_TEST_FILES}/plone-logo.png - Wait For Then Click Element //div[contains(@class,"pat-upload")]//button[contains(@class,"upload-all")] + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "toolBar")]//button[contains(@class,"upload")] + Upload File By Selector //div[contains(@class,"pat-upload")]//input[@class="dz-hidden-input"] ${PATH_TO_TEST_FILES}/plone-logo.png + Click //div[contains(@class,"pat-upload")]//button[contains(@class,"upload-all")] Click item in column 3 3 - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[contains(@class, "preview")]/div[contains(@class, "levelToolbar")]/button - Wait Until Element Is Not Visible //div[contains(@class,"content-browser-position-wrapper")] - Wait For Then Click Element //div[contains(@class, 'modal-footer')]//input[contains(@name, 'insert')] - Wait Until Element Is Not Visible css=.modal-footer input[name="insert"] + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[contains(@class, "preview")]/div[contains(@class, "levelToolbar")]/button + Click //div[contains(@class, 'modal-footer')]//input[contains(@name, 'insert')] I search and select an image via contentbrowser Go to ${PLONE_URL}/${DOCUMENT_ID}/edit - Fill text to tinymce editor Susi Sorglos and John Doe - Click Button //button[@aria-label="Insert/edit image"] - Wait For Then Click Element css=.linkModal .content-browser-selected-items-wrapper button.btn-primary + Fill text to tinymce editor form.widgets.IRichTextBehavior.text

Susi Sorglos and John Doe

+ Click //button[@aria-label="Insert/edit image"] + Click css=.linkModal .content-browser-selected-items-wrapper button.btn-primary Click item in column 1 3 Click item in column 2 1 Click item in column 3 2 Click item in column 4 1 - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "toolBar")]//input[contains(@name,"filter")] - Press Keys //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "toolBar")]//input[contains(@name,"filter")] Anot + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "toolBar")]//input[contains(@name,"filter")] + Type Text //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "toolBar")]//input[contains(@name,"filter")] Anot # here we need a timeout, because the search filter is not so fast like the testbrowser, it looks like a asynch operation - ${speed} Get Selenium Speed - Set Selenium Speed 1 seconds + Sleep 1 Click item in column 5 1 - Set Selenium Speed ${speed} - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[contains(@class, "preview")]/div[contains(@class, "levelToolbar")]/button - Wait Until Element Is Not Visible //div[contains(@class,"content-browser-position-wrapper")] - Wait For Then Click Element //div[contains(@class, 'modal-footer')]//input[contains(@name, 'insert')] - Wait Until Element Is Not Visible css=.modal-footer input[name="insert"] + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[contains(@class, "preview")]/div[contains(@class, "levelToolbar")]/button + Click //div[contains(@class, 'modal-footer')]//input[contains(@name, 'insert')] I save the document - Click Button //button[@id="form-buttons-save"] + Click //button[@id="form-buttons-save"] @@ -257,13 +246,6 @@ the document contain the uploaded image #--- Helper DRY ------------------------------------------------------------- -Fill text to tinymce editor - [arguments] ${text} - Wait Until Element Is Visible css=.tox-edit-area iframe - Select Frame css=.tox-edit-area iframe - Input Text //body[@id="tinymce"] ${text} - UnSelect Frame - image is releated item [arguments] ${xpath} ${imagepath} Element exists ${xpath} src ${imagepath} @@ -274,11 +256,8 @@ rendered textfield contain the image with title Element exists [arguments] ${xpath} ${attr} ${value} - ${element}= Set Variable ${xpath} - Element Should Be Visible ${element} - ${_attr}= Get Element Attribute ${element} ${attr} - Should End With ${_attr} ${value} + Wait for condition Attribute ${xpath} ${attr} should end with ${value} Click item in column [arguments] ${colnumber} ${itemposition} - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[${colnumber}]/div[contains(@class, "levelItems")]/div[${itemposition}] + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[${colnumber}]/div[contains(@class, "levelItems")]/div[${itemposition}] diff --git a/Products/CMFPlone/tests/robot/test_controlpanel_actions.robot b/Products/CMFPlone/tests/robot/test_controlpanel_actions.robot index 8bb0a2513c..1574010f60 100644 --- a/Products/CMFPlone/tests/robot/test_controlpanel_actions.robot +++ b/Products/CMFPlone/tests/robot/test_controlpanel_actions.robot @@ -1,137 +1,139 @@ *** Settings *** -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Library Remote ${PLONE_URL}/RobotRemote +Library Remote ${PLONE_URL}/RobotRemote -Resource keywords.robot +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown -Test Setup Run Keywords Plone test setup -Test Teardown Run keywords Plone test teardown +*** Test Cases *** -*** Test Cases *************************************************************** +# hint: the `Sleep` Statement is needed for the `Disable autologin` and the commit in the DB, it takes a while Scenario: Modify an existing action in Actions Control Panel - Given a logged-in administrator - and the actions control panel - When I modify an action title - Sleep 1 - Then anonymous users can see the new action title + Given a logged-in manager + and the actions control panel + When I modify an action title + and Sleep 1 + Then anonymous users can see the new action title Scenario: Reorder in Actions Control Panel - Given a logged-in administrator - and the actions control panel - When I change the actions order - Sleep 1 - Then anonymous users can see the actions new ordering + Given a logged-in manager + and the actions control panel + When I change the actions order + and Sleep 1 + Then anonymous users can see the actions new ordering Scenario: Create a new action in Actions Control Panel - Given a logged-in administrator - and the actions control panel - When I add a new action - Sleep 1 - Then logged-in users can see the new action + Given a logged-in manager + and the actions control panel + When I add a new action + and Sleep 1 + Then logged-in users can see the new action Scenario: Hide/show an action in Actions Control Panel - Given a logged-in administrator - and the actions control panel - When I hide an action - Sleep 1 - Then anonymous users cannot see the action anymore - Given a logged-in administrator - and the actions control panel - When I unhide the action - Sleep 1 - Then anonymous users can see the action again + Given a logged-in manager + and the actions control panel + When I hide an action + and Sleep 1 + Then anonymous users cannot see the action anymore + Given a logged-in manager + and the actions control panel + When I unhide the action + and Sleep 1 + Then anonymous users can see the action again Scenario: Delete an action in Actions Control Panel - Given a logged-in administrator - and the actions control panel - When I delete an action - Sleep 1 - Then anonymous users cannot see the action anymore + Given a logged-in manager + and the actions control panel + When I delete an action + and Sleep 1 + Then anonymous users cannot see the action anymore -*** Keywords ***************************************************************** +*** Keywords *** -# --- GIVEN ------------------------------------------------------------------ - -a logged-in administrator - Enable autologin as Manager +# GIVEN the actions control panel - Go to ${PLONE_URL}/@@actions-controlpanel - Wait until page contains Portal actions + Go to ${PLONE_URL}/@@actions-controlpanel + Get Text //body contains Portal actions -# --- WHEN ------------------------------------------------------------------- +# WHEN I modify an action title - Click Link css=section:nth-child(3) li:first-child a - Wait until page contains Action Settings - Input Text for sure form.widgets.title A new site map - Wait For Then Click Element css=.pattern-modal-buttons > button + Click //*[@id="content-core"]/section[2]/section/ol/li[1]/form/a + Get Text //body contains Action Settings + Type Text //input[@name="form.widgets.title"] A new site map + Click //div[contains(@class,'pattern-modal-buttons')]/button + I change the actions order - Click Link css=section:nth-child(3) li:first-child a - Wait until page contains Action Settings - Input Text for sure form.widgets.position 3 - Wait For Then Click Element css=.pattern-modal-buttons > button + Click //*[@id="content-core"]/section[2]/section/ol/li[1]/form/a + Get Text //body contains Action Settings + Type Text //input[@name="form.widgets.position"] 3 + Click //div[contains(@class,'pattern-modal-buttons')]/button + I add a new action - Click Link Add new action - Wait until page contains New action - Select From List By Label form.widgets.category:list User actions - Input Text for sure form.widgets.id favorites - Wait For Then Click Element css=.pattern-modal-buttons > button - Wait until page contains favorites - Wait For Then Click Element css=section.category:last-child li:last-child a - Wait until page contains Action Settings - Input Text for sure form.widgets.title My favorites - Input Text for sure form.widgets.url_expr string:\${globals_view/navigationRootUrl}/favorites - Wait For Then Click Element css=.pattern-modal-buttons > button + Click //*[@id="content-core"]/p[@class="addAction"]/a + Get Text //body contains New action + Select Options By //select[@name="form.widgets.category:list"] label User actions + Type Text //input[@name="form.widgets.id"] favorites + Click //div[contains(@class,'pattern-modal-buttons')]/button + Get Text //body contains favorites + Click //*[@id="content-core"]/section[6]/section/ol/li[8]/form/a + Get Text //body contains Action Settings + Type Text //input[@name="form.widgets.title"] My favorites + Type Text //input[@name="form.widgets.url_expr"] string:\${globals_view/navigationRootUrl}/favorites + Click //div[contains(@class,'pattern-modal-buttons')]/button -I delete an action - Click Button css=section:nth-child(3) li:first-child button[name=delete] - Handle alert I hide an action - Click Button css=section:nth-child(3) li:first-child button[name=hide] + Click //*[@id="content-core"]/section[2]/section/ol/li[1]/form/button[@name="hide"] + I unhide the action - Click Button css=section:nth-child(3) li:first-child button[name=show] + Click //*[@id="content-core"]/section[2]/section/ol/li[1]/form/button[@name="show"] + -# --- THEN ------------------------------------------------------------------- +I delete an action + Handle Future Dialogs action=accept + Click //*[@id="content-core"]/section[2]/section/ol/li[1]/form/button[@name="delete"] + + +# THEN anonymous users can see the new action title - Disable autologin - Go to ${PLONE_URL} - Wait until page contains Accessibility - Page Should Contain A new site map + Disable autologin + Go to ${PLONE_URL} + Get Text //body contains A new site map + anonymous users can see the actions new ordering - Disable autologin - Go to ${PLONE_URL} - Wait until page contains Accessibility - Page Should Contain Element xpath=//div[@id='portal-footer']//ul/li[1]/a/span[contains(text(), 'Accessibility')] - Page Should Contain Element xpath=//div[@id='portal-footer']//ul/li[3]/a/span[contains(text(), 'Site Map')] + Disable autologin + Go to ${PLONE_URL} + Get Element //div[@id='portal-footer']//ul/li[1]/a/span[contains(text(), 'Accessibility')] + Get Element //div[@id='portal-footer']//ul/li[3]/a/span[contains(text(), 'Site Map')] + logged-in users can see the new action - Disable autologin - Enable autologin as Contributor - Go to ${PLONE_URL} - Wait until page contains Accessibility - Page Should Contain My favorites + Disable autologin + Enable autologin as Contributor + Go to ${PLONE_URL} + Get Element Count //*[@id="personaltools-favorites"] should be 1 + Get Text //*[@id="personaltools-favorites"] contains My favorites + anonymous users cannot see the action anymore - Disable autologin - Go to ${PLONE_URL} - Wait until page contains Accessibility - Page Should Not Contain Site Map + Disable autologin + Go to ${PLONE_URL} + Get Text //body not contains Site Map + anonymous users can see the action again - Disable autologin - Go to ${PLONE_URL} - Wait until page contains Accessibility - Page Should Contain Site Map + Disable autologin + Go to ${PLONE_URL} + Get Text //body contains Site Map \ No newline at end of file diff --git a/Products/CMFPlone/tests/robot/test_controlpanel_editing.robot b/Products/CMFPlone/tests/robot/test_controlpanel_editing.robot index 3d997f0899..66ac2ed25f 100644 --- a/Products/CMFPlone/tests/robot/test_controlpanel_editing.robot +++ b/Products/CMFPlone/tests/robot/test_controlpanel_editing.robot @@ -1,105 +1,109 @@ -*** Settings ***************************************************************** +*** Settings *** -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Library Remote ${PLONE_URL}/RobotRemote -Resource keywords.robot +Library Remote ${PLONE_URL}/RobotRemote -Test Setup Run keywords Plone Test Setup -Test Teardown Run keywords Plone Test Teardown +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown +*** Variables *** -*** Test Cases *************************************************************** +${PAGE_TITLE} Doc +${PAGE_ID} doc + +*** Test Cases *** Scenario: Disable Standard Editor in the Editing Control Panel - Given a logged-in site administrator - and the editing control panel - When I disable the standard editor -# XXX: This test fails because the TinyMCE 4 widget ignores both the old and -# the new setting. -# Then I do not see the standard editor when I create a document + Given a logged-in site administrator + and the editing control panel + When I disable the standard editor + Then I do not see the standard editor when I create a document + + When I go to the editing control panel + and I enable the standard editor + Then I see the standard editor when I create a document + Scenario: Enable Link Integrity Check in the Editing Control Panel - Given a logged-in site administrator - and the editing control panel - When I enable link integrity checks -# XXX: Enabling referencefield behaviour for Documents to make this test work makes other tests fail. -# See https://github.com/plone/Products.CMFPlone/issues/255 for details. -# Then I will be warned if I remove a linked document + Given a logged-in site administrator + and the editing control panel + When I enable link integrity checks + # Linkintegrity checks are in `test_linkintegrity.robot` Scenario: Enable Lock on Through The Web in the Editing Control Panel - Given a logged-in site administrator - and the editing control panel - When I enable lock on through the web -# XXX: This test is not finished yet. -# Then I will see a warning if a document is edited by another user + Given a logged-in site administrator + and the editing control panel + and a document '${PAGE_TITLE}' + When I enable lock on through the web + and I edit the document + Then I will see a warning if a document is edited by another user -*** Keywords ***************************************************************** +*** Keywords *** -# --- GIVEN ------------------------------------------------------------------ +# GIVEN -a logged-in site administrator - Enable autologin as Site Administrator +the editing control panel + Go to ${PLONE_URL}/@@editing-controlpanel -a logged-in manager - Enable autologin as Manager -a document '${title}' - Create content type=Document id=doc title=${title} +# WHEN -the editing control panel - Go to ${PLONE_URL}/@@editing-controlpanel - Wait until page contains Editing Settings +I disable the standard editor + Select Options By //select[@name="form.widgets.default_editor:list"] label None + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved -# --- WHEN ------------------------------------------------------------------- -I disable the standard editor - Select from list by label name=form.widgets.default_editor:list None - Click Button Save - Wait until page contains Changes saved +I enable the standard editor + Select Options By //select[@name="form.widgets.default_editor:list"] label TinyMCE + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved + + +I go to the editing control panel + Go to ${PLONE_URL}/@@editing-controlpanel + I enable link integrity checks - Select Checkbox name=form.widgets.enable_link_integrity_checks:list - Click Button Save - Wait until page contains Changes saved + Check Checkbox //input[@name="form.widgets.enable_link_integrity_checks:list"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved + I enable lock on through the web - Select Checkbox name=form.widgets.lock_on_ttw_edit:list - Click Button Save - Wait until page contains Changes saved + Check Checkbox //input[@name="form.widgets.lock_on_ttw_edit:list"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved +I edit the document + Go to ${PLONE_URL}/${PAGE_ID} + Click //li[@id="contentview-edit"]/a + Get Text //body contains Edit Page -# --- THEN ------------------------------------------------------------------- -I can see an id field in the settings tab when I create a document - Go To ${PLONE_URL}/++add++Document - Given patterns are loaded - Execute Javascript $('#form-widgets-IDublinCore-title').val('My Document'); return 0; - Click Link Settings - Page should contain element name=form.widgets.IShortName.id - Input Text name=form.widgets.IShortName.id this-is-my-custom-short-name - Click Button Save - Wait until page contains Item created - Location should be ${PLONE_URL}/this-is-my-custom-short-name/view +# THEN I do not see the standard editor when I create a document - Go To ${PLONE_URL}/++add++Document - Wait until page contains Add Page - Page should not contain element css=.mce-tinymce - -I will be warned if I remove a linked document - ${doc1_uid}= Create content id=doc1 type=Document - ${doc2_uid}= Create content id=doc2 type=Document - Set field value uid=${doc1_uid} field=text field_type=text/html value=

link

- Go To ${PLONE_URL}/doc2/delete_confirmation - Wait until page contains doc2 - Click Button Delete - Wait until page contains Potential link breakage + Go To ${PLONE_URL}/++add++Document + Wait For Condition Classes //body contains patterns-loaded + Get Element Count //*[@id="formfield-form-widgets-IRichTextBehavior-text"]/div[@role="application"] should be 0 + Get Element States //textarea[@name="form.widgets.IRichTextBehavior.text"] contains visible + + +I see the standard editor when I create a document + Go To ${PLONE_URL}/++add++Document + Wait For Condition Classes //body contains patterns-loaded + Get Element Count //*[@id="formfield-form-widgets-IRichTextBehavior-text"]/div[@role="application"] should be 1 + Get Element States //textarea[@name="form.widgets.IRichTextBehavior.text"] contains hidden I will see a warning if a document is edited by another user - ${doc1_uid}= Create content id=doc1 type=Document + Disable autologin + Enable autologin as Contributor Reviewer Manager + New Page ${PLONE_URL}/${PAGE_ID} + Get Text //body contains Lock + Get Element Count //input[@value="Unlock"] should be 1 diff --git a/Products/CMFPlone/tests/robot/test_controlpanel_filter.robot b/Products/CMFPlone/tests/robot/test_controlpanel_filter.robot index bcdf3307aa..9d48ebb955 100644 --- a/Products/CMFPlone/tests/robot/test_controlpanel_filter.robot +++ b/Products/CMFPlone/tests/robot/test_controlpanel_filter.robot @@ -1,160 +1,162 @@ -# ============================================================================ -# Tests for the Plone Filter Control Panel -# ============================================================================ -# -# $ bin/robot-server --reload-path src/Products.CMFPlone/Products/CMFPlone/ Products.CMFPlone.testing.PRODUCTS_CMFPLONE_ROBOT_TESTING -# -# $ bin/robot src/Products.CMFPlone/Products/CMFPlone/tests/robot/test_controlpanel_filter.robot -# -# ============================================================================ - *** Settings *** -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot - -Library Remote ${PLONE_URL}/RobotRemote -Library Collections +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Resource keywords.robot +Library Remote ${PLONE_URL}/RobotRemote -Test Setup Run keywords Plone Test Setup -Test Teardown Run keywords Plone Test Teardown +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown -*** Test Cases *************************************************************** +*** Test Cases *** Scenario: Configure Filter Control Panel to filter out nasty tags - Given a logged-in site administrator - and the filter control panel - When I add 'h1' to the nasty tags list and remove it from the valid tags list - Then the 'h1' tag is filtered out when a document is saved + Given a logged-in site administrator + and the filter control panel + When I add 'h1' to the nasty tags list and remove it from the valid tags list + Then the 'h1' tag is filtered out when a document is saved Scenario: Configure Filter Control Panel to strip out tags - Given a logged-in site administrator - and the filter control panel - When I remove 'h1' from the valid tags list - Then the 'h1' tag is stripped when a document is saved + Given a logged-in site administrator + and the filter control panel + When I remove 'h1' from the valid tags list + Then the 'h1' tag is stripped when a document is saved Scenario: Configure Filter Control Panel to allow custom tags - Given a logged-in site administrator - and the filter control panel - When I add 'foobar' to the valid tags list - Then the 'foobar' tag is preserved when a document is saved + Given a logged-in site administrator + and the filter control panel + When I add 'foobar' to the valid tags list + Then the 'foobar' tag is preserved when a document is saved Scenario: Configure Filter Control Panel to allow custom attributes - Given a logged-in site administrator - and the filter control panel - When I add 'foo-foo' to the custom attributes list - Then the 'foo-foo' attribute is preserved when a document is saved + Given a logged-in site administrator + and the filter control panel + When I add 'foo-foo' to the custom attributes list + Then the 'foo-foo' attribute is preserved when a document is saved Scenario: Filter Control Panel displays information regarding caching when saved - Given a logged-in site administrator - and the filter control panel - When I save the form - Then success message should contain information regarding caching - + Given a logged-in site administrator + and the filter control panel + When I save the form + Then success message should contain information regarding caching -*** Keywords ***************************************************************** -# --- GIVEN ------------------------------------------------------------------ +*** Keywords *** -a logged-in site administrator - Enable autologin as Site Administrator +# GIVEN the filter control panel - Go to ${PLONE_URL}/@@filter-controlpanel - Wait until page contains HTML Filtering Settings - -Input RichText - [Arguments] ${input} - # Sleep to avoid random failures where the text is not actually set. - # This warning from the robotframework docs might be the cause: - # "Starting from Robot Framework 2.5 errors caused by invalid syntax, timeouts, - # or fatal exceptions are not caught by this keyword." - # See https://robotframework.org/robotframework/2.6.1/libraries/BuiltIn.html#Wait%20Until%20Keyword%20Succeeds - Sleep 1 - Wait until keyword succeeds 5s 1s Set and Check TinyMCE Content ${input} - -Set and Check TinyMCE Content - [Arguments] ${input} - # Simply check if tinyMCE.getContent() isn't empty when we set an input - Execute Javascript tinyMCE.activeEditor.setContent('${input}'); - Sleep 0.5 - ${check}= Execute Javascript return tinyMCE.activeEditor.getContent(); - Should not be empty ${check} - - -# --- WHEN ------------------------------------------------------------------- + Go to ${PLONE_URL}/@@filter-controlpanel + +# WHEN I add '${tag}' to the nasty tags list and remove it from the valid tags list - Input Text name=form.widgets.nasty_tags ${tag} - Remove line from textarea form.widgets.valid_tags ${tag} - I save the form + Type Text //textarea[@name="form.widgets.nasty_tags"] ${tag} + Remove line from textarea form.widgets.valid_tags ${tag} + I save the form + + +I save the form + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved + I remove '${tag}' from the valid tags list - Remove line from textarea form.widgets.valid_tags ${tag} - I save the form + Remove line from textarea form.widgets.valid_tags ${tag} + I save the form + I add '${tag}' to the valid tags list - Input Text name=form.widgets.valid_tags ${tag} - I save the form - Page Should Contain ${tag} + Type Text //textarea[@name="form.widgets.valid_tags"] ${tag} + I save the form + Get Text //textarea[@name="form.widgets.valid_tags"] contains ${tag} + I add '${tag}' to the custom attributes list - Input Text name=form.widgets.custom_attributes ${tag} - I save the form - Page Should Contain ${tag} + Type Text //textarea[@name="form.widgets.custom_attributes"] ${tag} + I save the form + Get Text //textarea[@name="form.widgets.custom_attributes"] contains ${tag} -I save the form - Wait For Then Click Element form.buttons.save - Wait until page contains Changes saved +# THEN +the 'h1' tag is filtered out when a document is saved -# --- THEN ------------------------------------------------------------------- + ${doc1_uid}= Create content + ... id=doc1 + ... title=Document 1 + ... type=Document + Go To ${PLONE_URL}/doc1/edit + Fill text to tinymce editor form.widgets.IRichTextBehavior.text

heading

Spanish Inquisition

+ Mark text heading as h1 in tinymce editor + I save the form + Get Text //body contains Spanish Inquisition + Get Text //body not contains heading -the 'h1' tag is filtered out when a document is saved - ${doc1_uid}= Create content id=doc1 title=Document 1 type=Document - Go To ${PLONE_URL}/doc1/edit - patterns are loaded - Input RichText

h1 heading

Spanish Inquisition

- I save the form - # We check that some standard text is there, before checking the interesting part. - # If the standard text is invisible, then something completely different is wrong. - # I see tests randomly fail where the safe html transform is not even called. - # In fact, no text is saved. Maybe some timing problem. - # I suspect the Input RichText keyword, which is why I added Sleep in there. - Page should contain Spanish Inquisition - Page should not contain heading the 'h1' tag is stripped when a document is saved - ${doc1_uid}= Create content id=doc1 title=Document 1 type=Document - Go To ${PLONE_URL}/doc1/edit - patterns are loaded - Input RichText

h1 heading

Spanish Inquisition

- I save the form - Page should contain Spanish Inquisition - Page should contain heading - Page Should Contain Element //div[@id='content-core']//h1 limit=0 message=h1 should have been stripped out + + ${doc1_uid}= Create content + ... id=doc1 + ... title=Document 1 + ... type=Document + Go To ${PLONE_URL}/doc1/edit + Fill text to tinymce editor form.widgets.IRichTextBehavior.text

heading

Spanish Inquisition

+ Mark text heading as h1 in tinymce editor + I save the form + Get Text //body contains Spanish Inquisition + Get Text //body contains heading + Get Element Count //div[@id='content-core']//h1 should be 0 message=h1 should have been stripped out + the '${tag}' tag is preserved when a document is saved - ${doc1_uid}= Create content id=doc1 title=Document 1 type=Document - Go To ${PLONE_URL}/doc1/edit - patterns are loaded - Input RichText <${tag}>lorem ipsum

Spanish Inquisition

- I save the form - Page should contain Spanish Inquisition - Page Should Contain Element //div[@id='content-core']//${tag} limit=1 message=the ${tag} tag should have been preserved + + ${doc1_uid}= Create content + ... id=doc1 + ... title=Document 1 + ... type=Document + Go To ${PLONE_URL}/doc1/edit + Fill text to tinymce editor form.widgets.IRichTextBehavior.text <${tag}>lorem ipsum

Spanish Inquisition

+ I save the form + Get Text //body contains Spanish Inquisition + Get Element Count //div[@id='content-core']//${tag} should be 1 message=the ${tag} tag should have been preserved + the '${attribute}' attribute is preserved when a document is saved - ${doc1_uid}= Create content id=doc1 title=Document 1 type=Document - Go To ${PLONE_URL}/doc1/edit - patterns are loaded - Input RichText lorem ipsum

Spanish Inquisition

- I save the form - Page should contain Spanish Inquisition - Page Should Contain Element //span[@${attribute}] limit=1 message=the ${attribute} tag should have been preserved + + ${doc1_uid}= Create content + ... id=doc1 + ... title=Document 1 + ... type=Document + Go To ${PLONE_URL}/doc1/edit + Fill text to tinymce editor form.widgets.IRichTextBehavior.text lorem ipsum

Spanish Inquisition

+ I save the form + Get Text //body contains Spanish Inquisition + Get Element Count //span[@${attribute}] should be 1 message=the ${attribute} tag should have been preserved + success message should contain information regarding caching - Element Should Contain css=.alert-warning HTML generation is heavily cached across Plone. You may have to edit existing content or restart your server to see the changes. + Get Text //*[contains(@class,"alert-warning")] contains HTML generation is heavily cached across Plone. You may have to edit existing content or restart your server to see the changes. + + +# DRY + +Mark text heading as h1 in tinymce editor + + # select the text `heading` via javascript + Evaluate JavaScript //div[contains(@class, 'tox-edit-area')]//iframe + ... (elem, args) => { + ... let iframe_document = elem.contentDocument; + ... let body = iframe_document.body; + ... let p = body.firstChild; + ... let range = new Range(); + ... range.setStart(p.firstChild, 0); + ... range.setEnd(p.firstChild, 7); + ... iframe_document.getSelection().removeAllRanges(); + ... iframe_document.getSelection().addRange(range); + ... } + ... all_elements=False + # here we use the editor to format the text `heading` with h1 + Click //button[@aria-label="Format Paragraph"] + Hover //div[@aria-label="Headers"] + Click //h1[contains(text(), "Header 1")] diff --git a/Products/CMFPlone/tests/robot/test_controlpanel_language.robot b/Products/CMFPlone/tests/robot/test_controlpanel_language.robot index 163081cffa..f7f9c265ad 100644 --- a/Products/CMFPlone/tests/robot/test_controlpanel_language.robot +++ b/Products/CMFPlone/tests/robot/test_controlpanel_language.robot @@ -1,51 +1,43 @@ -*** Settings ***************************************************************** +*** Settings *** -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Library Remote ${PLONE_URL}/RobotRemote +Library Remote ${PLONE_URL}/RobotRemote -Resource keywords.robot +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown -Test Setup Run keywords Plone Test Setup -Test Teardown Run keywords Plone Test Teardown - - -*** Test Cases *************************************************************** +*** Test Cases *** Scenario: Set Site Language in the Language Control Panel - Given a logged-in site administrator - and the language control panel - When I set the site language to German - Then the Plone user interface is in German - + Given a logged-in site administrator + and the language control panel + When I set the site language to German + Then the Plone user interface is in German -*** Keywords ***************************************************************** -# --- GIVEN ------------------------------------------------------------------ +*** Keywords *** -a logged-in site administrator - Enable autologin as Site Administrator +# GIVEN the language control panel - Go to ${PLONE_URL}/@@language-controlpanel - Wait until page contains Language Settings + Go to ${PLONE_URL}/@@language-controlpanel + Get Text //body contains Language Settings -# --- WHEN ------------------------------------------------------------------- +# WHEN I set the site language to German - Select From List By Label form.widgets.default_language:list Deutsch - Select From List By Label form.widgets.available_languages.from Deutsch - Click Button → - Click Button Save - Wait until page contains Changes saved + Select Options By //select[@name="form.widgets.default_language:list"] label Deutsch + Select Options By //select[@name="form.widgets.available_languages.from"] label Deutsch + Click //button[@value="→"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved. -# --- THEN ------------------------------------------------------------------- +# THEN the Plone user interface is in German - Go to ${PLONE_URL} - Wait until page contains Lizensiert unter der - Page should contain Lizensiert unter der + Go to ${PLONE_URL} + Get Text //body contains Lizensiert unter der diff --git a/Products/CMFPlone/tests/robot/test_controlpanel_markup.robot b/Products/CMFPlone/tests/robot/test_controlpanel_markup.robot index d629df48a9..9b43a45cec 100644 --- a/Products/CMFPlone/tests/robot/test_controlpanel_markup.robot +++ b/Products/CMFPlone/tests/robot/test_controlpanel_markup.robot @@ -1,70 +1,67 @@ -Documentation -... $ bin/robot-server Products.CMFPlone.testing.PRODUCTS_CMFPLONE_ROBOT_TESTING -... $ bin/robot test_controlpanel_markup.robot +*** Settings *** -*** Settings ***************************************************************** +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Library Remote ${PLONE_URL}/RobotRemote -Library Remote ${PLONE_URL}/RobotRemote +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown -Resource keywords.robot -Test Setup Run keywords Plone Test Setup -Test Teardown Run keywords Plone Test Teardown - - -*** Test Cases *************************************************************** +*** Test Cases *** Scenario: Change Default Markup Types in the Markup Control Panel - Given a logged-in site administrator - and the markup control panel - When I set allowed types to "text/restructured" -#TODO: Waiting on richtext pattern to support this -# Then I do not see the standard editor when I create a document + Given a logged-in site administrator + and the markup control panel + When I set allowed types to text/restructured + + #TODO: Waiting on richtext pattern to support this + #Then I do not see the standard editor when I create a document Scenario: Set Default Markup to be Restructured Text - Given a logged-in site administrator - and the markup control panel - When I set the default type to "text/restructured" -#TODO: Waiting on richtext pattern to support this -# Then I do not see the standard editor when I create a document + Given a logged-in manager + and the markup control panel + When I set the default type to text/restructured -*** Keywords ***************************************************************** + #TODO: Waiting on richtext pattern to support this + #Then I do not see the standard editor when I create a document -# --- GIVEN ------------------------------------------------------------------ +*** Keywords *** -a document '${title}' - Create content type=Document id=doc title=${title} +# GIVEN the markup control panel - Go to ${PLONE_URL}/@@markup-controlpanel - Wait until page contains Markup Settings + Go to ${PLONE_URL}/@@markup-controlpanel + Get Text //body contains Markup Settings # --- WHEN ------------------------------------------------------------------- -I set allowed types to "${type}" - with the label ${type} Select Checkbox - with the label text/html UnSelect Checkbox - with the label text/x-web-textile UnSelect Checkbox - Click Button Save - Wait until page contains Changes saved - Checkbox Should Be Selected ${type} - Checkbox Should Not Be Selected text/html - Checkbox Should Not Be Selected text/x-web-textile +I set allowed types to + [Arguments] ${type} -I set the default type to "${type}" - Select from list by label name=form.widgets.default_type:list ${type} - Click Button Save - Wait until page contains Changes saved + Check Checkbox //input[@name="form.widgets.allowed_types:list" and @value="${type}"] + Uncheck Checkbox //input[@name="form.widgets.allowed_types:list" and @value="text/html"] + Uncheck Checkbox //input[@name="form.widgets.allowed_types:list" and @value="text/x-web-textile"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved. -I disable the standard editor - Select from list by label name=form.widgets.default_editor:list None - Click Button Save - Wait until page contains Changes saved + Get Element States //input[@name="form.widgets.allowed_types:list" and @value="${type}"] contains checked + Get Element States //input[@name="form.widgets.allowed_types:list" and @value="text/html"] not contains checked + Get Element States //input[@name="form.widgets.allowed_types:list" and @value="text/x-web-textile"] not contains checked + +I set the default type to + [Arguments] ${type} + + Select Options By //select[@name="form.widgets.default_type:list"] value ${type} + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved. + +# I disable the standard editor +# Select from list by label name=form.widgets.default_editor:list None +# Click Button Save +# Wait until page contains Changes saved # --- THEN ------------------------------------------------------------------- @@ -80,22 +77,7 @@ Then I can see only "${type}" when creating a document Wait until page contains Item created Location should be ${PLONE_URL}/this-is-my-custom-short-name/view -I do not see the standard editor when I create a document - Go To ${PLONE_URL}/++add++Document - Wait until page contains Add Page - Page should not contain element css=.mce-tinymce - -# --- Helpers ----------------------------------------------------------------- - -With the label - [arguments] ${title} ${extra_keyword} @{list} - ${for}= label "${title}" - Run Keyword ${extra_keyword} id=${for} @{list} - -label "${title}" - [Return] ${for} - ${for}= Get Element Attribute xpath=//label[contains(., "${title}")] for - -label2 "${title}" - [Return] ${for} - ${for}= Get Element Attribute xpath=//label[contains(., "${title}")]//input +# I do not see the standard editor when I create a document +# Go To ${PLONE_URL}/++add++Document +# Pause +# Page should not contain element css=.mce-tinymce diff --git a/Products/CMFPlone/tests/robot/test_controlpanel_navigation.robot b/Products/CMFPlone/tests/robot/test_controlpanel_navigation.robot index c277aedf52..f40e8b751c 100644 --- a/Products/CMFPlone/tests/robot/test_controlpanel_navigation.robot +++ b/Products/CMFPlone/tests/robot/test_controlpanel_navigation.robot @@ -1,115 +1,115 @@ -*** Settings ***************************************************************** +*** Settings *** -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Library Remote ${PLONE_URL}/RobotRemote +Library Remote ${PLONE_URL}/RobotRemote -Resource keywords.robot +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown -Test Setup Run keywords Plone Test Setup -Test Teardown Run keywords Plone Test Teardown - -*** Test Cases *************************************************************** +*** Test Cases *** Scenario: Disable Generate Tabs in the Navigation Control Panel - Given a logged-in site administrator - and a document 'My Document' - and the navigation control panel - When I disable generate tabs - Then the document 'My Document' does not show up in the navigation + Given a logged-in site administrator + and a document 'My Document' + and the navigation control panel + When I disable generate tabs + Then the document 'My Document' does not show up in the navigation Scenario: Enable Folderish Tabs in the Navigation Control Panel - Given a logged-in site administrator - and a document 'My Document' - and the navigation control panel - When I disable non-folderish tabs - Then the document 'My Document' does not show up in the navigation + Given a logged-in site administrator + and a document 'My Document' + and the navigation control panel + When I disable non-folderish tabs + Then the document 'My Document' does not show up in the navigation Scenario: Filter Navigation By Displayed Types in the Navigation Control Panel - Given a logged-in site administrator - and a document 'My Document' - and the navigation control panel - When I remove 'Document' from the displayed types list - Then the document 'My Document' does not show up in the navigation - and the document 'My Document' does not show up in the sitemap + Given a logged-in site administrator + and a document 'My Document' + and the navigation control panel + When I remove 'Document' from the displayed types list + Then the document 'My Document' does not show up in the navigation + and the document 'My Document' does not show up in the sitemap -#Scenario: Filter Navigation By Workflow States in the Navigation Control Panel -# Given a logged-in site administrator -# and a published document 'My Document' -# and a private document 'My Internal Document' -# and the navigation control panel -# When I enable filtering by workflow states -# and I choose to show 'published' items -# and I choose to not show 'private' items -# Then the document 'My Document' shows up in the navigation -# and the document 'My Internal Document' does not show up in the navigation +Scenario: Filter Navigation By Workflow States in the Navigation Control Panel + Given a logged-in site administrator + and a published document 'My Document' + and a private document 'My Internal Document' + and the navigation control panel + When I enable filtering by workflow states + and I choose to show 'published' items + and I choose to not show 'private' items + Then the document 'My Document' shows up in the navigation + and the document 'My Internal Document' does not show up in the navigation -*** Keywords ***************************************************************** +*** Keywords *** -# --- GIVEN ------------------------------------------------------------------ +# GIVEN the navigation control panel - Go to ${PLONE_URL}/@@navigation-controlpanel - Wait until page contains Navigation Settings + Go to ${PLONE_URL}/@@navigation-controlpanel + Get Text //body contains Navigation Settings a published document '${title}' - ${uid}= a document '${title}' - Fire transition ${uid} publish + ${uid}= Create content + ... type=Document + ... id=doc + ... title=${title} + Fire transition ${uid} publish a private document '${title}' - a document '${title}' + Create content + ... type=Document + ... id=doc1 + ... title=${title} -# --- WHEN ------------------------------------------------------------------- +# WHEN I disable generate tabs - Unselect Checkbox form.widgets.generate_tabs:list - Wait For Then Click Element form.buttons.save - Wait until page contains Changes saved + Uncheck Checkbox //input[@name="form.widgets.generate_tabs:list"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved. I disable non-folderish tabs - Unselect Checkbox xpath=//input[@value='Document'] - Wait For Then Click Element form.buttons.save - Wait until page contains Changes saved + Uncheck Checkbox //input[@value='Document'] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved. I remove '${portal_type}' from the displayed types list - Unselect Checkbox xpath=//input[@value='Document'] - Wait For Then Click Element form.buttons.save - Wait until page contains Changes saved + Uncheck Checkbox //input[@value='Document'] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved. I enable filtering by workflow states - Select Checkbox name=form.widgets.filter_on_workflow:list - Wait For Then Click Element form.buttons.save - Wait until page contains Changes saved + Check Checkbox //input[@name="form.widgets.filter_on_workflow:list"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved. I choose to show '${workflow_state}' items - Select Checkbox xpath=//input[@value='${workflow_state}'] - Wait For Then Click Element form.buttons.save - Wait until page contains Changes saved + Check Checkbox //input[@value='${workflow_state}'] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved. I choose to not show '${workflow_state}' items - Unselect Checkbox xpath=//input[@value='${workflow_state}'] - Click Button Save - Wait until page contains Changes saved + Uncheck Checkbox //input[@value='${workflow_state}'] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved. -# --- THEN ------------------------------------------------------------------- +# THEN the document '${title}' shows up in the navigation - Go to ${PLONE_URL} - Wait until page contains Powered by Plone - Page Should Contain Element //ul[@id='portal-globalnav']/li/a[contains(text(), '${title}')] limit=1 message=The global navigation should have contained the item '${title}' + Go to ${PLONE_URL} + Get Element Count //ul[@id='portal-globalnav']/li/a[contains(text(), '${title}')] should be 1 message=The global navigation should have contained the item '${title}' the document '${title}' does not show up in the navigation - Go to ${PLONE_URL} - Wait until page contains Powered by Plone - Page Should Contain Element //ul[@id='portal-globalnav']/li/a[contains(text(), '${title}')] limit=0 message=The global navigation should not have contained the item '${title}' + Go to ${PLONE_URL} + Get Element Count //ul[@id='portal-globalnav']/li/a[contains(text(), '${title}')] should be 0 message=The global navigation should not have contained the item '${title}' the document '${title}' does not show up in the sitemap - Go to ${PLONE_URL}/sitemap - Wait until page contains Powered by Plone - Page Should Contain Element //ul[@id='portal-sitemap']/li/a/span[contains(text(), '${title}')] limit=0 message=The sitemap should not have contained the item '${title}' + Go to ${PLONE_URL}/sitemap + Get Element Count //ul[@id='portal-sitemap']/li/a/span[contains(text(), '${title}')] should be 0 message=The sitemap should not have contained the item '${title}' diff --git a/Products/CMFPlone/tests/robot/test_controlpanel_redirection.robot b/Products/CMFPlone/tests/robot/test_controlpanel_redirection.robot index 6c2f6673c5..037cea873f 100644 --- a/Products/CMFPlone/tests/robot/test_controlpanel_redirection.robot +++ b/Products/CMFPlone/tests/robot/test_controlpanel_redirection.robot @@ -1,43 +1,40 @@ -*** Settings ***************************************************************** +*** Settings *** -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Library Remote ${PLONE_URL}/RobotRemote +Library Remote ${PLONE_URL}/RobotRemote -Resource keywords.robot +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown -Test Setup Run keywords Plone Test Setup -Test Teardown Run keywords Plone Test Teardown - -*** Test Cases *************************************************************** +*** Test Cases *** Scenario: Add redirect in the URL Management Control Panel - Given a logged-in site administrator - and the URL Management control panel - When I add a redirect to the test folder from alternative url /old - Then I get redirected to the test folder when visiting /old + Given a logged-in site administrator + and the URL Management control panel + When I add a redirect to the test folder from alternative url /old + Then I get redirected to the test folder when visiting /old Scenario: Remove redirect in the URL Management Control Panel - Given a logged-in site administrator - and the URL Management control panel - When I add a redirect to the test folder from alternative url /old - and I remove the redirect from alternative url /old - Then I do not get redirected when visiting /old + Given a logged-in site administrator + and the URL Management control panel + When I add a redirect to the test folder from alternative url /old + and I remove the redirect from alternative url /old + Then I do not get redirected when visiting /old Scenario: Remove filtered redirects in the URL Management Control Panel - Given a logged-in site administrator - and the URL Management control panel - When I add a redirect to the test folder from alternative url /a - and I add a redirect to the test folder from alternative url /b - and I filter the redirects with path /a - and I remove the matching redirects - Then I do not get redirected when visiting /a - and I get redirected to the test folder when visiting /b + Given a logged-in site administrator + and the URL Management control panel + When I add a redirect to the test folder from alternative url /a + and I add a redirect to the test folder from alternative url /b + and I filter the redirects with path /a + and I remove the matching redirects + Then I do not get redirected when visiting /a + and I get redirected to the test folder when visiting /b Scenario: Download all redirects in the URL Management Control Panel @@ -48,58 +45,59 @@ Scenario: Download all redirects in the URL Management Control Panel Then I can download all redirects as CSV -*** Keywords ***************************************************************** - -# --- GIVEN ------------------------------------------------------------------ +*** Keywords *** -a logged-in site administrator - Enable autologin as Site Administrator +# GIVEN the URL Management control panel - Go to ${PLONE_URL}/@@redirection-controlpanel + Go to ${PLONE_URL}/@@redirection-controlpanel -# --- WHEN ------------------------------------------------------------------- +# WHEN I add a redirect to the test folder from alternative url - [Documentation] target path must exist in the site - [Arguments] ${old} - Input Text name=redirection ${old} - Input Text name=target_path /test-folder - Click Button Add + [Documentation] target path must exist in the site + [Arguments] ${old} + Type Text //input[@name="redirection"] ${old} + Type Text //input[@name="target_path"] /test-folder + Click //button[@name="form.button.Add"] I remove the redirect from alternative url - [Arguments] ${old} - Select Checkbox xpath=//input[@value='/plone${old}'] - Click Button Remove selected - + [Arguments] ${old} + Check Checkbox //input[@value="/plone${old}"] + Click //button[@name="form.button.Remove"] I filter the redirects with path - [Arguments] ${old} - Input Text name=q ${old} - Click Button Filter + [Arguments] ${old} + Type Text //input[@name="q"] ${old} + Click //button[@name="form.button.filter"] I remove the matching redirects - Click Button Remove all that match filter + Click //button[@name="form.button.MatchRemove"] -# --- THEN ------------------------------------------------------------------- +# THEN I get redirected to the test folder when visiting - [Arguments] ${old} - Go to ${PLONE_URL}/${old} - Location Should Be ${PLONE_URL}/test-folder + [Arguments] ${old} + Go to ${PLONE_URL}/${old} + Get Url should be ${PLONE_URL}/test-folder I do not get redirected when visiting - [Arguments] ${old} - Go to ${PLONE_URL}/${old} - Location Should Be ${PLONE_URL}/${old} - Wait Until Page Contains This page does not seem to exist + [Arguments] ${old} + Go to ${PLONE_URL}/${old} + Get Url should be ${PLONE_URL}/${old} + Get Text //body contains This page does not seem to exist I can download all redirects as CSV - [Documentation] I don't know how to get the contents of the downloaded file - Click Button Download all as CSV - Page Should Not Contain there seems to be an error + [Documentation] Test the download of CSV file + + Import library OperatingSystem + + ${dl_promise} Promise To Wait For Download saveAs=redirections.csv + Click //button[@name="form.button.Download"] + ${file_obj}= Wait For ${dl_promise} + File Should Exist ${file_obj}[saveAs] diff --git a/Products/CMFPlone/tests/robot/test_controlpanel_search.robot b/Products/CMFPlone/tests/robot/test_controlpanel_search.robot index de9c3b5cfe..8bc821890b 100644 --- a/Products/CMFPlone/tests/robot/test_controlpanel_search.robot +++ b/Products/CMFPlone/tests/robot/test_controlpanel_search.robot @@ -1,81 +1,65 @@ -*** Settings ***************************************************************** +*** Settings *** -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Library Remote ${PLONE_URL}/RobotRemote +Library Remote ${PLONE_URL}/RobotRemote -Resource keywords.robot +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown -Test Setup Run keywords Plone Test Setup -Test Teardown Run keywords Plone Test Teardown - -*** Test Cases *************************************************************** +*** Test Cases *** Scenario: Enable Livesearch in the Search Control Panel - Given a logged-in site administrator - and a document 'My Document' - and the search control panel - When I enable livesearch -# Then then searching for 'My Document' will show a live search -# XXX: Not implemented yet. See https://github.com/plone/Products.CMFPlone/issues/176 for details + Given a logged-in site administrator + and a document 'My Document' + and the search control panel + When I enable livesearch + Then then searching for 'My Document' will show a live search Scenario: Exclude Content Types from Search - Given a logged-in site administrator - and a document 'My Document' - and the search control panel - When I exclude the 'Document' type from search - Then searching for 'My Document' will not return any results - - -*** Keywords ***************************************************************** + Given a logged-in site administrator + and a document 'My Document' + and the search control panel + When I exclude the 'Document' type from search + Then searching for 'My Document' will not return any results -# --- GIVEN ------------------------------------------------------------------ -a logged-in site administrator - Enable autologin as Site Administrator +*** Keywords *** -a document '${title}' - Create content type=Document id=doc title=${title} +# GIVEN the search control panel - Go to ${PLONE_URL}/@@search-controlpanel - Wait until page contains Search Settings + Go to ${PLONE_URL}/@@search-controlpanel + Get Text //body contains Search Settings - -# --- WHEN ------------------------------------------------------------------- +# WHEN I enable livesearch - Select Checkbox form.widgets.enable_livesearch:list - Wait For Then Click Element css=#form-buttons-save - Wait until page contains Changes saved + Check Checkbox //input[@name="form.widgets.enable_livesearch:list"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved I exclude the '${portal_type}' type from search - # Make sure we see the checkbox, in expanded in jenkins it gets a bit under the toolbar - ${element} Set Variable xpath=//input[@name='form.widgets.types_not_searched:list' and @value='${portal_type}'] - Wait For Element ${element} - Unselect Checkbox ${element} - Wait For Then Click Element css=#form-buttons-save - Wait until page contains Changes saved + # Make sure we see the checkbox, in expanded in jenkins it gets a bit under the toolbar + Check Checkbox //input[@name='form.widgets.types_not_searched:list' and @value='${portal_type}'] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved -# --- THEN ------------------------------------------------------------------- +# THEN then searching for 'My Document' will show a live search - # XXX: Not implemented yet. - Go to ${PLONE_URL} - Wait until page contains element xpath=//input[@name='SearchableText'] - Input Text name=SearchableText My + Go to ${PLONE_URL} + Type Text //input[@name="SearchableText"] My D + Get Element States //ul[contains(@class,"livesearch-results")] contains visible + Get Text //ul[contains(@class,"livesearch-results")] contains My Document searching for '${search_term}' will not return any results - Go to ${PLONE_URL}/@@search - Given patterns are loaded - Wait until page contains No results were found - Input Text xpath=//form[@id='searchform']//input[@name='SearchableText'] ${search_term} - Submit Form name=searchform - Wait until page contains items matching your search terms - Page Should Contain Element //span[@id='search-results-number' and contains(.,'0')] 1 - - + Go to ${PLONE_URL}/@@search + Get Text //body contains No results were found + Type Text //form[@id='searchform']//input[@name='SearchableText'] ${search_term} + Click //input[@type="submit" and @value="Search"] + Get Text //body contains items matching your search terms + Get Text //span[@id='search-results-number'] should be 0 diff --git a/Products/CMFPlone/tests/robot/test_controlpanel_security.robot b/Products/CMFPlone/tests/robot/test_controlpanel_security.robot index 535f96945e..f7dd470b21 100644 --- a/Products/CMFPlone/tests/robot/test_controlpanel_security.robot +++ b/Products/CMFPlone/tests/robot/test_controlpanel_security.robot @@ -1,190 +1,172 @@ *** Settings *** -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Library Remote ${PLONE_URL}/RobotRemote +Library Remote ${PLONE_URL}/RobotRemote -Resource keywords.robot +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown -Test Setup Run keywords Plone Test Setup -Test Teardown Run keywords Plone Test Teardown - -*** Test Cases *************************************************************** +*** Test Cases *** Scenario: Enable self registration in the Security Control Panel - Given a logged-in site administrator - and the security control panel - When I enable self registration - Then anonymous users can register to the site + Given a logged-in site administrator + and the security control panel + When I enable self registration + Then anonymous users can register to the site Scenario: Enable users to select their own passwords in the Security Control Panel - Given a logged-in site administrator - and the security control panel - When I enable users to select their own passwords - Then users can select their own passwords when registering + Given a logged-in site administrator + and the security control panel + When I enable users to select their own passwords + Then users can select their own passwords when registering Scenario: Enable user folders in the Security Control Panel - Given a logged-in site administrator - and the security control panel - When I enable user folders - Then a user folder should be created when a user registers and logs in to the site + Given a logged-in site administrator + and the security control panel + When I enable user folders + Then a user folder should be created when a user registers and logs in to the site Scenario: Enable anyone to view 'about' information in the Security Control Panel - Given a logged-in site administrator - and a published test folder - and the security control panel - When I enable anyone to view 'about' information - Then anonymous users can view 'about' information + Given a logged-in site administrator + and a published test folder + and the security control panel + When I enable anyone to view 'about' information + Then anonymous users can view 'about' information Scenario: Enable use email as login in the Security Control Panel - Given a logged-in site administrator - and the security control panel - When I enable email to be used as a login name - Then users can use email as their login name + Given a logged-in site administrator + and the security control panel + When I enable email to be used as a login name + Then users can use email as their login name Scenario: Enable use uuid as uid in the Security Control Panel - Given a logged-in site administrator - and the security control panel - When I enable UUID to be used as a user id - Then UUID should be used for the user id - + Given a logged-in site administrator + and the security control panel + When I enable UUID to be used as a user id + Then UUID should be used for the user id -*** Keywords ***************************************************************** -# --- GIVEN ------------------------------------------------------------------ +*** Keywords *** -a logged-in site administrator - Enable autologin as Site Administrator +# GIVEN the security control panel - Go to ${PLONE_URL}/@@security-controlpanel - Wait until page contains Security Settings + Go to ${PLONE_URL}/@@security-controlpanel + Get Text //body contains Security Settings a published test folder - Go to ${PLONE_URL}/test-folder - Wait For Element css=#plone-contentmenu-workflow - Click link xpath=//li[@id='plone-contentmenu-workflow']/a - Wait For Element id=workflow-transition-publish - Click link id=workflow-transition-publish - Wait until page contains Item state changed + Go to ${PLONE_URL}/test-folder + Click //li[@id="plone-contentmenu-workflow"]/a + Click //*[@id="workflow-transition-publish"] + Get Text //body contains Item state changed -# --- WHEN ------------------------------------------------------------------- +# WHEN I enable self registration - Select Checkbox form.widgets.enable_self_reg:list - Click Button Save - Wait until page contains Changes saved + Check Checkbox //input[@name="form.widgets.enable_self_reg:list"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved I enable users to select their own passwords - Select Checkbox form.widgets.enable_self_reg:list - Select Checkbox form.widgets.enable_user_pwd_choice:list - Click Button Save - Wait until page contains Changes saved + Check Checkbox //input[@name="form.widgets.enable_self_reg:list"] + Check Checkbox //input[@name="form.widgets.enable_user_pwd_choice:list"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved I enable user folders - Select Checkbox form.widgets.enable_self_reg:list - Select Checkbox form.widgets.enable_user_pwd_choice:list - Select Checkbox form.widgets.enable_user_folders:list - Click Button Save - Wait until page contains Changes saved + Check Checkbox //input[@name="form.widgets.enable_self_reg:list"] + Check Checkbox //input[@name="form.widgets.enable_user_pwd_choice:list"] + Check Checkbox //input[@name="form.widgets.enable_user_folders:list"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved I enable anyone to view 'about' information - Select Checkbox form.widgets.allow_anon_views_about:list - Click Button Save - Wait until page contains Changes saved + Check Checkbox //input[@name="form.widgets.allow_anon_views_about:list"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved I enable email to be used as a login name - Select Checkbox form.widgets.enable_self_reg:list - Select Checkbox form.widgets.enable_user_pwd_choice:list - Select Checkbox form.widgets.use_email_as_login:list - Click Button Save - Wait until page contains Changes saved + Check Checkbox //input[@name="form.widgets.enable_self_reg:list"] + Check Checkbox //input[@name="form.widgets.enable_user_pwd_choice:list"] + Check Checkbox //input[@name="form.widgets.use_email_as_login:list"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved I enable UUID to be used as a user id - Select Checkbox form.widgets.enable_self_reg:list - Select Checkbox form.widgets.enable_user_pwd_choice:list - Select Checkbox form.widgets.use_uuid_as_userid:list - Click Button Save - Wait until page contains Changes saved + Check Checkbox //input[@name="form.widgets.enable_self_reg:list"] + Check Checkbox //input[@name="form.widgets.enable_user_pwd_choice:list"] + Check Checkbox //input[@name="form.widgets.use_uuid_as_userid:list"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved -# --- THEN ------------------------------------------------------------------- +# THEN Anonymous users can register to the site - Disable autologin - Go to ${PLONE_URL} - Wait until page contains Plone site - Element Should Be Visible xpath=//a[@id='personaltools-join'] + Disable autologin + Go to ${PLONE_URL} + Get Text //body contains Plone site + Get Element States //a[@id="personaltools-join"] contains visible Users can select their own passwords when registering - Disable autologin - Go to ${PLONE_URL}/@@register - Wait until page contains Registration form - Element Should Be Visible xpath=//input[@id='form-widgets-password'] + Disable autologin + Go to ${PLONE_URL}/@@register + Get Text //body contains Registration form + Get Element States //input[@id="form-widgets-password"] contains visible Users can use email as their login name - Disable autologin - Go to ${PLONE_URL}/@@register - Wait until page contains Registration form - Element Should Be Visible xpath=//input[@id='form-widgets-email'] - Element Should Not Be Visible xpath=//input[@id='form-widgets-username'] + Disable autologin + Go to ${PLONE_URL}/@@register + Get Text //body contains Registration form + Get Element States //input[@id="form-widgets-email"] contains visible + Get Element States //input[@id="form-widgets-username"] not contains visible A user folder should be created when a user registers and logs in to the site - Disable autologin - - # I register to the site - Go to ${PLONE_URL}/@@register - Wait until page contains Registration form - Input Text for sure form.widgets.username joe - Input Text for sure form.widgets.email joe@test.com - Input Text for sure form.widgets.password supersecret - Input Text for sure form.widgets.password_ctl supersecret - Wait For Then Click Element css=#form-buttons-register - - # I login to the site - Go to ${PLONE_URL}/login - Wait until page contains Login Name - Input text for sure __ac_name joe - Input text for sure __ac_password supersecret - Click Button Log in - Wait until page contains You are now logged in - - # The user folder should be created - Go to ${PLONE_URL}/Members/joe - Wait until element contains css=h1 joe - Page should Not contain This page does not seem to exist + Disable autologin + I register to the site + I login to the site + # The user folder should be created + Go to ${PLONE_URL}/Members/joe + Get Element Count //h1[contains(text(),'joe doe')] should be 1 + Get Text //body not contains This page does not seem to exist Anonymous users can view 'about' information - Disable autologin - Go to ${PLONE_URL}/@@search?SearchableText=test - Wait until page contains Search results - Element Should Be Visible xpath=//span[contains(@class, 'documentAuthor')] + Disable autologin + Go to ${PLONE_URL}/@@search?SearchableText=test + Get Text //body contains Search results + Get Element States //span[contains(@class, 'documentAuthor')] contains visible UUID should be used for the user id - Disable autologin - - # I register to the site - Go to ${PLONE_URL}/@@register - Wait until page contains Registration form - Input Text for sure form.widgets.username joe - Input Text for sure form.widgets.email joe@test.com - Input Text for sure form.widgets.password supersecret - Input Text for sure form.widgets.password_ctl supersecret - Wait For Then Click Element css=#form-buttons-register - - # I login to the site - Go to ${PLONE_URL}/login - Wait until page contains Login Name - Input text for sure __ac_name joe - Input text for sure __ac_password supersecret - Click Button Log in - Wait until page contains You are now logged in - # XXX: Here we can't really test that this is a uuid, since it's random, so - # we just check that user id is not equal to username or email - ${userid}= Get Text xpath=//a[@id='personaltools-menulink'] - Should Not Be Equal As Strings ${userid} joe - Should Not Be Equal As Strings ${userid} joe@test.com + Disable autologin + I register to the site + I login to the site + # XXX: Here we can't really test that this is a uuid, since it's random, so + # we just check that user id is not equal to username or email + ${userid}= Get Text //a[@id='personaltools-menulink'] + Should Not Be Equal As Strings ${userid} joe + Should Not Be Equal As Strings ${userid} joe@test.com + + +# DRY + +I register to the site + Go to ${PLONE_URL}/@@register + Get Text //body contains Registration form + Type Text //input[@name="form.widgets.fullname"] joe doe + Type Text //input[@name="form.widgets.username"] joe + Type Text //input[@name="form.widgets.email"] joe@test.com + Type Text //input[@name="form.widgets.password"] supersecret + Type Text //input[@name="form.widgets.password_ctl"] supersecret + Click //button[@name="form.buttons.register"] + +I login to the site + Go to ${PLONE_URL}/login + Get Text //body contains Login Name + Type Text //input[@name="__ac_name"] joe + Type Text //input[@name="__ac_password"] supersecret + Click //button[@name="buttons.login"] + Get Text //body contains You are now logged in \ No newline at end of file diff --git a/Products/CMFPlone/tests/robot/test_controlpanel_site.robot b/Products/CMFPlone/tests/robot/test_controlpanel_site.robot index 1844ac2d65..1e02aa71e0 100644 --- a/Products/CMFPlone/tests/robot/test_controlpanel_site.robot +++ b/Products/CMFPlone/tests/robot/test_controlpanel_site.robot @@ -1,125 +1,115 @@ -Documentation -... $ bin/robot-server Products.CMFPlone.testing.PRODUCTS_CMFPLONE_ROBOT_TESTING -... $ bin/robot test_controlpanel_site.robot +*** Settings *** -*** Settings ***************************************************************** +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot -Variables Products/CMFPlone/tests/robot/variables.py +Library Remote ${PLONE_URL}/RobotRemote -Library Remote ${PLONE_URL}/RobotRemote +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown -Resource keywords.robot +Variables variables.py -Test Setup Run keywords Plone Test Setup -Test Teardown Run keywords Plone Test Teardown - - -*** Test Cases *************************************************************** +*** Test Cases *** Scenario: Set Site Title in the Site Control Panel - Given a logged-in site administrator - and the site control panel - When I set the site title to 'My Site' - Then the site title should be set to 'My Site' + Given a logged-in site administrator + and the site control panel + When I set the site title to 'My Site' + Then the site title should be set to 'My Site' Scenario: Set Site Logo in the Site Control Panel - Given a logged-in site administrator - and the site control panel - When I set a custom logo - Then the site logo should be set to the custom logo + Given a logged-in site administrator + and the site control panel + When I set a custom logo + Then the site logo should be set to the custom logo Scenario: Enable Dublin Core Metadata in the Site Control Panel - Given a logged-in site administrator - and the site control panel - When I enable dublin core metadata - Then the dublin core metadata shows up on the site + Given a logged-in site administrator + and the site control panel + When I enable dublin core metadata + Then the dublin core metadata shows up on the site Scenario: Enable Sitemap in the Site Control Panel - Given a logged-in site administrator - and the site control panel - When I enable the sitemap - Then then I can see a sitemap + Given a logged-in site administrator + and the site control panel + When I enable the sitemap + Then then I can see a sitemap Scenario: Add Webstats Javascript in the Site Control Panel - Given a logged-in site administrator - and the site control panel - When I add a Javascript snippet to the webstats javascript - Then the Javascript snippet shows up on the site + Given a logged-in site administrator + and the site control panel + When I add a Javascript snippet to the webstats javascript + Then the Javascript snippet shows up on the site -*** Keywords ***************************************************************** +*** Keywords *** -# --- GIVEN ------------------------------------------------------------------ +# GIVEN the site control panel - Go to ${PLONE_URL}/@@site-controlpanel - Wait until page contains Site Settings + Go to ${PLONE_URL}/@@site-controlpanel + Get Text //body contains Site Settings -# --- WHEN ------------------------------------------------------------------- +# WHEN I enable the sitemap - Given patterns are loaded - Wait For Element css=#formfield-form-widgets-enable_sitemap - Select Checkbox form.widgets.enable_sitemap:list - Wait For Then Click Element css=#form-buttons-save - Wait until page contains Changes saved + Check Checkbox //input[@name="form.widgets.enable_sitemap:list"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved I set the site title to '${site_title}' - Given patterns are loaded - Input Text name=form.widgets.site_title ${site_title} - Wait For Then Click Element css=#form-buttons-save - Wait until page contains Changes saved + Type Text //input[@name="form.widgets.site_title"] ${site_title} + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved I set a custom logo - Given patterns are loaded - Choose File name=form.widgets.site_logo ${PATH_TO_TEST_FILES}/pixel.png - Wait For Then Click Element css=#form-buttons-save - Wait until page contains Changes saved + Upload File By Selector //input[@name="form.widgets.site_logo"] ${PATH_TO_TEST_FILES}/pixel.png + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved I enable dublin core metadata - Given patterns are loaded - Select Checkbox form.widgets.exposeDCMetaTags:list - Wait For Then Click Element css=#form-buttons-save - Wait until page contains Changes saved + Check Checkbox //input[@name="form.widgets.exposeDCMetaTags:list"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved I add a Javascript snippet to the webstats javascript - Given patterns are loaded - Input Text name=form.widgets.webstats_js - Wait For Then Click Element css=#form-buttons-save - Wait until page contains Changes saved + Type Text //textarea[@name="form.widgets.webstats_js"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved -# --- THEN ------------------------------------------------------------------- +# THEN the site title should be set to '${expected_site_title}' - Go To ${PLONE_URL} - ${actual_site_title}= Get title - Should be equal ${actual_site_title} ${expected_site_title} + Go To ${PLONE_URL} + Get Text //head/title should be ${expected_site_title} the site logo should be set to the custom logo - Go To ${PLONE_URL} - Wait Until Element Is Visible css=#portal-logo - Page should contain element //*[@id="portal-logo"]/img[contains(@src,'@@site-logo/pixel.png')] + Go To ${PLONE_URL} + Get Element Count //*[@id="portal-logo"]/img[contains(@src,'@@site-logo/pixel.png')] should be 1 then I can see a sitemap - Go to ${PLONE_URL}/sitemap.xml.gz - # We need a 'Download file' selenium2library keyword to test this: - # https://github.com/rtomac/robotframework-selenium2library/issues/24 + + Import library OperatingSystem + + # this is for robotframework browser > 17 + Download ${PLONE_URL}/sitemap.xml.gz saveAs=/tmp/sitemap.xml.gz + File Should Exist /tmp/sitemap.xml.gz + + # this is for robotframework browser < 18.0 + # ${file_object}= Download ${PLONE_URL}/sitemap.xml.gz + # File Should Exist ${file_object.saveAs} the dublin core metadata shows up on the site - Go to ${PLONE_URL} - Wait until page contains Powered by Plone - Page should contain element xpath=//html/head/meta[@name='DC.date.modified'] - Page should contain element xpath=//html/head/meta[@name='DC.format'] - Page should contain element xpath=//html/head/meta[@name='DC.type'] - Page should contain element xpath=//html/head/meta[@name='DC.date.created'] - Page should contain element xpath=//html/head/meta[@name='DC.language'] + Go to ${PLONE_URL} + Get Element Count //html/head/meta[@name="DC.date.modified"] should be 1 + Get Element Count //html/head/meta[@name="DC.format"] should be 1 + Get Element Count //html/head/meta[@name="DC.type"] should be 1 + Get Element Count //html/head/meta[@name="DC.date.created"] should be 1 + Get Element Count //html/head/meta[@name="DC.language"] should be 1 the Javascript snippet shows up on the site - Go to ${PLONE_URL} - Wait until page contains Powered by Plone - Page should contain element id=webstats_snippet + Go to ${PLONE_URL} + Get Element Count //*[@id="webstats_snippet"] should be 1 diff --git a/Products/CMFPlone/tests/robot/test_controlpanel_social.robot b/Products/CMFPlone/tests/robot/test_controlpanel_social.robot index 2fae936771..01239426e3 100644 --- a/Products/CMFPlone/tests/robot/test_controlpanel_social.robot +++ b/Products/CMFPlone/tests/robot/test_controlpanel_social.robot @@ -1,78 +1,69 @@ -*** Settings ***************************************************************** +*** Settings *** -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Library Remote ${PLONE_URL}/RobotRemote +Library Remote ${PLONE_URL}/RobotRemote -Resource keywords.robot +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown -Test Setup Run keywords Plone Test Setup -Test Teardown Run keywords Plone Test Teardown - -*** Test Cases *************************************************************** +*** Test Cases *** Scenario: Social settings are provided - Given a logged-in site administrator - and the social control panel - When I provide social settings - Then social tags should exist for anonymous + Given a logged-in site administrator + and the social control panel + When I provide social settings + Then social tags should exist for anonymous Scenario: Social tags are disabled - Given a logged-in site administrator - and the social control panel - When I provide social settings - When I disable social - Then social tags should not exist - + Given a logged-in site administrator + and the social control panel + When I provide social settings + When I disable social + Then social tags should not exist -*** Keywords ***************************************************************** -# --- GIVEN ------------------------------------------------------------------ +*** Keywords *** -a logged-in site administrator - Enable autologin as Site Administrator +# GIVEN the social control panel - Go to ${PLONE_URL}/@@social-controlpanel - Wait until page contains Social Media Settings + Go to ${PLONE_URL}/@@social-controlpanel + Get Text //body contains Social Media Settings -# --- WHEN ------------------------------------------------------------------- +# WHEN I disable social - UnSelect Checkbox form.widgets.share_social_data:list - Wait For Then Click Element css=#form-buttons-save - Wait until page contains Changes saved + Uncheck Checkbox //input[@name="form.widgets.share_social_data:list"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved I provide social settings - Input Text name=form.widgets.twitter_username plonecms - Input Text name=form.widgets.facebook_app_id 123456 - Input Text name=form.widgets.facebook_username plonecms - Wait For Then Click Element css=#form-buttons-save - Wait until page contains Changes saved + Type Text //input[@name="form.widgets.twitter_username"] plonecms + Type Text //input[@name="form.widgets.facebook_app_id"] 123456 + Type Text //input[@name="form.widgets.facebook_username"] plonecms + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved -# --- THEN ------------------------------------------------------------------- +# THEN social tags should exist for anonymous - Go to ${PLONE_URL} - Wait until page contains Plone site - Page should not contain element css=meta[name="twitter:site"] - Page should not contain element css=meta[property="og:article:publisher"] - Page should not contain element css=meta[property="fb:app_id"] - Disable autologin - Go to ${PLONE_URL} - Wait until page contains Plone site - Page should contain element css=meta[name="twitter:site"] - Page should contain element css=meta[property="og:article:publisher"] - Page should contain element css=meta[property="fb:app_id"] + Go to ${PLONE_URL} + Get Element Count //meta[@name="twitter:site"] should be 0 + Get Element Count //meta[@property="og:article:publisher"] should be 0 + Get Element Count //meta[@property="fb:app_id"] should be 0 + Disable autologin + Go to ${PLONE_URL} + Get Element Count //meta[@name="twitter:site"] should be 1 + Get Element Count //meta[@property="og:article:publisher"] should be 1 + Get Element Count //meta[@property="fb:app_id"] should be 1 social tags should not exist - Go to ${PLONE_URL} - Wait until page contains Plone site - Page should not contain element css=meta[name="twitter:site"] - Page should not contain element css=meta[property="og:article:publisher"] - Page should not contain element css=meta[property="fb:app_id"] + Go to ${PLONE_URL} + Get Element Count //meta[@name="twitter:site"] should be 0 + Get Element Count //meta[@property="og:article:publisher"] should be 0 + Get Element Count //meta[@property="fb:app_id"] should be 0 diff --git a/Products/CMFPlone/tests/robot/test_controlpanel_types.robot b/Products/CMFPlone/tests/robot/test_controlpanel_types.robot index b611a93109..4413ba0437 100644 --- a/Products/CMFPlone/tests/robot/test_controlpanel_types.robot +++ b/Products/CMFPlone/tests/robot/test_controlpanel_types.robot @@ -1,50 +1,50 @@ -*** Settings ***************************************************************** +*** Settings *** -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Library Remote ${PLONE_URL}/RobotRemote +Library Remote ${PLONE_URL}/RobotRemote -Resource keywords.robot +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown -Test Setup Run keywords Plone Test Setup -Test Teardown Run keywords Plone Test Teardown - -*** Test Cases *************************************************************** +*** Test Cases *** Scenario: Change default workflow - Given a logged-in site administrator - and the types control panel - When I select 'Single State Workflow' workflow - Then Wait until page contains Content Settings - When I add new Link 'my_link' - Then Link 'my_link' should have Single State Workflow enabled + Given a logged-in site administrator + and the types control panel + When I select 'Single State Workflow' workflow + and I add new Link 'my_link' + Then Link 'my_link' should have Single State Workflow enabled -*** Keywords ***************************************************************** +*** Keywords *** -# --- GIVEN ------------------------------------------------------------------ +# GIVEN the types control panel - Go to ${PLONE_URL}/@@content-controlpanel - Wait until page contains Content Settings + Go to ${PLONE_URL}/@@content-controlpanel + Get Text //body contains Content Settings -# --- WHEN ------------------------------------------------------------------- +# WHEN I select '${workflow}' workflow - Select from list by label name=new_workflow ${workflow} - Click Button Save + Select Options By //select[@name="new_workflow"] label ${workflow} + Click //button[@name="form.button.Save"] + Wait For Condition Text //body contains Content Settings + I add new Link '${id}' - Go to ${PLONE_URL} - Wait until page contains Plone site - Create content type=Link id=${id} title=${id} remoteUrl=http://www.starzel.de + Go to ${PLONE_URL} + Create content + ... type=Link + ... id=${id} + ... title=${id} + ... remoteUrl=https://www.plone.org -# --- THEN ------------------------------------------------------------------- +# THEN Link '${id}' should have Single State Workflow enabled - Go to ${PLONE_URL}/${id} - Wait until page contains ${id} - # We check that single state worklow is used, publish button is not present - Page should not contain element xpath=//a[@id="workflow-transition-publish"] + Go to ${PLONE_URL}/${id} + # We check that single state worklow is used, publish button is not present + Get Element Count //a[@id="workflow-transition-publish"] should be 0 diff --git a/Products/CMFPlone/tests/robot/test_controlpanel_usergroups.robot b/Products/CMFPlone/tests/robot/test_controlpanel_usergroups.robot index 0a4a2a9e1c..1b041b035e 100644 --- a/Products/CMFPlone/tests/robot/test_controlpanel_usergroups.robot +++ b/Products/CMFPlone/tests/robot/test_controlpanel_usergroups.robot @@ -1,123 +1,103 @@ -# ============================================================================ -# Tests for the Plone Usergroups Control Panel -# ============================================================================ -# -# $ bin/robot-server --reload-path src/Products.CMFPlone/Products/CMFPlone/ Products.CMFPlone.testing.PRODUCTS_CMFPLONE_ROBOT_TESTING -# -# $ bin/robot src/Products.CMFPlone/Products/CMFPlone/tests/robot/test_controlpanel_usergroups.robot -# -# ============================================================================ +*** Settings *** -*** Settings ***************************************************************** +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Library Remote ${PLONE_URL}/RobotRemote -Library Remote ${PLONE_URL}/RobotRemote +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown -Resource keywords.robot -Test Setup Run keywords Plone Test Setup -Test Teardown Run keywords Plone Test Teardown - - -*** Test Cases *************************************************************** +*** Test Cases *** Scenario: Show all users in users control panel - Given a logged-in site administrator - and the users control panel - When I click show all users - Then all users should be shown + Given a logged-in site administrator + and the users control panel + When I click show all users + Then all users should be shown Scenario: Show all groups in groups control panel - Given a logged-in site administrator - and the groups control panel - When I click show all groups - Then all groups should be shown + Given a logged-in site administrator + and the groups control panel + When I click show all groups + Then all groups should be shown Scenario: Create new group - Given a logged-in site administrator - and the groups control panel - When I create new group - Then new group should show under all groups + Given a logged-in site administrator + and the groups control panel + When I create new group + and I click show all groups + Then new group should show under all groups Scenario: Enable many groups and many users settings in usergroups control panel - Given a logged-in site administrator - and the user group settings control panel - When I enable many groups and many users settings - Then showing all users is disabled - and showing all groups is disabled - + Given a logged-in site administrator + and the user group settings control panel + When I enable many groups and many users settings + Then showing all users is disabled + and showing all groups is disabled -*** Keywords ***************************************************************** -# --- GIVEN ------------------------------------------------------------------ +*** Keywords *** -a logged-in site administrator - Enable autologin as Site Administrator +# GIVEN the users control panel - Go to ${PLONE_URL}/@@usergroup-userprefs - Wait until page contains User Search + Go to ${PLONE_URL}/@@usergroup-userprefs + Get Text //body contains User Search the groups control panel - Go to ${PLONE_URL}/@@usergroup-groupprefs - Wait until page contains Group Search + Go to ${PLONE_URL}/@@usergroup-groupprefs + Get Text //body contains Group Search the user group settings control panel - Go to ${PLONE_URL}/@@usergroup-controlpanel - Wait until page contains User and Groups Settings + Go to ${PLONE_URL}/@@usergroup-controlpanel + Get Text //body contains User and Groups Settings -# --- WHEN ------------------------------------------------------------------- +# WHEN I click show all users - Click button Show all - Wait until page contains User Search + Click //button[@name="form.button.FindAll"] + Get Text //body contains User Search I click show all groups - Click button Show all - Wait until page contains Group Search + Click //button[@name="form.button.FindAll"] + Get Text //body contains Group Search I create new group - Click link Add New Group - Wait until page contains element name=addname - patterns are loaded - Input Text name=addname my-new-group - Input Text name=title:string My New Group - Input Text name=description:text This is my new group - Input Text name=email:string my-group@plone.org - Submit Form id=createGroup -# "Click button Save" does not work for modals. See https://stackoverflow.com/questions/17602334/element-is-not-currently-visible-and-so-may-not-be-interacted-with-but-another for details. - I click show all groups - Page should contain my-new-group + Click //a[@id="add-group"] + Type Text //input[@name="addname"] my-new-group + Type Text //input[@name="title:string"] My New Group + Type Text //textarea[@name="description:text"] This is my new group + Type Text //input[@name="email:string"] my-group@plone.org + Click //form[@id="createGroup"]//button[@name="form.button.Save"] I enable many groups and many users settings - Select Checkbox name=form.widgets.many_groups:list - Select Checkbox name=form.widgets.many_users:list - Click button Save - Wait until page contains Data successfully updated. + Check Checkbox //input[@name="form.widgets.many_groups:list"] + Check Checkbox //input[@name="form.widgets.many_users:list"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Data successfully updated. -# --- THEN ------------------------------------------------------------------- +# THEN all users should be shown - Page should contain test-user - Page should contain admin + Get Text //body contains test-user + Get Text //body contains admin all groups should be shown - Page should contain Administrators - Page should contain Authenticated Users (Virtual Group) (AuthenticatedUsers) - Page should contain Reviewers - Page should contain Site Administrators + Get Text //body contains Administrators + Get Text //body contains Authenticated Users (Virtual Group) (AuthenticatedUsers) + Get Text //body contains Reviewers + Get Text //body contains Site Administrators showing all users is disabled - the users control panel - Page should not contain Show all + the users control panel + Get Text //body not contains Show all showing all groups is disabled - the users control panel - Page should not contain Show all + the groups control panel + Get Text //body not contains Show all new group should show under all groups - Page should contain my-new-group + Get Text //body contains my-new-group diff --git a/Products/CMFPlone/tests/robot/test_edit.robot b/Products/CMFPlone/tests/robot/test_edit.robot index 169b44418d..aede766e59 100644 --- a/Products/CMFPlone/tests/robot/test_edit.robot +++ b/Products/CMFPlone/tests/robot/test_edit.robot @@ -1,26 +1,23 @@ -*** Settings ***************************************************************** +*** Settings *** -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Library Remote ${PLONE_URL}/RobotRemote +Library Remote ${PLONE_URL}/RobotRemote -Resource keywords.robot +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown -Test Setup Run keywords Plone Test Setup -Test Teardown Run keywords Plone Test Teardown - -*** Variables **************************************************************** +*** Variables *** ${TITLE} An edited page ${LINK_TITLE} An edited link item ${PAGE_ID} an-edited-page ${LINK_ID} an-edited-link-item -${SELENIUM_RUN_ON_FAILURE} Capture Page Screenshot and log source -*** Test cases *************************************************************** + +*** Test cases *** Scenario: A page is opened to edit Given a logged-in site administrator @@ -31,7 +28,7 @@ Scenario: A page is opened to edit Scenario: Switch tabs Given a logged-in site administrator and an edited page - When i click the Categorization tab + When i click the 'Categorization' tab Then the Categorization tab is shown and no other tab is shown @@ -41,7 +38,7 @@ Scenario: Adding a related item Given a logged-in site administrator and at least one other item and an edited page - When i click the Categorization tab + When i click the 'Categorization' tab and i select a related item and i save the page Then the related item is shown in the page @@ -79,68 +76,70 @@ Scenario: Add an internal link to linked item Then the linked item is shown in the page and Capture page screenshot and log source -*** Keywords ***************************************************************** +*** Keywords *** -# --- GIVEN ------------------------------------------------------------------ +# GIVEN an edited page - Create content type=Document title=${TITLE} - Go to ${PLONE_URL}/${PAGE_ID}/edit - Wait until page contains Edit Page + Create content + ... type=Document + ... title=${TITLE} + Go to ${PLONE_URL}/${PAGE_ID}/edit + Get Text //body contains Edit Page an edited link item - Create content type=Link title=${LINK_TITLE} - Go to ${PLONE_URL}/${LINK_ID}/edit - Wait until page contains Edit Link + Create content + ... type=Link + ... title=${LINK_TITLE} + Go to ${PLONE_URL}/${LINK_ID}/edit + Get Text //body contains Edit Link -# --- WHEN ------------------------------------------------------------------- +# WHEN I have the title input field - Element Should Be Visible xpath=//fieldset[@id='fieldset-default'] + Get Element States //fieldset[@id='fieldset-default'] contains visible I can only see the default tab - Wait For Condition return window.jQuery('.autotoc-nav .active:visible').length > 0 - Element Should Not Be Visible xpath=//fieldset[@id='fieldset-settings'] - Element Should Not Be Visible xpath=//fieldset[@id='fieldset-dates'] - Element Should Not Be Visible xpath=//fieldset[@id='fieldset-categorization'] + Get Element States //fieldset[@id='fieldset-default'] contains visible + Get Element States //fieldset[@id='fieldset-dates'] not contains visible + Get Element States //fieldset[@id='fieldset-categorization'] not contains visible I click the ${tab} tab - Given patterns are loaded - Click link ${tab} + Click //a[contains(text(),${tab})] I select a related item # Click the select button - Wait For Then Click Element //div[@id="formfield-form-widgets-IRelatedItems-relatedItems"]//button + Click //div[@id="formfield-form-widgets-IRelatedItems-relatedItems"]//button # Click first element in first column - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[1]/div[contains(@class, "levelItems")]/div[1] + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[1]/div[contains(@class, "levelItems")]/div[1] # Click the select Button in the Toolbar of column 2 - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[2]/div[contains(@class, "levelToolbar")]/button + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[2]/div[contains(@class, "levelToolbar")]/button I select a linked item # Click the select button - Wait For Then Click Element //div[@id="formfield-form-widgets-remoteUrl"]//button + Click //div[@id="formfield-form-widgets-remoteUrl"]//button # Click first element in first column - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[1]/div[contains(@class, "levelItems")]/div[1] + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[1]/div[contains(@class, "levelItems")]/div[1] # Click the select Button in the Toolbar of column 2 # This selects the "test-folder" - Wait For Then Click Element //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[2]/div[contains(@class, "levelToolbar")]/button + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[2]/div[contains(@class, "levelToolbar")]/button I save the page - Click Button Save + Click //button[@name="form.buttons.save"] I click the calendar icon - Click Element xpath=//span[@id='edit_form_effectiveDate_0_popup'] - Element Should Be Visible xpath=//div[@class='calendar'] + Click //span[@id='edit_form_effectiveDate_0_popup'] + Get Element States //div[@class='calendar'] contains visible I select a date using the widget - Click Element xpath=//div[@class='calendar']/table/thead/tr[2]/td[4]/div + Click //div[@class='calendar']/table/thead/tr[2]/td[4]/div -# --- THEN ------------------------------------------------------------------- +# THEN popup calendar should have the same date - Element Text Should Be xpath=//div[@class='calendar']//thead//td[@class='title'] January, 2001 + Get Text //div[@class='calendar']//thead//td[@class='title'] should be January, 2001 form dropdowns should not have the default values anymore ${yearLabel} = Get Selected List Label xpath=//select[@id='edit_form_effectiveDate_0_year'] @@ -151,25 +150,26 @@ form dropdowns should not have the default values anymore Should Not Be Equal ${dayLabel} -- the related item is shown in the page - Page should contain element css=#section-related + Get Element Count //*[@id="section-related"] should be 1 the linked item is shown in the page # check if the selected testfolder is linked - Page should contain element xpath=//a[@href='${PLONE_URL}/test-folder'] + Get Element Count //a[@href='${PLONE_URL}/test-folder'] greater than 0 + an overlay pops up - Wait Until Page Contains Element xpath=//div[contains(@class, 'overlay')]//input[@class='insertreference'] + Get Element Count //div[contains(@class, 'overlay')]//input[@class='insertreference'] should be 1 the categorization tab is shown - Element Should Be Visible xpath=//fieldset[@id='fieldset-categorization'] + Get Element States //fieldset[@id='fieldset-categorization'] contains visible no other tab is shown - Element Should Not Be Visible xpath=//fieldset[@id='fieldset-dates'] - Element Should Not Be Visible xpath=//fieldset[@id='fieldset-default'] - Element Should Not Be Visible xpath=//fieldset[@id='fieldset-settings'] + Get Element States //fieldset[@id='fieldset-dates'] not contains visible + Get Element States //fieldset[@id='fieldset-default'] not contains visible + Get Element States //fieldset[@id='fieldset-settings'] not contains visible at least one other item - Go to ${PLONE_URL}/++add++Document - Given patterns are loaded - Execute Javascript $('#form-widgets-IDublinCore-title').val('${TITLE}'); return 0; - Click Button Save + Go to ${PLONE_URL}/++add++Document + Type Text //input[@id="form-widgets-IDublinCore-title"] ${TITLE} + Click //button[@name="form.buttons.save"] + Get Text //body contains Item created \ No newline at end of file diff --git a/Products/CMFPlone/tests/robot/test_edit_user_schema.robot b/Products/CMFPlone/tests/robot/test_edit_user_schema.robot index 439bb5b074..60e1a0a691 100644 --- a/Products/CMFPlone/tests/robot/test_edit_user_schema.robot +++ b/Products/CMFPlone/tests/robot/test_edit_user_schema.robot @@ -1,36 +1,23 @@ -# ============================================================================ -# Tests Editing the User Schema -# ============================================================================ -# -# $ bin/robot-server --reload-path src/Products.CMFPlone/Products/CMFPlone/ Products.CMFPlone.testing.PRODUCTS_CMFPLONE_ROBOT_TESTING -# -# $ bin/robot src/Products.CMFPlone/Products/CMFPlone/tests/robot/test_edit_user_schema.robot -# -# ============================================================================ - *** Settings *** -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot - -Library Remote ${PLONE_URL}/RobotRemote +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Resource keywords.robot +Library Remote ${PLONE_URL}/RobotRemote -Test Setup Run keywords Plone Test Setup -Test Teardown Run keywords Plone Test Teardown +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown -*** Test Cases *************************************************************** +*** Test Cases *** Scenario: As a manager I can add a field to the registration form - Given a logged-in manager - and the mail setup configured - and site registration enabled - When I add a new text field to the member fields - and choose to show the field on registration - Then an anonymous user will see the field in the registration form + Given a logged-in manager + and the mail setup configured + and site registration enabled + When I add a new text field to the member fields + and choose to show the field on registration + Then an anonymous user will see the field in the registration form Scenario: As a manager I can add a field to the user form Given a logged-in manager @@ -41,12 +28,12 @@ Scenario: As a manager I can add a field to the user form Then a logged-in user will see the field in the user profile Scenario: As a manager I can add a required field to the user form - Given a logged-in manager - and the mail setup configured - and site registration enabled - When I add a new required text field to the member fields - and choose to show the field in the user profile - Then a logged-in user will see the required field in the user profile + Given a logged-in manager + and the mail setup configured + and site registration enabled + When I add a new required text field to the member fields + and choose to show the field in the user profile + Then a logged-in user will see the required field in the user profile Scenario: As a manager I can move user form fields Pass Execution Drag and drop in schemaeditor does not work @@ -69,111 +56,92 @@ Scenario: As a manager I can add a field with constraints to the registration fo -*** Keywords ***************************************************************** - -# --- GIVEN ------------------------------------------------------------------ +*** Keywords *** -a logged-in site administrator - Enable autologin as Site Administrator - -a logged-in manager - Enable autologin as Manager +# GIVEN site registration enabled - Go To ${PLONE_URL}/@@security-controlpanel - Wait until page contains Security Settings - Wait until page contains element form.widgets.enable_self_reg:list - Select Checkbox form.widgets.enable_self_reg:list - Click Button Save - Wait until page contains Changes saved. - + Go To ${PLONE_URL}/@@security-controlpanel + Get Text //body contains Security Settings + Check Checkbox //input[@name="form.widgets.enable_self_reg:list"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved. -# --- WHEN ------------------------------------------------------------------- +# WHEN I add a new text field to the member fields - Go to ${PLONE_URL}/@@member-fields - Wait until page contains element css=#add-field - Click Link Add new field… - Wait Until Element Is visible css=#add-field-form #form-widgets-title - Input Text css=#add-field-form #form-widgets-title Test Field - Press Keys css=#add-field-form #form-widgets-title TAB - Select From List By Label css=#form-widgets-factory Text line (String) - Click button css=.pattern-modal-buttons button#form-buttons-add - Wait until page contains Field added successfully. + Go to ${PLONE_URL}/@@member-fields + Click //a[@id="add-field"] + Type Text //form[@id="add-field-form"]//input[@name="form.widgets.title"] Test Field + Press Keys //form[@id="add-field-form"]//input[@name="form.widgets.title"] Tab + Select Options By //form[@id="add-field-form"]//select[@name="form.widgets.factory:list"] label Text line (String) + Click //div[@class="modal-footer"]//button[@name="form.buttons.add"] + Get Text //body contains Field added successfully. I Open the test_field Settings - Go to ${PLONE_URL}/@@member-fields - Wait For Element css=div[data-field_id='test_field'] - Wait For Then Click Element css=div[data-field_id='test_field'] a.fieldSettings + Go to ${PLONE_URL}/@@member-fields + Click //div[@data-field_id="test_field"]//a[contains(@class,"fieldSettings")] I add a new required text field to the member fields - Go to ${PLONE_URL}/@@member-fields - Wait until page contains element css=#add-field - Click Link Add new field… - Wait Until Element Is visible css=#add-field-form #form-widgets-title - Input Text css=#add-field-form #form-widgets-title Test Field - Press Keys css=#add-field-form #form-widgets-title TAB - Select From List By Label css=#form-widgets-factory Text line (String) - Select Checkbox form.widgets.required:list - Click button css=.pattern-modal-buttons button#form-buttons-add - Wait until page contains Field added successfully. + Go to ${PLONE_URL}/@@member-fields + Click //a[@id="add-field"] + Type Text //form[@id="add-field-form"]//input[@name="form.widgets.title"] Test Field + Press Keys //form[@id="add-field-form"]//input[@name="form.widgets.title"] Tab + Select Options By //form[@id="add-field-form"]//select[@name="form.widgets.factory:list"] label Text line (String) + Check Checkbox //input[@name="form.widgets.required:list"] + Click //div[@class="modal-footer"]//button[@name="form.buttons.add"] + Get Text //body contains Field added successfully. choose to show the field on registration - I Open the test_field Settings - Wait Until Element Is visible form.widgets.IUserFormSelection.forms:list - Select Checkbox css=#form-widgets-IUserFormSelection-forms-0 - Click button css=.pattern-modal-buttons button#form-buttons-save - Wait until page contains Data successfully updated. + I Open the test_field Settings + Check Checkbox //input[@name="form.widgets.IUserFormSelection.forms:list" and @value="On Registration"] + Click //div[@class="modal-footer"]//button[@name="form.buttons.save"] + Get Text //body contains Data successfully updated. choose to show the field in the user profile - I Open the test_field Settings - Wait Until Element Is visible form.widgets.IUserFormSelection.forms:list - Select Checkbox css=#form-widgets-IUserFormSelection-forms-1 - Click button css=.pattern-modal-buttons button#form-buttons-save - Wait until page contains Data successfully updated. + I Open the test_field Settings + Check Checkbox //input[@name="form.widgets.IUserFormSelection.forms:list" and @value="In User Profile"] + Click //div[@class="modal-footer"]//button[@name="form.buttons.save"] + Get Text //body contains Data successfully updated. I move the new field to the top - # XXX: Drag and drop is not working!!! - Drag And Drop xpath=//div[@data-field_id="test_field"]//span[contains(@class, "draghandle")] xpath=//div[@data-field_id="home_page"] + Drag And Drop //div[@data-field_id="test_field"]//span[contains(@class, "draghandle")] //div[@data-field_id="home_page"] + add a min/max constraint to the field - I Open the test_field Settings - Wait until page contains element form.widgets.min_length - Input Text form.widgets.min_length 4 - Input Text form.widgets.max_length 6 - Wait Until Element Is visible css=.pattern-modal-buttons button#form-buttons-save - Click Button css=.pattern-modal-buttons button#form-buttons-save - Sleep 1 + I Open the test_field Settings + Type Text //input[@name="form.widgets.min_length"] 4 + Type Text //input[@name="form.widgets.max_length"] 6 + Click //div[@class="modal-footer"]//button[@name="form.buttons.save"] + Get Text //body contains Data successfully updated. -# --- THEN ------------------------------------------------------------------- +# THEN an anonymous user will see the field in the registration form - Disable Autologin - Go to ${PLONE_URL}/@@register - Wait until page contains Register - Page should contain element form.widgets.test_field + Disable Autologin + Go to ${PLONE_URL}/@@register + Get Text //body contains Register + Get Element Count //input[@name="form.widgets.test_field"] should be 1 a logged-in user will see the field in the user profile - Disable Autologin - Enable autologin as Member - Go to ${PLONE_URL}/@@personal-information - Wait until page contains Change your personal information - Page should contain element form.widgets.test_field + Disable Autologin + a logged-in member + Go to ${PLONE_URL}/@@personal-information + Get Element Count //input[@name="form.widgets.test_field"] should be 1 a logged-in user will see the required field in the user profile - a logged-in user will see the field in the user profile - Page Should Contain Element //div[@id='formfield-form-widgets-test_field']//span[contains(@class, 'required')] limit=1 message=test_field should be required + a logged-in user will see the field in the user profile + Get Element Count //div[@id='formfield-form-widgets-test_field']//span[contains(@class, 'required')] should be 1 message=test_field should be required a logged-in user will see the field on top of the user profile - a logged-in user will see the field in the user profile - Page Should Contain Element //form[@id='form']/div[1]//input[@id='form-widgets-test_field'] limit=1 message=test_field should be on top + a logged-in user will see the field in the user profile + Get Element Count //form[@id='form']/div[1]//input[@id='form-widgets-test_field'] should be 1 message=test_field should be on top a logged-in user will see a field with min/max constraints - a logged-in user will see the field in the user profile - Input Text form.widgets.email test@plone.org - Wait For Element css=#form-widgets-test_field - Input Text form.widgets.test_field 1 - Wait For Then Click Element css=.formControls button#form-buttons-save - Wait until page contains There were some errors. - Page should contain Value is too short + a logged-in user will see the field in the user profile + Type Text //input[@name="form.widgets.email"] test@plone.org + Type Text //input[@name="form.widgets.test_field"] 1 + Click //button[@name="form.buttons.save"] + Get Text //body contains There were some errors. + Get Text //body contains Value is too short diff --git a/Products/CMFPlone/tests/robot/test_folder_contents.robot b/Products/CMFPlone/tests/robot/test_folder_contents.robot index 1406b233e7..dcf33269b6 100644 --- a/Products/CMFPlone/tests/robot/test_folder_contents.robot +++ b/Products/CMFPlone/tests/robot/test_folder_contents.robot @@ -1,18 +1,15 @@ -*** Settings ***************************************************************** +*** Settings *** -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Library Remote ${PLONE_URL}/RobotRemote +Library Remote ${PLONE_URL}/RobotRemote -Resource keywords.robot +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown -Test Setup Run keywords Plone Test Setup -Test Teardown Run keywords Plone Test Teardown - -*** Test cases *************************************************************** +*** Test cases *** Scenario: Select All items @@ -21,14 +18,8 @@ Scenario: Select All items and the folder contents view When I select all the elements Then the selection count appears - and the four elements got selected and the clear selection link appears -Scenario: Clear selection - Given a logged-in site administrator - and a folder with four pages - and the folder contents view - And I select all the elements When I clear the selection Then no elements should be selected @@ -36,77 +27,88 @@ Scenario: Reorder Folder Contents Given a logged-in site administrator and a folder with four pages and the folder contents view - Then The Order Should Be 1 2 3 4 + Then The Order Should Be 1 2 3 4 When I reorder the elements - Then The Order Should Be 4 3 2 1 + Then The Order Should Be 4 3 2 1 -*** Keywords ***************************************************************** +*** Keywords *** a folder with four pages - ${folder_uid}= Create content type=Folder title=My Folder - Create content type=Document title=Doc1 container=${folder_uid} - Create content type=Document title=Doc2 container=${folder_uid} - Create content type=Document title=Doc3 container=${folder_uid} - Create content type=Document title=Doc4 container=${folder_uid} + ${folder_uid}= Create content + ... type=Folder + ... title=My Folder + Create content + ... type=Document + ... title=Doc1 + ... container=${folder_uid} + Create content + ... type=Document + ... title=Doc2 + ... container=${folder_uid} + Create content + ... type=Document + ... title=Doc3 + ... container=${folder_uid} + Create content + ... type=Document + ... title=Doc4 + ... container=${folder_uid} the folder contents view - Go to ${PLONE_URL}/my-folder/folder_contents - Given folder contents pattern loaded + Go to ${PLONE_URL}/my-folder/folder_contents I click the '${link_name}' link - Click Link ${link_name} + Click //a[contains(text(),${link_name})] I select all the elements - Wait until page contains element css=.pat-structure .select-all - Sleep 1s - ${select_all_selector} Set Variable .pat-structure .select-all - Wait Until Element Is Visible css=${select_all_selector} - Click Element css=${select_all_selector} - -the four elements got selected - Checkbox Should Be Selected css=tr[data-id="doc1"] input - Checkbox Should Be Selected css=tr[data-id="doc2"] input - Checkbox Should Be Selected css=tr[data-id="doc3"] input - Checkbox Should Be Selected css=tr[data-id="doc4"] input + Wait For Condition Classes //body contains patterns-loaded + Check Checkbox //tr[@data-id="doc1"]//input[@type="checkbox"] + Wait For Elements State //tr[@data-id="doc1"]//input[@type="checkbox"] checked timeout=10s + Check Checkbox //tr[@data-id="doc2"]//input[@type="checkbox"] + Wait For Elements State //tr[@data-id="doc2"]//input[@type="checkbox"] checked timeout=10s + Check Checkbox //tr[@data-id="doc3"]//input[@type="checkbox"] + Wait For Elements State //tr[@data-id="doc3"]//input[@type="checkbox"] checked timeout=10s + Check Checkbox //tr[@data-id="doc4"]//input[@type="checkbox"] + Wait For Elements State //tr[@data-id="doc4"]//input[@type="checkbox"] checked timeout=10s the selection count appears - Wait until page contains element css=#btn-selected-items .label-success - Element Should Contain css=#btn-selected-items .label-success 4 + Get Text //*[@id="btn-selected-items"]//*[contains(@class,"label-success")] should be 4 the clear selection link appears - Page Should Contain Element css=a.remove-all + Get Element Count //a[contains(@class,"remove-all")] greater than 0 I clear the selection - Click link id=btn-selected-items - Click link css=a.remove-all + Wait For Condition Classes //body contains patterns-loaded + Sleep 2s + Check Checkbox //*[contains(@class,"pat-structure")]//input[contains(@class,"select-all")] + Click //a[@id="btn-selected-items"] + Click //a[contains(@class,"remove-all")] + no elements should be selected - Checkbox Should Not Be Selected css=tr[data-id="doc1"] input - Checkbox Should Not Be Selected css=tr[data-id="doc2"] input - Checkbox Should Not Be Selected css=tr[data-id="doc3"] input - Checkbox Should Not Be Selected css=tr[data-id="doc4"] input + Get Checkbox State //tr[@data-id="doc1"]//input == unchecked + Get Checkbox State //tr[@data-id="doc2"]//input == unchecked + Get Checkbox State //tr[@data-id="doc3"]//input == unchecked + Get Checkbox State //tr[@data-id="doc4"]//input == unchecked I reorder the elements - Click link css=#btn-structure-rearrange - Click element name=reversed - Click button css=#popover-structure-rearrange .btn-primary - Wait until page contains Successfully rearranged folder + Click //a[@id="btn-structure-rearrange"] + Check Checkbox //*[@id="popover-structure-rearrange"]//input[@name="reversed"] + Click //*[@id="popover-structure-rearrange"]//button[contains(text(),"Rearrange")] + Wait For Condition Text //body contains Successfully rearranged folder The Order Should Be - [Arguments] ${first} ${second} ${third} ${fourth} - Wait Until Element Is Visible css=#doc${first} - Wait Until Element Is Visible css=#doc${second} - Wait Until Element Is Visible css=#doc${third} - Wait Until Element Is Visible css=#doc${fourth} - Should be above css=tr[data-id="doc${first}"] css=tr[data-id="doc${second}"] - Should be above css=tr[data-id="doc${second}"] css=tr[data-id="doc${third}"] - Should be above css=tr[data-id="doc${third}"] css=tr[data-id="doc${fourth}"] + [Arguments] ${first} ${second} ${third} ${fourth} + Should be above //tr[@data-id="doc${first}"] //tr[@data-id="doc${second}"] + Should be above //tr[@data-id="doc${second}"] //tr[@data-id="doc${third}"] + Should be above //tr[@data-id="doc${third}"] //tr[@data-id="doc${fourth}"] Should be above - [Arguments] ${locator1} ${locator2} + [Arguments] ${locator1} ${locator2} + + ${locator1-position}= Get BoundingBox ${locator1} y + ${locator2-position}= Get BoundingBox ${locator2} y - ${locator1-position} = Get vertical position ${locator1} - ${locator2-position} = Get vertical position ${locator2} - Should be true ${locator1-position} < ${locator2-position} + Should be true ${locator1-position} < ${locator2-position} diff --git a/Products/CMFPlone/tests/robot/test_linkintegrity.robot b/Products/CMFPlone/tests/robot/test_linkintegrity.robot index b45dc121ac..7a3db39c17 100644 --- a/Products/CMFPlone/tests/robot/test_linkintegrity.robot +++ b/Products/CMFPlone/tests/robot/test_linkintegrity.robot @@ -1,147 +1,132 @@ -# ============================================================================ -# Tests for the Plone Link Integrity Support -# ============================================================================ -# -# $ bin/robot-server --reload-path src/Products.CMFPlone/Products/CMFPlone/ Products.CMFPlone.testing.PRODUCTS_CMFPLONE_ROBOT_TESTING -# -# $ bin/robot src/Products.CMFPlone/Products/CMFPlone/tests/robot/test_linkintegrity.robot -# -# ============================================================================ +*** Settings *** -*** Settings ***************************************************************** +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Library Remote ${PLONE_URL}/RobotRemote -Library Remote ${PLONE_URL}/RobotRemote +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown -Resource keywords.robot -Test Setup Run keywords Plone Test Setup -Test Teardown Run keywords Plone Test Teardown - -*** Variables **************************************************************** - -${SELENIUM_RUN_ON_FAILURE} Capture page screenshot and log source - - -*** Test Cases *************************************************************** +*** Test Cases *** Scenario: When page is linked show warning Given a logged-in site administrator and a page to link to and a page to edit - and a link in rich text - should show warning when deleting page - + When I add a link in rich text + Then I should see a warning when deleting page Scenario: After you fix linked page no longer show warning Given a logged-in site administrator - a page to link to + and a page to link to and a page to edit - and a link in rich text - should show warning when deleting page - remove link to page - should not show warning when deleting page + When I add a link in rich text + Then I should see a warning when deleting page + When I remove link to page + Then I should not see a warning when deleting page Scenario: Show warning when deleting linked item from folder_contents - Given a logged-in site administrator - a page to link to - and a page to edit - and a link in rich text - should show warning when deleting page from folder_contents - remove link to page - should not show warning when deleting page from folder_contents - - -*** Keywords ***************************************************************** + Given a logged-in site administrator + and a page to link to + and a page to edit + When I add a link in rich text + Then I should see a warning when deleting page from folder_contents -# --- GIVEN ------------------------------------------------------------------ + When I remove link to page + Then I should not see a warning when deleting page from folder_contents -a logged-in site administrator - Enable autologin as Site Administrator +*** Keywords *** +# GIVEN a page to link to - Create content type=Document id=foo title=Foo + Create content + ... type=Document + ... id=foo + ... title=Foo a page to edit - Create content type=Document id=bar title=Bar - - -a link in rich text - Go To ${PLONE_URL}/bar/edit - Wait until element is visible css=.tox-edit-area iframe - Select Frame css=.tox-edit-area iframe - Input text css=.mce-content-body foo - Execute Javascript function selectElementContents(el) {var range = document.createRange(); range.selectNodeContents(el); var sel = window.getSelection(); sel.removeAllRanges(); sel.addRange(range);} var el = document.getElementById("tinymce"); selectElementContents(el); - UnSelect Frame - - Click Button css=button[aria-label="Insert/edit link"] - Wait For Then Click Element css=.linkModal .content-browser-selected-items-wrapper button.btn-primary - Wait For Then Click Element xpath=//div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[1]/div[contains(@class, "levelItems")]/div[3] - Wait For Then Click Element xpath=//div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[contains(@class, "preview")]/div[contains(@class, "levelToolbar")]/button - Wait Until Element Is Not Visible xpath=//div[contains(@class,"content-browser-position-wrapper")] - Wait For Then Click Element css=.modal-footer input[name="insert"] - Select Frame css=.tox-edit-area iframe - Execute Javascript window.getSelection().removeAllRanges() - UnSelect Frame - Wait Until Element Is Not Visible css=.modal-footer input[name="insert"] - Wait For Then Click Element css=#form-buttons-save - - -should show warning when deleting page - - Go To ${PLONE_URL}/foo - Wait For Then Click Element css=#plone-contentmenu-actions > a - Wait For Then Click Element css=#plone-contentmenu-actions-delete - Wait until page contains element css=.breach-container .breach-item - - -should show warning when deleting page from folder_contents - Go To ${PLONE_URL}/folder_contents - Given folder contents pattern loaded - Wait For Then Click Element css=tr[data-id="foo"] input - Checkbox Should Be Selected css=tr[data-id="foo"] input - Wait until keyword succeeds 30 1 Page should not contain element css=#btn-delete.disabled - - Wait For Then Click Element css=#btngroup-mainbuttons #btn-delete - Wait until page contains element css=.popover-content .btn-danger - Page should contain element css=.breach-container .breach-item - Wait For Then Click Element css=#popover-delete .closeBtn - Checkbox Should Be Selected css=tr[data-id="foo"] input - - -should not show warning when deleting page from folder_contents - Go To ${PLONE_URL}/folder_contents - Given folder contents pattern loaded - Wait For Then Click Element css=tr[data-id="foo"] input - Checkbox Should Be Selected css=tr[data-id="foo"] input - Wait until keyword succeeds 30 1 Page should not contain element css=#btn-delete.disabled - Wait For Then Click Element css=#btngroup-mainbuttons #btn-delete - Wait until page contains element css=.popover-content .btn-danger - Page should not contain element css=.breach-container .breach-item - Wait For Then Click Element css=#popover-delete .applyBtn - Wait until page contains Successfully delete items - Wait until keyword succeeds 30 1 Page should not contain Element css=tr[data-id="foo"] input - - -should not show warning when deleting page - Go To ${PLONE_URL}/foo - Wait For Then Click Element css=#plone-contentmenu-actions > a - Wait For Then Click Element css=#plone-contentmenu-actions-delete - Page should not contain element css=.breach-container .breach-item - - -remove link to page - Go To ${PLONE_URL}/bar - Wait For Then Click Element css=#contentview-edit a - Wait For Element css=.tox-edit-area iframe - Select Frame css=.tox-edit-area iframe - Input text css=.mce-content-body foo - Execute Javascript function selectElementContents(el) {var range = document.createRange(); range.selectNodeContents(el); var sel = window.getSelection(); sel.removeAllRanges(); sel.addRange(range);} var el = document.getElementById("tinymce"); selectElementContents(el); - UnSelect Frame - Click Button css=button[aria-label="Remove link"] - Wait For Then Click Element css=#form-buttons-save + Create content + ... type=Document + ... id=bar + ... title=Bar + +# When +I add a link in rich text + Go To ${PLONE_URL}/bar/edit + Fill text to tinymce editor form.widgets.IRichTextBehavior.text

foo

+ Mark text foo in tinymce editor + Click //button[@aria-label="Insert/edit link"] + Click //div[contains(@class,"linkModal")]//div[contains(@class,"content-browser-selected-items-wrapper")]//button[contains(@class,"btn-primary")] + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[1]/div[contains(@class, "levelItems")]/div[3] + Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[contains(@class, "preview")]/div[contains(@class, "levelToolbar")]/button + Click //div[contains(@class,"modal-footer")]//input[@name="insert"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved + +I remove link to page + Go To ${PLONE_URL}/bar + Click //*[@id="contentview-edit"]//a + Fill text to tinymce editor form.widgets.IRichTextBehavior.text foo + Mark text foo in tinymce editor + Click //button[@aria-label="Remove link"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved + +# Then + +I should see a warning when deleting page + Go To ${PLONE_URL}/foo + Click //*[@id="plone-contentmenu-actions"]/a + Click //*[@id="plone-contentmenu-actions-delete"] + Get Element Count //*[contains(@class,"breach-container")]//*[contains(@class,"breach-item")] greater than 0 + +I should not see a warning when deleting page + Go To ${PLONE_URL}/foo + Click //*[@id="plone-contentmenu-actions"]/a + Click //*[@id="plone-contentmenu-actions-delete"] + Get Element Count //*[contains(@class,"breach-container")]//*[contains(@class,"breach-item")] should be 0 + + +I should see a warning when deleting page from folder_contents + Go To ${PLONE_URL}/folder_contents + Check Checkbox //tr[@data-id="foo"]//input + Get Checkbox State //tr[@data-id="foo"]//input == checked + Get Element Count //*[@id="btngroup-mainbuttons"]//a[@id="btn-delete" and contains(@class,"disabled")] should be 0 + Click //*[@id="btngroup-mainbuttons"]//a[@id="btn-delete"] + Get Element Count //*[contains(@class,"breach-container")]//*[contains(@class,"breach-item")] greater than 0 + Get Checkbox State //tr[@data-id="foo"]//input == checked + + +I should not see a warning when deleting page from folder_contents + Go To ${PLONE_URL}/folder_contents + Check Checkbox //tr[@data-id="foo"]//input + Get Checkbox State //tr[@data-id="foo"]//input == checked + Get Element Count //*[@id="btngroup-mainbuttons"]//a[@id="btn-delete" and contains(@class,"disabled")] should be 0 + Click //*[@id="btngroup-mainbuttons"]//a[@id="btn-delete"] + Get Element States //*[@id="popover-delete"]//*[contains(@class,"popover-content")] contains visible + Get Element Count //*[contains(@class,"breach-container")]//*[contains(@class,"breach-item")] should be 0 + Click //*[contains(@class,"popover-content")]//button[contains(@class,"applyBtn")] + Get Text //body contains Successfully delete items + Get Element Count //tr[@data-id="foo"]//input should be 0 + +# DRY + +Mark text foo in tinymce editor + + # select the text `heading` via javascript + Evaluate JavaScript ${None} + ... () => { + ... let iframe_document = document.querySelector(".tox-edit-area iframe").contentDocument; + ... let body = iframe_document.body; + ... let p = body.firstChild; + ... let range = new Range(); + ... range.setStart(p.firstChild, 0); + ... range.setEnd(p.firstChild, 3); + ... iframe_document.getSelection().removeAllRanges(); + ... iframe_document.getSelection().addRange(range); + ... } + ... all_elements=False diff --git a/Products/CMFPlone/tests/robot/test_livesearch.robot b/Products/CMFPlone/tests/robot/test_livesearch.robot index 8bed725311..a8a2c33ee5 100644 --- a/Products/CMFPlone/tests/robot/test_livesearch.robot +++ b/Products/CMFPlone/tests/robot/test_livesearch.robot @@ -1,84 +1,82 @@ -*** Settings ***************************************************************** +*** Settings *** -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Library Remote ${PLONE_URL}/RobotRemote +Library Remote ${PLONE_URL}/RobotRemote -Variables Products/CMFPlone/tests/robot/variables.py +Variables variables.py -Resource keywords.robot +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown -Test Setup Run keywords Plone Test Setup -Test Teardown Run keywords Plone Test Teardown - -*** Test cases *************************************************************** +*** Test cases *** Scenario: Simple Livesearch Given a logged-in site administrator - and a document Welcome to Plone - When I search for Welcome - Then the livesearch results should contain Welcome to Plone - and expected livesearch results 1 + and a document Welcome to Plone + When I search for Welcome + Then the livesearch results should contain Welcome to Plone + and expected livesearch results 1 Scenario: Livesearch with image results Given a logged-in site administrator - and a news item My News with Image - When I search for My News - Then the livesearch results should contain My News with Image - and expected livesearch results 1 - and Page should contain image css=.livesearch-results li.search-result .col.img img + and a news item My News with Image + When I search for My News + Then the livesearch results should contain My News with Image + and expected livesearch results 1 + and Get Element Count //*[contains(@class,"livesearch-results")]//li[contains(@class,"search-result")]//*[contains(@class,"col") and contains(@class,"img")]//img greater than 0 When I disable images in results in search controlpanel and I search for My News - Then Page should not contain image css=.livesearch-results li.search-result .col.img img + and Get Element Count //*[contains(@class,"livesearch-results")]//li[contains(@class,"search-result")]//*[contains(@class,"col") and contains(@class,"img")]//img should be 0 -*** Keywords ***************************************************************** +*** Keywords *** a document - [Arguments] ${title} - Create content type=Document id=doc title=${title} + [Arguments] ${title} + Create content + ... type=Document + ... id=doc + ... title=${title} a news item - [Arguments] ${title} - Go to ${PLONE_URL}/++add++News Item - Wait until page contains Add News Item - Input text name=form.widgets.IDublinCore.title ${title} - Choose File name=form.widgets.ILeadImageBehavior.image ${PATH_TO_TEST_FILES}/plone-logo.png - Click Button Save - Wait until page contains Item created error=Image could not be created. + [Arguments] ${title} + Go to ${PLONE_URL}/++add++News Item + Type text //input[@name="form.widgets.IDublinCore.title"] ${title} + Upload File By Selector //input[@name="form.widgets.ILeadImageBehavior.image"] ${PATH_TO_TEST_FILES}/pixel.png + Click //button[@name="form.buttons.save"] + Get Text //body contains Item created message=Image could not be created. I search for - [Arguments] ${searchtext} - Input text css=input#searchGadget ${searchtext} - Wait For Element css=input#searchGadget + [Arguments] ${searchtext} + Type Text //input[@id="searchGadget"] ${searchtext} I search the currentfolder only for - [Arguments] ${searchtext} - Select checkbox id=searchbox_currentfolder_only - Input text css=input#searchGadget ${searchtext} - Wait For Element css=input#searchGadget + [Arguments] ${searchtext} + Check Checkbox //*[@id="searchbox_currentfolder_only"] + Type Text //input[@id="searchGadget"] ${searchtext} the livesearch results should contain - [Arguments] ${text} - Wait until keyword succeeds 5s 1s Element should contain css=.livesearch-results li a .heading ${text} + [Arguments] ${text} + Get Element States //ul[contains(@class,"livesearch-results")] contains visible + Get Text //ul[contains(@class,"livesearch-results")] contains ${text} the livesearch results should not contain - [Arguments] ${text} - Wait until keyword succeeds 5s 1s Page should not contain css=.livesearch-results li a .heading ${text} + [Arguments] ${text} + Get Element States //ul[contains(@class,"livesearch-results")] contains visible + Get Text //ul[contains(@class,"livesearch-results")] not contains ${text} expected livesearch results - [Arguments] ${num} - ${count} = Get Element Count css=.livesearch-results li.search-result - Should Be Equal as Numbers ${count} ${num} + [Arguments] ${num} + Get Element Count //*[contains(@class,"livesearch-results")]//li[contains(@class,"search-result")] should be ${num} + I disable images in results in search controlpanel - Go to ${PLONE_URL}/@@search-controlpanel - Wait until page contains Search Settings - Unselect Checkbox form.widgets.search_show_images:list - Click Button Save - Wait until page contains Changes saved + Go to ${PLONE_URL}/@@search-controlpanel + Uncheck Checkbox //input[@name="form.widgets.search_show_images:list"] + Click //button[@name="form.buttons.save"] + Get Text //body contains Changes saved diff --git a/Products/CMFPlone/tests/robot/test_overlays.robot b/Products/CMFPlone/tests/robot/test_overlays.robot index b8fca6d3d9..5b96532721 100644 --- a/Products/CMFPlone/tests/robot/test_overlays.robot +++ b/Products/CMFPlone/tests/robot/test_overlays.robot @@ -1,22 +1,18 @@ *** Settings *** -Documentation These tests are just testing the overlay behavior not the -... functionality of each form. This is supposed to be tested in -... functional tests somewhere. At some point in the future the -... functional tests can be transferred to robot tests into each -... scenario test case. +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Library Remote ${PLONE_URL}/RobotRemote -Library Remote ${PLONE_URL}/RobotRemote +Variables variables.py -Resource common.robot +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown -Test Setup Run Keywords Plone test setup -Test Teardown Run keywords Plone test teardown +*** Variables *** +${TEST_FOLDER} test-folder *** Test cases *** @@ -25,78 +21,65 @@ Scenario: Contact form overlay opens When I click the 'Contact' link Then overlay should open + Scenario: Contact form overlay closes - Go to ${PLONE_URL}/logout - Given the 'Contact' overlay + Given the site root logged out + and the 'Contact' overlay When I close the overlay Then overlay should close Scenario: Log in form overlay opens - Go to ${PLONE_URL}/logout - Given the site root + Given the site root logged out + and the site root When I click the 'Log in' link Then overlay should open Scenario: Log in form overlay closes - Go to ${PLONE_URL}/logout - Given the site root - Given the 'Log in' overlay + Given the site root logged out + and the site root + and the 'Log in' overlay When I close the overlay Then overlay should close Scenario: Log in form overlay remains on wrong credentials - Go to ${PLONE_URL}/logout - Given the site root - Given the 'Log in' overlay + Given the site root logged out + and the site root + and the 'Log in' overlay When I enter wrong credentials Then overlay should remain open - And login overlay shows an error + and login overlay shows an error Scenario: Log in form overlay closes on valid credentials - Go to ${PLONE_URL}/logout - Given the site root - Given the 'Log in' overlay + Given the site root logged out + and the site root + and the 'Log in' overlay When I enter valid credentials Then overlay should close Scenario: Set default content item of a folder overlay opens Given a logged-in site administrator - And a document 'doc' in the test folder + and a document 'doc' in the test folder When I set the default content view of the test folder Then overlay should open -# XXX Next 2 tests are commented out. After hours of messing around, -# I still can not pinpoint why this is happening. -# The error originates from this change https://github.com/plone/mockup/commit/ccec87028bc22e082d6d9a95874d8a961f91b707 -# which provides at least some error reporting(window.alert) to users when modals -# experience issues. We need this change in modals... -# -# However, in these 2 cases, it is triggering the window.alert -# and causing the tests to fail in certain cases. -# It ONLY happens when running automatically by the robot framework -# runner. If you try to use Import library DebugLibrary and -# run the commands manually, of course it works fine. So yes, -# there is no way to really figure out this AFAIK. -# Also, of course, this doesn't happen in real user testing. -# -#Scenario: Change default content item of a folder overlay opens -# Given a logged-in site administrator -# And a document as the default view of the test folder -# When I change the default content view of the test folder -# Then overlay should open - -#Scenario: Change default content item of a folder overlay closes -# Given a logged-in site administrator -# And a document as the default view of the test folder -# When I change the default content view of the test folder -# And I 'Cancel' the form -# Then overlay should close -# When I change the default content view of the test folder -# And I 'Save' the form -# Then overlay should close -# When I change the default content view of the test folder -# And I close the overlay -# Then overlay should close +Scenario: Change default content item of a folder overlay opens + Given a logged-in site administrator + and a document as the default view of the test folder + When I change the default content view of the test folder + Then overlay should open + +Scenario: Change default content item of a folder overlay closes + Given a logged-in site administrator + And a document as the default view of the test folder + When I change the default content view of the test folder + And I 'Cancel' the form + Then overlay should close + When I change the default content view of the test folder + And I 'Save' the form + Then overlay should close + When I change the default content view of the test folder + And I close the overlay + Then overlay should close Scenario: Delete content action overlay opens Given a logged-in site administrator @@ -132,7 +115,7 @@ Scenario: Rename content action overlay closes Scenario: Register user overlay opens Given the mail setup configured And the self registration enabled - Go to ${PLONE_URL}/logout + and the site root logged out And the site root When I click the 'Register' link Then overlay should open @@ -140,7 +123,7 @@ Scenario: Register user overlay opens Scenario: Register user overlay closes Given the mail setup configured And the self registration enabled - Go to ${PLONE_URL}/logout + and the site root logged out And the site root And the 'Register' overlay When I close the overlay @@ -149,24 +132,22 @@ Scenario: Register user overlay closes Scenario: Register user overlay remains on wrong data Given the mail setup configured And the self registration enabled - Go to ${PLONE_URL}/logout + and the site root logged out And the site root And the 'Register' overlay When I send the register form Then overlay should remain open And overlay shows an error -# Note: For this one we need to fake the mail server, as it tries to send the -# mail right away. Or change the somehow confusing message that shows when this -# happens. -#Scenario: Register user overlay closes on valid data -# Given the mail setup configured -# And the self registration enabled -# And the site root -# And the 'Register' overlay -# When I enter valid register user data -# And I send the register form -# Then overlay should close +# Tests based on MockupMailServer, this should be a valid tests +Scenario: Register user overlay closes on valid data + Given the mail setup configured + And the self registration enabled + And the site root + And the 'Register' overlay + When I enter valid register user data + And I send the register form + Then overlay should close Scenario: New user overlay opens Given a logged-in site administrator @@ -190,144 +171,137 @@ Scenario: New user overlay closes on valid data And I send the register form Then overlay should close -# There is no more history overlay -# Scenario: History overlay opens -# Given a logged-in site administrator -# And the test folder -# When I click the 'Content Info' link -# And I click the 'History' link -# Then overlay should open -# -# Scenario: History overlay closes -# Given a logged-in site administrator -# And the test folder -# When I click the 'Content Info' link -# And I click the 'History' link -# When I close the overlay -# Then overlay should close -# + *** Keywords *** -Background - Given a logged-in site administrator - and a test folder - Disable autologin - Go to homepage +# GIVEN +the site root logged out + Go to ${PLONE_URL}/logout + +the site root + Go to ${PLONE_URL} + + +the '${link_name}' overlay + Click //a[descendant-or-self::*[contains(text(), "${link_name}")]] + Get Element Count //div[contains(@class,"modal-dialog")] greater than 0 + + +a document '${title}' in the test folder + Go to ${PLONE_URL}/${TEST_FOLDER}/++add++Document + Type Text //input[@id="form-widgets-IDublinCore-title"] ${title} + Click //button[@name="form.buttons.save"] + + +a document as the default view of the test folder + a document 'doc' in the test folder + Go to ${PLONE_URL}/${TEST_FOLDER} + Click //li[@id='plone-contentmenu-display']/a + Click //a[@id="contextSetDefaultPage"] + Click //input[@id="doc"] + Click //div[contains(@class,"modal-footer")]//button[@name="form.buttons.Save"] + Wait For Condition Text //body//h1 contains doc -a logged-in site administrator - Enable autologin as Site Administrator the users and groups configlet - Go to ${PLONE_URL}/@@usergroup-userprefs - Wait until page contains User Search + Go to ${PLONE_URL}/@@usergroup-userprefs + Get Text //body contains User Search + +# WHEN I click the '${link_name}' link - Wait until page contains ${link_name} - Element should be visible xpath=//a[descendant-or-self::*[contains(text(), '${link_name}')]] - Click Link xpath=//a[descendant-or-self::*[contains(text(), '${link_name}')]] + Get Element Count //a[descendant-or-self::*[contains(text(), "${link_name}")]] greater than 0 + Click //a[descendant-or-self::*[contains(text(), "${link_name}")]] -the '${link_name}' overlay - Wait until page contains ${link_name} - Click Link xpath=//a[descendant-or-self::*[contains(text(), '${link_name}')]] - Wait until keyword succeeds 30 1 Page should contain element css=div.modal-dialog -overlay should open - Wait until keyword succeeds 30 1 Element Should Be Visible css=div.modal-dialog +I close the overlay + Click //div[contains(@class,"modal-header")]//button[contains(@class,"modal-close")] -overlay should remain open - Wait until page contains element css=div.modal-wrapper - Wait until element is visible css=div.modal-wrapper -I close the overlay - Click Element css=div.modal-header button.modal-close +I enter wrong credentials + I enter credentials wrong user -overlay should close - Wait until keyword succeeds 40 1 Page should not contain element css=div.modal-dialog -login overlay shows an error - Wait Until Page Contains Error +I enter valid credentials + I enter credentials ${SITE_OWNER_NAME} ${SITE_OWNER_PASSWORD} -overlay shows an error - Wait Until Page Contains There were errors -overlay requires to compile a field - Wait Until Page Contains Required input is missing +I set the default content view of the test folder + Go to ${PLONE_URL}/${TEST_FOLDER} + Click //li[@id='plone-contentmenu-display']/a + Click //a[@id="contextSetDefaultPage"] + + +I change the default content view of the test folder + Go to ${PLONE_URL}/${TEST_FOLDER} + Click //li[@id='plone-contentmenu-display']/a + Click //a[@id="folderChangeDefaultPage"] + I '${action}' the form - Wait until keyword succeeds 30 1 Element Should Be Visible css=div.modal-footer button[name="form.buttons.${action}"] - Click Element css=div.modal-footer button[name="form.buttons.${action}"] + Click //div[contains(@class,"modal-footer")]//button[@name="form.buttons.${action}"] -I enter wrong credentials - Input text __ac_name wrong - Input text __ac_password user - Wait For Then Click Element css=div.modal-footer button -I enter valid credentials - Wait until page contains element name=__ac_name - Input text for sure __ac_name ${SITE_OWNER_NAME} - Input text for sure __ac_password ${SITE_OWNER_PASSWORD} - Wait For Then Click Element css=div.modal-footer button +I trigger the '${action}' action menu item of the test folder + Go to ${PLONE_URL}/${TEST_FOLDER} + Click //li[@id="plone-contentmenu-actions"]/a + Click //a[@id="plone-contentmenu-actions-${action}"] -I enter valid user data - Wait until page contains element name=form.widgets.password_ctl - Input text for sure form.widgets.username myuser - Input text for sure form.widgets.email my@email.eu - Input text for sure form.widgets.password newpassword - Input text for sure form.widgets.password_ctl newpassword -I enter valid register user data - Wait until page contains element name=form.widgets.username - Input text form.widgets.username myuser - Input text form.widgets.email my@email.eu +I confirm deletion of the content + Click //div[contains(@class,"modal-footer")]//button[@name="form.buttons.Delete"] + I send the register form - Wait until page contains element css=div.modal-footer #form-buttons-register - Click Element css=div.modal-footer #form-buttons-register + Click //div[contains(@class,"modal-footer")]//button[@name="form.buttons.register"] + + +I enter valid register user data + Type Text //input[@name="form.widgets.username"] myuser + Type Text //input[@name="form.widgets.email"] myuser@plone.org + I trigger the add a new user action - Click Element id=add-user + Click //a[@id="add-user"] -a document '${title}' in the test folder - Go to ${PLONE_URL}/${TEST_FOLDER}/++add++Document - Wait For Condition return window.jQuery('.autotoc-nav .active:visible').length > 0 - Execute Javascript $('#form-widgets-IDublinCore-title').val('${title}'); return 0; - Click Button Save -I set the default content view of the test folder - Go to ${PLONE_URL}/${TEST_FOLDER} - Given patterns are loaded - Click link xpath=//li[@id='plone-contentmenu-display']/a - Click link id=contextSetDefaultPage +I enter valid user data + Type Text //input[@name="form.widgets.username"] myuser + Type Text //input[@name="form.widgets.email"] myuser@plone.org + Type Text //input[@name="form.widgets.password"] newpassword + Type Text //input[@name="form.widgets.password_ctl"] newpassword -a document as the default view of the test folder - a document 'doc' in the test folder - Go to ${PLONE_URL}/${TEST_FOLDER} - Given patterns are loaded - Click link xpath=//li[@id='plone-contentmenu-display']/a - Wait until element is visible id=contextSetDefaultPage - Click link id=contextSetDefaultPage - Click element id=doc - Click element css=div.modal-footer button[name="form.buttons.Save"] -I change the default content view of the test folder - Go to ${PLONE_URL}/${TEST_FOLDER} - Given patterns are loaded - Click link xpath=//li[@id='plone-contentmenu-display']/a - Wait until element is visible id=folderChangeDefaultPage - Click link id=folderChangeDefaultPage -I trigger the '${action}' action menu item of the test folder - Go to ${PLONE_URL}/${TEST_FOLDER} - Given patterns are loaded - Element should be visible xpath=//li[@id='plone-contentmenu-actions']/a - Click link xpath=//li[@id='plone-contentmenu-actions']/a - Wait until element is visible id=plone-contentmenu-actions-${action} - Click link id=plone-contentmenu-actions-${action} - Wait until page contains Element css=div.modal-dialog +# THEN + +overlay should open + Get Element States //div[contains(@class,"modal-dialog")] contains visible + + +overlay should close + Get Element Count //div[contains(@class,"modal-dialog")] should be 0 + + +overlay should remain open + Get Element States //div[contains(@class,"modal-wrapper")] contains visible + + +login overlay shows an error + Get Text //div[contains(@class,"modal-wrapper")] contains Error + + +overlay shows an error + Get Text //div[contains(@class,"modal-wrapper")] contains There were errors + + +overlay requires to compile a field + Get Text //div[contains(@class,"modal-wrapper")] contains Required input is missing -I confirm deletion of the content - # Note: The 'delete' button has no standard z3c.form name attribute - Wait until keyword succeeds 2 2 Click Element css=div.modal-footer button#form-buttons-Delete -modals loaded - Wait For Condition return window.jQuery('.modal-wrapper').size() > 0 +# DRY +I enter credentials + [Arguments] ${username} ${password} + Type Text //input[@name="__ac_name"] ${username} + Type Text //input[@name="__ac_password"] ${password} + Click //div[contains(@class,"modal-footer")]//button diff --git a/Products/CMFPlone/tests/robot/test_portlets.robot b/Products/CMFPlone/tests/robot/test_portlets.robot index 6167adc91b..5641220fab 100644 --- a/Products/CMFPlone/tests/robot/test_portlets.robot +++ b/Products/CMFPlone/tests/robot/test_portlets.robot @@ -1,56 +1,89 @@ -*** Settings ***************************************************************** +*** Settings *** -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Library Remote ${PLONE_URL}/RobotRemote +Library Remote ${PLONE_URL}/RobotRemote -Resource keywords.robot +Variables variables.py -Test Setup Run keywords Plone Test Setup -Test Teardown Run keywords Plone Test Teardown +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown -*** Test cases *************************************************************** +*** Test cases *** -Scenario: Add Login Portlet +Scenario: Add Login Portlet to left column Given a logged-in site administrator and a manage portlets view When I add a 'Login' portlet to the left column + and I go to portal root Then I should see a 'Login' portlet in the left column +Scenario: Add Login Portlet to right column + Given a logged-in site administrator + and a manage portlets view + When I add a 'Login' portlet to the right column + and I go to portal root + Then I should see a 'Login' portlet in the right column -*** Keywords ***************************************************************** +Scenario: Delete Login Portlet from left column + Given a logged-in site administrator + and a manage portlets view + When I add a 'Login' portlet to the left column + and I delete a 'Login' portlet from the left column + and I go to portal root + Then I should not see a 'Login' portlet in the left column + +Scenario: Delete Login Portlet from right column + Given a logged-in site administrator + and a manage portlets view + When I add a 'Login' portlet to the right column + and I delete a 'Login' portlet from the right column + and I go to portal root + Then I should not see a 'Login' portlet in the right column + +# TODO: Move Portlets Up and Down +*** Keywords *** + +# Given a manage portlets view - Go to ${PLONE_URL}/@@manage-portlets - Wait until page contains Manage portlets + Go to ${PLONE_URL}/@@manage-portlets + Get Text //body contains Manage portlets + +# When I add a '${portletname}' portlet to the left column - Select from list by label xpath=//div[@id="portletmanager-plone-leftcolumn"]//select ${portletname} + Select Options By //div[@id="portletmanager-plone-leftcolumn"]//select[contains(@class,"add-portlet")] label ${portletname} + Get Text //body contains Portlet added I add a '${portletname}' portlet to the right column - Select from list by label xpath=//div[@id="portletmanager-plone-rightcolumn"]//select ${portletname} + Select Options By //div[@id="portletmanager-plone-rightcolumn"]//select[contains(@class,"add-portlet")] label ${portletname} + Get Text //body contains Portlet added + +I go to portal root + Disable autologin + Go to ${PLONE_URL} + +I delete a '${portlet}' portlet from the left column + Click //*[@id="portletmanager-plone-leftcolumn"]/div[2]/div[2]/div[2]/form[3]/button + Get Element Count //*[@id="portletmanager-plone-leftcolumn"]//div[@class="portletAssignment"] <= 1 -I delete a '${portlet}'' portlet from the left column - Click Link xpath=//div[@id="portal-column-one"]//div[@class="portletHeader" and contains(.,"${portlet}")]//a[@class="delete"] don't wait - Wait until keyword succeeds 1s 10s Flex Element Should not exist xpath=//div[@id="portal-column-one"]//div[@class="portletHeader" and contains(.,"${portlet}")] +I delete a '${portlet}' portlet from the right column + Click //*[@id="portletmanager-plone-rightcolumn"]/div[2]/div[2]/div[2]/form[3]/button + Get Element Count //*[@id="portletmanager-plone-rightcolumn"]//div[@class="portletAssignment"] <= 1 -when I delete the '${portlet}' portlet from the right column - Click Link xpath=//div[@id="portal-column-two"]//div[@class="portletHeader" and contains(.,"${portlet}")]//a[@class="delete"] don't wait - Wait until keyword succeeds 1s 10s Flex Element Should not exist xpath=//div[@id="portal-column-two"]//div[@class="portletHeader" and contains(.,"${portlet}")] +# Then I should see a '${portletname}' portlet in the left column - Wait until page contains ${portletname} - Element should contain portal-column-one ${portletname} + Get Element Count //*[@id="portal-column-one"]//div[contains(@class,"portlet${portletname}")] should be 1 I should see a '${portletname}' portlet in the right column - Wait until page contains ${portletname} - Element should contain portal-column-two ${portletname} + Get Element Count //*[@id="portal-column-two"]//div[contains(@class,"portlet${portletname}")] should be 1 -I should not see '${text}' in the left column - Flex Element should not exist xpath=//div[@id="portal-column-one" and contains(.,"${text}")] +I should not see a '${text}' portlet in the left column + Get Element Count //*[@id="portal-column-one"]//div[contains(@class,"portlet${text}")] should be 0 -I should not see '${text}' in the right column - Flex Element should not exist xpath=//div[@id="portal-column-two" and contains(.,"${text}")] +I should not see a '${text}' portlet in the right column + Get Element Count //*[@id="portal-column-two"]//div[contains(@class,"portlet${text}")] should be 0 diff --git a/Products/CMFPlone/tests/robot/test_querystring.robot b/Products/CMFPlone/tests/robot/test_querystring.robot index 5a5e66fbf7..ae0a1a3bf4 100644 --- a/Products/CMFPlone/tests/robot/test_querystring.robot +++ b/Products/CMFPlone/tests/robot/test_querystring.robot @@ -1,246 +1,346 @@ -*** Settings ***************************************************************** +*** Settings *** -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Resource plone/app/robotframework/browser.robot +Resource keywords.robot -Library Remote ${PLONE_URL}/RobotRemote +Library Remote ${PLONE_URL}/RobotRemote -Resource keywords.robot +Variables variables.py -Test Setup Run keywords Plone Test Setup -Test Teardown Run keywords Plone Test Teardown +Test Setup Run Keywords Plone test setup +Test Teardown Run keywords Plone test teardown -*** Test Cases ************************************************************** + +*** Test Cases *** Scenario: Location query Current Given a logged-in site administrator - and a bunch of folders - and the querystring pattern - When I activate the operator Current in the criteria Location - Then we expect 1 hits + and a bunch of folders + and the querystring pattern + When I activate the operator Current in the criteria Location + Then we expect 1 hits Scenario: Location query Parent Given a logged-in site administrator - and a bunch of folders - and the querystring pattern - When I activate the operator Parent in the criteria Location - Then we expect 3 hits + and a bunch of folders + and the querystring pattern + When I activate the operator Parent in the criteria Location + Then we expect 3 hits Scenario: Location query Custom Given a logged-in site administrator - and a bunch of folders - and the querystring pattern - When I activate the operator Custom in the criteria Location - and I search in B subfolder in the related items widget - Then we expect 5 hits + and a bunch of folders + and the querystring pattern + When I activate the operator Custom in the criteria Location + and I search in B subfolder in the related items widget + Then we expect 5 hits Scenario: Location query Advanced Given a logged-in site administrator - and a bunch of folders - and the querystring pattern - When I activate the operator Advanced in the criteria Location - Then I expect to be in Advanced mode + and a bunch of folders + and the querystring pattern + When I activate the operator Advanced in the criteria Location + Then I expect to be in Advanced mode Scenario: Location query Simple + # this fails simple is not available, first select 'Advanced Mode' then you can select 'Simple Mode' Given a logged-in site administrator - and a bunch of folders - and the querystring pattern - When I activate the operator Simple in the criteria Location - Then I expect to be in Simple mode + and a bunch of folders + and the querystring pattern + When I activate the operator Advanced in the criteria Location + and I open the select box titled operator + and I select index Simple + Then I expect to be in Simple mode Scenario: Title query Given a logged-in site administrator - and a bunch of folders - and the querystring pattern - When I open the criteria Title - and I search for A - Then we expect 1 hits + and a bunch of folders + and the querystring pattern + When I open the criteria Title + and I search for A + Then we expect 1 hits Scenario: Description query Given a logged-in site administrator - and a bunch of folders - and the querystring pattern - When I open the criteria Description - and I search for a - Then we expect 1 hits + and a bunch of folders + and the querystring pattern + When I open the criteria Description + and I search for a + Then we expect 1 hits Scenario: Searchable text query Given a logged-in site administrator - and a bunch of folders - and the querystring pattern - When I open the criteria Searchable text - and I search for a - and Sleep 0.2 - and Wait For Then Click Element css=div.querystring-preview - Then we expect 2 hits - When I open the criteria Searchable text - and I search for d - Then we expect 1 hits + and a bunch of folders + and the querystring pattern + When I open the criteria Searchable text + and I search for a + and Sleep 0.2 + Then we expect 2 hits + + When I open the criteria Searchable text + and I search for d + Then we expect 1 hits Scenario: Tag query one + + ${base_option_selector}= Set Variable select2-results-dept-0 select2-result select2-result-selectable select2-option + ${base_option_selector_o}= Set Variable ${base_option_selector}-o + ${base_option_selector_n}= Set Variable ${base_option_selector}-n + ${base_option_selector_p}= Set Variable ${base_option_selector}-p + ${base_option_selector_e}= Set Variable ${base_option_selector}-e # tests the "Matches any of" option Given a logged-in site administrator - and a bunch of folders - and the querystring pattern - When I activate the default operator in the criteria Tag - and I open the Selection Widget - ${base_option_selector} Set Variable li.select2-results-dept-0.select2-result.select2-result-selectable.select2-option - and Wait For Then Click Element css=${base_option_selector}-o - Then we expect 4 hits - When I open the Selection Widget - and Wait For Then Click Element css=${base_option_selector}-n - Then we expect 4 hits - When I delete my selection - and I open the Selection Widget - and Wait For Then Click Element css=${base_option_selector}-p - Then we expect 1 hits - When I open the Selection Widget - and Wait For Then Click Element css=${base_option_selector}-e - Then we expect 2 hits + and a bunch of folders + and the querystring pattern + When I activate the default operator in the criteria Tag + and I open the Selection Widget + and Click //li[contains(@class,"${base_option_selector_o}")] + Then we expect 4 hits + + When I open the Selection Widget + and Click //li[contains(@class,"${base_option_selector_n}")] + Then we expect 4 hits + + When I delete my selection + and I open the Selection Widget + and Click //li[contains(@class,"${base_option_selector_p}")] + Then we expect 1 hits + + When I open the Selection Widget + and Click //li[contains(@class,"${base_option_selector_e}")] + Then we expect 2 hits Scenario Tag query two + ${base_option_selector}= Set Variable select2-results-dept-0 select2-result select2-result-selectable select2-option + ${base_option_selector_o}= Set Variable ${base_option_selector}-o + ${base_option_selector_n}= Set Variable ${base_option_selector}-n + ${base_option_selector_p}= Set Variable ${base_option_selector}-p + ${base_option_selector_e}= Set Variable ${base_option_selector}-e # tests the "Matches all of" option Given a logged-in site administrator - and a bunch of folders - and the querystring pattern - When I expect an empty result after open the operator Matches all of in the criteria Tag - and I open the Selection Widget - ${base_option_selector} Set Variable li.select2-results-dept-0.select2-result.select2-result-selectable.select2-option - and Wait For Then Click Element css=${base_option_selector}-o - Then we expect 4 hits - When and I open the Selection Widget - and Wait For Then Click Element css=${base_option_selector}-n - Then we expect 3 hits - When I delete my selection - and and I open the Selection Widget - and Wait For Then Click Element css=${base_option_selector}-p - Then we expect 1 hits - When and I open the Selection Widget - and Wait For Then Click Element css=${base_option_selector}-e - Then we expect 1 hits + and a bunch of folders + and the querystring pattern + When I expect an empty result after open the operator Matches all of in the criteria Tag + and I open the Selection Widget + and Click //li[contains(@class,"${base_option_selector_o}")] + Then we expect 4 hits + + When I open the Selection Widget + and Click //li[contains(@class,"${base_option_selector_n}")] + Then we expect 3 hits + + When I delete my selection + and I open the Selection Widget + and Click //li[contains(@class,"${base_option_selector_p}")] + Then we expect 1 hits + + When I open the Selection Widget + and Click //li[contains(@class,"${base_option_selector_e}")] + Then we expect 1 hits Scenario Event end date query Given a logged-in manager - and a bunch of events - and the querystring pattern + and a bunch of events + and the querystring pattern # Before date - When I activate the default operator in the criteria Event end date - and Execute Javascript $('.querystring-criteria-value input[type="date"]').val('2018-07-01') - Then we do not expect any hits + When I activate the default operator in the criteria Event end date + and Evaluate Javascript //div[contains(@class,"querystring-criteria-value")]//input[@type="date"] + ... (element) => { + ... # fire the event for the browser build-in date input field + ... element.value="2018-07-01"; + ... element.dispatchEvent(new Event("change", { bubbles: true })); + ... } + ... all_elements=False + + Then we do not expect any hits # When Execute Javascript $('.querystring-criteria-value input[type="date"]').val('2018-07-06') - # !!! BUG in plone.app.robotframework? + # !!! BUG in plone.app.robotframework ? # File "~/.buildout/shared-eggs/plone.app.event-3.2.1-py3.6.egg/plone/app/event/recurrence.py", line 77, in occurrences # duration = event_end - event_start # TypeError: can't subtract offset-naive and offset-aware datetimes - # for some reason the timezone is not applied correctly here. this is - # probably a problem with plone.app.robotframework.content creation mechanism. - # actually we got 3 hits, but right would be: - # Then we expect 2 hits - # Between dates - # When I activate the operator Between dates in the criteria Event end date - # and Execute Javascript $($('.querystring-criteria-value .pattern-pickadate-date-wrapper > input[type="text"]')[0]).pickadate('picker').set('select', new Date(2018, 7, 1)) - # and Execute Javascript $($('.querystring-criteria-value .pattern-pickadate-date-wrapper > input[type="text"]')[1]).pickadate('picker').set('select', new Date(2018, 7, 7)) - # Then we expect 3 hits - # When Execute Javascript $($('.querystring-criteria-value .pattern-pickadate-date-wrapper > input[type="text"]')[0]).pickadate('picker').set('select', new Date(2018, 7, 6)) - # and Execute Javascript $($('.querystring-criteria-value .pattern-pickadate-date-wrapper > input[type="text"]')[1]).pickadate('picker').set('select', new Date(2018, 7, 8)) - # Then we expect 2 hits + # When Evaluate Javascript //div[contains(@class,"querystring-criteria-value")]//input[@type="date"] + # ... (element) => { + # ... # fire the event for the browser build-in date input field + # ... element.value="2018-08-06"; + # ... element.dispatchEvent(new Event("change", { bubbles: true })); + # ... } + # ... all_elements=False + # Then we expect 2 hits + + # # Between dates + # When I activate the operator Between dates in the criteria Event end date + # and Evaluate Javascript //div[contains(@class,"querystring-criteria-value")]//input[@type="date" and contains(@class,"querystring-criteria-value-DateRangeWidget-start")] + # ... (element) => { + # ... # fire the event for the browser build-in date input field + # ... element.value="2018-08-01"; + # ... element.dispatchEvent(new Event("change", { bubbles: true })); + # ... } + # ... all_elements=False + # and Evaluate Javascript //div[contains(@class,"querystring-criteria-value")]//input[@type="date" and contains(@class,"querystring-criteria-value-DateRangeWidget-end")] + # ... (element) => { + # ... # fire the event for the browser build-in date input field + # ... element.value="2018-08-07"; + # ... element.dispatchEvent(new Event("change", { bubbles: true })); + # ... } + # ... all_elements=False + # Then we expect 3 hits + + # # Between dates + # When I activate the operator Between dates in the criteria Event end date + # and Evaluate Javascript //div[contains(@class,"querystring-criteria-value")]//input[@type="date" and contains(@class,"querystring-criteria-value-DateRangeWidget-start")] + # ... (element) => { + # ... # fire the event for the browser build-in date input field + # ... element.value="2018-08-06"; + # ... element.dispatchEvent(new Event("change", { bubbles: true })); + # ... } + # ... all_elements=False + # and Evaluate Javascript //div[contains(@class,"querystring-criteria-value")]//input[@type="date" and contains(@class,"querystring-criteria-value-DateRangeWidget-end")] + # ... (element) => { + # ... # fire the event for the browser build-in date input field + # ... element.value="2018-08-06"; + # ... element.dispatchEvent(new Event("change", { bubbles: true })); + # ... } + # ... all_elements=False + # Then we expect 2 hits + + Scenario Short name (id) query Given a logged-in site administrator - and a bunch of folders - and the querystring pattern - When I open the criteria Short name (id) - And I search for a - Then Page Should Contain A + and a bunch of folders + and the querystring pattern + When I open the criteria Short name (id) + and I search for a + Then I see A in Preview Scenario Review state query Given a logged-in site administrator - and a bunch of folders - and the querystring pattern - When I open the criteria Review State - and I open the Selection Widget - and Wait For Then Click Element css=li.select2-option-private - Then we expect 7 hits + and a bunch of folders + and the querystring pattern + When I open the criteria Review State + and I open the Selection Widget + and Click //li[contains(@class,"select2-option-private")] + Then we expect 7 hits Scenario Type query Given a logged-in site administrator - and a bunch of events - and the querystring pattern - When I open the criteria Type - and I open the Selection Widget - and Wait For Then Click Element css=li.select2-option-event - Then we expect 4 hits - When I delete one selection - and I open the Selection Widget - and Wait For Then Click Element css=li.select2-option-file - Then we do not expect any hits - When I delete one selection - and I open the Selection Widget - and Wait For Then Click Element css=li.select2-option-folder - Then we expect 5 hits - When I delete one selection - and I open the Selection Widget - and Wait For Then Click Element css=li.select2-option-link - Then we expect 1 hits - When I delete one selection - and I open the Selection Widget - and Wait For Then Click Element css=li.select2-option-document - Then we expect 2 hits - When I open the Selection Widget - and Wait For Then Click Element css=li.select2-option-link - Then we expect 3 hits + and a bunch of events + and the querystring pattern + When I open the criteria Type + and I open the Selection Widget + and Click //li[contains(@class,"select2-option-event")] + Then we expect 4 hits + + When I delete one selection + and I open the Selection Widget + and Click //li[contains(@class,"select2-option-file")] + Then we do not expect any hits + + When I delete one selection + and I open the Selection Widget + and Click //li[contains(@class,"select2-option-folder")] + Then we expect 5 hits + + When I delete one selection + and I open the Selection Widget + and Click //li[contains(@class,"select2-option-link")] + Then we expect 1 hits + + When I delete one selection + and I open the Selection Widget + and Click //li[contains(@class,"select2-option-document")] + Then we expect 2 hits + + When I open the Selection Widget + and Click //li[contains(@class,"select2-option-link")] + Then we expect 3 hits Scenario Creator query Given a logged-in site administrator - and a bunch of folders - and the querystring pattern - When I activate the default operator in the criteria Creator - Then we expect 6 hits + and a bunch of folders + and the querystring pattern + When I activate the default operator in the criteria Creator + Then we expect 6 hits -*** Keywords **************************************************************** +*** Keywords *** -save - Click Link css=input#form-buttons-save - -the querystring pattern - #We go the /a to give more useful query results - Go to ${PLONE_URL}/a/++add++Collection - Wait until page contains element css=.pat-querystring - Given querystring pattern loaded - # Set a title, otherwise you see 'Please fill out this field' - Execute Javascript $('#form-widgets-IDublinCore-title').val('A Collection'); return 0; - # for some unknown reason unload protection pops up, but only in robot tests - Execute Javascript $(window).unbind('beforeunload') - -querystring pattern loaded - Wait For Condition return !!document.querySelector('.querystring-criteria-remove') +# GIVEN a bunch of folders #We create enough items to give meaningful test results - ${F1}= Create content type=Folder title=A description=a subject=onep - ${F2}= Create content type=Folder title=B description=b subject=one container=${F1} - ${F3}= Create content type=Folder title=C description=and subject=on container=${F2} - Create content type=Document title=D subject=o container=${F3} - Create content type=Document title=E container=${F3} - Create content type=Link title=Link remoteUrl=/front-page container=${F3} + ${F1}= Create content + ... type=Folder + ... title=A + ... description=a + ... subject=onep + ${F2}= Create content + ... type=Folder + ... title=B + ... description=b + ... subject=one + ... container=${F1} + ${F3}= Create content + ... type=Folder + ... title=C + ... description=and + ... subject=on + ... container=${F2} + Create content + ... type=Document + ... title=D + ... subject=o + ... container=${F3} + Create content + ... type=Document + ... title=E + ... container=${F3} + Create content + ... type=Link + ... title=Link + ... remoteUrl=/front-page + ... container=${F3} [Return] ${F1} + a bunch of events ${F1}= a bunch of folders - Create content type=Event title=Event1 start=2018-08-01T15:00 end=2018-08-01T17:00 container=${F1} - Create content type=Event title=Event2 start=2018-08-05T16:00 end=2018-08-07T11:00 container=${F1} - Create content type=Event title=Event3 start=2018-08-05T16:30 open_end-empty-marker=1 container=${F1} - Create content type=Event title=Event4 start=2018-08-06 end=2018-08-06 whole_day-empty-marker=1 container=${F1} + Create content + ... type=Event + ... title=Event1 + ... start=2018-08-01T15:00 + ... end=2018-08-01T17:00 + ... container=${F1} + Create content + ... type=Event + ... title=Event2 + ... start=2018-08-05T16:00 + ... end=2018-08-07T11:00 + ... container=${F1} + Create content + ... type=Event + ... title=Event3 + ... start=2018-08-05T16:30 + ... open_end-empty-marker=1 + ... container=${F1} + Create content + ... type=Event + ... title=Event4 + ... start=2018-08-06 + ... end=2018-08-06 + ... whole_day-empty-marker=1 + ... container=${F1} -I activate the default operator in the criteria ${CRITERIA} - open the select box titled index - select index type ${CRITERIA} +the querystring pattern + #We go the /a to give more useful query results + Go to ${PLONE_URL}/a/++add++Collection + Type Text //input[@id="form-widgets-IDublinCore-title"] A Collection + +# WHEN I activate the operator ${OPERATOR} in the criteria ${CRITERIA} open the select box titled index @@ -249,98 +349,129 @@ I activate the operator ${OPERATOR} in the criteria ${CRITERIA} open the select box titled operator select index type ${OPERATOR} -I expect an empty result after open the operator ${OPERATOR} in the criteria ${CRITERIA} - open the select box titled index - select index type ${CRITERIA} - Wait for condition return $("dl.searchResults").length == 0 + +I search in ${NAME} subfolder in the related items widget + mark results + Click //div[@class="pat-relateditems-container"]//ul[@class="select2-choices"] + # I have seen this fail sometimes, where the screen shot showed the NAME just fine. + Sleep 0.1 + Click //a[contains(concat(' ', normalize-space(@class), ' '), ' pat-relateditems-result-select ')]//span[contains(text(),'${NAME}')] + + +I open the select box titled operator open the select box titled operator - select index type ${OPERATOR} + + +I select index Simple + select index type Simple + I open the criteria ${CRITERIA} open the select box titled index select index type ${CRITERIA} + I search for ${KEYWORD} - ${keyword_selector} Set Variable input.querystring-criteria-value-StringWidget - Wait For Then Click Element css=${keyword_selector} - Input Text css=${keyword_selector} ${KEYWORD} - Click Element css=div#content-core + ${element} Get Element //input[contains(@class,"querystring-criteria-value-StringWidget")] + Click ${element} + Type Text ${element} ${KEYWORD} + Click //div[@id="content-core"] + + +I activate the default operator in the criteria ${CRITERIA} + open the select box titled index + select index type ${CRITERIA} + I open the Selection Widget - Wait For Then Click Element css=div.select2-container-multi.querystring-criteria-value-MultipleSelectionWidget + Click //div[contains(@class,"select2-container-multi") and contains(@class,"querystring-criteria-value-MultipleSelectionWidget")] -I delete one selection - #deletes one element - Wait For Then Click Element jquery=a.select2-search-choice-close:visible I delete my selection #deletes two elements - Wait For Then Click Element jquery=a.select2-search-choice-close:visible:first + Click (//div[contains(@class,"querystring-criteria-value-MultipleSelectionWidget")]//a[contains(@class,"select2-search-choice-close")])[1] Sleep 0.1 - Wait For Then Click Element jquery=a.select2-search-choice-close:visible + Click //div[contains(@class,"querystring-criteria-value-MultipleSelectionWidget")]//a[contains(@class,"select2-search-choice-close")] -I search in ${NAME} subfolder in the related items widget - mark results - Wait For Then Click Element jquery=.pat-relateditems-container ul.select2-choices:visible - Wait Until Page Contains ${NAME} - # I have seen this fail sometimes, where the screen shot showed the NAME just fine. - Sleep 0.1 - Click Element //a[contains(concat(' ', normalize-space(@class), ' '), ' pat-relateditems-result-select ')]//span[contains(text(),'${NAME}')] -I expect to be in Advanced mode - open the select box titled operator - ${selector} Set Variable .select2-drop-active[style*="display: block;"] - Element Should Contain jquery=${selector} Navigation Path - Element Should Contain jquery=${selector} Absolute Path - Element Should Contain jquery=${selector} Relative Path - Element Should Contain jquery=${selector} Simple Mode - ${selector} Set Variable div#select2-drop-mask - Wait For Then Click Invisible Element css=${selector} - Wait Until Element Is Not Visible css=${selector} +I delete one selection + # :visible - should this be checked? + Click //div[contains(@class,"querystring-criteria-value-MultipleSelectionWidget")]//a[contains(@class,"select2-search-choice-close")] -I expect to be in Simple mode + +I expect an empty result after open the operator ${OPERATOR} in the criteria ${CRITERIA} + open the select box titled index + select index type ${CRITERIA} + Wait For Condition Element Count //dl[@class="searchResults"] should be 0 open the select box titled operator - ${selector} Set Variable .select2-drop-active[style*="display: block;"] - Element Should Contain jquery=${selector} Custom - Element Should Contain jquery=${selector} Parent (../) - Element Should Contain jquery=${selector} Current (./) - Element Should Contain jquery=${selector} Advanced Mode - ${selector} Set Variable div#select2-drop-mask - Wait For Then Click Invisible Element css=${selector} - Wait Until Element Is Not Visible css=${selector} + select index type ${OPERATOR} -open the select box titled ${NAME} - Click Element css=body - Wait For Then Click Element jquery=.querystring-criteria-${NAME} .select2-container:first -select index type ${INDEX} - ${input_selector} Set Variable .select2-drop-active[style*="display: block;"] input - Wait For Element css=${input_selector} - Input Text css=${input_selector} text=${INDEX} - Press Keys jquery=:focus RETURN +# THEN we expect ${NUM} hits #This assumes we have the 2 "Test document" and "Test folder" items from the #robot setup, as well as the 4 additional items from the "a bunch of folders" macro #works only for ${NUM} > 0 - Sleep 0.5s + # we need as `Sleep`, the select2 js is very slow + Sleep 0.5s Wait until result is no longer marked - ${hits}= Execute Javascript return $('.searchResults > dd').length - Should Be Equal As Integers ${hits} ${NUM} + ${hits}= Evaluate Javascript //dl[@class="searchResults"] + ... (element) => { + ... return document.querySelectorAll(".searchResults > dd").length + ... } + ... all_elements=False + Should Be Equal As Integers ${hits} ${NUM} mark results we do not expect any hits [Documentation] The search results may be the previous results that are still visible for a short time, so sleep a bit. Alternatively look at http://www.obeythetestinggoat.com/how-to-get-selenium-to-wait-for-page-load-after-a-click.html - Sleep 0.2 - Wait Until Element Is Visible css=div#search-results - Wait Until Element Contains css=div#search-results No results were found. + Sleep 0.2 + Get Text //div[@id="search-results"] contains No results were found. + +I expect to be in Advanced mode + open the select box titled operator + ${element}= Get Element //div[contains(@class,"select2-drop-active") and contains(@style,"display: block;")] + Get Text ${element} contains Navigation Path + Get Text ${element} contains Absolute Path + Get Text ${element} contains Relative Path + Get Text ${element} contains Simple Mode + Click //div[@id="select2-drop-mask"] + Get Element States //div[@id="select2-drop-mask"] contains hidden + +I expect to be in Simple mode + open the select box titled operator + ${element}= Get Element //div[contains(@class,"select2-drop-active") and contains(@style,"display: block;")] + Get Text ${element} contains Custom + Get Text ${element} contains Parent (../) + Get Text ${element} contains Current (./) + Get Text ${element} contains Advanced Mode + Click //div[@id="select2-drop-mask"] + Get Element States //div[@id="select2-drop-mask"] contains hidden + +I see ${TEXT} in Preview + Sleep 0.2 + Get Text //div[@id="search-results"] contains ${TEXT} +# Helper + +open the select box titled ${NAME} + Click //body + Click (//div[@class="querystring-criteria-${NAME}"])[1]//div[contains(@class,"select2-container")] -a logged-in manager - Enable autologin as Manager Site Administrator Contributor Reviewer +select index type ${INDEX} + Type Text //div[contains(@class,"select2-drop-active") and contains(@style, "display: block;")]//input ${INDEX} + Click //*[contains(@class,"select2-match")] mark results - Wait for condition return $("dl.searchResults").length > 0 - Execute Javascript $("dl.searchResults").attr("marker", "marked") + Evaluate Javascript //dl[@class="searchResults"] + ... (element) => { + ... element.setAttribute("marker", "marked") + ... } + ... all_elements=False wait until result is no longer marked - Wait for condition return $("dl.searchResults").length > 0 && $("dl.searchResults").attr("marker") != "marked" + Evaluate Javascript //dl[@class="searchResults"] + ... (element) => { + ... return element && element.getAttribute("marker") != "marked" + ... } + ... all_elements=False \ No newline at end of file diff --git a/Products/CMFPlone/tests/robot/test_select_widget.robot b/Products/CMFPlone/tests/robot/test_select_widget.robot new file mode 100644 index 0000000000..1b00374205 --- /dev/null +++ b/Products/CMFPlone/tests/robot/test_select_widget.robot @@ -0,0 +1,120 @@ +*** Settings *** + +Resource plone/app/robotframework/browser.robot + +Library Remote ${PLONE_URL}/RobotRemote + +Resource keywords.robot + +Test Setup Run keywords Plone Test Setup +Test Teardown Run keywords Plone Test Teardown + + +*** Variables *** + +${mockup_bootstrap_class} pat-select2 + +${select_field_name} form.widgets.select_field +${list_field_name} form.widgets.list_field + +${input_search} //div[@id="select2-drop"]//div[contains(@class,"select2-search")]//input +${dropdown_multiple} css=.select2-choices +${dropdown_select} //a[@class="select2-choice"] +${results_label} css=.select2-result-label + + +*** Test Cases *** + +Scenario: The Select Widget has the class that bootstraps mockup JS + Given a form + Then the input fields have the mockup class + +Scenario: The Select Widget allows to select a single value + Given a logged-in member + and a form + When I select the option 3 + Then the widget shows the element three + +Scenario: The Select Widget autocomplete function works + Given a logged-in member + and a form + When I type on the autocomplete field wo + Then the widget shows the element two + +The Select Multiple Widget allows to select multiple values + Given a logged-in member + and a form + When I click on the element 2 + And I click on the element 1 + Then the widget shows two elements five four + +Scenario: The Select Multiple Widget autocomplete function works + Given a logged-in member + and a form + When I type on the multiple autocomplete field s + Then the widget shows one element six + + +*** Keywords *** + +# Given + +a form + Go to ${PLONE_URL}/@@select-widget-view + +# When + + +I select the option + [Arguments] ${index} + Wait For Elements State ${dropdown_select} visible timeout=2 s + Open Dropdown ${dropdown_select} ${input_search} + Click css=li.select2-results-dept-0:nth-child(${index}) + +I type on the autocomplete field + [Arguments] ${text} + Wait For Elements State ${dropdown_select} visible timeout=2 s + Open Dropdown ${dropdown_select} ${input_search} + Type Text ${input_search} ${text} + Click ${results_label} + +I click on the element + [Arguments] ${index} + Wait For Elements State ${dropdown_multiple} visible timeout=2 s + Open Dropdown ${dropdown_multiple} ${dropdown_multiple} + Focus css=li.select2-results-dept-0:nth-child(${index}) + Click css=li.select2-results-dept-0:nth-child(${index}) + +I type on the multiple autocomplete field + [Arguments] ${text} + Wait For Elements State ${dropdown_multiple} visible timeout=2 s + Click //ul[@class="select2-choices"] + Type Text css=.select2-input.select2-focused ${text} + Keyboard Key press Enter + +# Then + +the input fields have the mockup class + Get Classes //select[@name="${select_field_name}"] contains ${mockup_bootstrap_class} + Get Classes //select[@name="${list_field_name}"] contains ${mockup_bootstrap_class} + +the widget shows the element + [Arguments] ${text} + Get Text css=.select2-chosen should be ${text} messsage=${text} seems to not be selected + + +the widget shows two elements + [Arguments] ${first_string} ${second_string} + Get Text li.select2-search-choice:nth-child(1) > div:nth-child(1) contains ${first_string} + Get Text li.select2-search-choice:nth-child(2) > div:nth-child(1) contains ${second_string} + +the widget shows one element + [Arguments] ${string} + Get Text li.select2-search-choice:nth-child(1) > div:nth-child(1) contains ${string} + +# dry + +Open Dropdown + [Arguments] ${locator} ${validaton} + Click ${locator} + Wait For Elements State ${validaton} visible timeout=2 s message=The dropdown did not show up at location ${validaton} \ No newline at end of file diff --git a/Products/CMFPlone/tests/robot/test_tinymce.robot b/Products/CMFPlone/tests/robot/test_tinymce.robot index 69eb813598..5a126857d6 100644 --- a/Products/CMFPlone/tests/robot/test_tinymce.robot +++ b/Products/CMFPlone/tests/robot/test_tinymce.robot @@ -1,8 +1,6 @@ *** Settings ***************************************************************** -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Resource plone/app/robotframework/browser.robot Library Remote ${PLONE_URL}/RobotRemote @@ -28,8 +26,8 @@ Scenario: A page is opened to edit in TinyMCE and insert link and insert image - Wait For Then Click Element css=#form-buttons-save - Wait until page contains Changes saved + Click //*[@id="form-buttons-save"] + Get Text //body contains Changes saved *** Keywords ***************************************************************** @@ -39,47 +37,38 @@ Scenario: A page is opened to edit in TinyMCE an edited page Create content type=Document title=${TITLE} Go to ${PLONE_URL}/${PAGE_ID}/edit - Wait until page contains Edit Page + Get Text //body contains Edit Page an uploaded image Create content type=Image title=an-image text inserted into wysiwyg - Wait Until Element Is Visible css=.tox-edit-area iframe - Select Frame css=.tox-edit-area iframe - Press Keys //body[@id="tinymce"] Susi Sorglos and John Doe - UnSelect Frame + Fill text to tinymce editor form.widgets.IRichTextBehavior.text

Susi Sorglos and John Doe

insert link - Execute Javascript function selectText() { - ... var iframe_document = document.querySelector(".tox-edit-area iframe").contentDocument; - ... var body = iframe_document.body; - ... var p = body.firstChild; - ... var range = new Range(); - ... range.setStart(p.firstChild, 5); - ... range.setEnd(p.firstChild, 12); - ... iframe_document.getSelection().removeAllRanges(); - ... iframe_document.getSelection().addRange(range); - ... }; selectText(); - Click Button css=button[aria-label="Insert/edit link"] - Wait For Then Click Element css=.linkModal .content-browser-selected-items-wrapper button.btn-primary - Wait For Then Click Element xpath=//div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[1]/div[contains(@class, "levelItems")]/div[3] - Wait For Then Click Element xpath=//div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[contains(@class, "preview")]/div[contains(@class, "levelToolbar")]/button - Wait Until Element Is Not Visible xpath=//div[contains(@class,"content-browser-position-wrapper")] - Wait For Then Click Element css=.modal-footer input[name="insert"] - Select Frame css=.tox-edit-area iframe - Execute Javascript window.getSelection().removeAllRanges() - UnSelect Frame - Wait Until Element Is Not Visible css=.modal-footer input[name="insert"] + Evaluate JavaScript //div[contains(@class, 'tox-edit-area')]//iframe + ... (elem, args) => { + ... const iframe_document = elem.contentDocument; + ... const body = iframe_document.body; + ... const p = body.firstChild; + ... const range = new Range(); + ... range.setStart(p.firstChild, 5); + ... range.setEnd(p.firstChild, 12); + ... iframe_document.getSelection().removeAllRanges(); + ... iframe_document.getSelection().addRange(range); + ... } + ... all_elements=False + Click //button[@aria-label='Insert/edit link'] + Click css=.linkModal .content-browser-selected-items-wrapper button.btn-primary + Click xpath=//div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[1]/div[contains(@class, "levelItems")]/div[3] + Click xpath=//div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[contains(@class, "preview")]/div[contains(@class, "levelToolbar")]/button + Click //div[contains(@class, 'modal-footer')]//input[contains(@name, 'insert')] insert image - Click Button css=button[aria-label="Insert/edit image"] - Wait For Then Click Element css=.linkModal .content-browser-selected-items-wrapper button.btn-primary - Wait For Then Click Element xpath=//div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[1]/div[contains(@class, "levelItems")]/div[3] - Capture Page Screenshot - Wait For Then Click Element xpath=//div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[contains(@class, "preview")]/div[contains(@class, "levelToolbar")]/button - Wait Until Element Is Not Visible xpath=//div[contains(@class,"content-browser-position-wrapper")] - Input Text css=.modal-body [name="title"] SomeTitle - Input Text css=.modal-body [name="alt"] SomeAlt - Click Button css=.modal-footer input[name="insert"] - Wait Until Element Is Not Visible css=.modal-footer input[name="insert"] \ No newline at end of file + Click //button[@aria-label="Insert/edit image"] + Click css=.linkModal .content-browser-selected-items-wrapper button.btn-primary + Click xpath=//div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[1]/div[contains(@class, "levelItems")]/div[3] + Click xpath=//div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[contains(@class, "preview")]/div[contains(@class, "levelToolbar")]/button + Type Text //div[contains(@class, 'modal-body')]//input[@name="title"] SomeTitle + Type Text //div[contains(@class, 'modal-body')]//input[@name="alt"] SomeAlt + Click //div[contains(@class, 'modal-footer')]//input[contains(@name, 'insert')] diff --git a/news/3980.1.feature b/news/3980.1.feature new file mode 100644 index 0000000000..5670be2202 --- /dev/null +++ b/news/3980.1.feature @@ -0,0 +1,4 @@ +Port robot tests to playwright based tests, use robotframework browser library + +Remove obsolete robodocs +[1letter, petschki]